All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lengyel, Tamas" <tamas.lengyel@intel.com>
To: "Cooper, Andrew" <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Tamas K Lengyel" <tamas@tklengyel.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: RE: [PATCH 1/2] x86/mem_sharing: copy cpuid during vm forking
Date: Tue, 5 Jan 2021 15:50:39 +0000	[thread overview]
Message-ID: <BN6PR11MB0049D21959B95836B4997594FBD10@BN6PR11MB0049.namprd11.prod.outlook.com> (raw)
In-Reply-To: <7cfa7763-e905-58a0-d4c6-2cca0a54b1ad@citrix.com>



> -----Original Message-----
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> Sent: Tuesday, January 5, 2021 6:05 AM
> To: Lengyel, Tamas <tamas.lengyel@intel.com>; xen-
> devel@lists.xenproject.org
> Cc: Tamas K Lengyel <tamas@tklengyel.com>; Jan Beulich
> <jbeulich@suse.com>; George Dunlap <george.dunlap@citrix.com>; Roger
> Pau Monné <roger.pau@citrix.com>; Wei Liu <wl@xen.org>
> Subject: Re: [PATCH 1/2] x86/mem_sharing: copy cpuid during vm forking
> 
> On 04/01/2021 17:41, Tamas K Lengyel wrote:
> > Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
> > ---
> >  xen/arch/x86/mm/mem_sharing.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/xen/arch/x86/mm/mem_sharing.c
> > b/xen/arch/x86/mm/mem_sharing.c index c428fd16ce..4a02c7d6f2
> 100644
> > --- a/xen/arch/x86/mm/mem_sharing.c
> > +++ b/xen/arch/x86/mm/mem_sharing.c
> > @@ -1764,6 +1764,7 @@ static int fork(struct domain *cd, struct domain
> > *d)
> >
> >          domain_pause(d);
> >          cd->max_pages = d->max_pages;
> > +        memcpy(cd->arch.cpuid, d->arch.cpuid,
> > + sizeof(*d->arch.cpuid));
> >          cd->parent = d;
> >      }
> >
> 
> You need to extend this to d->arch.msr and v->arch.msrs or someone is
> going to have a very subtle bug to debug in the future.

I need more information why v->arch.msrs would need to be copied manually. If it's saved/reloaded by hvm_save/hvm_load then we are already covered. If not, then why would we need to do that for forks but not for domain save/restore?

Tamas

      reply	other threads:[~2021-01-05 15:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 17:41 [PATCH 1/2] x86/mem_sharing: copy cpuid during vm forking Tamas K Lengyel
2021-01-04 17:41 ` [PATCH 2/2] x86/hap: Resolve mm-lock order violations when forking VMs with nested p2m Tamas K Lengyel
2021-01-06 12:03   ` Jan Beulich
2021-01-06 15:29     ` Tamas K Lengyel
2021-01-06 16:11       ` Jan Beulich
2021-01-06 16:26         ` Tamas K Lengyel
2021-01-07 12:25           ` Jan Beulich
2021-01-07 12:43             ` Tamas K Lengyel
2021-01-07 12:56               ` Jan Beulich
2021-01-07 13:27                 ` Tamas K Lengyel
2021-01-05  8:40 ` [PATCH 1/2] x86/mem_sharing: copy cpuid during vm forking Jan Beulich
2021-01-05 11:04 ` Andrew Cooper
2021-01-05 15:50   ` Lengyel, Tamas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN6PR11MB0049D21959B95836B4997594FBD10@BN6PR11MB0049.namprd11.prod.outlook.com \
    --to=tamas.lengyel@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=tamas@tklengyel.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.