Skip to content

Commit e3aa4e6

Browse files
Liu, Jinsongkonradwilk
authored andcommitted
xen/acpi: revert pad config check in xen_check_mwait
With Xen acpi pad logic added into kernel, we can now revert xen mwait related patch df88b2d ("xen/enlighten: Disable MWAIT_LEAF so that acpi-pad won't be loaded. "). The reason is, when running under newer Xen platform, Xen pad driver would be early loaded, so native pad driver would fail to be loaded, and hence no mwait/monitor #UD risk again. Another point is, only Xen4.2 or later support Xen acpi pad, so we won't expose mwait cpuid capability when running under older Xen platform. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
1 parent 92e3229 commit e3aa4e6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/x86/xen/enlighten.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
287287

288288
static bool __init xen_check_mwait(void)
289289
{
290-
#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && \
291-
!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
290+
#ifdef CONFIG_ACPI
292291
struct xen_platform_op op = {
293292
.cmd = XENPF_set_processor_pminfo,
294293
.u.set_pminfo.id = -1,
@@ -309,6 +308,13 @@ static bool __init xen_check_mwait(void)
309308
if (!xen_initial_domain())
310309
return false;
311310

311+
/*
312+
* When running under platform earlier than Xen4.2, do not expose
313+
* mwait, to avoid the risk of loading native acpi pad driver
314+
*/
315+
if (!xen_running_on_version_or_later(4, 2))
316+
return false;
317+
312318
ax = 1;
313319
cx = 0;
314320

0 commit comments

Comments
 (0)