All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/apic: implement io apic read with hypercall
@ 2012-04-20  9:25 Lin Ming
  2012-04-20  9:58 ` [Xen-devel] " Andrew Cooper
  0 siblings, 1 reply; 22+ messages in thread
From: Lin Ming @ 2012-04-20  9:25 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel, linux-kernel

Implements xen_io_apic_read with hypercall, so it returns proper IO-APIC
information instead of fabricated one.

Signed-off-by: Lin Ming <mlin@ss.pku.edu.cn>
---
 arch/x86/xen/apic.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/x86/xen/apic.c b/arch/x86/xen/apic.c
index aee16ab..f1f392d 100644
--- a/arch/x86/xen/apic.c
+++ b/arch/x86/xen/apic.c
@@ -1,14 +1,20 @@
 #include <linux/init.h>
 #include <asm/x86_init.h>
+#include <asm/apic.h>
+#include <xen/interface/physdev.h>
+#include <asm/xen/hypercall.h>
 
 unsigned int xen_io_apic_read(unsigned apic, unsigned reg)
 {
-	if (reg == 0x1)
-		return 0x00170020;
-	else if (reg == 0x0)
-		return apic << 24;
+	struct physdev_apic apic_op;
+	int ret;
 
-	return 0xff;
+	apic_op.apic_physbase = mpc_ioapic_addr(apic);
+	apic_op.reg = reg;
+	ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op);
+	if (ret)
+		return ret;
+	return apic_op.value;
 }
 
 void __init xen_init_apic(void)
-- 
1.7.2.5




^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-04-26 15:39 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20  9:25 [PATCH] xen/apic: implement io apic read with hypercall Lin Ming
2012-04-20  9:58 ` [Xen-devel] " Andrew Cooper
2012-04-20 11:13   ` Lin Ming
2012-04-20 12:38     ` Ian Campbell
2012-04-20 12:52       ` Jan Beulich
2012-04-20 12:53       ` Andrew Cooper
2012-04-20 13:12         ` Ian Campbell
2012-04-20 13:20           ` Andrew Cooper
2012-04-20 14:50           ` Lin Ming
2012-04-20 14:50             ` Lin Ming
2012-04-20 14:59             ` [Xen-devel] " Jan Beulich
2012-04-20 15:06             ` Ian Campbell
2012-04-20 15:39               ` Lin Ming
2012-04-20 16:43                 ` Konrad Rzeszutek Wilk
2012-04-20 16:41       ` Konrad Rzeszutek Wilk
2012-04-23  8:42         ` Lin Ming
2012-04-23 15:11           ` Konrad Rzeszutek Wilk
2012-04-24 14:43             ` Lin Ming
2012-04-24 16:23               ` Konrad Rzeszutek Wilk
2012-04-25 10:06                 ` Lin Ming
2012-04-26 15:33                   ` Konrad Rzeszutek Wilk
2012-04-26 15:33                     ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.