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

Re: [PATCH v3 7/7] xen/arm: introduce new xen,enhanced property value


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 2 Sep 2022 14:51:07 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=hfU4WtZdxG3QjEDzMjigkky0H4P3dG5bwh9cBQcwF7M=; b=PtbB0ovHEj7C54o1D2Np0I2xuCpe6g7VH/+GnhdpXgaKdGFNSc8l327z1Xu7T3KMAZ3Cp6P8u/8fGzWusaOKAr6zNI6R+bQDUTxWqz7NNfLVBL46YSsjK9vSuJ10O+EkkrUxsIifM9OW+8vW1IhuTspMjilbrO/vfHjjC5gYuHWWTXGjOhNJeCwSgXymdluzianXBLwBTokWBIKixKsUQES+4aQfy7TrWhq1RRV7zHIK3lK5Iyr29Mo/pKAltF/THR1FpbUGoz1PB9cBGsDQgEQkbvqnfi2WHETFNcJ+4Fx63zV3wGNoat+OcaAJzEAQOzZZ7ZwlTOx7hlnlA/jxGw==
  • 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=hfU4WtZdxG3QjEDzMjigkky0H4P3dG5bwh9cBQcwF7M=; b=WxiVQpUR8+XZU59vIQs699dUqpNGKb9ilSyxdDxHFG1CzJwTs1LCLRFDOzq2GXnv7/snDhnHVUtNLjRqxseTekUHtOq/5JnvVSRp7CRt1D3jgQLhg3y+l5t+vWUzAuyZvgKW97EQRXygc7CDyey9VSX3H663ZLsnxre7Vqd1MGXfD3MlFITRnd8XHIPtBB3ATS3BK0IOahy5kkpGbkJILzaxx8TyDLgmcrbJHxH8tq4SBpkyAsMppSFPbhpFO7wxcBjBcNs/nL3nDQRLqQ4k4y6AwCSSUTKasKfpEH60n/gqYHxD6YJjemKrTKVwt7tvyhCIVyHbKxYjrCgryqx51A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=b7Bx4y2ftc/pvHz9eeulQOTF5qQIIEFfF5Q4xoBTO18SWyx4ZcWflypc3wsbmU9e07tR9PGmi2jOJjrniTM8Lwhr0qOnjqKldwOrnISXyOvjUCAK30AHfgSKixnSwFUbyZ4JArWhlf+NNfGX4DF2ELLAjqW5KS5NNI0tjW2W834Xw8179peKU8Yqsuoy0Ee312OsN2EDtsViFxvjIkk1Qt1df6vlta8F7t6bRRLbGos0VA5Oqa8txpBhnTo6upjbfPAMXvr4dOjHiZalcL7BG2Kkvf+nj0ZCCU+0ExFZIwikvLESpekSuJpQYWwgzOFZTEuK9fl1PLg0uXhA3WeMxw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bGtNCX65okOSrB7fubbi0iqY80Nsk/HdoDKfCGRA/iSargl92NEd9iQcUD7e9R7d4HE5tMYBp5fvQc1R4coaniXxd0oQmFSGNZxQTq6IgED+ydk9y2zMI4bWyfVB6WJ1IkoKA+MY/H33PQWs9tReJ0+drIOo6wB3YkuAADL9Eaerogc44p7HJ6W8RYPsIOPxUEXkuCD+rdphPO2BIt6Z0X3GCFnA9l7CReg7dIX2SWck12xMAVGv1vRi2W6Un3chtCdOi8V1AXWj8xG8Lrkf3/v9nKUcXn6CwYW7MDkIjAHzlT+Fe6lcS5gAywZvZYUNhHyxwX7m4JCkt1/brGJ6NA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Rahul Singh <Rahul.Singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 02 Sep 2022 14:51:29 +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: AQHYveOAeMLlOwX5Mka7ZrpAabJW7K3K4ewAgAFZKAA=
  • Thread-topic: [PATCH v3 7/7] xen/arm: introduce new xen,enhanced property value

Hi Julien,

> On 1 Sep 2022, at 19:15, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 01/09/2022 10:13, Rahul Singh wrote:
>> Introduce a new "xen,enhanced" dom0less property value "no-xenstore" to
>> disable xenstore interface for dom0less guests.
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>> Changes in v3:
>>  - new patch in this version
>> ---
>>  docs/misc/arm/device-tree/booting.txt |  4 ++++
>>  xen/arch/arm/domain_build.c           | 10 +++++++---
>>  xen/arch/arm/include/asm/kernel.h     |  3 +++
>>  3 files changed, 14 insertions(+), 3 deletions(-)
>> diff --git a/docs/misc/arm/device-tree/booting.txt 
>> b/docs/misc/arm/device-tree/booting.txt
>> index edef98e6d1..87f57f8889 100644
>> --- a/docs/misc/arm/device-tree/booting.txt
>> +++ b/docs/misc/arm/device-tree/booting.txt
>> @@ -204,6 +204,10 @@ with the following properties:
>>      - "disabled"
>>      Xen PV interfaces are disabled.
>>  +    - no-xenstore
>> +    Xen PV interfaces, including grant-table will be enabled for the VM but
>> +    xenstore will be disabled for the VM.
> 
> NIT: I would drop one of the "for the VM" as it seems to be redundant.
> 
>> +
>>      If the xen,enhanced property is present with no value, it defaults
>>      to "enabled". If the xen,enhanced property is not present, PV
>>      interfaces are disabled.
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 4b24261825..8dd9984225 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -3336,10 +3336,14 @@ static int __init construct_domU(struct domain *d,
>>           (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
>>      {
>>          if ( hardware_domain )
>> -            kinfo.dom0less_enhanced = true;
>> +            kinfo.dom0less_xenstore = true;
>>          else
>> -            panic("Tried to use xen,enhanced without dom0\n");
>> +            panic("Tried to use xen,enhanced without dom0 without 
>> no-xenstore\n");
> 
> This is a bit hard to parse. How about:
> 
> "At the moment, Xenstore support requires dom0 to be present"
> 
>>      }
>> +    else if ( rc == 0 && !strcmp(dom0less_enhanced, "no-xenstore") )
>> +        kinfo.dom0less_xenstore = false;
>> +
>> +    kinfo.dom0less_enhanced = true;
> 
> Wouldn't this now set dom0less_enhanced unconditionally?
> 
>>        if ( vcpu_create(d, 0) == NULL )
>>          return -ENOMEM;
>> @@ -3379,7 +3383,7 @@ static int __init construct_domU(struct domain *d,
>>      if ( rc < 0 )
>>          return rc;
>>  -    if ( kinfo.dom0less_enhanced )
>> +    if ( kinfo.dom0less_xenstore )
>>      {
>>          ASSERT(hardware_domain);
>>          rc = alloc_xenstore_evtchn(d);
>> diff --git a/xen/arch/arm/include/asm/kernel.h 
>> b/xen/arch/arm/include/asm/kernel.h
>> index c4dc039b54..3d7fa94910 100644
>> --- a/xen/arch/arm/include/asm/kernel.h
>> +++ b/xen/arch/arm/include/asm/kernel.h
>> @@ -39,6 +39,9 @@ struct kernel_info {
>>      /* Enable PV drivers */
>>      bool dom0less_enhanced;
>>  +    /* Enable Xenstore */
>> +    bool dom0less_xenstore;
>> +
> 
> AFAIU, it is not possible to have *_xenstore = true and *_enhanced = false. I 
> think it would be clearer if ``dom0less_enhanced`` is turned to an enum with 
> 3 values:
> - None
> - NOXENSTORE/BASIC
> - FULLY_ENHANCED
> 
> If we want to be future proof, I would use a field 'flags' where non-zero 
> means enhanced. Each bit would indicate which features of Xen is exposed.

I think that could be a good solution if we do it this way:
- define a dom0less feature field and have defines like the following:
#define DOM0LESS_GNTTAB
#define DOM0LESS_EVENTCHN
#define DOM0LESS_XENSTORE

- define dom0less enhanced as the right combination:
#define DOM0LESS_ENHANCED = (DOM0LESS_GNTTAB| DOM0LESS_EVENTCHN| 
DOM0LESS_XENSTORE)

This way we have a proper feature bitset and ENHANCED is properly defined as a 
combination of the 3 features.

What do you guys think ?

Cheers
Bertrand


> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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