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

Re: [PATCH] xen/arm: rename guest_cpuinfo in domain_cpuinfo


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 12 Jun 2023 12:13:32 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Rpsk8Y9Q0eievOy/GsfLaiZhzqL8MTX9O2C9JrlAnfI=; b=a/cp8ewXr8FFPCWdxCbMivKE7bf97oSTBpx3etRf6fPiyW9i1GTDx3zKkoMP72RLYLNEts3xK40FXMhds2eferoryGfnIgJjrAUXsXNHhtLwZ/29S5UsxBtpTsADwaLoGYLczuKTmgM3TBrm7jx074O7RPbHYOseZn9ucsfJaVVGtwQ+HcdtVJ1gp6+Vph9Isx0QL9wGrFpPd1u8/w2nbm1x2XRB7yTzpqo1/trHNCdphbSaJ1I1mDKLGRLvVUSsibVKXjTLOaii80x059kvkkCpjZ+Og+Q3/EExBpPYliAkWFriiefktQASLVptmilFui1GElaca63yrX/WvVInJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nYy/xwWOq2e8SZl11mCsZus8tLGZKluiYfLF1V4MbJWVvcaGXMMNh2SWhmC2aBu2hEBdIsv8XbHUUxUbSO8FOn7IvwstE+DBYHHu+dv9XtI4Krxha/J5LqOldGf5xS9HISsjARgYwpfONDYEGNlSfExoghnBKO1Wuas7UwK27CB0PesHjHHTzD9bI3VpmVUKjHHNie+TDR6xrDv1R0weHjZtVCA0GuNjc+rJlEWAaIkCwMcH31SEBryNPEaKaE3p5HQP2weeDj/d9tdsAxTSWuxEasKk8+HzjVmZ/8xDm7Vzu7yMGSZ43nKuWdRsGazw/FCm/Xt5GpNulgRIeRgYag==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 12 Jun 2023 12:13:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZmtRITNbkwbPefkCb2va33qE53K+G/lAAgAAalwA=
  • Thread-topic: [PATCH] xen/arm: rename guest_cpuinfo in domain_cpuinfo

Hi Julien,

> On 12 Jun 2023, at 12:38, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> On 09/06/2023 14:13, Bertrand Marquis wrote:
>> Rename the guest_cpuinfo structure to domain_cpuinfo as it is not only
>> used for guests but also for dom0 so domain is a more suitable name.
>> While there also rename the create_guest_cpuinfo function to
>> create_domain_cpuinfo to be coherent.
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>> ---
>>  xen/arch/arm/arm64/vsysreg.c          |  6 ++--
>>  xen/arch/arm/cpufeature.c             | 40 +++++++++++++--------------
>>  xen/arch/arm/include/asm/cpufeature.h |  2 +-
>>  xen/arch/arm/vcpreg.c                 |  2 +-
>>  4 files changed, 25 insertions(+), 25 deletions(-)
>> diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
>> index fe31f7b3827f..b5d54c569b33 100644
>> --- a/xen/arch/arm/arm64/vsysreg.c
>> +++ b/xen/arch/arm/arm64/vsysreg.c
>> @@ -76,7 +76,7 @@ TVM_REG(CONTEXTIDR_EL1)
>>      case HSR_SYSREG_##reg:                                              \
>>      {                                                                   \
>>          return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr,   \
>> -                                  1, guest_cpuinfo.field.bits[offset]); \
>> +                                  1, domain_cpuinfo.field.bits[offset]); \
>>      }
>>    void do_sysreg(struct cpu_user_regs *regs,
>> @@ -300,7 +300,7 @@ void do_sysreg(struct cpu_user_regs *regs,
>>        case HSR_SYSREG_ID_AA64PFR0_EL1:
>>      {
>> -        register_t guest_reg_value = guest_cpuinfo.pfr64.bits[0];
>> +        register_t guest_reg_value = domain_cpuinfo.pfr64.bits[0];
>>            if ( is_sve_domain(v->domain) )
>>          {
>> @@ -336,7 +336,7 @@ void do_sysreg(struct cpu_user_regs *regs,
>>           * When the guest has the SVE feature enabled, the whole 
>> id_aa64zfr0_el1
>>           * needs to be exposed.
>>           */
>> -        register_t guest_reg_value = guest_cpuinfo.zfr64.bits[0];
>> +        register_t guest_reg_value = domain_cpuinfo.zfr64.bits[0];
>>            if ( is_sve_domain(v->domain) )
>>              guest_reg_value = system_cpuinfo.zfr64.bits[0];
>> diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
>> index b53e1a977601..5f4644865505 100644
>> --- a/xen/arch/arm/cpufeature.c
>> +++ b/xen/arch/arm/cpufeature.c
>> @@ -14,7 +14,7 @@
>>    DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
>>  -struct cpuinfo_arm __read_mostly guest_cpuinfo;
>> +struct cpuinfo_arm __read_mostly domain_cpuinfo;
>>    #ifdef CONFIG_ARM_64
>>  static bool has_sb_instruction(const struct arm_cpu_capabilities *entry)
>> @@ -191,45 +191,45 @@ void identify_cpu(struct cpuinfo_arm *c)
>>  /*
>>   * This function is creating a cpuinfo structure with values modified to 
>> mask
>>   * all cpu features that should not be published to guest.
> 
> I noticed you modified "guests" to "domains" below but not "guest" here. Is 
> this intended?
> 
>> - * The created structure is then used to provide ID registers values to 
>> guests.
>> + * The created structure is then used to provide ID registers values to 
>> domains.
>>   */
>> -static int __init create_guest_cpuinfo(void)
>> +static int __init create_domain_cpuinfo(void)
>>  {
>>      /* Use the sanitized cpuinfo as initial guest cpuinfo */
> 
> Same question here.

Definitely should have been done, i will make a v2 and a path on "guest" 
without extra s.

Cheers
Bertrand


> 
>> -    guest_cpuinfo = system_cpuinfo;
>> +    domain_cpuinfo = system_cpuinfo;
> 
> Cheers,
> 
> -- 
> Julien Grall





 


Rackspace

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