From nobody Sun Feb 8 18:10:43 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 ARC-Seal: i=1; a=rsa-sha256; t=1604071049; cv=none; d=zohomail.com; s=zohoarc; b=PWodzgEIQEQaTuJuuqbPG7s4vdU/3m98se1gREFawlGjw3z5LqAynwIyZGKVP9F4jVE6btyp2mVsWsedu55eQs6PQhdhLvMchXCmSW5JAjYdNG9B42z9yxY27LM/xgzoXdAyHUyPQEwzUGQelWoWBMtkPXGd39ZV86rGLECtVNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604071049; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=UWbOnVF8zS8gv7LmBg3QTVKJWRhoExH2pis5BbvUm5s=; b=nxaBE+fvNNBU8MzIlBZzxWYgzpNzbkhhZSM8RCV+Lz1QhngwQBGjow3hPSheyg+4mV7+uDEe+cSNkRX6+NtNqStSSujo4wmzjvAI6e/QrpsnF4egYNCrzXUPmIoDS01A8SjYwjmqttBOw0JzbwR8gm0d4mV3WoCXY/O+njaTJ9M= ARC-Authentication-Results: i=1; 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 1604071049394673.1468375822616; Fri, 30 Oct 2020 08:17:29 -0700 (PDT) Received: from localhost ([::1]:38032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYW9g-0004Ss-2e for importer@patchew.org; Fri, 30 Oct 2020 11:17:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYW83-0003Fd-VR; Fri, 30 Oct 2020 11:15:47 -0400 Received: from poy.remlab.net ([2001:41d0:2:5a1a::]:54018 helo=ns207790.ip-94-23-215.eu) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYW81-00079D-0y; Fri, 30 Oct 2020 11:15:47 -0400 Received: from basile.remlab.net (ip6-localhost [IPv6:::1]) by ns207790.ip-94-23-215.eu (Postfix) with ESMTP id CD3295FC12; Fri, 30 Oct 2020 16:15:41 +0100 (CET) From: remi@remlab.net To: qemu-arm@nongnu.org Subject: [PATCH] hw/arm/boot: fix SVE for EL3 direct kernel boot Date: Fri, 30 Oct 2020 17:15:41 +0200 Message-Id: <20201030151541.11976-1-remi@remlab.net> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2001:41d0:2:5a1a::; envelope-from=remi@remlab.net; helo=ns207790.ip-94-23-215.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 11:15:42 X-ACL-Warn: Detected OS = ??? 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: R=C3=A9mi Denis-Courmont When booting a CPU with EL3 using the -kernel flag, set up CPTR_EL3 so that SVE will not trap to EL3. Signed-off-by: R=C3=A9mi Denis-Courmont Reviewed-by: Richard Henderson --- hw/arm/boot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 3e9816af80..cf97600a91 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -742,6 +742,9 @@ static void do_cpu_reset(void *opaque) if (cpu_isar_feature(aa64_mte, cpu)) { env->cp15.scr_el3 |=3D SCR_ATA; } + if (cpu_isar_feature(aa64_sve, cpu)) { + env->cp15.cptr_el[3] |=3D CPTR_EZ; + } /* AArch64 kernels never boot in secure mode */ assert(!info->secure_boot); /* This hook is only supported for AArch32 currently: --=20 2.29.1