x86/nEPT: ditch nept_sp_entry()
diff mbox series

Message ID ebc609e7-ae35-6eba-d21e-2a37ef3b3894@suse.com
State New
Headers show
Series
  • x86/nEPT: ditch nept_sp_entry()
Related show

Commit Message

Jan Beulich Dec. 5, 2019, 3:41 p.m. UTC
It's bogusly non-static. It making the call sites actually less easy to
read, and there being another open-coded use in the file - let's just
get rid of it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper Dec. 5, 2019, 3:48 p.m. UTC | #1
On 05/12/2019 15:41, Jan Beulich wrote:
> It's bogusly non-static. It making the call sites actually less easy to
> read, and there being another open-coded use in the file - let's just
> get rid of it.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
George Dunlap Dec. 5, 2019, 3:51 p.m. UTC | #2
On 12/5/19 3:41 PM, Jan Beulich wrote:
> It's bogusly non-static. It making the call sites actually less easy to
> read, and there being another open-coded use in the file - let's just
> get rid of it.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/mm/hap/nested_ept.c
> +++ b/xen/arch/x86/mm/hap/nested_ept.c
> @@ -54,11 +54,6 @@
>  #define NEPT_2M_ENTRY_FLAG (1 << 10)
>  #define NEPT_4K_ENTRY_FLAG (1 << 9)
>  
> -bool_t nept_sp_entry(ept_entry_t e)
> -{
> -    return !!(e.sp);
> -}

What a strange function!

Acked-by: George Dunlap <george.dunlap@citrix.com>

Patch
diff mbox series

--- a/xen/arch/x86/mm/hap/nested_ept.c
+++ b/xen/arch/x86/mm/hap/nested_ept.c
@@ -54,11 +54,6 @@ 
 #define NEPT_2M_ENTRY_FLAG (1 << 10)
 #define NEPT_4K_ENTRY_FLAG (1 << 9)
 
-bool_t nept_sp_entry(ept_entry_t e)
-{
-    return !!(e.sp);
-}
-
 static bool_t nept_rsv_bits_check(ept_entry_t e, uint32_t level)
 {
     uint64_t rsv_bits = EPT_MUST_RSV_BITS;
@@ -68,7 +63,7 @@  static bool_t nept_rsv_bits_check(ept_en
     case 1:
         break;
     case 2 ... 3:
-        if ( nept_sp_entry(e) )
+        if ( e.sp )
             rsv_bits |=  ((1ull << (9 * (level - 1))) - 1) << PAGE_SHIFT;
         else
             rsv_bits |= EPTE_EMT_MASK | EPTE_IGMT_MASK;
@@ -181,7 +176,7 @@  nept_walk_tables(struct vcpu *v, unsigne
         if ( nept_misconfiguration_check(gw->lxe[lvl], lvl) )
             goto misconfig_err;
 
-        if ( (lvl == 2 || lvl == 3) && nept_sp_entry(gw->lxe[lvl]) )
+        if ( (lvl == 2 || lvl == 3) && gw->lxe[lvl].sp )
         {
             /* Generate a fake l1 table entry so callers don't all
              * have to understand superpages. */