From patchwork Fri Sep 15 20:36:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13387668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 134D9CD37AA for ; Fri, 15 Sep 2023 20:36:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.603359.940321 (Exim 4.92) (envelope-from ) id 1qhFYO-0000xw-Mv; Fri, 15 Sep 2023 20:36:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 603359.940321; Fri, 15 Sep 2023 20:36:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qhFYO-0000xp-KG; Fri, 15 Sep 2023 20:36:40 +0000 Received: by outflank-mailman (input) for mailman id 603359; Fri, 15 Sep 2023 20:36:39 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qhFYN-0000xj-6k for xen-devel@lists.xenproject.org; Fri, 15 Sep 2023 20:36:39 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8eb97a50-5407-11ee-9b0d-b553b5be7939; Fri, 15 Sep 2023 22:36:35 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8eb97a50-5407-11ee-9b0d-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1694810195; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iVvBxcmH9/frdKV3USiWYWpvNhtBBf3353lMt0BYDpE=; b=Y3n1u3phZdSG7QQuZ+fKxnD+ejHHv38oRp1AZcE1VMxwZWDeSUEiL9CU 0xqqGlNnisJnHsdXew5yokEzmidktkBvNNMVYZL/2zMG7+lAqW3DswWwd FMR4v4iaNnyc49GTITnYz0iiJ/g/yhcgWnwjD0jj3zQs3UjjT9U0YN3Uu A=; X-CSE-ConnectionGUID: 40xdC7HJRICoFGlJfSNwcw== X-CSE-MsgGUID: cCkTKcjLTiaOoIrGwy9qpw== Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 122825024 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED X-ThreatScanner-Verdict: Negative IronPort-Data: A9a23:b+Mhb61bLWR7HYCtVvbD5eVxkn2cJEfYwER7XKvMYLTBsI5bpzZWn 2QYX2jSaKrcYmH0ctx1PNzn9k1UsZ+Dx4dlQAM5pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliOfQAOK6UbaYUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8nuDgNyo4GlD5g1nOKgQ1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfXTle+ ddHCBI3TzuEqc2y4ryAbPZnmZF2RCXrFNt3VnBIyDjYCb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o= X-IronPort-AV: E=Sophos;i="6.02,150,1688443200"; d="scan'208";a="122825024" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Jinoh Kang Subject: [PATCH 1/7] x86/emul: ASSERT that X86EMUL_DONE doesn't escape to callers Date: Fri, 15 Sep 2023 21:36:22 +0100 Message-ID: <20230915203628.837732-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230915203628.837732-1-andrew.cooper3@citrix.com> References: <20230915203628.837732-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 This property is far from clear. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Jinoh Kang v2: * New --- xen/arch/x86/x86_emulate/x86_emulate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index e88245eae9fb..94caec1d142c 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -8651,6 +8651,12 @@ int x86_emulate_wrapper( rc = x86_emulate(ctxt, ops); + /* + * X86EMUL_DONE is an internal signal in the emulator, and is not expected + * to ever escape out to callers. + */ + ASSERT(rc != X86EMUL_DONE); + /* * Most retire flags should only be set for successful instruction * emulation.