From nobody Sun Feb 8 22:54:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163688746614928.528610115826837; Sun, 14 Nov 2021 02:57:46 -0800 (PST) Received: from localhost ([::1]:38480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmDCi-0007lP-PF for importer@patchew.org; Sun, 14 Nov 2021 05:57:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmDBz-0006fT-Cq; Sun, 14 Nov 2021 05:56:59 -0500 Received: from mail.csgraf.de ([85.25.223.15]:39320 helo=zulu616.server4you.de) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmDBu-00034M-Gr; Sun, 14 Nov 2021 05:56:58 -0500 Received: from localhost.localdomain (dynamic-095-118-029-131.95.118.pool.telefonica.de [95.118.29.131]) by csgraf.de (Postfix) with ESMTPSA id 27F376080090; Sun, 14 Nov 2021 11:56:46 +0100 (CET) From: Alexander Graf To: qemu-arm@nongnu.org Subject: [PATCH] arm: Don't remove EL3 exposure for SMC conduit Date: Sun, 14 Nov 2021 11:56:45 +0100 Message-Id: <20211114105645.16841-1-agraf@csgraf.de> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.25.223.15; envelope-from=agraf@csgraf.de; helo=zulu616.server4you.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , Richard Henderson , qemu-devel@nongnu.org, Andrei Warkentin Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1636887469258100001 Content-Type: text/plain; charset="utf-8" When we expose an SMC conduit, we're implicitly telling the guest that there is EL3 available because it needs to call it. While that EL3 then is not backed by the emulated CPU, from the guest's EL2 point of view, it still means there is an EL3 to call into. This is a problem for VMware ESXi, which validates EL3 availability before doing SMC calls. With this patch, VMware ESXi works with SMP in TCG. Reported-by: Andrei Warkentin Signed-off-by: Alexander Graf --- target/arm/cpu.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index a211804fd3..21092c5242 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1782,11 +1782,21 @@ static void arm_cpu_realizefn(DeviceState *dev, Err= or **errp) */ unset_feature(env, ARM_FEATURE_EL3); =20 - /* Disable the security extension feature bits in the processor fe= ature - * registers as well. These are id_pfr1[7:4] and id_aa64pfr0[15:12= ]. - */ - cpu->isar.id_pfr1 &=3D ~0xf0; - cpu->isar.id_aa64pfr0 &=3D ~0xf000; + if (cpu->psci_conduit =3D=3D QEMU_PSCI_CONDUIT_SMC) { + /* + * We tell the guest to use SMC calls into EL3 for PSCI calls,= so + * there has to be EL3 available. We merely execute it on the = host + * in QEMU rather than in actual EL3 inside the guest. + */ + } else { + /* + * Disable the security extension feature bits in the processor + * feature registers as well. These are id_pfr1[7:4] and + * id_aa64pfr0[15:12]. + */ + cpu->isar.id_pfr1 &=3D ~0xf0; + cpu->isar.id_aa64pfr0 &=3D ~0xf000; + } } =20 if (!cpu->has_el2) { --=20 2.30.1 (Apple Git-130)