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

RE: [PATCH v2 04/26] xen: consolidate CONFIG_VM_EVENT


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Wed, 24 Sep 2025 06:39:31 +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=lptSSdVNYZRu2s6aCMuWaga4bKrS3C8zZyyGgUczNx4=; b=CIRQkeaUf3KvZUvRaBZ0+e01fovmmLlVN8UZNtODoqnJrWAbmuSB5wX5Tf1zhZPGtjCy1jqrzCxXBtqAj+HC4uDTBlrJmiVMXv+oRZJ8YzE4fbOpamaobAi+Ngem+t64T2ijW80EByeA1U3U61mI3DwvAeXAGP1KNKf50wXrcHlMPeulfSC0ndeYRvOm6zEyg+gVSBcSs863VVSxXF1M04wyH02iaYrQG5xChXTjb6LBLznION4Ofk72k2N3DLzYBvIQDSLaIandzLz28xKU2ZBTbBBl1GuKxbjfxvAOc1lNPwgI9hahjg2QUXFTWxmBLnlxyXXQw+uA8Dxs6r1WXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KK359Zcq1bLL8rCrslV8sVs1H23zML6iUVS8YOfVa7fZsWTysCUXilJz3bOGNX3oAf4gOPFB08sE2gvYZyEP/d4CaoLwrcxvj7iiVrS5gIP0L4mY3IryFBOQEwyO7sdFl/RvMm/gbGhoDcImmt3nJIoUsNSL2pb8q3Eu4FCNlSqej4DZpD48tty1p6hj18SFo9OGQtq5pdLZiQCr+K075AuVBZLKVKEDr8SaoW52DcvqsrA8A4L2+SiohZ8XDVrXSJD5fw7CBOJ1MDRpBr19NtziDZihkcj9UwACFYeo4DPP0CHTdAQaNraBfil0xVUTOrmjwVtBn0YW3wUiDCL49Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Sep 2025 06:39:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=True;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-09-24T06:39:17.0000000Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=3;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged
  • Thread-index: AQHcIiYDHxl9uXccpkex+vWb0p4h67SMggMAgAVG3ICAAPOvgIAPObqA
  • Thread-topic: [PATCH v2 04/26] xen: consolidate CONFIG_VM_EVENT

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Sunday, September 14, 2025 10:04 PM
> To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>; Penny, Zheng
> <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>;
> Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>; Petre Pircalabu
> <ppircalabu@xxxxxxxxxxxxxxx>; Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>;
> xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 04/26] xen: consolidate CONFIG_VM_EVENT
>
> On 14.09.2025 01:31, Tamas K Lengyel wrote:
> >>> @@ -99,10 +98,40 @@ long p2m_set_mem_access_multi(struct domain *d,
> >>> int p2m_get_mem_access(struct domain *d, gfn_t gfn, xenmem_access_t
> *access,
> >>>                         unsigned int altp2m_idx);
> >>>
> >>> -#ifdef CONFIG_VM_EVENT
> >>>  int mem_access_memop(unsigned long cmd,
> >>>                       XEN_GUEST_HANDLE_PARAM(xen_mem_access_op_t)
> >>> arg);  #else
> >>> +static inline bool xenmem_access_to_p2m_access(const struct p2m_domain
> *p2m,
> >>> +                                               xenmem_access_t xaccess,
> >>> +                                               p2m_access_t
> >>> +*paccess) {
> >>> +    return false;
> >>> +}
> >>
> >> So this is needed when VM_EVENT=n and ALTP2M=y. Tamas, is this a
> >> configuration which makes sense?
> >
> > Yes, altp2m should be functional without vm_event being enabled. There
> > could very well be in-guest only use of altp2m via #VE. This function
> > is used in p2m_init_next_altp2m which means it being stubbed out like
> > this when vm_event is disabled breaks altp2m.
>
> Oh, indeed - the stub still needs to handle XENMEM_access_default. Of course
> with MEM_ACCESS=n it's not quite clear to me what p2m->default_access ought
> to be; imo in principle that field ought to also go away in that case 
> (becoming hard-
> coded p2m_access_rwx). While doing that will be a larger patch, perhaps using 
> the
> hard-coded value here should be done right away.
>
> Once the code correctly handles MEM_ACCESS=n as an implication from
> VM_EVENT=n, it's also questionable whether MEM_ACCESS_ALWAYS_ON
> should be retained.
>

If we intend to remove MEM_ACCESS_ALWAYS_ON, I suggest to do the following 
modification on VM_EVENT to still keep y on default on x86:
```
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 7bd8a04730..61d48a5120 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -170,13 +170,10 @@ config HAS_VMAP
 config LIBFDT
        bool

-config MEM_ACCESS_ALWAYS_ON
-       bool
-
 config VM_EVENT
-       def_bool MEM_ACCESS_ALWAYS_ON
-       prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
+       bool "Memory Access and VM events"
        depends on HVM
+       default X86
        help

          Framework to configure memory access types for guests and receive
```


> Jan

 


Rackspace

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