[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] x86/HVM: permit CLFLUSH{,OPT} on execute-only code segments


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 3 Dec 2021 12:21:57 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=arRBtooexp9YOjjgqZoKeIru/O8fhzNxUbCM5wJ1rzw=; b=PJpRwChpTLtbaGVRVhxiOkVfMMYAiPG/xwWEODn5RtHzyltTLgilDUwz/3cKceFT7bkU9Er5B4kXfzM3cSKpo7ziiHfkLDPTp8LIBCMip1jXepKVboAILkJqLCFEwR/lKUraX6x9hi91wgj8fiMgxT7HssNAGl+mu7uN6/tkpRAnfxbIePhi/Gmw79aEZy7iJ07D7a6w2NlOblBvnS24b7wEd4CM3VnskY0Zi3OUu5oEc3QnXU75i7cYaJ+n0Gcezq9NSGc1Zm4pkR/NDOdd0c28Qi1dz+/Is9f2f4Oedh+QscWZoofHtLOjx9BM4Q9EpeB74jhe95zA1Wili/uYWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M3u9qxZX1/15FAaZnOpL6ftR3cjZr4impl4oZp0v1Shh6zLhJ0nusdRwWNv8y//7UAluG6IO1PLJAFJG+ZHTsAHDKneyOU0NmAeJO6dgh84M39yBNccMBb8gTxjwXb4N/TfE8+5vYB1I+wUg2zj3vitScKmDFr37wwqIhtCisjKPu6u19m1Vf1NO1TF7Iu3Q6m9RrrCqYwLendwTkAXWq2SfmyAAooP+kip78+VaAhrONlUlpbxxJfBScnC1VZBXoI8HMNhZPaHUAxrs+0mXIVHS6cYJcfJCGWezgc5onGByiiyzcIrGsuj26zsmkw//TB9DdO51GWyOjxF8MyrM4w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Fri, 03 Dec 2021 11:22:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The SDM explicitly permits this, and since that's sensible behavior
don't special case AMD (where the PM doesn't explicitly say so).

Fixes: 52dba7bd0b36 ("x86emul: generalize wbinvd() hook")
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- 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;
 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.