Commit
6af1c37c19ea ("x86/pti: Don't report XenPV as vulnerable")
looks at current hypervisor to determine whether we are running as a Xen
PV guest. This is incorrect since the test will be true for HVM guests
as well.
Instead we should see if we are xen_pv_domain().
(Using Xen-specific primitives in this file is not ideal. This is not
for upstream though so we are going to have to live with this)
Orabug:
29774291
Fixes: 6af1c37c19ea ("x86/pti: Don't report XenPV as vulnerable")
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Patrick Colp <patrick.colp@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
#include <asm/hypervisor.h>
#include <asm/e820.h>
#include <asm/vmx.h>
+#include <xen/xen.h>
/*
* use_ibrs flags:
if (boot_cpu_has(X86_FEATURE_PTI))
return sprintf(buf, "Mitigation: PTI\n");
- if (x86_hyper == &x86_hyper_xen)
+ if (xen_pv_domain())
return sprintf(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n");
break;