[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86: clarify shadow paging Dom0 support



commit ac9ff74f39a734756af90ccbb7184551f7b1e22a
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Mon Mar 27 12:26:56 2017 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Mon Mar 27 15:05:07 2017 +0100

    x86: clarify shadow paging Dom0 support
    
    Classic PV shadow paging Dom0 has been broken for years, and can't
    possibly be configured after 4045953.
    
    PVH shadow paging Dom0 should still be possible.
    
    Change the code and documentation to clarify that.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper@xxxxxxxxxx>
---
 docs/misc/xen-command-line.markdown |  8 ++------
 xen/arch/x86/dom0_build.c           | 13 ++++++++++---
 xen/arch/x86/pv/dom0_build.c        |  5 -----
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown 
b/docs/misc/xen-command-line.markdown
index bdbdb8a..9eb85d6 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -652,11 +652,6 @@ restrictions set up here. Note that the values to be 
specified here are
 ACPI PXM ones, not Xen internal node numbers. `relaxed` sets up vCPU
 affinities to prefer but be not limited to the specified node(s).
 
-### dom0\_shadow
-> `= <boolean>`
-
-This option is deprecated, please use `dom0=shadow` instead.
-
 ### dom0\_vcpus\_pin
 > `= <boolean>`
 
@@ -679,7 +674,8 @@ Flag that makes a dom0 boot in PVHv2 mode.
 
 > Default: `false`
 
-Flag that makes a dom0 use shadow paging.
+Flag that makes a dom0 use shadow paging. Only works when "pvh" is
+enabled.
 
 ### dtuart (ARM)
 > `= path [:options]`
diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 20221b5..cc8acad 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -174,7 +174,6 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
 
 #ifdef CONFIG_SHADOW_PAGING
 bool __initdata opt_dom0_shadow;
-boolean_param("dom0_shadow", opt_dom0_shadow);
 #endif
 bool __initdata dom0_pvh;
 
@@ -252,8 +251,8 @@ unsigned long __init dom0_compute_nr_pages(
             avail -= max_pdx >> s;
     }
 
-    need_paging = is_hvm_domain(d) ? !iommu_hap_pt_share || !paging_mode_hap(d)
-                                   : opt_dom0_shadow;
+    need_paging = is_hvm_domain(d) &&
+        (!iommu_hap_pt_share || !paging_mode_hap(d));
     for ( ; ; need_paging = 0 )
     {
         nr_pages = dom0_nrpages;
@@ -456,6 +455,14 @@ int __init construct_dom0(struct domain *d, const module_t 
*image,
 
     process_pending_softirqs();
 
+#ifdef CONFIG_SHADOW_PAGING
+    if ( opt_dom0_shadow && !dom0_pvh )
+    {
+        opt_dom0_shadow = false;
+        printk(XENLOG_WARNING "Shadow Dom0 requires PVH. Option ignored.\n");
+    }
+#endif
+
     return (is_hvm_domain(d) ? dom0_construct_pvh : dom0_construct_pv)
            (d, image, image_headroom, initrd,bootstrap_map, cmdline);
 }
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 65cd2c5..18c19a2 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -870,11 +870,6 @@ int __init dom0_construct_pv(struct domain *d,
     regs->rsi = vstartinfo_start;
     regs->eflags = X86_EFLAGS_IF;
 
-#ifdef CONFIG_SHADOW_PAGING
-    if ( opt_dom0_shadow && paging_enable(d, PG_SH_enable) == 0 )
-        paging_update_paging_modes(v);
-#endif
-
     if ( test_bit(XENFEAT_supervisor_mode_kernel, parms.f_required) )
         panic("Dom0 requires supervisor-mode execution");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.