diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-07 08:05:32 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-01-30 06:50:11 -0500 |
commit | a53a35a8b485b9c16b73e5177bddaa4321971199 (patch) | |
tree | 8ed96838cb47d1263f63aba6dd6921b3c811f46c /drivers/lguest/page_tables.c | |
parent | a3863f68b0d7fe2073c0f4efe534ec87a685c4fa (diff) |
lguest: make registers per-vcpu
This is the most obvious per-vcpu field: registers.
So this patch moves it from struct lguest to struct vcpu,
and patch the places in which they are used, accordingly
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/page_tables.c')
-rw-r--r-- | drivers/lguest/page_tables.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c index 17d3329e34c2..f19add469944 100644 --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c | |||
@@ -640,6 +640,7 @@ void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages) | |||
640 | pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages); | 640 | pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages); |
641 | pgd_t switcher_pgd; | 641 | pgd_t switcher_pgd; |
642 | pte_t regs_pte; | 642 | pte_t regs_pte; |
643 | unsigned long pfn; | ||
643 | 644 | ||
644 | /* Make the last PGD entry for this Guest point to the Switcher's PTE | 645 | /* Make the last PGD entry for this Guest point to the Switcher's PTE |
645 | * page for this CPU (with appropriate flags). */ | 646 | * page for this CPU (with appropriate flags). */ |
@@ -654,7 +655,8 @@ void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages) | |||
654 | * CPU's "struct lguest_pages": if we make sure the Guest's register | 655 | * CPU's "struct lguest_pages": if we make sure the Guest's register |
655 | * page is already mapped there, we don't have to copy them out | 656 | * page is already mapped there, we don't have to copy them out |
656 | * again. */ | 657 | * again. */ |
657 | regs_pte = pfn_pte (__pa(lg->regs_page) >> PAGE_SHIFT, __pgprot(_PAGE_KERNEL)); | 658 | pfn = __pa(cpu->regs_page) >> PAGE_SHIFT; |
659 | regs_pte = pfn_pte(pfn, __pgprot(_PAGE_KERNEL)); | ||
658 | switcher_pte_page[(unsigned long)pages/PAGE_SIZE%PTRS_PER_PTE] = regs_pte; | 660 | switcher_pte_page[(unsigned long)pages/PAGE_SIZE%PTRS_PER_PTE] = regs_pte; |
659 | } | 661 | } |
660 | /*:*/ | 662 | /*:*/ |