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

Re: [PATCH v3 6/8] domain: introduce GADDR based runstate area registration alternative


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 27 Sep 2023 17:36:30 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=GDlIW4+9R8qB2gIkr00WQPjqJi8hTClh1ZuYhgzVzAU=; b=VHRcuixFYUI52vUG9ffs4XPtvmNd791gBgHG5Y0oh/DslUEtTZMvrzmMggQ3kbu1YHGnNj/rI7TSkhSw9KYf6c4q6IHoppwmQWXM6eGFaH69dp5DBxLopx4itnYcPROQapEyp9rLMLBszHFdI+alOYyS7Z+MUMcANA7qkcqde+RzSswDO5gMJwhj9mA/fG3+40BGf+Cdplo5WtEAoJxeReyi0zKR/Hr5f9ILRrmXTYRQr9Hss/wfndUD0U+XZAcbWA1yo6Ayf4BiC1JQlq3HsNUFLWiHDPcx9aCpHS8/Mt/+vzZvjoHja4PuEFfi0h+bLyrEbsyJ04nkCZZpio5H0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iln8dcra1KkEXb98bsB/MlwBIv+tX95c/deYzHQB04h/wXOm3+slwhxe5aMFdnRZFcso/itanwIsSpHD7fqDp1dgHjmbDMYD+M+uOAN35noYmZRUnNM1WuViok0K3xAJGoqk+ssePGSrfkpj80VDrSfj8ESlyd4bTH5TVZ7wiulq2xNHvWOge4t7k0x1y+XWrxWGct3abDUBZcrz3jVtBEuOTitSjV7F5nSK7Ra7E1qMxIYWugcXJVMM8QdejPbu9QvtCTDUV32iq1RhcAQUhhgXCG29HLIpohujrKYyteqhKWMRSLh9u4UL1qPqmEtiD/GSftCY4V1f1A/8F+lQAA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 27 Sep 2023 15:36:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.09.2023 17:24, Roger Pau Monné wrote:
> On Wed, May 03, 2023 at 05:57:40PM +0200, Jan Beulich wrote:
>> The registration by virtual/linear address has downsides: At least on
>> x86 the access is expensive for HVM/PVH domains. Furthermore for 64-bit
>> PV domains the area is inaccessible (and hence cannot be updated by Xen)
>> when in guest-user mode.
>>
>> Introduce a new vCPU operation allowing to register the runstate area by
>> guest-physical address.
>>
>> An at least theoretical downside to using physically registered areas is
>> that PV then won't see dirty (and perhaps also accessed) bits set in its
>> respective page table entries.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.

> One comment below.
> 
>> --- a/xen/include/public/vcpu.h
>> +++ b/xen/include/public/vcpu.h
>> @@ -221,6 +221,19 @@ struct vcpu_register_time_memory_area {
>>  typedef struct vcpu_register_time_memory_area 
>> vcpu_register_time_memory_area_t;
>>  DEFINE_XEN_GUEST_HANDLE(vcpu_register_time_memory_area_t);
>>  
>> +/*
>> + * Like the respective VCPUOP_register_*_memory_area, just using the 
>> "addr.p"
>> + * field of the supplied struct as a guest physical address (i.e. in GFN 
>> space).
>> + * The respective area may not cross a page boundary.  Pass ~0 to 
>> unregister an
>> + * area.  Note that as long as an area is registered by physical address, 
>> the
>> + * linear address based area will not be serviced (updated) by the 
>> hypervisor.
>> + *
>> + * Note that the area registered via VCPUOP_register_runstate_memory_area 
>> will
>> + * be updated in the same manner as the one registered via virtual address 
>> PLUS
>> + * VMASST_TYPE_runstate_update_flag engaged by the domain.
>> + */
>> +#define VCPUOP_register_runstate_phys_area      14
> 
> Just to make it more obvious, it might be nice to add a note in the
> comment on VCPUOP_register_runstate_memory_area that `p` can also be
> used with the `VCPUOP_register_runstate_phys_area` hypercall.

I can add a reference there (and then in the later patch also for the
time area), but I don't think it wants or needs to emphasize p. It
merely needs to point to the alternative sub-function imo.

Jan



 


Rackspace

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