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

RE: [PATCH v1 18/19] xen/sysctl: wrap around arch-specific arch_do_sysctl


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Mon, 24 Mar 2025 07:59:17 +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=NwxPaEozaESBEW1iVkA/K3I3sTL2YRw+5pk+wbE0/cw=; b=xf2DZUsNcwCIlTtNIWU8KtObcEVL1npYX4lgL+dqIz/WMwZ+zUbvILbO2aCjdjY4og+xU+CYCvv2aylFZEGjCOtGxkRmFowsguF9dgj7v8B+u4tVp+wTvQSap3PdDqOS0c1KbBk5r/Xwu5FgXMebobvc17oiIV+NOtH6RbxgDtuOOJdY9KMlM1Y21xGmY68J2gKGLjQ7DWwPuNBOfl9anZbcwaNoB3kQ9lXVISd7dVqXJYdWNslYFmtd2GWBnY/5DNAINywOlgVPMsALT2OD8LkyvgeCWUnXJOAs7rFOGKq7+h097sAJZ59PnReo0YFEjugUqo+73udT2jwV04dnHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tPQRrEjnpyrQSovXtOelSi83a2TjKK9PnOWJEBjhbXZcDXOynl/tJHphloGc6/9XvhFyeoEQFf+OlNlNTYb8yCJ7eRXFfLV2b3oyRn4htKSCaIj73M/TZzI1KgtXVZPCVTKGwdhrDbZeBxbz8Ta2K6qerQIN2qJ3/Kr1sKK4/TG9/6kl5SHXkeRwt7BnYm83Hb91qGMzDhyALqapI88kldf1XxttUa8VnkVtrMIXDLtVJ+A8EytHbNYX6slTHkC7bUvhMb/yFT6d3GbV9FpdfFAarY7/URQ5c64+emFldBthSYoGy9vuvbhdUBEH+9/kDgpk8A3FNfJgnTBMeabEKQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>, Sergiy Kibrik <Sergiy_Kibrik@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 24 Mar 2025 07:59:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=38e40917-7f76-4008-b47a-3aa2517e97fa;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-24T07:58:59Z;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: AQHbkwRVqqEOllQJtEeRzJGK6AnihrNxRScAgBC2aMA=
  • Thread-topic: [PATCH v1 18/19] xen/sysctl: wrap around arch-specific arch_do_sysctl

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Friday, March 14, 2025 12:33 AM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; Bertrand Marquis
> <bertrand.marquis@xxxxxxx>; Orzel, Michal <Michal.Orzel@xxxxxxx>;
> Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>;
> Roger Pau Monné <roger.pau@xxxxxxxxxx>; Alistair Francis
> <alistair.francis@xxxxxxx>; Bob Eshleman <bobbyeshleman@xxxxxxxxx>;
> Connor Davis <connojdavis@xxxxxxxxx>; Oleksii Kurochko
> <oleksii.kurochko@xxxxxxxxx>; Stabellini, Stefano 
> <stefano.stabellini@xxxxxxx>;
> Sergiy Kibrik <Sergiy_Kibrik@xxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1 18/19] xen/sysctl: wrap around arch-specific
> arch_do_sysctl
>
> On 12.03.2025 05:06, Penny Zheng wrote:
> > --- a/xen/arch/x86/psr.c
> > +++ b/xen/arch/x86/psr.c
> > @@ -133,9 +133,11 @@ static const struct feat_props {
> >       */
> >      enum psr_type alt_type;
> >
> > +#ifdef CONFIG_SYSCTL
> >      /* get_feat_info is used to return feature HW info through sysctl. */
> >      bool (*get_feat_info)(const struct feat_node *feat,
> >                            uint32_t data[], unsigned int array_len);
> > +#endif
> >
> >      /* write_msr is used to write out feature MSR register. */
> >      void (*write_msr)(unsigned int cos, uint32_t val, enum psr_type
> > type); @@ -418,6 +420,7 @@ static bool mba_init_feature(const struct
> cpuid_leaf *regs,
> >      return true;
> >  }
> >
> > +#ifdef CONFIG_SYSCTL
> >  static bool cf_check cat_get_feat_info(
> >      const struct feat_node *feat, uint32_t data[], unsigned int
> > array_len)  { @@ -430,6 +433,7 @@ static bool cf_check
> > cat_get_feat_info(
> >
> >      return true;
> >  }
> > +#endif
> >
> >  /* L3 CAT props */
> >  static void cf_check l3_cat_write_msr( @@ -442,11 +446,14 @@ static
> > const struct feat_props l3_cat_props = {
> >      .cos_num = 1,
> >      .type[0] = PSR_TYPE_L3_CBM,
> >      .alt_type = PSR_TYPE_UNKNOWN,
> > +#ifdef CONFIG_SYSCTL
> >      .get_feat_info = cat_get_feat_info,
> > +#endif
> >      .write_msr = l3_cat_write_msr,
> >      .sanitize = cat_check_cbm,
> >  };
> >
> > +#ifdef CONFIG_SYSCTL
> >  /* L3 CDP props */
> >  static bool cf_check l3_cdp_get_feat_info(
> >      const struct feat_node *feat, uint32_t data[], uint32_t
> > array_len) @@ -458,6 +465,7 @@ static bool cf_check
> > l3_cdp_get_feat_info(
> >
> >      return true;
> >  }
> > +#endif
> >
> >  static void cf_check l3_cdp_write_msr(
> >      unsigned int cos, uint32_t val, enum psr_type type) @@ -473,7
> > +481,9 @@ static const struct feat_props l3_cdp_props = {
> >      .type[0] = PSR_TYPE_L3_DATA,
> >      .type[1] = PSR_TYPE_L3_CODE,
> >      .alt_type = PSR_TYPE_L3_CBM,
> > +#ifdef CONFIG_SYSCTL
> >      .get_feat_info = l3_cdp_get_feat_info,
> > +#endif
> >      .write_msr = l3_cdp_write_msr,
> >      .sanitize = cat_check_cbm,
> >  };
> > @@ -489,11 +499,14 @@ static const struct feat_props l2_cat_props = {
> >      .cos_num = 1,
> >      .type[0] = PSR_TYPE_L2_CBM,
> >      .alt_type = PSR_TYPE_UNKNOWN,
> > +#ifdef CONFIG_SYSCTL
> >      .get_feat_info = cat_get_feat_info,
> > +#endif
> >      .write_msr = l2_cat_write_msr,
> >      .sanitize = cat_check_cbm,
> >  };
> >
> > +#ifdef CONFIG_SYSCTL
> >  /* MBA props */
> >  static bool cf_check mba_get_feat_info(
> >      const struct feat_node *feat, uint32_t data[], unsigned int
> > array_len) @@ -508,6 +521,7 @@ static bool cf_check mba_get_feat_info(
> >
> >      return true;
> >  }
> > +#endif
> >
> >  static void cf_check mba_write_msr(
> >      unsigned int cos, uint32_t val, enum psr_type type) @@ -545,7
> > +559,9 @@ static const struct feat_props mba_props = {
> >      .cos_num = 1,
> >      .type[0] = PSR_TYPE_MBA_THRTL,
> >      .alt_type = PSR_TYPE_UNKNOWN,
> > +#ifdef CONFIG_SYSCTL
> >      .get_feat_info = mba_get_feat_info,
> > +#endif
> >      .write_msr = mba_write_msr,
> >      .sanitize = mba_sanitize_thrtl,
> >  };
> > @@ -808,6 +824,7 @@ static struct psr_socket_info *get_socket_info(unsigned
> int socket)
> >      return socket_info + socket;
> >  }
> >
> > +#ifdef CONFIG_SYSCTL
> >  int psr_get_info(unsigned int socket, enum psr_type type,
> >                   uint32_t data[], unsigned int array_len)  { @@
> > -839,6 +856,7 @@ int psr_get_info(unsigned int socket, enum psr_type
> > type,
> >
> >      return -EINVAL;
> >  }
> > +#endif /* CONFIG_SYSCTL */
> >
> >  int psr_get_val(struct domain *d, unsigned int socket,
> >                  uint32_t *val, enum psr_type type)
>
> That's quite a lot of #ifdef-ary here. I wonder if we can't do any better.
>

xl-psr half relies on sysctl op, and half relies on domctl. So I'm not sure for
CONFIG_X86_PSR, whether we shall make it dependent on CONFIG_SYSCTL

> Jan

 


Rackspace

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