From: Jan Beulich Date: Fri, 10 Dec 2021 13:03:56 +0000 (+0100) Subject: x86/HVM: permit CLFLUSH{,OPT} on execute-only code segments X-Git-Tag: archive/raspbian/4.17.0-1+rpi1^2~33^2~1233 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=df3e1a5efe700a9f59eced801cac73f9fd02a0e2;p=xen.git x86/HVM: permit CLFLUSH{,OPT} on execute-only code segments Both SDM and PM explicitly permit this. Fixes: 52dba7bd0b36 ("x86emul: generalize wbinvd() hook") Reported-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Acked-by: Paul Durrant --- diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index 425c8ddd97..76a2ccfafe 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -2310,7 +2310,9 @@ static int hvmemul_cache_op( ASSERT(!is_x86_system_segment(seg)); rc = hvmemul_virtual_to_linear(seg, offset, 0, NULL, - hvm_access_read, hvmemul_ctxt, &addr); + op != x86emul_clwb ? hvm_access_none + : hvm_access_read, + hvmemul_ctxt, &addr); if ( rc != X86EMUL_OKAY ) break;