diff mbox series

[v2,4/6] x86/domain: remove the 'oos_off' flag

Message ID 20190725133920.40673-5-paul.durrant@citrix.com (mailing list archive)
State New, archived
Headers show
Series stash domain create flags and then use them | expand

Commit Message

Paul Durrant July 25, 2019, 1:39 p.m. UTC
The flag is not needed since the domain 'options' can now be tested
directly.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>

v2:
 - Move some of the hunks from patch #3
 - Also update the definition of shadow_domain_init() in none.c
---
 xen/arch/x86/mm/paging.c        | 2 +-
 xen/arch/x86/mm/shadow/common.c | 5 ++---
 xen/arch/x86/mm/shadow/none.c   | 2 +-
 xen/include/asm-x86/domain.h    | 1 -
 xen/include/asm-x86/shadow.h    | 2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

Comments

George Dunlap July 29, 2019, 9:21 a.m. UTC | #1
On 7/25/19 2:39 PM, Paul Durrant wrote:
> The flag is not needed since the domain 'options' can now be tested
> directly.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

Acked-by: George Dunlap <george.dunlap@citrix.com>
Jan Beulich July 29, 2019, 3:13 p.m. UTC | #2
On 25.07.2019 15:39, Paul Durrant wrote:
> @@ -2523,7 +2522,7 @@ static void sh_update_paging_modes(struct vcpu *v)
>   #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
>       /* We need to check that all the vcpus have paging enabled to
>        * unsync PTs. */
> -    if ( is_hvm_domain(d) && !d->arch.paging.shadow.oos_off )
> +    if ( is_hvm_domain(d) && !(d->options & XEN_DOMCTL_CDF_oos_off) )

Afaics this is the only evaluation of the flag, i.e. it's HVM
specific. In which cases it should probably follow the model
outlined for patch 3, at which point the is_hvm_domain() here
becomes redundant (i.e. could be demoted to an ASSERT() inside
the if()).

Jan
Paul Durrant July 29, 2019, 3:39 p.m. UTC | #3
> -----Original Message-----
> From: Jan Beulich <JBeulich@suse.com>
> Sent: 29 July 2019 16:14
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: xen-devel@lists.xenproject.org; Andrew Cooper <Andrew.Cooper3@citrix.com>; Roger Pau Monne
> <roger.pau@citrix.com>; George Dunlap <George.Dunlap@citrix.com>; Tim (Xen.org) <tim@xen.org>; Wei Liu
> <wl@xen.org>
> Subject: Re: [PATCH v2 4/6] x86/domain: remove the 'oos_off' flag
> 
> On 25.07.2019 15:39, Paul Durrant wrote:
> > @@ -2523,7 +2522,7 @@ static void sh_update_paging_modes(struct vcpu *v)
> >   #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
> >       /* We need to check that all the vcpus have paging enabled to
> >        * unsync PTs. */
> > -    if ( is_hvm_domain(d) && !d->arch.paging.shadow.oos_off )
> > +    if ( is_hvm_domain(d) && !(d->options & XEN_DOMCTL_CDF_oos_off) )
> 
> Afaics this is the only evaluation of the flag, i.e. it's HVM
> specific. In which cases it should probably follow the model
> outlined for patch 3, at which point the is_hvm_domain() here
> becomes redundant (i.e. could be demoted to an ASSERT() inside
> the if()).

Ok, I'll do that.

  Paul

> 
> Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 097a27f608..69aa228e46 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -653,7 +653,7 @@  int paging_domain_init(struct domain *d)
     if ( hap_enabled(d) )
         hap_domain_init(d);
     else
-        rc = shadow_domain_init(d, d->options);
+        rc = shadow_domain_init(d);
 
     return rc;
 }
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index fa18de0bb6..911d91e502 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -46,7 +46,7 @@  static void sh_clean_dirty_bitmap(struct domain *);
 
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called for every domain from arch_domain_create() */
-int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+int shadow_domain_init(struct domain *d)
 {
     static const struct log_dirty_ops sh_ops = {
         .enable  = sh_enable_log_dirty,
@@ -62,7 +62,6 @@  int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
     d->arch.paging.shadow.oos_active = 0;
-    d->arch.paging.shadow.oos_off = domcr_flags & XEN_DOMCTL_CDF_oos_off;
 #endif
     d->arch.paging.shadow.pagetable_dying_op = 0;
 
@@ -2523,7 +2522,7 @@  static void sh_update_paging_modes(struct vcpu *v)
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
     /* We need to check that all the vcpus have paging enabled to
      * unsync PTs. */
-    if ( is_hvm_domain(d) && !d->arch.paging.shadow.oos_off )
+    if ( is_hvm_domain(d) && !(d->options & XEN_DOMCTL_CDF_oos_off) )
     {
         int pe = 1;
         struct vcpu *vptr;
diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c
index a70888bd98..2fddf4274c 100644
--- a/xen/arch/x86/mm/shadow/none.c
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -18,7 +18,7 @@  static void _clean_dirty_bitmap(struct domain *d)
     ASSERT(is_pv_domain(d));
 }
 
-int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+int shadow_domain_init(struct domain *d)
 {
     static const struct log_dirty_ops sh_none_ops = {
         .enable  = _enable_log_dirty,
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 933b85901f..5f9899469c 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -115,7 +115,6 @@  struct shadow_domain {
 
     /* OOS */
     bool_t oos_active;
-    bool_t oos_off;
 
     /* Has this domain ever used HVMOP_pagetable_dying? */
     bool_t pagetable_dying_op;
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index f29f0f652b..8ebb89c027 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -49,7 +49,7 @@ 
 
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called from paging_domain_init(). */
-int shadow_domain_init(struct domain *d, unsigned int domcr_flags);
+int shadow_domain_init(struct domain *d);
 
 /* Setup the shadow-specific parts of a vcpu struct. It is called by
  * paging_vcpu_init() in paging.c */