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

Re: [PATCH v5 01/10] mem_sharing/fork: do not attempt to populate vcpu_info page


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 3 Oct 2023 09:15:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=rHP9YXezTIkQHtH/UNEzKdM20E7PMa/NJKdQERuHM9E=; b=bACGk5fVjt01+PQVE0X/4s442CU5y5m+JLoWMmUaXmZJ28KmUa1Gz6inL916aHPyTeSe24ewFrUjGpBedknCFKG6zlwkYb4DnJLpC4s4gaS2pIQ2cmRrKn0q7f+QJ0+QM5XsGNi1CLUz4rIwG0YBDTQfngftpNPuVMyvHnPgvzClaV/jxxaIoPKg2BlvVvJyGmQZ9Y7FgHzZXm5nhMKwPVrUrhK8e+cy5uR7daClqPJ47/zZHtr7ZtEuPjpBFJqvb/0SN0nsgbZfXrQPT/3SI/xYTGjw88akp2NWKY/8U/txLrZaTP/vhnDB9h2eElSY5rTLKMNeZhWcZKoKIq1Rdg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JcrLbaiP2XnifDKlzBEQtrJV/bH7exmlCT/H985Qjw50WkskoAiiLEReMXYIh0J9W8E5TvTdhIUJVmIz/FQpl11+s3/RKSm1ZGOZVY0egGjpeMf+JiMpuRNSeGDGoJs5VOxZ2nZaiqLZrISmBkaosdWEcGswIUpqUgTiAgOpfcSQ86tMtXEhadJqoArD7u0I6wQ9kMmnqr2EvCZd6zlc82KuX7aReGAK4IT4BltAxd3tW0ivQ3yN9suJgpHNm10Zp2i2lT1AMIjlB1Ur04D9bBKH8NnYQy5NmmUwD2SOoL4wp3sNEio+Olc3sAD5nx5E4eaptJC0Aj1wl/xBIS5Ypw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, henry.wang@xxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 03 Oct 2023 07:15:38 +0000
  • Ironport-data: A9a23:MMl07qu9aMciCdrkRYIYrARfEOfnVJ9fMUV32f8akzHdYApBsoF/q tZmKWuDaP3YZmLzfdsna4S+/UNXuJbcy4QwTlQ4qXtjH3wW+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVaicfHg3HFc4IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq41v0gnRkPaoQ5QeGzCFPZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwIxJdY1eOtsSK0JGSc7JFh/0GANHUBdZK0p1g5Wmx4fcOZ7nmGvyPzvgBmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osjv60b4C9lt+iHK25mm6Co W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAt5JTuXiqqECbFu75EEZUU0EEnaHsafnqmuvYYltC 0Y49X97xUQ13AnxJjXnZDWkqXuNpTYAWN5dFeIr5QXLwa3Riy6JC25BQjNfZdgOsM4tWSdsx lKPh8nuBzFkrPuSU3313reZqymjfzccK2AqbDUBCwAC5rHLoos+kxbORdZLC7Oug5v+HjSY6 y+OhDgzgfMUl8Fj6kmg1VXOgjbprZ+QSAcwv1zTRjj8sVk/Y5O5bYu171Sd9exHMIuSUliGu j4DhtSa6+cNS5qKkURhXdkwIV1g3N7dWBW0vLKlN8BJG+iFk5J7Qb1t3Q==
  • Ironport-hdrordr: A9a23:wGS5fqtrON1Iy+qfbT2XEELj7skDstV00zEX/kB9WHVpm6yj+v xG/c5rsCMc7Qx6ZJhOo7+90cW7L080lqQFg7X5X43DYOCOggLBQL2KhbGI/9SKIVycygcy78 Zdm6gVMqyLMbB55/yKnTVRxbwbsaW6GKPDv5ag8590JzsaD52Jd21Ce36m+ksdfnggObMJUK Cyy+BgvDSadXEefq2AdwI4t7iqnaysqHr+CyR2fiIa1A==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Oct 02, 2023 at 01:05:24PM -0400, Tamas K Lengyel wrote:
> On Mon, Oct 2, 2023 at 11:12 AM Roger Pau Monne <roger.pau@xxxxxxxxxx> wrote:
> >
> > Instead let map_vcpu_info() and it's call to get_page_from_gfn()
> > populate the page in the child as needed.  Also remove the bogus
> > copy_domain_page(): should be placed before the call to map_vcpu_info(),
> > as the later can update the contents of the vcpu_info page.
> >
> > Note that this eliminates a bug in copy_vcpu_settings(): The function did
> > allocate a new page regardless of the GFN already having a mapping, thus in
> > particular breaking the case of two vCPU-s having their info areas on the 
> > same
> > page.
> >
> > Fixes: 41548c5472a3 ('mem_sharing: VM forking')
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > Only build tested.
> 
> So this will allocate & map a page in, but its content won't be
> matching that of the parent. Is that not an issue? If there is no
> state on this page the guest is going to rely on, it looks fine to me.
> But if the guest may expect a certain state to be already setup on
> this page we could run into weird issues in the fork, no?

mem_sharing_fork_page() will do the copy from the parent, and this is
what gets called from get_page_from_gfn().

map_vcpu_info() might change some of the vcpu_info contents when
compared to the parent, but such changes could also happen without the
fork, and the guest should be able to handle it just like any update
to vcpu_info.  There will likely be an spurious event channel upcall
injected depending on the delivery method selected by the guest, but
again this could also happen without the fork taking place.

Thanks, Roger.



 


Rackspace

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