[RFC/PATCH LGUEST X86_64 05/13] asm-offsets update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



plain text document attachment (lguest64-asm-offset.patch)
This patch puts in the offsets used by Lguest64 in assembly.

Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
Signed-off-by: Glauber de Oliveira Costa <glommer@xxxxxxxxx>
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>


Index: work-pv/arch/x86_64/kernel/asm-offsets.c
===================================================================
--- work-pv.orig/arch/x86_64/kernel/asm-offsets.c
+++ work-pv/arch/x86_64/kernel/asm-offsets.c
@@ -18,6 +18,9 @@
 #ifdef CONFIG_PARAVIRT
 #include <asm/paravirt.h>
 #endif
+#ifdef CONFIG_LGUEST_GUEST
+#include <asm/lguest.h>
+#endif
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -89,5 +92,51 @@ int main(void)
 	ENTRY(read_cr2);
 	ENTRY(swapgs);
 #endif
+
+#ifdef CONFIG_LGUEST_GUEST
+#undef ENTRY
+#define ENTRY(entry)  DEFINE(LGUEST_VCPU_ ##entry, offsetof(struct lguest_vcpu, entry))
+	ENTRY(vcpu);
+	ENTRY(debug);
+	ENTRY(magic);
+	ENTRY(guest_syscall);
+	ENTRY(host_stack);
+	ENTRY(host_cr3);
+	ENTRY(host_gs_a);
+	ENTRY(host_gs_d);
+	ENTRY(host_proc_gs_a);
+	ENTRY(host_proc_gs_d);
+	ENTRY(guest_gs_a);
+	ENTRY(guest_gs_d);
+	ENTRY(gdt);
+	ENTRY(idt);
+	ENTRY(host_gdt);
+	ENTRY(host_idt);
+	ENTRY(host_gdt_ptr);
+	ENTRY(gdt_table);
+	DEFINE(LGUEST_VCPU_trapnum, offsetof(struct lguest_vcpu, regs.trapnum));
+	DEFINE(LGUEST_VCPU_errcode, offsetof(struct lguest_vcpu, regs.errcode));
+	DEFINE(LGUEST_VCPU_rflags, offsetof(struct lguest_vcpu, regs.rflags));
+	DEFINE(LGUEST_VCPU_host_idt_address, offsetof(struct lguest_vcpu, host_idt.address));
+	ENTRY(regs);
+	ENTRY(nmi_regs);
+	DEFINE(LGUEST_VCPU_errcode, offsetof(struct lguest_vcpu, regs.errcode));
+	ENTRY(nmi_gs_a);
+	ENTRY(nmi_gs_d);
+	ENTRY(nmi_gs_shadow_a);
+	ENTRY(nmi_gs_shadow_d);
+	ENTRY(nmi_stack_end);
+	ENTRY(nmi_gdt);
+	ENTRY(nmi_sw);
+#undef ENTRY
+#define ENTRY(entry)  DEFINE(LGUEST_DATA_##entry, offsetof(struct lguest_data, entry))
+	ENTRY(irq_enabled);
+#undef ENTRY
+#define ENTRY(entry)  DEFINE(LGUEST_REGS_##entry, offsetof(struct lguest_regs, entry))
+	ENTRY(errcode);
+	ENTRY(rip);
+	ENTRY(size);
+	BLANK();
+#endif
 	return 0;
 }

--

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxx
https://lists.osdl.org/mailman/listinfo/virtualization


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux