Skip to content

Commit 6a92b11

Browse files
Boris OstrovskyKAGA-KOKO
authored andcommitted
x86/EISA: Don't probe EISA bus for Xen PV guests
For unprivileged Xen PV guests this is normal memory and ioremap will not be able to properly map it. While at it, since ioremap may return NULL, add a test for pointer's validity. Reported-by: Andy Smith <andy@strugglers.net> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: hpa@zytor.com Cc: xen-devel@lists.xenproject.org Cc: jgross@suse.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180911195538.23289-1-boris.ostrovsky@oracle.com
1 parent 07e846b commit 6a92b11

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/x86/kernel/eisa.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@
77
#include <linux/eisa.h>
88
#include <linux/io.h>
99

10+
#include <xen/xen.h>
11+
1012
static __init int eisa_bus_probe(void)
1113
{
12-
void __iomem *p = ioremap(0x0FFFD9, 4);
14+
void __iomem *p;
15+
16+
if (xen_pv_domain() && !xen_initial_domain())
17+
return 0;
1318

14-
if (readl(p) == 'E' + ('I'<<8) + ('S'<<16) + ('A'<<24))
19+
p = ioremap(0x0FFFD9, 4);
20+
if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
1521
EISA_bus = 1;
1622
iounmap(p);
1723
return 0;

0 commit comments

Comments
 (0)