Displaying 20 results from an estimated 26 matches for "trapnum".
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...g->pending_key, (unsigned long *)user+1))
+ if (put_user(lg->pending_dma, user) ||
+ put_user(lg->pending_key, user+1))
return -EFAULT;
return sizeof(unsigned long)*2;
}
@@ -367,7 +368,7 @@ int run_guest(struct lguest *lg, char *_
if (deliver_trap(lg, lg->regs->trapnum))
continue;
- kill_guest(lg, "unhandled trap %i at %#x (%#x)",
+ kill_guest(lg, "unhandled trap %li at %#lx (%#lx)",
lg->regs->trapnum, lg->regs->eip,
lg->regs->trapnum == 14 ? cr2 : lg->regs->errcode);
}
@@ -420,7 +421,7 @@ static...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...g->pending_key, (unsigned long *)user+1))
+ if (put_user(lg->pending_dma, user) ||
+ put_user(lg->pending_key, user+1))
return -EFAULT;
return sizeof(unsigned long)*2;
}
@@ -367,7 +368,7 @@ int run_guest(struct lguest *lg, char *_
if (deliver_trap(lg, lg->regs->trapnum))
continue;
- kill_guest(lg, "unhandled trap %i at %#x (%#x)",
+ kill_guest(lg, "unhandled trap %li at %#lx (%#lx)",
lg->regs->trapnum, lg->regs->eip,
lg->regs->trapnum == 14 ? cr2 : lg->regs->errcode);
}
@@ -420,7 +421,7 @@ static...
2007 Jul 12
1
[PATCH] lguest: disable SYSENTER for guests
.... */
+ if (boot_cpu_has(X86_FEATURE_SEP))
+ wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+
run_guest_once(lg, lguest_pages(raw_smp_processor_id()));
/* Save cr2 now if we page-faulted. */
@@ -345,6 +349,9 @@ int run_guest(struct lguest *lg, unsigne
cr2 = read_cr2();
else if (lg->regs->trapnum == 7)
math_state_restore();
+
+ if (boot_cpu_has(X86_FEATURE_SEP))
+ wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
local_irq_enable();
switch (lg->regs->trapnum) {
2007 Jul 12
1
[PATCH] lguest: disable SYSENTER for guests
.... */
+ if (boot_cpu_has(X86_FEATURE_SEP))
+ wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+
run_guest_once(lg, lguest_pages(raw_smp_processor_id()));
/* Save cr2 now if we page-faulted. */
@@ -345,6 +349,9 @@ int run_guest(struct lguest *lg, unsigne
cr2 = read_cr2();
else if (lg->regs->trapnum == 7)
math_state_restore();
+
+ if (boot_cpu_has(X86_FEATURE_SEP))
+ wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
local_irq_enable();
switch (lg->regs->trapnum) {
2007 May 09
1
[patch 3/9] lguest: the host code
...E);
+ schedule_timeout(1);
+ continue;
+ }
+
+ local_irq_disable();
+
+ /* Even if *we* don't want FPU trap, guest might... */
+ if (lg->ts)
+ set_ts();
+
+ run_guest_once(lg, lguest_pages(raw_smp_processor_id()));
+
+ /* Save cr2 now if we page-faulted. */
+ if (lg->regs->trapnum == 14)
+ cr2 = read_cr2();
+ else if (lg->regs->trapnum == 7)
+ math_state_restore();
+ local_irq_enable();
+
+ switch (lg->regs->trapnum) {
+ case 13: /* We've intercepted a GPF. */
+ if (lg->regs->errcode == 0) {
+ if (emulate_insn(lg))
+ continue;
+ }
+...
2007 May 09
1
[patch 3/9] lguest: the host code
...E);
+ schedule_timeout(1);
+ continue;
+ }
+
+ local_irq_disable();
+
+ /* Even if *we* don't want FPU trap, guest might... */
+ if (lg->ts)
+ set_ts();
+
+ run_guest_once(lg, lguest_pages(raw_smp_processor_id()));
+
+ /* Save cr2 now if we page-faulted. */
+ if (lg->regs->trapnum == 14)
+ cr2 = read_cr2();
+ else if (lg->regs->trapnum == 7)
+ math_state_restore();
+ local_irq_enable();
+
+ switch (lg->regs->trapnum) {
+ case 13: /* We've intercepted a GPF. */
+ if (lg->regs->errcode == 0) {
+ if (emulate_insn(lg))
+ continue;
+ }
+...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...s to put here */
+int run_guest(struct lguest_vcpu *vcpu, char *__user user)
+{
+ struct lguest_guest_info *linfo = vcpu->guest;
+ struct desc_struct *gdt_table;
+ struct lguest_regs *regs = &vcpu->regs;
+ int ret;
+
+ unsigned long cr2 = 0;
+
+ while (!linfo->dead) {
+
+ if (regs->trapnum == LGUEST_TRAP_ENTRY) {
+
+ if (lguest_debug) {
+ printk("hit trap %lld rip=", regs->trapnum);
+ lguest_print_address(vcpu, regs->rip);
+ printk("calling hypercall %d!\n", (unsigned)regs->rax);
+ }
+
+ regs->trapnum = 255;
+ hypercall(vcpu);
+ if (...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...s to put here */
+int run_guest(struct lguest_vcpu *vcpu, char *__user user)
+{
+ struct lguest_guest_info *linfo = vcpu->guest;
+ struct desc_struct *gdt_table;
+ struct lguest_regs *regs = &vcpu->regs;
+ int ret;
+
+ unsigned long cr2 = 0;
+
+ while (!linfo->dead) {
+
+ if (regs->trapnum == LGUEST_TRAP_ENTRY) {
+
+ if (lguest_debug) {
+ printk("hit trap %lld rip=", regs->trapnum);
+ lguest_print_address(vcpu, regs->rip);
+ printk("calling hypercall %d!\n", (unsigned)regs->rax);
+ }
+
+ regs->trapnum = 255;
+ hypercall(vcpu);
+ if (...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...8c7131b>] lgread+0x59/0x90 [lg]
Printing LG 0 regs cr3: 021eb000
EIP: 0061: [<00000000e00227d2>]
ESP: 0069:c236fe3c EFLAGS: 00010202
EAX: 00000004 EBX: e001fb20 ECX: 00000008 EDX: 000003f2
ESI: e001ee00 EDI: e001fb60 EBP: c236fea0
CR2: 1278000 lguest_data->cr2: 80011380
errcode: 0 trapnum: d
Stack Dump:
[<00000000c1042b7a>] trace_hardirqs_on+0x125/0x149
[<00000000c123b0ea>] wait_for_completion+0x90/0x98
[<00000000c123bddc>] __mutex_unlock_slowpath+0x129/0x13e
[<00000000c1048769>] unlock_cpu_hotplug+0x62/0x64
[<00000000c104b5b6>] sys_init_module+0x1...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...8c7131b>] lgread+0x59/0x90 [lg]
Printing LG 0 regs cr3: 021eb000
EIP: 0061: [<00000000e00227d2>]
ESP: 0069:c236fe3c EFLAGS: 00010202
EAX: 00000004 EBX: e001fb20 ECX: 00000008 EDX: 000003f2
ESI: e001ee00 EDI: e001fb60 EBP: c236fea0
CR2: 1278000 lguest_data->cr2: 80011380
errcode: 0 trapnum: d
Stack Dump:
[<00000000c1042b7a>] trace_hardirqs_on+0x125/0x149
[<00000000c123b0ea>] wait_for_completion+0x90/0x98
[<00000000c123bddc>] __mutex_unlock_slowpath+0x129/0x13e
[<00000000c1048769>] unlock_cpu_hotplug+0x62/0x64
[<00000000c104b5b6>] sys_init_module+0x1...
2007 May 09
1
[patch 4/9] lguest: the asm offsets
...OFFSET(LGUEST_PAGES_host_sp, lguest_pages, state.host_sp);
+ OFFSET(LGUEST_PAGES_guest_gdt_desc, lguest_pages,state.guest_gdt_desc);
+ OFFSET(LGUEST_PAGES_guest_idt_desc, lguest_pages,state.guest_idt_desc);
+ OFFSET(LGUEST_PAGES_guest_gdt, lguest_pages, state.guest_gdt);
+ OFFSET(LGUEST_PAGES_regs_trapnum, lguest_pages, regs.trapnum);
+ OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode);
+ OFFSET(LGUEST_PAGES_regs, lguest_pages, regs);
+#endif
}
_
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 05/13] asm-offsets update
...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);
+...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 05/13] asm-offsets update
...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);
+...
2007 May 09
1
[patch 4/9] lguest: the asm offsets
...OFFSET(LGUEST_PAGES_host_sp, lguest_pages, state.host_sp);
+ OFFSET(LGUEST_PAGES_guest_gdt_desc, lguest_pages,state.guest_gdt_desc);
+ OFFSET(LGUEST_PAGES_guest_idt_desc, lguest_pages,state.guest_idt_desc);
+ OFFSET(LGUEST_PAGES_guest_gdt, lguest_pages, state.guest_gdt);
+ OFFSET(LGUEST_PAGES_regs_trapnum, lguest_pages, regs.trapnum);
+ OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode);
+ OFFSET(LGUEST_PAGES_regs, lguest_pages, regs);
+#endif
}
_
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 04/13] Useful debugging
...->rbp, regs->r8, regs->r9);
+ printk("R10: %016llx R11: %016llx R12: %016llx\n",
+ regs->r10, regs->r11, regs->r12);
+ printk("R13: %016llx R14: %016llx R15: %016llx\n",
+ regs->r13, regs->r14, regs->r15);
+
+ printk("errcode: %llx trapnum: %llx\n",
+ regs->errcode, regs->trapnum);
+
+ lguest_dump_trace(vcpu, regs);
+}
+
+struct guest_ksym_stuff {
+ unsigned long *addresses;
+ unsigned long num_syms;
+ u8 *names;
+ u8 *token_table;
+ u16 *token_index;
+ unsigned long *markers;
+};
+
+static struct lguest_text_ptr *g...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 04/13] Useful debugging
...->rbp, regs->r8, regs->r9);
+ printk("R10: %016llx R11: %016llx R12: %016llx\n",
+ regs->r10, regs->r11, regs->r12);
+ printk("R13: %016llx R14: %016llx R15: %016llx\n",
+ regs->r13, regs->r14, regs->r15);
+
+ printk("errcode: %llx trapnum: %llx\n",
+ regs->errcode, regs->trapnum);
+
+ lguest_dump_trace(vcpu, regs);
+}
+
+struct guest_ksym_stuff {
+ unsigned long *addresses;
+ unsigned long num_syms;
+ u8 *names;
+ u8 *token_table;
+ u16 *token_index;
+ unsigned long *markers;
+};
+
+static struct lguest_text_ptr *g...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 00/13] Lguest for the x86_64
...e ability to implement page cleaning at
a lower level, and this lets us limit the amount of pages the
guest can take from the host.
Interrupts:
===========
When an interrupt goes off, we've put the tss->rsp0 to point to
the vcpu struct regs field. This way we push onto the vcpu struct
the trapnum errcord, rip, cs, rflags, rsp and ss regs. Alse we
put onto this field the guests regs and cr3. This is somewhat similar
to the i386 way of doing things.
We then put back the host gdt, idt, tr and cr3 regs and jump back to
the host.
We use the stack pointer to find our location of the vcpu struct...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 00/13] Lguest for the x86_64
...e ability to implement page cleaning at
a lower level, and this lets us limit the amount of pages the
guest can take from the host.
Interrupts:
===========
When an interrupt goes off, we've put the tss->rsp0 to point to
the vcpu struct regs field. This way we push onto the vcpu struct
the trapnum errcord, rip, cs, rflags, rsp and ss regs. Alse we
put onto this field the guests regs and cr3. This is somewhat similar
to the i386 way of doing things.
We then put back the host gdt, idt, tr and cr3 regs and jump back to
the host.
We use the stack pointer to find our location of the vcpu struct...
2007 Aug 07
1
[PATCH] Fix Malicious Guest GDT Host Crash
...rmation into this CPU's "struct
* lguest_pages". */
copy_in_guest_info(lg, pages);
+
+ /* Set the trap number to 256 (impossible value). If we fault while
+ * switching to the Guest (bad segment registers or bug), this will
+ * cause us to abort the Guest. */
+ lg->regs->trapnum = 256;
/* Now: we push the "eflags" register on the stack, then do an "lcall".
* This is how we change from using the kernel code segment to using
diff -r 55fdd7fa62b7 drivers/lguest/interrupts_and_traps.c
--- a/drivers/lguest/interrupts_and_traps.c Mon Aug 06 16:38:47 20...
2007 Aug 07
1
[PATCH] Fix Malicious Guest GDT Host Crash
...rmation into this CPU's "struct
* lguest_pages". */
copy_in_guest_info(lg, pages);
+
+ /* Set the trap number to 256 (impossible value). If we fault while
+ * switching to the Guest (bad segment registers or bug), this will
+ * cause us to abort the Guest. */
+ lg->regs->trapnum = 256;
/* Now: we push the "eflags" register on the stack, then do an "lcall".
* This is how we change from using the kernel code segment to using
diff -r 55fdd7fa62b7 drivers/lguest/interrupts_and_traps.c
--- a/drivers/lguest/interrupts_and_traps.c Mon Aug 06 16:38:47 20...