46ad899
Or rather just implement one different function as opposed
46ad899
to the native one : the read function.
46ad899
46ad899
We synthesize the values.
46ad899
46ad899
Acked-by:  Suresh Siddha <suresh.b.siddha@intel.com>
46ad899
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
46ad899
---
46ad899
 arch/x86/xen/Makefile    |    2 +-
46ad899
 arch/x86/xen/apic.c      |   17 +++++++++++++++++
46ad899
 arch/x86/xen/enlighten.c |    2 ++
46ad899
 arch/x86/xen/xen-ops.h   |    4 ++++
46ad899
 4 files changed, 24 insertions(+), 1 deletions(-)
46ad899
 create mode 100644 arch/x86/xen/apic.c
46ad899
46ad899
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
46ad899
index add2c2d..96ab2c0 100644
46ad899
--- a/arch/x86/xen/Makefile
46ad899
+++ b/arch/x86/xen/Makefile
46ad899
@@ -20,5 +20,5 @@ obj-$(CONFIG_EVENT_TRACING) += trace.o
46ad899
 obj-$(CONFIG_SMP)		+= smp.o
46ad899
 obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
46ad899
 obj-$(CONFIG_XEN_DEBUG_FS)	+= debugfs.o
46ad899
-obj-$(CONFIG_XEN_DOM0)		+= vga.o
46ad899
+obj-$(CONFIG_XEN_DOM0)		+= apic.o vga.o
46ad899
 obj-$(CONFIG_SWIOTLB_XEN)	+= pci-swiotlb-xen.o
46ad899
diff --git a/arch/x86/xen/apic.c b/arch/x86/xen/apic.c
46ad899
new file mode 100644
46ad899
index 0000000..71ed91c
46ad899
--- /dev/null
46ad899
+++ b/arch/x86/xen/apic.c
46ad899
@@ -0,0 +1,17 @@
46ad899
+#include <linux/init.h>
46ad899
+#include <asm/x86_init.h>
46ad899
+
46ad899
+unsigned int xen_io_apic_read(unsigned apic, unsigned reg)
46ad899
+{
46ad899
+	if (reg == 0x1)
46ad899
+		return 0x00170020;
46ad899
+	else if (reg == 0x0)
46ad899
+		return apic << 24;
46ad899
+
46ad899
+	return 0xff;
46ad899
+}
46ad899
+
46ad899
+void __init xen_init_apic(void)
46ad899
+{
46ad899
+	x86_ioapic.read = xen_io_apic_read;
46ad899
+}
46ad899
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
46ad899
index 0732326..93a03195 100644
46ad899
--- a/arch/x86/xen/enlighten.c
46ad899
+++ b/arch/x86/xen/enlighten.c
46ad899
@@ -1377,6 +1377,8 @@ asmlinkage void __init xen_start_kernel(void)
46ad899
 		xen_start_info->console.domU.mfn = 0;
46ad899
 		xen_start_info->console.domU.evtchn = 0;
46ad899
 
46ad899
+		xen_init_apic();
46ad899
+
46ad899
 		/* Make sure ACS will be enabled */
46ad899
 		pci_request_acs();
46ad899
 
46ad899
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
46ad899
index b095739..45c0c06 100644
46ad899
--- a/arch/x86/xen/xen-ops.h
46ad899
+++ b/arch/x86/xen/xen-ops.h
46ad899
@@ -92,11 +92,15 @@ struct dom0_vga_console_info;
46ad899
 
46ad899
 #ifdef CONFIG_XEN_DOM0
46ad899
 void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size);
46ad899
+void __init xen_init_apic(void);
46ad899
 #else
46ad899
 static inline void __init xen_init_vga(const struct dom0_vga_console_info *info,
46ad899
 				       size_t size)
46ad899
 {
46ad899
 }
46ad899
+static inline void __init xen_init_apic(void)
46ad899
+{
46ad899
+}
46ad899
 #endif
46ad899
 
46ad899
 /* Declare an asm function, along with symbols needed to make it
46ad899
-- 
46ad899
1.7.7.5
46ad899