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

RE: [PATCH v2 03/26] xen/x86: consolidate vram tracking support


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Thu, 11 Sep 2025 07:15:55 +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=akXXZmOus3534TwnnQZvkOuf3V88X7Jud7UbWM7gcPs=; b=wkFCYyjAqFqsvcpIaLJ6gUTFRRAezcGD05le9CIufYOPzTd6xLZ4UioKJ38rghPhNC4idv01+9HjRZdvG9qWIWw4dNl+DGttDWPGW+IzvzZlSoD41f0q8AKSTEO21uqGQWzz3sbeUJWXHezsH47o74pRUqTKWO///iAu8AvE5ZGt6Kdep2WnsI+PfqIxdgbYc8/LjDoAFFff0lLGkCKAvJJSz3Ow1Hdb9uKRUeRrLu0xl+Vsdd17spglBMqmrV403eZkqqPkHM5YnBJsINyrCEffL0akqeHntBOIUsEi3sMOqvUNDn8u68nLgU93QMDCxE2EQ8GjwF17TbD6XpFqZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Br7WOojWgTIQCeBpM9rtbYGVrA32wohHluU+479m3yO+LEywrXynLAKOnYLqFTPihWNjLbaQ8rpguq1Kp6Q1sCqVHOLU6hiUhabQVu1NuwSjJ+0HLylRv1pY+5Gh9EQCB412xiBbAn+RlnxzNwkr4FWZXWlm3YjiQK9kMLx2aAFpuGjMwmg+3yiDQY0qdYd8bRP/FMs5sFXSxpezrkmRhtEAsj0CwNHYkSbQ0pZRhE1sa4//pcJorzUUQzBbOzrzMV4TloYQI5XSlCm3RJggyI/6jobGexX4UD+jmv7RJ/popPnGn9z5FVdMQWEzpKEjAyoY08DB5HFD/M1WzrDNWQ==
  • 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>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 11 Sep 2025 07:16:08 +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-11T07:06:27.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: AQHcIiYBT2pZeRIoyka2sfY1lhJyobSMdHkAgAEcX0A=
  • Thread-topic: [PATCH v2 03/26] xen/x86: consolidate vram tracking support

[Public]

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, September 10, 2025 10:09 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 03/26] xen/x86: consolidate vram tracking support
>
> On 10.09.2025 09:38, Penny Zheng wrote:
> > Flag PG_log_dirty is for paging log dirty support, not vram tracking 
> > support.
> > However data structure sh_dirty_vram{} and function
> > paging_log_dirty_range() designed for vram tracking support, are guarded 
> > with
> PG_log_dirty.
> > We release both from PG_log_dirty, and also move
> > paging_log_dirty_range(), remamed with p2m_log_dirty_range(), into p2m.c, 
> > where
> it logically belongs.
>
> Aren't these two independent changes? One to deal with struct sh_dirty_vram, 
> the
> other to move and rename paging_log_dirty_range()? Irrespective, in the 
> interest of
> making progress:
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> with ...
>
> > --- a/xen/arch/x86/include/asm/p2m.h
> > +++ b/xen/arch/x86/include/asm/p2m.h
> > @@ -1110,6 +1110,10 @@ static inline int p2m_entry_modify(struct
> > p2m_domain *p2m, p2m_type_t nt,
> >
> >  #endif /* CONFIG_HVM */
> >
> > +/* get the dirty bitmap for a specific range of pfns */
>
> ... comment style corrected here (happy to do so while committing).
>
> Aiui the patch is independent of the earlier two, and hence could go in ahead 
> of
> them. Sadly once again nothing like this is stated anywhere, so please 
> confirm.
>

Yes, it could go in ahead of them. I'll split it into two commits, and I will 
do this immediately to send regardless of this patch serie.

> > --- a/xen/arch/x86/include/asm/paging.h
> > +++ b/xen/arch/x86/include/asm/paging.h
> > @@ -133,13 +133,20 @@ struct paging_mode {
> >      (DIV_ROUND_UP(PADDR_BITS - PAGE_SHIFT - (PAGE_SHIFT + 3), \
> >                    PAGE_SHIFT - ilog2(sizeof(mfn_t))) + 1)
> >
> > -#if PG_log_dirty
> > +#ifdef CONFIG_HVM
> > +/* VRAM dirty tracking support */
> > +struct sh_dirty_vram {
> > +    unsigned long begin_pfn;
> > +    unsigned long end_pfn;
> > +#ifdef CONFIG_SHADOW_PAGING
> > +    paddr_t *sl1ma;
> > +    uint8_t *dirty_bitmap;
> > +    s_time_t last_dirty;
> > +#endif
> > +};
> > +#endif
>
> Subsequently I think we will want to do more cleanup here. Us using a shadow
> mode struct also in HAP code is bogus and, afaics, wasteful. The three latter
> members are used only by shadow code, so HAP could have its own, smaller
> variant of the type. And each type could be private to the hap/ and shadow/
> subtrees respectively.
>

Understood.

> Jan

 


Rackspace

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