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

Re: [PATCH 1/2] x86/mem_sharing: copy cpuid during vm forking


  • To: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 5 Jan 2021 11:04:35 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 05 Jan 2021 11:04:46 +0000
  • Ironport-sdr: 6uAqFmoxa6lVZ2buUQwSRk5tGAdh7a3JUDknrC1MBGqixgm3YyWog4ReZGYr/Mna4DZxAuhQnJ KhJLyNuG9JNzblhOjNuyIhqoJ0lKMfYhLPOoJb5aoodqFbyqcE1FTbkA+RAydSVZ6chYrCfwGn LVb4RhaZB8j44z0S3KzBeuy/ZGbX9E+rNrWMOYn+oqhoBSq9zKCdhZEF0ImsIo3u5C5oBL2g5o 6eM9L/Ruy45Tr5LMsHFnofxG7aiU+rQdZ0WjsT3Dj2cmU4f/OFDP72CXJ7sZeWRLqkns06ZU0u 9lM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04/01/2021 17:41, Tamas K Lengyel wrote:
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>
> ---
>  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.

~Andrew



 


Rackspace

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