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

[Xen-changelog] [xen master] libxc/x86: Report consistent initial APIC value for PV guests



commit 1a5245528ee3d3287f940a44b6cf91fea3dbae32
Author:     Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
AuthorDate: Thu Nov 10 09:50:24 2016 -0500
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Sat Nov 12 06:45:16 2016 +0000

    libxc/x86: Report consistent initial APIC value for PV guests
    
    Currently hypervisor provides PV guest's CPUID(1).EBX[31:24] (initial
    APIC ID) with contents of that field on the processor that launched
    the guest. This results in the guest reporting different initial
    APIC IDs across runs.
    
    We should be consistent in how this value is reported, let's set
    it to 0 (which is also what Linux guests expect).
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    [ wei: remove trailing whitespace in comment ]
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxc/xc_cpuid_x86.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index d761805..2ad9aeb 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -618,6 +618,12 @@ static void xc_cpuid_pv_policy(xc_interface *xch,
         /* Host topology exposed to PV guest.  Provide host value. */
         bool host_htt = regs[3] & bitmaskof(X86_FEATURE_HTT);
 
+        /*
+         * Don't pick host's Initial APIC ID which can change from run
+         * to run.
+         */
+        regs[1] &= 0x00ffffffu;
+
         regs[2] = info->featureset[featureword_of(X86_FEATURE_SSE3)];
         regs[3] = (info->featureset[featureword_of(X86_FEATURE_FPU)] &
                    ~bitmaskof(X86_FEATURE_HTT));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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