From patchwork Mon Jun 17 06:28:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 804836 Delivered-To: patch@linaro.org Received: by 2002:adf:fb90:0:b0:360:93e7:1765 with SMTP id a16csp423827wrr; Sun, 16 Jun 2024 23:30:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQOg8EXj3rKix02xd6Tg+WZAgYoYypLy8nDaIjw/oEpOBAS+hyFf5srU15y2eyLxWuYUZt2Zy+GYQq6mBoUsv+ X-Google-Smtp-Source: AGHT+IG4/H+Y0cDYMT6jya2qY5nj/b/0cq4WSLzuEJ+Y/44BFlsO1JLii8exubCTcUC6V69DaNJF X-Received: by 2002:a05:622a:1aa5:b0:441:59c6:770d with SMTP id d75a77b69052e-44216b4531emr143467261cf.60.1718605842427; Sun, 16 Jun 2024 23:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718605842; cv=none; d=google.com; s=arc-20160816; b=VEdV5Fs6TBBQGhXFlwjgQ2ZVbxpErKm4tAi/fEPQh6VvtT8OZ5EyfH7XVf4rD4WdP1 snVJkv85O/ZOmYFOvFPNMpM6ihRz6SVsz9/3vO8w4fsZt1f4lfzIvEj1nTOQXu0mEyOq M8EBfObLU4kcRKVjtDlwjtouMlvDAP05d6wXtwzp/QvR7d+IL6pTxfyLmnOSpJhMeCDt dN9D7eY2mIFT1lglhHOCBp2wmjBkJop5D/KtND5V3eCi1pj2jN7hSi+fuS1LG5JyRVfj OFhZW7DIPzYoOncqoXcvezqpw7dhk8Az5G/NPyx4rMdJgbc347oYMWccO0GcZsdlYpmF zD7A== 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=THKPrI8tkqIcVbNLqgSdh8XD5pC35UvKcKsvFX/vTJs=; fh=ZLVo7h1WCYX+mCQET83n+8bPmyNFw4pMQxFlbH8xyms=; b=hACDVeHyrYGtYyo/nVKsvjuf9JsU/w/7JLLkAgJsev2tTNn0LqEizHGpQ64sCJ3u4O xg/nxKQeYQjVi6N2uuOdwEr3tSQMZPCKipfKwQ0no3j7MyrGcKOje1i/4CpWnjZegnwc Yv1deOBMtL7rkI56+eI+Y7uxwSpem0XAawdnTVonpMxj6JWnBtCr2wdbcNJDnnIbYscJ U0FNeraWwR1678XcSeVmHyw2ly20O6vYeh29tYofqapSMrIV8qZVVAOq0VaDuQdt2iyu OvAkkOou7JkKJYsT3X4EcAzNBzxhSK5pjtu8kaDzm52ejcabXnz7G9Fbw5CceNfAuDY7 P9lA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sg015Bif; 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 d75a77b69052e-441f2fc7ee7si92355101cf.503.2024.06.16.23.30.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Jun 2024 23:30:42 -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=sg015Bif; 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 1sJ5rp-0003mn-Fw; Mon, 17 Jun 2024 02:29:25 -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 1sJ5ro-0003me-8N for qemu-devel@nongnu.org; Mon, 17 Jun 2024 02:29:24 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJ5rm-0003T2-Hd for qemu-devel@nongnu.org; Mon, 17 Jun 2024 02:29:24 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2c508ea0cc5so880884a91.1 for ; Sun, 16 Jun 2024 23:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718605760; x=1719210560; 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=THKPrI8tkqIcVbNLqgSdh8XD5pC35UvKcKsvFX/vTJs=; b=sg015BifnO6gDhoP+juRO+UzUVbYkMwnVES/ZPAlKWtDUkiuP+IS6z9SJTwwkBgAwS NrgFhj43wyGsxFtjzhmlvEpplzCbSNIWuQJ4ENVzJl6LmJINCXlA7B9vb762ZI+ihF/3 ZXeSqcLRK9JiVqpZJujq7oR677vKaMdd2ocdFXlE9kGbx05AckKorbc8uikheN421Mna /3IupMSjbzBBu+fWSzZtY1mdispriQpVzCGt4MVKVSiircMoiyfhOTINeSkuq756vE/d qj9SKnThs3ip9Yeu9c/MXhE7Jh16bun5lDIv9Oq+Z4slzGW10lzpGUq1ErcHkLAXUjsS Tw+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718605760; x=1719210560; 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=THKPrI8tkqIcVbNLqgSdh8XD5pC35UvKcKsvFX/vTJs=; b=ZwIENE1o/H29hIH1H/MLgE0Lcprhrwb7kplVs5TxZyKzbmZPCymZRJzsx9FqrWjYMo CoR/HYQJmnNFo1Mh8hiEFesct8D3yc6daSYDVevDO2Esb+V245MJKweTotjHb0xQEoDB Kpu8xxxt4T9upHvqJqmOybSQoRS95S3fKgOqQU5f4eyXSlStAMpfqTcuX+KtiRDMrHPP GOMJDC+ElqmcE7h4cj6qWKnT4dzTvKvkM8Jx5NAsisKeEB1Z8/xBUuoCwKB+MX245QKj aaviWnfLe4N4wQKdcqCo+Z09cLKVUMxIpIzMznkFtAPoB47OaQz6o/pC0p2r0gSivQp1 7GJg== X-Gm-Message-State: AOJu0Yw6OmAbFdXy/jDvHIzfayPntRIKvBep0tMirPmau6YPTiOb9nFf cwtZ9ERS0jD0PqbOj1lNaJpRqHJzUHkh6tZWJICa4hIHbaVmH7FWPVFxXwY9Mpn7B9pWXLkQQH/ b X-Received: by 2002:a17:90a:5d13:b0:2c3:274b:dfb0 with SMTP id 98e67ed59e1d1-2c4db24b497mr7594237a91.17.1718605760456; Sun, 16 Jun 2024 23:29:20 -0700 (PDT) Received: from amd.. ([2804:7f0:b400:8dcb:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c4a75ed69csm10641863a91.14.2024.06.16.23.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 23:29:20 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, philmd@linaro.org, peter.maydell@linaro.org, alex.bennee@linaro.org, richard.henderson@linaro.org Cc: gustavo.romero@linaro.org Subject: [PATCH v3 4/9] target/arm: Fix exception case in allocation_tag_mem_probe Date: Mon, 17 Jun 2024 06:28:44 +0000 Message-Id: <20240617062849.3531745-5-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240617062849.3531745-1-gustavo.romero@linaro.org> References: <20240617062849.3531745-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=gustavo.romero@linaro.org; helo=mail-pj1-x1036.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, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 --- target/arm/tcg/mte_helper.c | 3 +++ 1 file changed, 3 insertions(+) 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); }