On 08/16/2017 02:23 PM, Andrew Cooper wrote: > They are only referenced by physical address (either the HSA MSR, or via > VMSAVE/VMLOAD which take a physical operand). Allocating xenheap hages and > storing their virtual address is wasteful. > > Allocate them with domheap pages instead, taking the opportunity to suitably > NUMA-position them. This avoids Xen needing to perform a virt to phys > translation on every context switch. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrov...@oracle.com> > --- > CC: Jan Beulich <jbeul...@suse.com> > CC: Boris Ostrovsky <boris.ostrov...@oracle.com> > CC: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> > > TODO at some other point: Figure out why svm_cpu_up_prepare() is reliably > called twice for every CPU. That's because it is called by BSP via PREPARE_CPU notifier and then by the ASP during svm_cpu_up(). I think diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 0dc9442..3e7b9fc 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1538,7 +1538,7 @@ static int _svm_cpu_up(bool bsp) return -EINVAL; } - if ( (rc = svm_cpu_up_prepare(cpu)) != 0 ) + if ( bsp && (rc = svm_cpu_up_prepare(cpu)) != 0 ) return rc; write_efer(read_efer() | EFER_SVME); should take care of this. I only had a quick look at intel and seems they may have the same problem. -boris _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel