search for: lgread

Displaying 20 results from an estimated 24 matches for "lgread".

2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...(pgd_flags(gpgd) & _PAGE_PRESENT)); + return gpage + pmd_index(vaddr) * sizeof(pmd_t); } +#endif -static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr) +static unsigned long gpte_addr(struct lg_cpu *cpu, + pgd_t gpgd, unsigned long vaddr) { +#ifdef CONFIG_X86_PAE + pmd_t gpmd = lgread(cpu, + (unsigned long) gpmd_addr(gpgd, vaddr), pmd_t); + unsigned long gpage = pmd_pfn(gpmd) << PAGE_SHIFT; +#else unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); - return gpage + ((vaddr>>PAGE_SHIFT) % PTRS_PER_PTE) * sizeof...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...(pgd_flags(gpgd) & _PAGE_PRESENT)); + return gpage + pmd_index(vaddr) * sizeof(pmd_t); } +#endif -static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr) +static unsigned long gpte_addr(struct lg_cpu *cpu, + pgd_t gpgd, unsigned long vaddr) { +#ifdef CONFIG_X86_PAE + pmd_t gpmd = lgread(cpu, + (unsigned long) gpmd_addr(gpgd, vaddr), pmd_t); + unsigned long gpage = pmd_pfn(gpmd) << PAGE_SHIFT; +#else unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); - return gpage + ((vaddr>>PAGE_SHIFT) % PTRS_PER_PTE) * sizeof...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...run_lguest and do cast in caller instead (when we add __user to cast, it runs over another line). Al Viro pointed out the ugly cast in push_lguest_stack(): 3) Stick with unsigned long for arg, removes 4 casts in total. Most importantly, I now realize that Christoph's incorrect ranting about lgread_u32 et al was in fact a subtle ploy to make me diagnose the real issue: sparse 0.3 complains about casting a __user pointer to/from u32, but not an "unsigned long". They are (currently) equivalent for lguest, but this is a much better solution than __force. Kudos, Christoph, for such ma...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...run_lguest and do cast in caller instead (when we add __user to cast, it runs over another line). Al Viro pointed out the ugly cast in push_lguest_stack(): 3) Stick with unsigned long for arg, removes 4 casts in total. Most importantly, I now realize that Christoph's incorrect ranting about lgread_u32 et al was in fact a subtle ploy to make me diagnose the real issue: sparse 0.3 complains about casting a __user pointer to/from u32, but not an "unsigned long". They are (currently) equivalent for lguest, but this is a much better solution than __force. Kudos, Christoph, for such ma...
2009 Jun 05
1
[PATCH] lguest: PAE support
...gpage + pmd_index(vaddr) * sizeof(pmd_t); +} +#endif + +static unsigned long gpte_addr(struct lg_cpu *cpu, + pgd_t gpgd, unsigned long vaddr) +{ +#ifdef CONFIG_X86_PAE + pmd_t gpmd; +#endif + unsigned long gpage; + + BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); +#ifdef CONFIG_X86_PAE + gpmd = lgread(cpu, gpmd_addr(gpgd, vaddr), pmd_t); + gpage = pmd_pfn(gpmd) << PAGE_SHIFT; + BUG_ON(!(pmd_flags(gpmd) & _PAGE_PRESENT)); +#else + gpage = pgd_pfn(gpgd) << PAGE_SHIFT; +#endif return gpage + pte_index(vaddr) * sizeof(pte_t); } /*:*/ @@ -184,11 +251,20 @@ static void check_gpte(s...
2009 Jun 05
1
[PATCH] lguest: PAE support
...gpage + pmd_index(vaddr) * sizeof(pmd_t); +} +#endif + +static unsigned long gpte_addr(struct lg_cpu *cpu, + pgd_t gpgd, unsigned long vaddr) +{ +#ifdef CONFIG_X86_PAE + pmd_t gpmd; +#endif + unsigned long gpage; + + BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); +#ifdef CONFIG_X86_PAE + gpmd = lgread(cpu, gpmd_addr(gpgd, vaddr), pmd_t); + gpage = pmd_pfn(gpmd) << PAGE_SHIFT; + BUG_ON(!(pmd_flags(gpmd) & _PAGE_PRESENT)); +#else + gpage = pgd_pfn(gpgd) << PAGE_SHIFT; +#endif return gpage + pte_index(vaddr) * sizeof(pte_t); } /*:*/ @@ -184,11 +251,20 @@ static void check_gpte(s...
2007 Apr 18
1
[PATCH] Lguest32 print hex on bad reads and writes
...Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Index: linux-2.6.21-rc5-mm2/drivers/lguest/core.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -220,7 +220,7 @@ u8 lgread_u8(struct lguest *lg, u32 addr /* Don't let them access lguest binary */ if (!lguest_address_ok(lg, addr) || get_user(val, (u32 __user *)addr) != 0) - kill_guest(lg, "bad read address %u", addr); + kill_guest(lg, "bad read address %x", addr); return val; } @...
2007 Apr 18
1
[PATCH] Lguest32 print hex on bad reads and writes
...Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Index: linux-2.6.21-rc5-mm2/drivers/lguest/core.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -220,7 +220,7 @@ u8 lgread_u8(struct lguest *lg, u32 addr /* Don't let them access lguest binary */ if (!lguest_address_ok(lg, addr) || get_user(val, (u32 __user *)addr) != 0) - kill_guest(lg, "bad read address %u", addr); + kill_guest(lg, "bad read address %x", addr); return val; } @...
2007 May 09
1
[patch 3/9] lguest: the host code
...g. */ +static int emulate_insn(struct lguest *lg) +{ + u8 insn; + unsigned int insnlen = 0, in = 0, shift = 0; + unsigned long physaddr = guest_pa(lg, lg->regs->eip); + + /* This only works for addresses in linear mapping... */ + if (lg->regs->eip < lg->page_offset) + return 0; + lgread(lg, &insn, physaddr, 1); + + /* Operand size prefix means it's actually for ax. */ + if (insn == 0x66) { + shift = 16; + insnlen = 1; + lgread(lg, &insn, physaddr + insnlen, 1); + } + + switch (insn & 0xFE) { + case 0xE4: /* in <next byte>,%al */ + insnlen += 2; + in...
2007 May 09
1
[patch 3/9] lguest: the host code
...g. */ +static int emulate_insn(struct lguest *lg) +{ + u8 insn; + unsigned int insnlen = 0, in = 0, shift = 0; + unsigned long physaddr = guest_pa(lg, lg->regs->eip); + + /* This only works for addresses in linear mapping... */ + if (lg->regs->eip < lg->page_offset) + return 0; + lgread(lg, &insn, physaddr, 1); + + /* Operand size prefix means it's actually for ax. */ + if (insn == 0x66) { + shift = 16; + insnlen = 1; + lgread(lg, &insn, physaddr + insnlen, 1); + } + + switch (insn & 0xFE) { + case 0xE4: /* in <next byte>,%al */ + insnlen += 2; + in...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...launcher of: lguest: bad read address 537012178 len 1 I also get in my dmesg: called from [<c0405f30>] show_trace_log_lvl+0x1a/0x2f [<c04069aa>] show_trace+0x12/0x14 [<c0406a03>] dump_stack+0x16/0x18 [<f8c746de>] lguest_dump_lg_regs+0x22/0x13c [lg] [<f8c7131b>] lgread+0x59/0x90 [lg] [<f8c715bd>] run_guest+0x26b/0x406 [lg] [<f8c739be>] read+0x73/0x7d [lg] [<c04825e9>] vfs_read+0xad/0x161 [<c0482a75>] sys_read+0x3d/0x61 [<c0404f34>] syscall_call+0x7/0xb ======================= [<f8c7131b>] lgread+0x59/0x90 [lg] Printing LG...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...launcher of: lguest: bad read address 537012178 len 1 I also get in my dmesg: called from [<c0405f30>] show_trace_log_lvl+0x1a/0x2f [<c04069aa>] show_trace+0x12/0x14 [<c0406a03>] dump_stack+0x16/0x18 [<f8c746de>] lguest_dump_lg_regs+0x22/0x13c [lg] [<f8c7131b>] lgread+0x59/0x90 [lg] [<f8c715bd>] run_guest+0x26b/0x406 [lg] [<f8c739be>] read+0x73/0x7d [lg] [<c04825e9>] vfs_read+0xad/0x161 [<c0482a75>] sys_read+0x3d/0x61 [<c0404f34>] syscall_call+0x7/0xb ======================= [<f8c7131b>] lgread+0x59/0x90 [lg] Printing LG...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...->eip); - /* This only works for addresses in linear mapping... */ - if (lg->regs->eip < lg->page_offset) + /* FIXME: Handle physaddr's that crosses pages (modules are in VM) */ + + /* did we actually find the physaddr? */ + if (physaddr == (unsigned long)-1UL) return 0; + lgread(lg, &insn, physaddr, 1); /* Operand size prefix means it's actually for ax. */ Index: linux-2.6.21-rc5-mm2/drivers/lguest/lg.h =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/lg.h +++ linux-2.6.21-rc5-mm2/drivers/lguest/lg...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...->eip); - /* This only works for addresses in linear mapping... */ - if (lg->regs->eip < lg->page_offset) + /* FIXME: Handle physaddr's that crosses pages (modules are in VM) */ + + /* did we actually find the physaddr? */ + if (physaddr == (unsigned long)-1UL) return 0; + lgread(lg, &insn, physaddr, 1); /* Operand size prefix means it's actually for ax. */ Index: linux-2.6.21-rc5-mm2/drivers/lguest/lg.h =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/lg.h +++ linux-2.6.21-rc5-mm2/drivers/lguest/lg...
2007 Dec 20
5
[PATCH 0/16] lguest: introduce vcpu structure
this patch makes room for the vcpu structure in lguest, already used in this very same way at lguest64. It's the first part of our plan to have lguest and lguest64 unified too. When two dogs hang out, you don't have new puppies right in the other day. Some time has to be elapsed. They have to grow first. In this same spirit, having these patches _do not_ mean smp guests can be launched
2007 Dec 20
5
[PATCH 0/16] lguest: introduce vcpu structure
this patch makes room for the vcpu structure in lguest, already used in this very same way at lguest64. It's the first part of our plan to have lguest and lguest64 unified too. When two dogs hang out, you don't have new puppies right in the other day. Some time has to be elapsed. They have to grow first. In this same spirit, having these patches _do not_ mean smp guests can be launched
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c
2007 May 10
4
[PATCH 0/5] lguest feedback tidyups
Hi all, Gratefully-received recent feedback from CC'd was applied to excellent effect (and the advice from Matt Mackall about my personal appearance is best unrequited). The patch is split in 5 parts to correspond with the 9 parts Andrew sent out before, but here's the summary: 1) Sparse (thanks Christoph Hellwig): - lguest_const can be static now - lguest.c should include
2007 May 10
4
[PATCH 0/5] lguest feedback tidyups
Hi all, Gratefully-received recent feedback from CC'd was applied to excellent effect (and the advice from Matt Mackall about my personal appearance is best unrequited). The patch is split in 5 parts to correspond with the 9 parts Andrew sent out before, but here's the summary: 1) Sparse (thanks Christoph Hellwig): - lguest_const can be static now - lguest.c should include