diff mbox series

[RFC,84/84] x86/pv: fix a couple of direct map assumptions in dom0 building.

Message ID 19981ca60bdd61b305946e51fa4ec4e66e2a9408.1569489002.git.hongyax@amazon.com (mailing list archive)
State New, archived
Headers show
Series Remove direct map from Xen | expand

Commit Message

Xia, Hongyan Sept. 26, 2019, 9:46 a.m. UTC
From: Hongyan Xia <hongyax@amazon.com>

Signed-off-by: Hongyan Xia <hongyax@amazon.com>
---
 xen/arch/x86/pv/dom0_build.c    | 7 ++++---
 xen/include/asm-x86/processor.h | 2 --
 2 files changed, 4 insertions(+), 5 deletions(-)

Comments

Wei Liu Sept. 26, 2019, 3:51 p.m. UTC | #1
On Thu, Sep 26, 2019 at 10:46:47AM +0100, hongyax@amazon.com wrote:
> From: Hongyan Xia <hongyax@amazon.com>
> 
> Signed-off-by: Hongyan Xia <hongyax@amazon.com>
> ---
>  xen/arch/x86/pv/dom0_build.c    | 7 ++++---
>  xen/include/asm-x86/processor.h | 2 --
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
> index 202edcaa17..98dcc18d21 100644
> --- a/xen/arch/x86/pv/dom0_build.c
> +++ b/xen/arch/x86/pv/dom0_build.c
> @@ -626,9 +626,10 @@ int __init dom0_construct_pv(struct domain *d,
>          l4start = l4tab = map_xen_pagetable(maddr_to_mfn(mpt_alloc));
>          mpt_alloc += PAGE_SIZE;
>          clear_page(l4tab);
> -        init_xen_l4_slots(l4tab, _mfn(virt_to_mfn(l4start)),
> -                          d, INVALID_MFN, true);
> -        v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
> +        init_xen_l4_slots(l4tab, _mfn(virt_to_mfn_walk(l4start)), d,
> +                INVALID_MFN, true);
> +        v->arch.guest_table =
> +                pagetable_from_mfn(_mfn(virt_to_mfn_walk(l4start)));
>      }
>      else
>      {
> diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
> index f571191cdb..7e8d010d07 100644
> --- a/xen/include/asm-x86/processor.h
> +++ b/xen/include/asm-x86/processor.h
> @@ -465,8 +465,6 @@ static inline void disable_each_ist(idt_entry_t *idt)
>  extern idt_entry_t idt_table[];
>  extern idt_entry_t *idt_tables[];
>  
> -DECLARE_PER_CPU(struct tss_struct, init_tss);
> -

Why is this deleted?

Wei.
diff mbox series

Patch

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 202edcaa17..98dcc18d21 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -626,9 +626,10 @@  int __init dom0_construct_pv(struct domain *d,
         l4start = l4tab = map_xen_pagetable(maddr_to_mfn(mpt_alloc));
         mpt_alloc += PAGE_SIZE;
         clear_page(l4tab);
-        init_xen_l4_slots(l4tab, _mfn(virt_to_mfn(l4start)),
-                          d, INVALID_MFN, true);
-        v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
+        init_xen_l4_slots(l4tab, _mfn(virt_to_mfn_walk(l4start)), d,
+                INVALID_MFN, true);
+        v->arch.guest_table =
+                pagetable_from_mfn(_mfn(virt_to_mfn_walk(l4start)));
     }
     else
     {
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index f571191cdb..7e8d010d07 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -465,8 +465,6 @@  static inline void disable_each_ist(idt_entry_t *idt)
 extern idt_entry_t idt_table[];
 extern idt_entry_t *idt_tables[];
 
-DECLARE_PER_CPU(struct tss_struct, init_tss);
-
 extern void write_ptbase(struct vcpu *v);
 
 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */