[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 1/9] x86/pv: fix MMUEXT_FLUSH_CACHE to flush all pCPU caches
The implementation of MMUEXT_FLUSH_CACHE is bogus, as it doesn't account to flush the cache of any previous pCPU where the current vCPU might have run, and hence is likely to not work as expected. Fix this by resorting to use the same logic as MMUEXT_FLUSH_CACHE_GLOBAL, which will be correct in all cases. Fixes: 534ffcb416bb ("Fix WBINVD by adding a new hypercall.") Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- Alternatively, the hypercall could be made correct by keeping track of the pCPUs the vCPU has run on since the last cache flush. That's however more work. See later in the series. --- xen/arch/x86/mm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 66c15a3c864f..38e214352201 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -3805,14 +3805,11 @@ long do_mmuext_op( break; case MMUEXT_FLUSH_CACHE: - if ( unlikely(currd != pg_owner) ) - rc = -EPERM; - else if ( unlikely(!cache_flush_permitted(currd)) ) - rc = -EACCES; - else - wbinvd(); - break; - + /* + * Dirty pCPU caches where the current vCPU has been scheduled are + * not tracked, and hence we need to resort to a global cache + * flush for correctness. + */ case MMUEXT_FLUSH_CACHE_GLOBAL: if ( unlikely(currd != pg_owner) ) rc = -EPERM; -- 2.48.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |