From patchwork Fri Jul 5 15:30:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 810433 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1670392wru; Fri, 5 Jul 2024 08:39:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVSan1NWshCkizO6xB9vASxub8d+O0wyXzvAYvC8cuKWLkPgpjmnZFZX5H0gkRnSg4z5oyPrVQfZyD8OJbkzvVp X-Google-Smtp-Source: AGHT+IFtlBRFOk/B5lj7O9+uERIsDWZ+xh8F4ufjBvk6aEjK5yKr1WfH++jfcpF9gLlCrYslquKj X-Received: by 2002:a05:620a:2688:b0:79d:7970:d7d3 with SMTP id af79cd13be357-79eee1b002emr583331985a.2.1720193988191; Fri, 05 Jul 2024 08:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720193988; cv=none; d=google.com; s=arc-20160816; b=cuILXgPZ/9n8bRSQUkpysdLc9a+n9iK+qw22tta8FAVovFfMe9bZzPOZCvTT+d36dF RuW71I79ik7HMKu8IUo1+ZugbER+sgOdAluCEn/xLqgrSWCnraavfc+OLI4tLhP6P/WW zO1bDGTJ5oNEkWxB9eTezby5YMM2Ot0dOS4FF+KEGF6tZoVKr+gtAUwTMcJ6MYBXKrpG JQkL8bxTvjCH5pbqJmIIVskqhW7LmLFpBKN+Lkw6AFL5uKwtXKnd2Pjn2FdHJ2gi+rZM 2yjRxumIxmKkekftLdBHU7jU/tXxBbG9ucJL+UOKMpHmoUh4HbLsswyMx+dSmEjnsSWT 1NQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iNTI1OxNzY3tCEGj206q5bDerGVhXw3fIYt94bTCFu0=; fh=8FLk4Ih3Lbrsv0cnY4BqHX+2EEa3ySqAqshMfns3vXY=; b=IzKtEkT9hdd0lL+Uz0ACl6WgbGD7xho/5chRgyJmLYFDcsKlY4xHrG2f2VU2FJ5bBJ A8+hx32hdpbggZ1VqlWTYtVDeFBMHOAX+JDywvUT2pF0FK7D7FMOkw/CJGV9sKVQ7ZUI Iw42keNUjmj2L1VxJ6EPxPUXfp94QwYgLaxnUmNdMumFCdM7xjMIF6V7uUXEZlCFG5yQ C/3aOAJSfV094eXeaKYcx2ZMi+zQxBZciG31Xk4dqxifVRxauhqAsfechZnIC7MApzRO 1Iiwo9DlWp95A+VjgKMe1NmhMj1lreQ3GuVjlzaYbQHRthuwWQiBiPPbBnwTew/GfxPY EtLw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cKvgivHv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-79d6928781fsi1676049385a.187.2024.07.05.08.39.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2024 08:39:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cKvgivHv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPl0E-0002zh-7G; Fri, 05 Jul 2024 11:37:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPkzs-0002Zp-EX for qemu-devel@nongnu.org; Fri, 05 Jul 2024 11:37:16 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPkzq-0001GR-6k for qemu-devel@nongnu.org; Fri, 05 Jul 2024 11:37:16 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a7527afa23cso215488066b.2 for ; Fri, 05 Jul 2024 08:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720193832; x=1720798632; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iNTI1OxNzY3tCEGj206q5bDerGVhXw3fIYt94bTCFu0=; b=cKvgivHvE6Uom+pPq7kMH9IWKYZrJ3xGeg6MR06AoUJUHVhG0iXJ/X8+XakUdXVKYK /2ztW+bWulUMFwMmpnEEZ467WKQOwCtgA798yLh+QT1hlxeBnLJRCHVMBn7s1cYigt2y OcdQxW58/QOcSl9zagtQ3VVZYned0Y/JndpvspTba1jdF6znQueiX6wBmUq+lKEyvayb kB60M0ugNMvi0JfrIuPFMdyMdPv75loShLUYxUDyRzKbuONfhf1rbOiBrMjVqFOvtPhv RDHuiRnlh232LZt0J34itDOOsD6EqpGiyC+U92Ub8Lcg8V4fB8cNS4yyyISjdWP/s1DN 3WsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720193832; x=1720798632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iNTI1OxNzY3tCEGj206q5bDerGVhXw3fIYt94bTCFu0=; b=RmyLaYkOOS8Yx7i2rDNh4+d399VN34MHdaui5jwf/ks5Yu4C/YrOPSpUomB1zqxFqI jGDn0J7WUlIxjDSQexyNHSctqWCBU86dEwwu8jDsFIsMs1wWyh27qS2xT/nXO6kb/ie+ gL9KRxTwizSMfoRsNLmuXOtzJdl/Ib9ZMy76LMWLhbDWGL/rKFkpKCzdPyPfXhO1o6S9 EJ9NvS96JcR2pui1QRXXWqlqVPd8n0BIupUdppCVAk6ptUsydiDfCltuHPc/4QBO/mMW qNqCD72Rq/krbvHxtBZM+gqTtLX4VMLmqzJoXEar6G3N8S9wKuu8sRvyKSx1DTONYiS3 7O3Q== X-Gm-Message-State: AOJu0Yxh3HS7AHl0PxnnsNggtg8d4RjOzVgB1cNIL7ok9tvVhM69Mb4P Q7Ij/Ncd1YFlboJx9/1oVsaxkdrzAqqwpqZjj6hnr7+JgS3yS3lIA9aGYpY2H98= X-Received: by 2002:a17:906:3b8e:b0:a72:4676:4f8 with SMTP id a640c23a62f3a-a77ba70d755mr282546366b.62.1720193831692; Fri, 05 Jul 2024 08:37:11 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a77d8ce6a78sm40399366b.179.2024.07.05.08.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 08:37:10 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2A58A6216F; Fri, 5 Jul 2024 16:30:56 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 33/40] target/arm: Fix exception case in allocation_tag_mem_probe Date: Fri, 5 Jul 2024 16:30:45 +0100 Message-Id: <20240705153052.1219696-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240705153052.1219696-1-alex.bennee@linaro.org> References: <20240705153052.1219696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com 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=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Gustavo Romero If page in 'ptr_access' is inaccessible and probe is 'true' allocation_tag_mem_probe should not throw an exception, but currently it does, so fix it. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20240628050850.536447-5-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240705084047.857176-34-alex.bennee@linaro.org> diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index 037ac6dd60..a50d576294 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -96,6 +96,9 @@ static uint8_t *allocation_tag_mem_probe(CPUARMState *env, int ptr_mmu_idx, assert(!(probe && ra)); if (!(flags & (ptr_access == MMU_DATA_STORE ? PAGE_WRITE_ORG : PAGE_READ))) { + if (probe) { + return NULL; + } cpu_loop_exit_sigsegv(env_cpu(env), ptr, ptr_access, !(flags & PAGE_VALID), ra); }