search for: guest_pa

Displaying 20 results from an estimated 30 matches for "guest_pa".

2015 Nov 20
15
[RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target
Hi, This is the first attempt to add a new qemu nvme backend using in-kernel nvme target. Most code are ported from qemu-nvme and also borrow code from Hannes Reinecke's rts-megasas. It's similar as vhost-scsi, but doesn't use virtio. The advantage is guest can run unmodified NVMe driver. So guest can be any OS that has a NVMe driver. The goal is to get as good performance as
2015 Nov 20
15
[RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target
Hi, This is the first attempt to add a new qemu nvme backend using in-kernel nvme target. Most code are ported from qemu-nvme and also borrow code from Hannes Reinecke's rts-megasas. It's similar as vhost-scsi, but doesn't use virtio. The advantage is guest can run unmodified NVMe driver. So guest can be any OS that has a NVMe driver. The goal is to get as good performance as
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...d set_guest_interrupt(struct lguest *lg, u32 lo, u32 hi, int has_err) { - u32 __user *gstack; + unsigned long gstack; u32 eflags, ss, irq_enable; /* If they want a ring change, we use new stack and push old ss/esp */ if ((lg->regs->ss&0x3) != GUEST_PL) { - gstack = (u32 __user *)guest_pa(lg, lg->esp1); + gstack = guest_pa(lg, lg->esp1); ss = lg->ss1; push_guest_stack(lg, &gstack, lg->regs->ss); push_guest_stack(lg, &gstack, lg->regs->esp); } else { - gstack = (u32 __user *)guest_pa(lg, lg->regs->esp); + gstack = guest_pa(lg, lg->r...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...d set_guest_interrupt(struct lguest *lg, u32 lo, u32 hi, int has_err) { - u32 __user *gstack; + unsigned long gstack; u32 eflags, ss, irq_enable; /* If they want a ring change, we use new stack and push old ss/esp */ if ((lg->regs->ss&0x3) != GUEST_PL) { - gstack = (u32 __user *)guest_pa(lg, lg->esp1); + gstack = guest_pa(lg, lg->esp1); ss = lg->ss1; push_guest_stack(lg, &gstack, lg->regs->ss); push_guest_stack(lg, &gstack, lg->regs->esp); } else { - gstack = (u32 __user *)guest_pa(lg, lg->regs->esp); + gstack = guest_pa(lg, lg->r...
2009 Mar 26
1
[PATCH 3/5] lguest: avoid accidental recycling of pgdir pages
...drivers/lguest/lg.h b/drivers/lguest/lg.h index 5faefea..363c231 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -174,6 +174,7 @@ void guest_set_pte(struct lg_cpu *cpu, unsigned long gpgdir, unsigned long vaddr, pte_t val); void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages); int demand_page(struct lg_cpu *cpu, unsigned long cr2, int errcode); +void invalidate_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void pin_page(struct lg_cpu *cpu, unsigned long vaddr); unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr); void page_table_guest_...
2009 Mar 26
1
[PATCH 3/5] lguest: avoid accidental recycling of pgdir pages
...drivers/lguest/lg.h b/drivers/lguest/lg.h index 5faefea..363c231 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -174,6 +174,7 @@ void guest_set_pte(struct lg_cpu *cpu, unsigned long gpgdir, unsigned long vaddr, pte_t val); void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages); int demand_page(struct lg_cpu *cpu, unsigned long cr2, int errcode); +void invalidate_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void pin_page(struct lg_cpu *cpu, unsigned long vaddr); unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr); void page_table_guest_...
2009 Apr 02
7
[Lguest] [PATCH 4/5] lguest: use KVM hypercalls
...+ > + /* This must be the Guest kernel trying to do something. > + * The bottom two bits of the CS segment register are the privilege > + * level. */ > + if ((cpu->regs->cs & 3) != GUEST_PL) > + return false; > + > + /* Is it a vmcall? */ > + __lgread(cpu, insn, guest_pa(cpu, cpu->regs->eip), sizeof(insn)); I've put a printk for insn here that shows up twice. The first time insn holds the values below, and the second time it holds the values that are patched in by rewrite_hypercall. > + return insn[0] == 0x0f && insn[1] == 0x01 && ins...
2009 Apr 02
7
[Lguest] [PATCH 4/5] lguest: use KVM hypercalls
...+ > + /* This must be the Guest kernel trying to do something. > + * The bottom two bits of the CS segment register are the privilege > + * level. */ > + if ((cpu->regs->cs & 3) != GUEST_PL) > + return false; > + > + /* Is it a vmcall? */ > + __lgread(cpu, insn, guest_pa(cpu, cpu->regs->eip), sizeof(insn)); I've put a printk for insn here that shows up twice. The first time insn holds the values below, and the second time it holds the values that are patched in by rewrite_hypercall. > + return insn[0] == 0x0f && insn[1] == 0x01 && ins...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...================================================= --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -160,11 +160,14 @@ static int emulate_insn(struct lguest *l { u8 insn; unsigned int insnlen = 0, in = 0, shift = 0; - unsigned long physaddr = guest_pa(lg, lg->regs->eip); + unsigned long physaddr = lguest_find_guest_paddr(lg, lg->regs->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) */ + + /* d...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...================================================= --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -160,11 +160,14 @@ static int emulate_insn(struct lguest *l { u8 insn; unsigned int insnlen = 0, in = 0, shift = 0; - unsigned long physaddr = guest_pa(lg, lg->regs->eip); + unsigned long physaddr = lguest_find_guest_paddr(lg, lg->regs->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) */ + + /* d...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...uct lguest *info, struc #define kill_guest(lg, fmt...) \ do { \ if (!(lg)->dead) { \ + lguest_dump_lg_regs(lg); \ (lg)->dead = kasprintf(GFP_ATOMIC, fmt); \ if (!(lg)->dead) \ (lg)->dead = (void *)1; \ @@ -248,5 +251,11 @@ static inline unsigned long guest_pa(str { return vaddr - lg->page_offset; } + +/* lguest_debug.c */ +void lguest_print_address(struct lguest *lg, unsigned long address); +void lguest_dump_trace(struct lguest *lg, struct lguest_regs *regs); +void lguest_dump_lg_regs(struct lguest *lg); + #endif /* __ASSEMBLY__ */ #endif /* _L...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...uct lguest *info, struc #define kill_guest(lg, fmt...) \ do { \ if (!(lg)->dead) { \ + lguest_dump_lg_regs(lg); \ (lg)->dead = kasprintf(GFP_ATOMIC, fmt); \ if (!(lg)->dead) \ (lg)->dead = (void *)1; \ @@ -248,5 +251,11 @@ static inline unsigned long guest_pa(str { return vaddr - lg->page_offset; } + +/* lguest_debug.c */ +void lguest_print_address(struct lguest *lg, unsigned long address); +void lguest_dump_trace(struct lguest *lg, struct lguest_regs *regs); +void lguest_dump_lg_regs(struct lguest *lg); + #endif /* __ASSEMBLY__ */ #endif /* _L...
2009 Apr 19
0
[PULL] lguest & virtio fixes
...CHANGED_GDT; diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c index a6b7176..1a83910 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c @@ -324,6 +324,11 @@ static void rewrite_hypercall(struct lg_cpu *cpu) u8 insn[3] = {0xcd, 0x1f, 0x90}; __lgwrite(cpu, guest_pa(cpu, cpu->regs->eip), insn, sizeof(insn)); + /* The above write might have caused a copy of that page to be made + * (if it was read-only). We need to make sure the Guest has + * up-to-date pagetables. As this doesn't happen often, we can just + * drop them all. */ + guest_pagetable_...
2009 Apr 19
0
[PULL] lguest & virtio fixes
...CHANGED_GDT; diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c index a6b7176..1a83910 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c @@ -324,6 +324,11 @@ static void rewrite_hypercall(struct lg_cpu *cpu) u8 insn[3] = {0xcd, 0x1f, 0x90}; __lgwrite(cpu, guest_pa(cpu, cpu->regs->eip), insn, sizeof(insn)); + /* The above write might have caused a copy of that page to be made + * (if it was read-only). We need to make sure the Guest has + * up-to-date pagetables. As this doesn't happen often, we can just + * drop them all. */ + guest_pagetable_...
2009 Jun 05
1
[PATCH] lguest: PAE support
...(pgd_val(x) & ~PAGE_MASK) #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) +#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) +#define pmd_pfn(x) (pmd_val(x) >> PAGE_SHIFT) /* interrupts_and_traps.c: */ void maybe_do_interrupt(struct lg_cpu *cpu); @@ -169,6 +171,9 @@ int init_guest_pagetable(struct lguest *lg); void free_guest_pagetable(struct lguest *lg); void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void guest_set_pgd(struct lguest *lg, unsigned long gpgdir, u32 i); +#ifdef CONFIG_X86_PAE +void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u3...
2009 Jun 05
1
[PATCH] lguest: PAE support
...(pgd_val(x) & ~PAGE_MASK) #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) +#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) +#define pmd_pfn(x) (pmd_val(x) >> PAGE_SHIFT) /* interrupts_and_traps.c: */ void maybe_do_interrupt(struct lg_cpu *cpu); @@ -169,6 +171,9 @@ int init_guest_pagetable(struct lguest *lg); void free_guest_pagetable(struct lguest *lg); void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void guest_set_pgd(struct lguest *lg, unsigned long gpgdir, u32 i); +#ifdef CONFIG_X86_PAE +void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u3...
2007 May 09
1
[patch 3/9] lguest: the host code
...ic. */ +#define MAX_LGUEST_GUESTS 16 +struct lguest lguests[MAX_LGUEST_GUESTS]; + +/* Offset from where switcher.S was compiled to where we've copied it */ +static unsigned long switcher_offset(void) +{ + return SWITCHER_ADDR - (unsigned long)start_switcher_text; +} + +/* This cpu's struct lguest_pages. */ +static struct lguest_pages *lguest_pages(unsigned int cpu) +{ + return &(((struct lguest_pages *) + (SWITCHER_ADDR + SHARED_SWITCHER_PAGES*PAGE_SIZE))[cpu]); +} + +static __init int map_switcher(void) +{ + int i, err; + struct page **pagep; + + switcher_page = kmalloc(sizeof(switcher...
2007 May 09
1
[patch 3/9] lguest: the host code
...ic. */ +#define MAX_LGUEST_GUESTS 16 +struct lguest lguests[MAX_LGUEST_GUESTS]; + +/* Offset from where switcher.S was compiled to where we've copied it */ +static unsigned long switcher_offset(void) +{ + return SWITCHER_ADDR - (unsigned long)start_switcher_text; +} + +/* This cpu's struct lguest_pages. */ +static struct lguest_pages *lguest_pages(unsigned int cpu) +{ + return &(((struct lguest_pages *) + (SWITCHER_ADDR + SHARED_SWITCHER_PAGES*PAGE_SIZE))[cpu]); +} + +static __init int map_switcher(void) +{ + int i, err; + struct page **pagep; + + switcher_page = kmalloc(sizeof(switcher...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...(pgd_val(x) & ~PAGE_MASK) #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) +#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) +#define pmd_pfn(x) (pmd_val(x) >> PAGE_SHIFT) /* interrupts_and_traps.c: */ void maybe_do_interrupt(struct lg_cpu *cpu); @@ -168,6 +170,9 @@ int init_guest_pagetable(struct lguest *lg); void free_guest_pagetable(struct lguest *lg); void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); +#ifdef CONFIG_X86_PAE +void guest_set_pud(struct lguest *lg, unsigned long gpgdir, u3...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...(pgd_val(x) & ~PAGE_MASK) #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) +#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) +#define pmd_pfn(x) (pmd_val(x) >> PAGE_SHIFT) /* interrupts_and_traps.c: */ void maybe_do_interrupt(struct lg_cpu *cpu); @@ -168,6 +170,9 @@ int init_guest_pagetable(struct lguest *lg); void free_guest_pagetable(struct lguest *lg); void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); +#ifdef CONFIG_X86_PAE +void guest_set_pud(struct lguest *lg, unsigned long gpgdir, u3...