svn commit: r234162 - in projects/amd64_xen_pv/sys/amd64: include
xen
Cherry G. Mathew
cherry at FreeBSD.org
Thu Apr 12 00:59:31 UTC 2012
Author: cherry
Date: Thu Apr 12 00:59:30 2012
New Revision: 234162
URL: http://svn.freebsd.org/changeset/base/234162
Log:
PV kernels cannot use the cli/sti privileged opcodes to
mask/unmask interrupts (known as "events" in xenspeak).
We mask/unmask interrupts by notifying the hypervisor via the
shared_info page.
Approved by: gibbs (implicit)
Modified:
projects/amd64_xen_pv/sys/amd64/include/cpufunc.h
projects/amd64_xen_pv/sys/amd64/xen/machdep.c
Modified: projects/amd64_xen_pv/sys/amd64/include/cpufunc.h
==============================================================================
--- projects/amd64_xen_pv/sys/amd64/include/cpufunc.h Thu Apr 12 00:45:43 2012 (r234161)
+++ projects/amd64_xen_pv/sys/amd64/include/cpufunc.h Thu Apr 12 00:59:30 2012 (r234162)
@@ -44,6 +44,8 @@
#endif
#ifdef XEN
+extern void xen_cli(void);
+extern void xen_sti(void);
extern void xen_load_cr3(u_int data);
extern void xen_tlb_flush(void);
extern void xen_invlpg(vm_offset_t addr);
@@ -138,7 +140,11 @@ cpuid_count(u_int ax, u_int cx, u_int *p
static __inline void
enable_intr(void)
{
+#ifdef XEN
+ xen_sti();
+#else
__asm __volatile("sti");
+#endif
}
#ifdef _KERNEL
Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c
==============================================================================
--- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Thu Apr 12 00:45:43 2012 (r234161)
+++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Thu Apr 12 00:59:30 2012 (r234162)
@@ -988,6 +988,20 @@ read_rflags(void)
return (rflags);
}
+void
+xen_cli(void)
+{
+ CTR1(KTR_SPARE2, "%x xen_cli disabling interrupts", rrbp());
+ __cli();
+}
+
+void
+xen_sti(void)
+{
+ CTR1(KTR_SPARE2, "%x xen_sti enabling interrupts", rrbp());
+ __sti();
+}
+
char *console_page;
#include <machine/tss.h>
struct amd64tss common_tss[MAXCPU];
More information about the svn-src-projects
mailing list