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

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


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Wed, 7 Sep 2022 08:13:17 +0000
  • Accept-language: 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=Ft6uLKczm3hU5DDIuM7yyjOWYpK/8bv0f33qklLKKmU=; b=A+Q4BPM2rGrrsRnvLncvcVGPJpbgNbtweRk8tf3UTr5+4MtPFBruqDbrQWafo6ET13dr5wZ7aFb1Y+b1rfjSrxp6fUrfQL+48gZgjaFxNCI+YaRDkziwtOuGoASpG61Djr8SzrKd9+fNzG8P4p5IFJ/7c18TOs/siAgTxLSLnDkkumpwvzR4vAktmyu6sPu3FR6OJ+KRRj3COa5qFqz0MhA6XFqGou7DxnS0wWrydnRvkSGVulUuqVQ5SjD0N/krMG2Mi+QZ7ahsJnEvQQsPbNU5XCybytGoNLjHY1/K6p3mMbfOJQdQTBJPup+92FWJ05OIjY9ugSnwtC32xO+90Q==
  • 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=Ft6uLKczm3hU5DDIuM7yyjOWYpK/8bv0f33qklLKKmU=; b=OrSAN7ApASwH3zs2zBHpgjJ2S75bFe2VLwowkdyKm5UIYVEMZSo+suifUPqjgIThFJiGpK9KwKH2vCUOc4rkUNNTyi90rrGNb0P+7UV8nUff+w2gA8EzG/pr+TrdQ6UsG0K7w/kK3pOL8Us8dg1apxNft9KR5uLkGvrQ46RZXEowAmRc4AYbA4pCbdWOtm+oxIoCLKVtX1tTlEY0AfjPTK57AYFWv4bUg+1wNVPWaA8PGEeH/lY3/p6xq3OTKflTt2O7DUIhBsVuy7DvyVMkuer1xleuf4oaWGf1ZlzGi/u311nyT9uIwhR0ZiFoEPB/ZKE1ohonhpuq5dQFxqJ2Gw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=lBNhkbaquuwgF5H40YbTxlKLa7IO4TAKMPbQk1t3fVFPqC6KF5QO+nvtuZPTWKPMTnC7RqgC26RGLaynyc3KwSSheLFnihCdLnZwvwY14pkNj3ey+YVbLceMO43shMLR7OIq2wCc1z/S16u5Fz/JmJmvoRB+/ZTuCyDP97d5LyMlGn821910fX2fLIbP73mA4zBeNc/vmgljTckuzE4uTBo5DYTujWNTPWdO44rA+weYRthA863ubggjleNy9IIm+wlZxECSDs0tzZOfWTNq+dKIC8LVIk7mJWit2Sqd7RHy1uU+ma9k8QGum2KRdsqH+muqZf6ZHk2OneQKgyaANw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nOwoyD6PHiJPhQH/1Rfu68VOuVYNgS5+dBzlJUDb+7piciY5wdA8769Ei1xWwiioCEHiSTouJVl0AsWH+1FjgILuoeKEKeJaz86VJL4XwNFO2lz1+5auNSKZX6Z6WFCyB/3FPKRT7fVRVZ3R+jGOZD95gzag+fH3cxeYzE88QZ5HkH9JV3Q8quFTvT0VvLAZwMx+pCqWvU5ArPdmUppdIiU38mlxsk/H8RQ8TIhrwOujboOy8wXRGH/UwpLiMSX/YZ31ILF7ey/g+b1gdvYXBBaZzVgZcm756aeDmiAcx7D+uin1gnl8Xdv06ZRRiNVmbKxaSg3sjFDNWUwZ30m/nQ==
  • 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>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 07 Sep 2022 08:13:38 +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: AQHYwfap3Ps5bdyrBEC9qTgdrU+ZKq3S960AgACnw4A=
  • Thread-topic: [PATCH v4 6/7] xen/arm: introduce new xen,enhanced property value

Hi Stefano,

> On 6 Sep 2022, at 11:12 pm, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> On Tue, 6 Sep 2022, 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 v4:
>> - Implement defines for dom0less features
>> 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     | 23 +++++++++++++++++++++--
>> 3 files changed, 31 insertions(+), 6 deletions(-)
>> 
>> diff --git a/docs/misc/arm/device-tree/booting.txt 
>> b/docs/misc/arm/device-tree/booting.txt
>> index 98253414b8..1b0dca1454 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 but xenstore
>> +    will be disabled for the VM.
> 
> Please use "" for consistency:
> 
>    - "no-xenstore"
> 

Ack. 
> 
>>     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 707e247f6a..0b164ef595 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -2891,7 +2891,7 @@ static int __init prepare_dtb_domU(struct domain *d, 
>> struct kernel_info *kinfo)
>>             goto err;
>>     }
>> 
>> -    if ( kinfo->dom0less_enhanced )
>> +    if ( kinfo->dom0less_feature & DOM0LESS_ENHANCED_NO_XS )
>>     {
>>         ret = make_hypervisor_node(d, kinfo, addrcells, sizecells);
>>         if ( ret )
>> @@ -3209,10 +3209,12 @@ static int __init construct_domU(struct domain *d,
>>          (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
>>     {
>>         if ( hardware_domain )
>> -            kinfo.dom0less_enhanced = true;
>> +            kinfo.dom0less_feature = DOM0LESS_ENHANCED;
>>         else
>> -            panic("Tried to use xen,enhanced without dom0\n");
>> +            panic("At the moment, Xenstore support requires dom0 to be 
>> present\n");
>>     }
>> +    else if ( rc == 0 && !strcmp(dom0less_enhanced, "no-xenstore") )
>> +        kinfo.dom0less_feature = DOM0LESS_ENHANCED_NO_XS;
>> 
>>     if ( vcpu_create(d, 0) == NULL )
>>         return -ENOMEM;
>> @@ -3252,7 +3254,7 @@ static int __init construct_domU(struct domain *d,
>>     if ( rc < 0 )
>>         return rc;
>> 
>> -    if ( kinfo.dom0less_enhanced )
>> +    if ( kinfo.dom0less_feature & 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..ad240494ea 100644
>> --- a/xen/arch/arm/include/asm/kernel.h
>> +++ b/xen/arch/arm/include/asm/kernel.h
>> @@ -9,6 +9,25 @@
>> #include <xen/device_tree.h>
>> #include <asm/setup.h>
>> 
>> +/*
>> + * List of possible features for dom0less domUs
>> + *
>> + * DOM0LESS_ENHANCED_NO_XS: Notify the OS it is running on top of Xen. All 
>> the
>> + *                          default features (excluding Xenstore) will be
>> + *                          available. Note that an OS *must* not rely on 
>> the
>> + *                          availability of Xen features if this is not set.
>> + * DOM0LESS_XENSTORE:       Xenstore will be enabled for the VM. This 
>> feature
>> + *                          can't be enabled without the
>> + *                          DOM0LESS_ENHANCED_NO_XS.
>> + * DOM0LESS_ENHANCED:       Notify the OS it is running on top of Xen. All 
>> the
>> + *                          default features (including Xenstore) will be
>> + *                          available. Note that an OS *must* not rely on 
>> the
>> + *                          availability of Xen features if this is not set.
>> + */
>> +#define DOM0LESS_ENHANCED_NO_XS  BIT(0, U)
>> +#define DOM0LESS_XENSTORE        BIT(1, U)
>> +#define DOM0LESS_ENHANCED        (DOM0LESS_ENHANCED_NO_XS | 
>> DOM0LESS_XENSTORE)
>> +
>> struct kernel_info {
>> #ifdef CONFIG_ARM_64
>>     enum domain_type type;
>> @@ -36,8 +55,8 @@ struct kernel_info {
>>     /* Enable pl011 emulation */
>>     bool vpl011;
>> 
>> -    /* Enable PV drivers */
>> -    bool dom0less_enhanced;
>> +    /* Enable/Disable PV drivers interface,grant table, evtchn or xenstore 
>> */
> 
> missing a whitespace

Ack. 
> 
> 
>> +    uint32_t dom0less_feature;
> 
> Given that we only really need 2 bits today, and given that uint8_t and
> uint16_t are free but uint32_t increases the size of the struct, could
> we just use uint16_t dom0less_feature ?

Yes, I will change to uint16_t in next version.

Regards,
Rahul


 


Rackspace

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