diff mbox

x86: clarify shadow paging Dom0 support

Message ID 20170327113138.28289-1-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu March 27, 2017, 11:31 a.m. UTC
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@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
---
 docs/misc/xen-command-line.markdown | 8 ++------
 xen/arch/x86/dom0_build.c           | 4 +++-
 xen/arch/x86/pv/dom0_build.c        | 5 -----
 3 files changed, 5 insertions(+), 12 deletions(-)

Comments

Roger Pau Monne March 27, 2017, 11:38 a.m. UTC | #1
On Mon, Mar 27, 2017 at 12:31:38PM +0100, Wei Liu wrote:
> 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@citrix.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

With one minor nit, AFAIK the need_paging check in dom0_compute_nr_pages can be
simplified to:

need_paging = is_hvm_domain(d) && (!iommu_hap_pt_share || !paging_mode_hap(d));

Roger.
Jan Beulich March 27, 2017, 12:17 p.m. UTC | #2
>>> On 27.03.17 at 13:31, <wei.liu2@citrix.com> wrote:
> @@ -203,6 +202,9 @@ static void __init parse_dom0_param(char *s)
>  
>          s = ss + 1;
>      } while ( ss );
> +
> +    if ( opt_dom0_shadow && !dom0_pvh )
> +        panic("Shadow paging Dom0 only works in PVH mode");

Tis is too early - option parsing happens before serial and video
have been set up. This should be moved to somewhere early in
Dom0 setup.

Jan
diff mbox

Patch

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index bdbdb8a53b..9eb85d68b5 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 20221b5e32..1083042069 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;
 
@@ -203,6 +202,9 @@  static void __init parse_dom0_param(char *s)
 
         s = ss + 1;
     } while ( ss );
+
+    if ( opt_dom0_shadow && !dom0_pvh )
+        panic("Shadow paging Dom0 only works in PVH mode");
 }
 custom_param("dom0", parse_dom0_param);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 65cd2c5019..18c19a256f 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");