All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86: clarify shadow paging Dom0 support
@ 2017-03-27 13:11 Wei Liu
  2017-03-27 13:20 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2017-03-27 13:11 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan, Jan Beulich,
	Roger Pau Monné

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>
---
v2:
1. simplify need_paging
2. move panic to construct_dom0

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           | 8 +++++---
 xen/arch/x86/pv/dom0_build.c        | 5 -----
 3 files changed, 7 insertions(+), 14 deletions(-)

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..8074e7d200 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,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
 
     process_pending_softirqs();
 
+    if ( opt_dom0_shadow && !dom0_pvh )
+        panic("Shadow paging Dom0 only works in PVH mode");
+
     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 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");
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] x86: clarify shadow paging Dom0 support
  2017-03-27 13:11 [PATCH v2] x86: clarify shadow paging Dom0 support Wei Liu
@ 2017-03-27 13:20 ` Andrew Cooper
  2017-03-27 13:21   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2017-03-27 13:20 UTC (permalink / raw)
  To: Wei Liu, Xen-devel
  Cc: George Dunlap, Tim Deegan, Jan Beulich, Roger Pau Monné

On 27/03/17 14:11, Wei Liu wrote:
> @@ -456,6 +455,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>  
>      process_pending_softirqs();
>  
> +    if ( opt_dom0_shadow && !dom0_pvh )
> +        panic("Shadow paging Dom0 only works in PVH mode");

Is there any way to do this without panic?

For situations like this, it is much more useful for the server to boot
in the wrong configuration, than to not boot at all.  At least if it
boots in the wrong configuarion, you can still SSH in and edit the
command line differently, rather than having to use a serial console or
remote KVM.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] x86: clarify shadow paging Dom0 support
  2017-03-27 13:20 ` Andrew Cooper
@ 2017-03-27 13:21   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2017-03-27 13:21 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Wei Liu, George Dunlap, Tim Deegan, Jan Beulich, Xen-devel,
	Roger Pau Monné

On Mon, Mar 27, 2017 at 02:20:17PM +0100, Andrew Cooper wrote:
> On 27/03/17 14:11, Wei Liu wrote:
> > @@ -456,6 +455,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
> >  
> >      process_pending_softirqs();
> >  
> > +    if ( opt_dom0_shadow && !dom0_pvh )
> > +        panic("Shadow paging Dom0 only works in PVH mode");
> 
> Is there any way to do this without panic?
> 
> For situations like this, it is much more useful for the server to boot
> in the wrong configuration, than to not boot at all.  At least if it
> boots in the wrong configuarion, you can still SSH in and edit the
> command line differently, rather than having to use a serial console or
> remote KVM.
> 

We can simply unset opt_dom0_shadow and print a message if you prefer.

Wei.

> ~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-27 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 13:11 [PATCH v2] x86: clarify shadow paging Dom0 support Wei Liu
2017-03-27 13:20 ` Andrew Cooper
2017-03-27 13:21   ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.