]> xenbits.xensource.com Git - xen.git/commitdiff
x86/HVM: permit CLFLUSH{,OPT} on execute-only code segments
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Dec 2021 13:03:56 +0000 (14:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Dec 2021 13:03:56 +0000 (14:03 +0100)
Both SDM and PM explicitly permit this.

Fixes: 52dba7bd0b36 ("x86emul: generalize wbinvd() hook")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Paul Durrant <paul@xen.org>
xen/arch/x86/hvm/emulate.c

index 425c8ddd9779f15da71ddd8add85cd27f164597f..76a2ccfafe23933dccec873a825972c45c5dbef5 100644 (file)
@@ -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;