From nobody Sat Nov 15 14:11:23 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1595349383; cv=none; d=zohomail.com; s=zohoarc; b=PmMfIvD1aXzuZGXXoKsGiOOyO3LL4Ns8qMUfPH+ekX4+yy+ePzrupKF+XkLhtyZVdvnzMBVxba8Z4ngbwKgxjVRsaBAaT7jYdzY6upiUOYdBt8Dv9yp3HdrQRANHrHiMI4XT+QaUCMrZKn3xKZfYf0yF5jIbSbDDha19cbfsEkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595349383; h=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=yRKeuIb3S/CPSg/9o/b2IVVuDvOtAIxwNSt2XmbJjGk=; b=OQNRM8csAYfBDlXq7zRS0bQgFNmS100jOkFiOblquHDee+Dg1u8Xz1qa6cC7qjvg8COzuQJZ07IAXyaE6pI6NUZ3AMQINmselrcVre6TqjEMrncT83B1XBS6vOhhcScY3ddMSolCqotEGUdtvjcLV3WrLZZC42hAKJmOlBUcCpE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1595349383698262.01041400455836; Tue, 21 Jul 2020 09:36:23 -0700 (PDT) Received: from localhost ([::1]:48442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxvFe-0008C3-3U for importer@patchew.org; Tue, 21 Jul 2020 12:36:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxvEs-0007gD-Dm for qemu-devel@nongnu.org; Tue, 21 Jul 2020 12:35:34 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:42827) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jxvEq-0008WV-P0 for qemu-devel@nongnu.org; Tue, 21 Jul 2020 12:35:34 -0400 Received: by mail-pl1-x642.google.com with SMTP id q17so10480629pls.9 for ; Tue, 21 Jul 2020 09:35:31 -0700 (PDT) Received: from localhost.localdomain (216-160-65-90.tukw.qwest.net. [216.160.65.90]) by smtp.gmail.com with ESMTPSA id g22sm18527701pgb.82.2020.07.21.09.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 09:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yRKeuIb3S/CPSg/9o/b2IVVuDvOtAIxwNSt2XmbJjGk=; b=kmY1GFkODvFfHwcjM2PvVQCzV167DYLvpY3uCggrJ363S29/Ptur1r4BJu2/FQwY3O QuZAg7obKrLXu/caLR3FkMfo5t+ofCFl9ZfPl9tHhz1c9tQRjMOaTnro8G1gKNxnyxwk RqAAv2DPsW3sDtyuLD8TA9T4FoanqvEdPcl8uJNc9aB0l8XURP8rAl0Y833SH6eTggEI 7ZlQ9ionoo5bGYFkiv+rPWbZzrX1phw35CzpkzBTZrjFqY3Y3zbdJY8+mRjS/PoXQmhq PzE/B3CLf0y+Q+yOdyhSm+sFKLRu1kq0SVGk+KwXXDLdfutMAVwIcxDataILHkHmVADq rrcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yRKeuIb3S/CPSg/9o/b2IVVuDvOtAIxwNSt2XmbJjGk=; b=mz8JFCIpTtnfM0lmRsth2hyP8aaZmsMU6jamxShCnNDzuDcLa24/LHqxxh87iADp2G NkVPx6A+e8/7FFt7MX4Fj3HeTdYarID4hn30CFf2MbPblwq98FpU4p77SviGJmSzWaUW N2gN3wiC1pkOdKfaq/JwHbZiDsEjEq6chRL51CgCYPBspyiY2S6c2p291YEgCm0B+oKK ysri+Rk/SeUaoxjkezfyPZyowy/r2jlN9yTMDnz2lZ9ed99KBQ2fnJjTzIn7P9GyHF62 Tz5ZEiPf/DlvjWRMAbPj6x0n07unnAqqvuvvBNhgxwmTVFSD1KjVodr/N6rpWdYQbQ0V kmFA== X-Gm-Message-State: AOAM530lGPKzktfleHjSMJAngmBwf0i5jb8BOsSUDazqUiT2HobF6AqY QLSY8+wUXARf/On/QkuMdBk8wz1iXko= X-Google-Smtp-Source: ABdhPJyOqSpyFHdhUcIdyyh4RPT+Yd2agLuxg2JAKHFCq3JWbhwvhcmwUx8nHx6illLSHgbM5ur1pw== X-Received: by 2002:a17:90b:188d:: with SMTP id mn13mr5860108pjb.229.1595349330271; Tue, 21 Jul 2020 09:35:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-5.1] target/arm: Always pass cacheattr in S1_ptw_translate Date: Tue, 21 Jul 2020 09:35:28 -0700 Message-Id: <20200721163528.80080-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 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=2607:f8b0:4864:20::642; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: peter.maydell@linaro.org, Jan Kiszka Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" When we changed the interface of get_phys_addr_lpae to require the cacheattr parameter, this spot was missed. The compiler is unable to detect the use of NULL vs the nonnull attribute here. Fixes: 7e98e21c098 Reported-by: Jan Kiszka Signed-off-by: Richard Henderson Tested-by: Jan Kiszka --- target/arm/helper.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index c69a2baf1d..8ef0fb478f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10204,21 +10204,11 @@ static hwaddr S1_ptw_translate(CPUARMState *env, = ARMMMUIdx mmu_idx, int s2prot; int ret; ARMCacheAttrs cacheattrs =3D {}; - ARMCacheAttrs *pcacheattrs =3D NULL; - - if (env->cp15.hcr_el2 & HCR_PTW) { - /* - * PTW means we must fault if this S1 walk touches S2 Device - * memory; otherwise we don't care about the attributes and can - * save the S2 translation the effort of computing them. - */ - pcacheattrs =3D &cacheattrs; - } =20 ret =3D get_phys_addr_lpae(env, addr, MMU_DATA_LOAD, ARMMMUIdx_Sta= ge2, false, &s2pa, &txattrs, &s2prot, &s2size, fi, - pcacheattrs); + &cacheattrs); if (ret) { assert(fi->type !=3D ARMFault_None); fi->s2addr =3D addr; @@ -10226,8 +10216,11 @@ static hwaddr S1_ptw_translate(CPUARMState *env, A= RMMMUIdx mmu_idx, fi->s1ptw =3D true; return ~0; } - if (pcacheattrs && (pcacheattrs->attrs & 0xf0) =3D=3D 0) { - /* Access was to Device memory: generate Permission fault */ + if ((env->cp15.hcr_el2 & HCR_PTW) && (cacheattrs.attrs & 0xf0) =3D= =3D 0) { + /* + * PTW set and S1 walk touched S2 Device memory: + * generate Permission fault. + */ fi->type =3D ARMFault_Permission; fi->s2addr =3D addr; fi->stage2 =3D true; --=20 2.25.1