[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH v1 03/19] xen/sysctl: wrap around XEN_SYSCTL_readconsole


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Thu, 20 Mar 2025 09:01:40 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gHVuCRChUVFBGGQHxwZzG7sqLXLQi8lmhfp28kTr39E=; b=X9t10LkqN4DkliFl8aIFzvs+W2/ppaZvuxkxofi95vtC1wf/zqranRkjRW9CwUG5bXhScmq45zlFqzVhpvjR8Q11L9Kbny4Y+CM7MSND9QUKndk6J3d2ACtIafOuFn/gNiIq4s+apuCFkdLvJI+Uec+5SiDS59u+4MhWGc9Z+MXwIu8y0tL1X53stL5GF3h40NpJu21ExMN2CyI1Rsnh29HKkqfczazJxft6gHkwLDs6ED+kiWYCRT6Q4PswilKjh7v/YlHOED2y/FKRpjUhJFe3rRhN8oK++IWij5Ccr29MgEwHoeFQhqMst9ue8RQaPgm0ZlUy1ZBvmdlAg6h1Hw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TtVzlPfcc70rwzBQbxR9Vxpgdcnh1li6GyBAJ6xKzCgdWNtzwVImhhbZP5hfsmSdAYW1gIWqzY3PQXGXTboVc5HtqhFjDSuNpwrhMmyjxpf6llPzjH15p1YudguUGYXd2awABUlTBv/mUP0WAHToWdegzse2i12Clas2OxiQnhCvbw0xbE0KT/juo6IM1q3/Tlo4HPTFLBLXt6xJ9BV4x/cj0k/TFQF8PhXkbvz8rVf2ZvmEBS4xB3ZqTuCpaOR7iiuLCjjtH7agQaQ3wbAf5hWVf7N/qKSPkIWpeBvBs4Xp+0Uzqhp8WLQP+RMBI2XWH0l1ODph335IYsgCZAoDoQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 20 Mar 2025 09:01:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=ddfb5eca-2cf4-49cd-9555-6b7c30ea294a;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=0;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=true;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-03-20T09:01:33Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Tag=10, 0, 1, 1;
  • Thread-index: AQHbkwQ4YtLwdtCzBUqbGFlzJHozTrNw+akAgAq7AVCAAA6JAIAAAgHw
  • Thread-topic: [PATCH v1 03/19] xen/sysctl: wrap around XEN_SYSCTL_readconsole

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Thursday, March 20, 2025 4:47 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>;
> Orzel, Michal <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; 
> Daniel
> P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>; Alejandro Vallejo
> <alejandro.vallejo@xxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1 03/19] xen/sysctl: wrap around
> XEN_SYSCTL_readconsole
>
> On 20.03.2025 09:02, Penny, Zheng wrote:
> >> -----Original Message-----
> >> From: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
> >> Sent: Thursday, March 13, 2025 8:03 PM
> >>
> >> Ok, so readconsole is done here. I see how if you're also removing
> >> the console handler for the sysctl that's a bit unwiledly to do in one go.
> >>
> >> I think my earlier remarks still hold in terms of removal of else branches 
> >> of ifdefs.
> >>
> >> On Wed Mar 12, 2025 at 4:06 AM GMT, Penny Zheng wrote:
> >>> The following functions is to deal with XEN_SYSCTL_readconsole
> >>> sub-op, and shall be wrapped:
> >>> - xsm_readconsole
> >>> - read_console_ring
> >>>
> >>> Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
> >>> ---
> >>>  xen/drivers/char/console.c |  2 ++
> >>>  xen/include/xen/console.h  |  8 ++++++++
> >>>  xen/include/xsm/dummy.h    | 11 ++++++++---
> >>>  xen/include/xsm/xsm.h      | 11 ++++++++---
> >>>  xen/xsm/dummy.c            |  2 +-
> >>>  xen/xsm/flask/hooks.c      |  4 ++--
> >>>  6 files changed, 29 insertions(+), 9 deletions(-)
> >>>
> >>> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> >>> index 2f028c5d44..6e4f3c4659 100644
> >>> --- a/xen/drivers/char/console.c
> >>> +++ b/xen/drivers/char/console.c
> >>> @@ -336,6 +336,7 @@ static void conring_puts(const char *str, size_t len)
> >>>          conringc = conringp - conring_size;  }
> >>>
> >>> +#ifdef CONFIG_SYSCTL
> >>>  long read_console_ring(struct xen_sysctl_readconsole *op)  {
> >>>      XEN_GUEST_HANDLE_PARAM(char) str; @@ -378,6 +379,7 @@ long
> >>> read_console_ring(struct xen_sysctl_readconsole *op)
> >>>
> >>>      return 0;
> >>>  }
> >>> +#endif /* CONFIG_SYSCTL */
> >>>
> >>>
> >>>  /*
> >>> diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h
> >>> index 83cbc9fbda..e7d5063d82 100644
> >>> --- a/xen/include/xen/console.h
> >>> +++ b/xen/include/xen/console.h
> >>> @@ -7,12 +7,20 @@
> >>>  #ifndef __CONSOLE_H__
> >>>  #define __CONSOLE_H__
> >>>
> >>> +#include <xen/errno.h>
> >>>  #include <xen/inttypes.h>
> >>>  #include <xen/ctype.h>
> >>>  #include <public/xen.h>
> >>>
> >>>  struct xen_sysctl_readconsole;
> >>
> >> That forward declaration should probably be inside the ifdef
> >>
> >>> +#ifdef CONFIG_SYSCTL
> >>>  long read_console_ring(struct xen_sysctl_readconsole *op);
> >>> +#else
> >>> +static inline long read_console_ring(struct xen_sysctl_readconsole
> >>> +*op) {
> >>> +    return -EOPNOTSUPP;
> >>> +}
> >>> +#endif
> >>
> >> This is only called from sysctl.c, which will be compiled out. Why is
> >> the else needed?
> >>
> >
> > Because I wrapped the sysctl.c in the last commit.
> > If removing the else condition here, the compilation will fail on this 
> > commit.
> > So either I add #ifdef into read_console_ring function body, or in the
> > last commit, I draw back all these unnecessary else conditions, or
> > combine all commits into one Any preference? Or any other suggestion?
>
> Munging everything in a single commit may yield unwieldily big a result. 
> Transiently
> adding #ifdef in sysctl.c would seem like the cleanest approach to me. In the 
> final
> commit it'll (hopefully) be obvious enough then why all of the #ifdef-s are 
> dropped
> again.
>

Understood, I'll add #ifdef in sysctl.c and remove them all in the last, and 
also add
description why we drop them in the commit message

> Jan

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.