From nobody Fri Nov 7 10:30:29 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1547995937858150.6149381146264; Sun, 20 Jan 2019 06:52:17 -0800 (PST) Received: from localhost ([127.0.0.1]:40803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glESH-0001gE-1Q for importer@patchew.org; Sun, 20 Jan 2019 09:52:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glEDJ-0003Xg-FO for qemu-devel@nongnu.org; Sun, 20 Jan 2019 09:36:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glEDI-0003ME-Gc for qemu-devel@nongnu.org; Sun, 20 Jan 2019 09:36:41 -0500 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:41015) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glEDI-0003EF-0E for qemu-devel@nongnu.org; Sun, 20 Jan 2019 09:36:40 -0500 Received: by mail-oi1-x243.google.com with SMTP id j21so12599226oii.8 for ; Sun, 20 Jan 2019 06:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stacksmashing-net.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to:cc; bh=N4nKt9Bud20mwkkhmKBDwXT4iofxplv4A1mcAPiVyTM=; b=0KxkvFeE6QiOIYItEBo4FNSE1cKGFTjCueq7o86pLHkBvZfWTWHP21tCpfkR1uNm8G ZiOMPjj74cGla8wGQNQQlcUEK5NN4hic2TEbcTV/os6kwJmAhwYY/6sTW1I1bxtO6/pr 91PqP/g/MMUS7wzDUK0TUd7CsuwxJQV5pGDa6GjaKdVeL6uV/wdyDzsvX2fFO8NvJlo3 hkrP8tWIvyrLUS7u2aIGPrlT043Md2H+uNv093tR94iiRGR2NP+dk4RvC9K7sy96vG+U Z0Uc7PiYqpIpI8nDDpvL4UpE6tJD4Zas3/I0CtiHgLQ2gNwwH4Jv7Yb/Srbmvke9jV+3 qy6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=N4nKt9Bud20mwkkhmKBDwXT4iofxplv4A1mcAPiVyTM=; b=IBZgfE8WcGouMO6S+qUl9NhSbYyUwieuvhGeaqFDSZ/mb7tgu6gPe3TbBuEaVfhze+ xxQ9MKMa0dRZ8ub9qtOCms4N981kZV0RYlQa/RdflEad3xXrwgyFS6m3VHVEHbS/Lcyw A9D7jB7KbUlTr/fqYDAPhYX01yu4TfScxBfj9WnCTK5TadaUIrCAQWLB6pMH2twHq+lR /NAw6jPPiPq+LALMNmfsuTiZMsNzlHgr5nl+gXVpluSNAQPiCz5Y2MuVlflCKAKWSTrS 4kMVYNhsCidj3a7S0rUNLsyEFyegHKRcopgsHzHudV9Puq4M8+hof2daZoF/WI5ux/xf +PcQ== X-Gm-Message-State: AJcUukceNI57z8EBJGWvuqkcJg1m9S0gCpcffiv9fYd6RAcMziCSZuxJ lIaGRBBkpeJOoVRU4UiU9ZQHvIh0JVwzZkd8JIvKNCTcajQ= X-Google-Smtp-Source: ALg8bN7nnzJIQlxTU/v8zxTEudIs3uKXuHp1BRnx+WswqiuC8WtndCcdEs3ByqsI52GATxs4rp87TbRIpqATuQKO/Pg= X-Received: by 2002:aca:4489:: with SMTP id r131mr3420003oia.296.1547994987930; Sun, 20 Jan 2019 06:36:27 -0800 (PST) MIME-Version: 1.0 From: Thomas Roth Date: Sun, 20 Jan 2019 15:36:16 +0100 Message-ID: To: qemu-arm@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::243 X-Mailman-Approved-At: Sun, 20 Jan 2019 09:51:02 -0500 Subject: [Qemu-devel] [PATCH] target/arm: v8m: Ensure IDAU is respected if SAU is disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The current behavior of v8m_security_lookup in helper.c only checks whether= the IDAU specifies a higher security if the SAU is enabled. If SAU.ALLNS is set= to 1, this will lead to addresses being treated as non-secure, even though the IDAU indicates that they must be secure. This patch changes the behavior to also check the IDAU if the SAU is curren= tly disabled. Signed-off-by: Thomas Roth --- target/arm/helper.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index f00c141ef9..34fe7f21bf 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10479,17 +10479,17 @@ static void v8m_security_lookup(CPUARMState *env, uint32_t address, } } } + break; + } - /* The IDAU will override the SAU lookup results if it specifies - * higher security than the SAU does. - */ - if (!idau_ns) { - if (sattrs->ns || (!idau_nsc && sattrs->nsc)) { - sattrs->ns =3D false; - sattrs->nsc =3D idau_nsc; - } + /* The IDAU will override the SAU lookup results if it specifies + * higher security than the SAU does. + */ + if (!idau_ns) { + if (sattrs->ns || (!idau_nsc && sattrs->nsc)) { + sattrs->ns =3D false; + sattrs->nsc =3D idau_nsc; } - break; } } --=20 2.17.2