Re: [Xen-devel] [PATCH 04/34] x86/mm: don't reference hvm_funcs directly

2018-08-20 Thread Wei Liu
On Mon, Aug 20, 2018 at 10:28:21AM +0100, Andrew Cooper wrote:
> On 17/08/2018 16:12, Wei Liu wrote:
> > diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
> > index 4f720ad..146720c 100644
> > --- a/xen/include/asm-x86/hvm/hvm.h
> > +++ b/xen/include/asm-x86/hvm/hvm.h
> > @@ -454,6 +454,11 @@ 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)
> 
> Please s/va/linear/ while making this addition (or do a general va =>
> linear cleanup for invlpg).  Sadly, the terminology has been incorrect

I will make another patch to clean it up.

Wei.

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

Re: [Xen-devel] [PATCH 04/34] x86/mm: don't reference hvm_funcs directly

2018-08-20 Thread Andrew Cooper
On 17/08/2018 16:12, Wei Liu wrote:
> diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
> index 4f720ad..146720c 100644
> --- a/xen/include/asm-x86/hvm/hvm.h
> +++ b/xen/include/asm-x86/hvm/hvm.h
> @@ -454,6 +454,11 @@ 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)

Please s/va/linear/ while making this addition (or do a general va =>
linear cleanup for invlpg).  Sadly, the terminology has been incorrect
since the codes introduction.

~Andrew

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

[Xen-devel] [PATCH 04/34] x86/mm: don't reference hvm_funcs directly

2018-08-17 Thread Wei Liu
It is generally not a good idea to reference the internal data
structure of the another subsystem directly. Introduce a wrapper
function for the invlpg hook.

No functional change.

Signed-off-by: Wei Liu 
---
 xen/arch/x86/mm.c | 2 +-
 xen/include/asm-x86/hvm/hvm.h | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 85ccf48..8ac4412 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5800,7 +5800,7 @@ void paging_invlpg(struct vcpu *v, unsigned long va)
 if ( is_pv_vcpu(v) )
 flush_tlb_one_local(va);
 else
-hvm_funcs.invlpg(v, va);
+hvm_invlpg(v, va);
 }
 
 /* Build a 32bit PSE page table using 4MB pages. */
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 4f720ad..146720c 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -454,6 +454,11 @@ 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)
+{
+hvm_funcs.invlpg(v, va);
+}
+
 /* These bits in CR4 are owned by the host. */
 #define HVM_CR4_HOST_MASK (mmu_cr4_features & \
 (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
-- 
git-series 0.9.1

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