All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Kevin Tian <kevin.tian@intel.com>, Wei Liu <wei.liu2@citrix.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Brian Woods <brian.woods@amd.com>
Subject: [PATCH v2 01/23] x86: change name of parameter for various invlpg functions
Date: Sun, 26 Aug 2018 13:19:34 +0100	[thread overview]
Message-ID: <ae822cd4b618fc4078e137cf69f6827f1647752c.1535285866.git-series.wei.liu2@citrix.com> (raw)
In-Reply-To: <cover.65253d1128f698146b48c4ff3bba2198f360c7b1.1535285866.git-series.wei.liu2@citrix.com>

They all incorrectly named a parameter virtual address while it should
have been linear address.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c         | 14 +++++++-------
 xen/arch/x86/hvm/vmx/vmx.c         | 12 ++++++------
 xen/arch/x86/mm.c                  | 10 +++++-----
 xen/arch/x86/mm/hap/hap.c          |  2 +-
 xen/arch/x86/mm/shadow/multi.c     | 14 +++++++-------
 xen/arch/x86/mm/shadow/none.c      |  2 +-
 xen/include/asm-x86/hvm/hvm.h      |  6 +++---
 xen/include/asm-x86/hvm/svm/asid.h |  4 ++--
 xen/include/asm-x86/hvm/svm/svm.h  |  4 ++--
 xen/include/asm-x86/paging.h       |  3 ++-
 10 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 37f782b..cecd4f0 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2500,18 +2500,18 @@ static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
 }
 
 static void svm_invlpga_intercept(
-    struct vcpu *v, unsigned long vaddr, uint32_t asid)
+    struct vcpu *v, unsigned long linear, uint32_t asid)
 {
-    svm_invlpga(vaddr,
+    svm_invlpga(linear,
                 (asid == 0)
                 ? v->arch.hvm_vcpu.n1asid.asid
                 : vcpu_nestedhvm(v).nv_n2asid.asid);
 }
 
-static void svm_invlpg_intercept(unsigned long vaddr)
+static void svm_invlpg_intercept(unsigned long linear)
 {
-    HVMTRACE_LONG_2D(INVLPG, 0, TRC_PAR_LONG(vaddr));
-    paging_invlpg(current, vaddr);
+    HVMTRACE_LONG_2D(INVLPG, 0, TRC_PAR_LONG(linear));
+    paging_invlpg(current, linear);
 }
 
 static bool is_invlpg(const struct x86_emulate_state *state,
@@ -2524,9 +2524,9 @@ static bool is_invlpg(const struct x86_emulate_state *state,
            (ext & 7) == 7;
 }
 
-static void svm_invlpg(struct vcpu *v, unsigned long vaddr)
+static void svm_invlpg(struct vcpu *v, unsigned long linear)
 {
-    svm_asid_g_invlpg(v, vaddr);
+    svm_asid_g_invlpg(v, linear);
 }
 
 static bool svm_get_pending_event(struct vcpu *v, struct x86_event *info)
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 73f0d52..2f4947a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -75,7 +75,7 @@ static void vmx_wbinvd_intercept(void);
 static void vmx_fpu_dirty_intercept(void);
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content);
 static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content);
-static void vmx_invlpg(struct vcpu *v, unsigned long vaddr);
+static void vmx_invlpg(struct vcpu *v, unsigned long linear);
 
 struct vmx_pi_blocking_vcpu {
     struct list_head     list;
@@ -2594,16 +2594,16 @@ static void vmx_dr_access(unsigned long exit_qualification,
     vmx_update_cpu_exec_control(v);
 }
 
-static void vmx_invlpg_intercept(unsigned long vaddr)
+static void vmx_invlpg_intercept(unsigned long linear)
 {
-    HVMTRACE_LONG_2D(INVLPG, /*invlpga=*/ 0, TRC_PAR_LONG(vaddr));
-    paging_invlpg(current, vaddr);
+    HVMTRACE_LONG_2D(INVLPG, /*invlpga=*/ 0, TRC_PAR_LONG(linear));
+    paging_invlpg(current, linear);
 }
 
-static void vmx_invlpg(struct vcpu *v, unsigned long vaddr)
+static void vmx_invlpg(struct vcpu *v, unsigned long linear)
 {
     if ( cpu_has_vmx_vpid )
-        vpid_sync_vcpu_gva(v, vaddr);
+        vpid_sync_vcpu_gva(v, linear);
 }
 
 static int vmx_vmfunc_intercept(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8ac4412..a774458 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5788,19 +5788,19 @@ const unsigned long *__init get_platform_badpages(unsigned int *array_size)
     return bad_pages;
 }
 
-void paging_invlpg(struct vcpu *v, unsigned long va)
+void paging_invlpg(struct vcpu *v, unsigned long linear)
 {
-    if ( !is_canonical_address(va) )
+    if ( !is_canonical_address(linear) )
         return;
 
     if ( paging_mode_enabled(v->domain) &&
-         !paging_get_hostmode(v)->invlpg(v, va) )
+         !paging_get_hostmode(v)->invlpg(v, linear) )
         return;
 
     if ( is_pv_vcpu(v) )
-        flush_tlb_one_local(va);
+        flush_tlb_one_local(linear);
     else
-        hvm_invlpg(v, va);
+        hvm_invlpg(v, linear);
 }
 
 /* Build a 32bit PSE page table using 4MB pages. */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 812a840..c78da99 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -650,7 +650,7 @@ static int hap_page_fault(struct vcpu *v, unsigned long va,
  * should not be intercepting it.  However, we need to correctly handle
  * getting here from instruction emulation.
  */
-static bool_t hap_invlpg(struct vcpu *v, unsigned long va)
+static bool_t hap_invlpg(struct vcpu *v, unsigned long linear)
 {
     /*
      * Emulate INVLPGA:
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 9e43533..fe322ec 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3554,7 +3554,7 @@ propagate:
  * instruction should be issued on the hardware, or false if it's safe not
  * to do so.
  */
-static bool sh_invlpg(struct vcpu *v, unsigned long va)
+static bool sh_invlpg(struct vcpu *v, unsigned long linear)
 {
     mfn_t sl1mfn;
     shadow_l2e_t sl2e;
@@ -3577,14 +3577,14 @@ static bool sh_invlpg(struct vcpu *v, unsigned long va)
     {
         shadow_l3e_t sl3e;
         if ( !(shadow_l4e_get_flags(
-                   sh_linear_l4_table(v)[shadow_l4_linear_offset(va)])
+                   sh_linear_l4_table(v)[shadow_l4_linear_offset(linear)])
                & _PAGE_PRESENT) )
             return false;
         /* This must still be a copy-from-user because we don't have the
          * paging lock, and the higher-level shadows might disappear
          * under our feet. */
         if ( __copy_from_user(&sl3e, (sh_linear_l3_table(v)
-                                      + shadow_l3_linear_offset(va)),
+                                      + shadow_l3_linear_offset(linear)),
                               sizeof (sl3e)) != 0 )
         {
             perfc_incr(shadow_invlpg_fault);
@@ -3594,7 +3594,7 @@ static bool sh_invlpg(struct vcpu *v, unsigned long va)
             return false;
     }
 #else /* SHADOW_PAGING_LEVELS == 3 */
-    if ( !(l3e_get_flags(v->arch.paging.shadow.l3table[shadow_l3_linear_offset(va)])
+    if ( !(l3e_get_flags(v->arch.paging.shadow.l3table[shadow_l3_linear_offset(linear)])
            & _PAGE_PRESENT) )
         // no need to flush anything if there's no SL2...
         return false;
@@ -3603,7 +3603,7 @@ static bool sh_invlpg(struct vcpu *v, unsigned long va)
     /* This must still be a copy-from-user because we don't have the shadow
      * lock, and the higher-level shadows might disappear under our feet. */
     if ( __copy_from_user(&sl2e,
-                          sh_linear_l2_table(v) + shadow_l2_linear_offset(va),
+                          sh_linear_l2_table(v) + shadow_l2_linear_offset(linear),
                           sizeof (sl2e)) != 0 )
     {
         perfc_incr(shadow_invlpg_fault);
@@ -3647,7 +3647,7 @@ static bool sh_invlpg(struct vcpu *v, unsigned long va)
              * feet. */
             if ( __copy_from_user(&sl2e,
                                   sh_linear_l2_table(v)
-                                  + shadow_l2_linear_offset(va),
+                                  + shadow_l2_linear_offset(linear),
                                   sizeof (sl2e)) != 0 )
             {
                 perfc_incr(shadow_invlpg_fault);
@@ -3669,7 +3669,7 @@ static bool sh_invlpg(struct vcpu *v, unsigned long va)
                         && page_is_out_of_sync(pg) ) )
             {
                 shadow_l1e_t *sl1;
-                sl1 = sh_linear_l1_table(v) + shadow_l1_linear_offset(va);
+                sl1 = sh_linear_l1_table(v) + shadow_l1_linear_offset(linear);
                 /* Remove the shadow entry that maps this VA */
                 (void) shadow_set_l1e(d, sl1, shadow_l1e_empty(),
                                       p2m_invalid, sl1mfn);
diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c
index a8c9604..4de645a 100644
--- a/xen/arch/x86/mm/shadow/none.c
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -37,7 +37,7 @@ static int _page_fault(struct vcpu *v, unsigned long va,
     return 0;
 }
 
-static bool _invlpg(struct vcpu *v, unsigned long va)
+static bool _invlpg(struct vcpu *v, unsigned long linear)
 {
     ASSERT_UNREACHABLE();
     return true;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 146720c..78e7900 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -160,7 +160,7 @@ struct hvm_function_table {
 
     int  (*event_pending)(struct vcpu *v);
     bool (*get_pending_event)(struct vcpu *v, struct x86_event *info);
-    void (*invlpg)(struct vcpu *v, unsigned long vaddr);
+    void (*invlpg)(struct vcpu *v, unsigned long linear);
 
     int  (*cpu_up_prepare)(unsigned int cpu);
     void (*cpu_dead)(unsigned int cpu);
@@ -454,9 +454,9 @@ static inline int hvm_event_pending(struct vcpu *v)
     return hvm_funcs.event_pending(v);
 }
 
-static inline void hvm_invlpg(struct vcpu *v, unsigned long va)
+static inline void hvm_invlpg(struct vcpu *v, unsigned long linear)
 {
-    hvm_funcs.invlpg(v, va);
+    hvm_funcs.invlpg(v, linear);
 }
 
 /* These bits in CR4 are owned by the host. */
diff --git a/xen/include/asm-x86/hvm/svm/asid.h b/xen/include/asm-x86/hvm/svm/asid.h
index d3a144c..b16bd04 100644
--- a/xen/include/asm-x86/hvm/svm/asid.h
+++ b/xen/include/asm-x86/hvm/svm/asid.h
@@ -25,11 +25,11 @@
 void svm_asid_init(const struct cpuinfo_x86 *c);
 void svm_asid_handle_vmrun(void);
 
-static inline void svm_asid_g_invlpg(struct vcpu *v, unsigned long g_vaddr)
+static inline void svm_asid_g_invlpg(struct vcpu *v, unsigned long g_linear)
 {
 #if 0
     /* Optimization? */
-    svm_invlpga(g_vaddr, v->arch.hvm_svm.vmcb->guest_asid);
+    svm_invlpga(g_linear, v->arch.hvm_svm.vmcb->guest_asid);
 #endif
 
     /* Safe fallback. Take a new ASID. */
diff --git a/xen/include/asm-x86/hvm/svm/svm.h b/xen/include/asm-x86/hvm/svm/svm.h
index 4e5e142..8166046 100644
--- a/xen/include/asm-x86/hvm/svm/svm.h
+++ b/xen/include/asm-x86/hvm/svm/svm.h
@@ -40,13 +40,13 @@ static inline void svm_vmsave_pa(paddr_t vmcb)
         : : "a" (vmcb) : "memory" );
 }
 
-static inline void svm_invlpga(unsigned long vaddr, uint32_t asid)
+static inline void svm_invlpga(unsigned long linear, uint32_t asid)
 {
     asm volatile (
         ".byte 0x0f,0x01,0xdf"
         : /* output */
         : /* input */
-        "a" (vaddr), "c" (asid));
+        "a" (linear), "c" (asid));
 }
 
 unsigned long *svm_msrbit(unsigned long *msr_bitmap, uint32_t msr);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index f440e3e..b51e170 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -110,7 +110,8 @@ struct shadow_paging_mode {
 struct paging_mode {
     int           (*page_fault            )(struct vcpu *v, unsigned long va,
                                             struct cpu_user_regs *regs);
-    bool          (*invlpg                )(struct vcpu *v, unsigned long va);
+    bool          (*invlpg                )(struct vcpu *v,
+                                            unsigned long linear);
     unsigned long (*gva_to_gfn            )(struct vcpu *v,
                                             struct p2m_domain *p2m,
                                             unsigned long va,
-- 
git-series 0.9.1

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

  reply	other threads:[~2018-08-26 12:20 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 12:19 [PATCH v2 00/23] Make CONFIG_HVM work Wei Liu
2018-08-26 12:19 ` Wei Liu [this message]
2018-08-27 13:49   ` [PATCH v2 01/23] x86: change name of parameter for various invlpg functions Boris Ostrovsky
2018-08-27 13:54     ` Jan Beulich
2018-08-27 14:20   ` Jan Beulich
2018-08-30  1:26   ` Tian, Kevin
2018-09-03 13:46   ` Wei Liu
2018-09-04 13:42     ` Boris Ostrovsky
2018-08-26 12:19 ` [PATCH v2 02/23] xen: is_hvm_{domain, vcpu} should evaluate to false when !CONFIG_HVM Wei Liu
2018-08-27 14:24   ` Jan Beulich
2018-08-28  8:41     ` Wei Liu
2018-08-28 11:09       ` Julien Grall
2018-08-26 12:19 ` [PATCH v2 03/23] x86: enclose hvm_op and dm_op in CONFIG_HVM in relevant tables Wei Liu
2018-08-27 14:24   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 04/23] x86/hvm: provide hvm_hap_supported Wei Liu
2018-08-27 14:25   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 05/23] x86: provide stub for memory_type_changed Wei Liu
2018-08-27 14:28   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 06/23] x86: don't call vpci function in physdev_op when !CONFIG_HAS_VPCI Wei Liu
2018-08-27 14:29   ` Jan Beulich
2018-08-28  8:45     ` Wei Liu
2018-08-28  9:08       ` Jan Beulich
2018-08-29 16:23         ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 07/23] x86/vpmu: put HVM only code under CONFIG_HVM Wei Liu
2018-08-27 15:03   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 08/23] xen/pt: io.c contains HVM only code Wei Liu
2018-08-27 15:04   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 09/23] x86/pt: make it build with !CONFIG_HVM Wei Liu
2018-08-27 15:07   ` Jan Beulich
2018-08-30  1:29   ` Tian, Kevin
2018-08-26 12:19 ` [PATCH v2 10/23] x86/pt: split out HVM functions from vtd.c Wei Liu
2018-08-30  1:29   ` Tian, Kevin
2018-08-26 12:19 ` [PATCH v2 11/23] x86: XENMEM_resource_ioreq_server is HVM only Wei Liu
2018-08-27 15:13   ` Jan Beulich
2018-08-29 16:28     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 12/23] x86: monitor.o is currently " Wei Liu
2018-08-26 16:33   ` Razvan Cojocaru
2018-08-27 15:18   ` Jan Beulich
2018-08-27 15:23     ` Razvan Cojocaru
2018-08-29 16:42     ` Wei Liu
2018-08-29 17:43       ` Tamas K Lengyel
2018-08-29 18:09         ` Razvan Cojocaru
2018-08-30  7:14           ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 13/23] x86: provide stubs, declarations and macros in hvm.h Wei Liu
2018-08-27 15:43   ` Jan Beulich
2018-09-03  9:45   ` Paul Durrant
2018-09-03  9:50     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 14/23] x86/mm: put nested p2m code under CONFIG_HVM Wei Liu
2018-08-27 15:56   ` Jan Beulich
2018-08-28  8:40     ` Wei Liu
2018-08-28  9:10       ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 15/23] x86/mm: put HVM only " Wei Liu
2018-08-26 16:39   ` Razvan Cojocaru
2018-08-27  9:03   ` Wei Liu
2018-08-28 10:41     ` Wei Liu
2018-08-28 10:53       ` Jan Beulich
2018-08-27 16:01   ` Jan Beulich
2018-08-28 10:41     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 16/23] x86/p2m/pod: make it build with !CONFIG_HVM Wei Liu
2018-08-28 10:47   ` Jan Beulich
2018-08-28 10:54     ` Wei Liu
2018-08-28 11:32       ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 17/23] x86/mm: put paging_update_nestedmode under CONFIG_HVM Wei Liu
2018-08-28 10:50   ` Jan Beulich
2018-08-30  7:42     ` Wei Liu
2018-08-30  8:35       ` Jan Beulich
2018-09-03 14:27         ` Wei Liu
2018-09-03 14:48           ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 18/23] x86/domctl: XEN_DOMCTL_debug_op is HVM only Wei Liu
2018-08-28 10:50   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 19/23] x86: PIT emulation is common to both PV and HVM Wei Liu
2018-08-28 11:44   ` Jan Beulich
2018-08-28 13:19     ` Wei Liu
2018-08-28 14:36       ` Jan Beulich
2018-08-28 14:48         ` Wei Liu
2018-08-28 14:51           ` Andrew Cooper
2018-08-28 14:58             ` Wei Liu
2018-08-28 15:04               ` Jan Beulich
2018-08-28 15:17                 ` Wei Liu
2018-08-28 14:56           ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 20/23] xen: connect guest creation with CONFIG_{HVM, PV} Wei Liu
2018-08-28 11:07   ` Julien Grall
2018-08-28 13:13     ` Wei Liu
2018-08-28 11:47   ` Jan Beulich
2018-08-28 13:15     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 21/23] x86: expose CONFIG_HVM Wei Liu
2018-08-28 11:50   ` Jan Beulich
2018-08-28 12:14     ` Andrew Cooper
2018-08-28 13:33       ` Jan Beulich
2018-08-29 16:56         ` Andrew Cooper
2018-08-30  6:21           ` Jan Beulich
2018-08-30  6:57             ` Juergen Gross
2018-08-31 20:09             ` Andrew Cooper
2018-09-03 11:35               ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 22/23] x86/pvshim: disable HVM for PV shim Wei Liu
2018-08-26 12:19 ` [PATCH v2 23/23] xen: decouple HVM and IOMMU capabilities Wei Liu
2018-08-28 11:56   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae822cd4b618fc4078e137cf69f6827f1647752c.1535285866.git-series.wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=brian.woods@amd.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.