Re: [Xen-devel] [PATCH v6 6/9] x86/mm: export set_tlbflush_timestamp

2018-03-13 Thread Jan Beulich
>>> On 13.02.18 at 21:04,  wrote:
> The function will skip stamping the page when the page is used as page
> table in shadow mode. Since it is called both in PV code and common
> code we need to export it.

Again I think there's some prerequisite analysis necessary: Is this
functionality actually needed at all for HVM guests? What we use
the time stamp for is to know whether, at a given later time, there
may still be TLB entries around for this page. With HVM guests'
pages not managed the PV way, I'm not convinced there is any
case where we'd need to worry about such TLB flushes.

Jan


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

[Xen-devel] [PATCH v6 6/9] x86/mm: export set_tlbflush_timestamp

2018-02-13 Thread Wei Liu
The function will skip stamping the page when the page is used as page
table in shadow mode. Since it is called both in PV code and common
code we need to export it.

Signed-off-by: Wei Liu 
---
I tried to move it to a header to keep in static inline but couldn't
find a place that works.

This function depends on asm/flushtlb.h and asm/shadow.h;
asm/flushtlb.h depends on xen/mm.h; xen/mm.h depends on asm/mm.h.

The best location would be asm/mm.h, but that creates a circular
dependency.

Moving it to flushtlb.h (and include shadow.h there) breaks
compilation of other files that include flushtlb.h.
---
 xen/arch/x86/mm.c| 2 +-
 xen/include/asm-x86/mm.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e0dfa58f95..db6b703c56 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -521,7 +521,7 @@ void update_cr3(struct vcpu *v)
 make_cr3(v, cr3_mfn);
 }
 
-static inline void set_tlbflush_timestamp(struct page_info *page)
+void set_tlbflush_timestamp(struct page_info *page)
 {
 /*
  * Record TLB information for flush later. We do not stamp page tables
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index dca1831382..f6399f531b 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -628,4 +628,6 @@ static inline bool arch_mfn_in_directmap(unsigned long mfn)
 return mfn <= (virt_to_mfn(eva - 1) + 1);
 }
 
+void set_tlbflush_timestamp(struct page_info *page);
+
 #endif /* __ASM_X86_MM_H__ */
-- 
2.11.0


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