From patchwork Sat Oct 5 15:25:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 832981 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp1256460wra; Sat, 5 Oct 2024 08:29:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUK1t26gYkAL10efEJb0UJZ+ylKAto4U3jVbEQnJTPZIJsVeIWFoZUv2Un4m/OZciOo/6HB4Q==@linaro.org X-Google-Smtp-Source: AGHT+IGsx9SZ76yjWaL7GfUfqbu8VndILYg3rOwAx88/IwgD9H/eLA8HIPyv452XZ7y+9+3Ft8hT X-Received: by 2002:a05:6214:318c:b0:6cb:1006:e9cb with SMTP id 6a1803df08f44-6cb9a45e98dmr92242536d6.28.1728142181743; Sat, 05 Oct 2024 08:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728142181; cv=none; d=google.com; s=arc-20240605; b=dgLwlW20cJr8kkIqJ1JiG8q090+hDcP8XjHdflRb3lw6oKbqYlLPF9aq86U2jO1/78 eIZ0YO6A1v1M+C+7f01eP4XJkwd2rbXnh1A8oip4kMXNV7mPyyd9ohQkffOgaGwmTMxn 35e0CX/DBkVqaQJm+3utEhgAmJ5f/UqengdKgljD6sRR2Fpr9o0fmcNSmc5Nf81gaD+D dNJZE3AL0xp5UGdWyOIyYnFAe3VAhVjH313znVwLuz+nVN3Bnh9AmkzhGaqGKEUiT6ub JnM15lp35invDbyXYi5pixrQPq+dsVIfSJ9+iQeXYloq4kKtXKSMGNqk0sJ4pT8M3YZt e78g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=TZFSB9ZUy/VXACo96L3HUXARpyVU9ywq9XNxX+p9inM=; fh=rQg8EQ8KH04w/0VkDYF6/ktgEyHJ2dqn1eatHCfBaLw=; b=UmmC7UD4eqGl9/xQvy4FU4jDehvvrdmRu8dQl9O7zhakypreEyPF3m9a97CYP1UGwH 4zCkIELt2RhO7uidz0MO6p5zKlUHYict5VmPt8ZhZ0DslOsn6JUk1icamoGOVu1q3Uit 9DMZxcLvcuLXzdJKIPqAn5DkhIh8DxxYFLvrXXvSAf1wEl243LR2CNBHaHyW8gHpAZLH 2GdScApyfhpkySFh2pgTpWYmVTpNOpXizp2zNrozZ/qzFl05HhyFy6lbaUgEKA50er8/ KhWRCQudknMNGbwMxOMwQ0SPpVi92y2vmCFNPEDHO8kxpStMKKI10QY3xBCoJwkK6Yyw Zqrg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k8e89w4C; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6cba478b93bsi22368156d6.449.2024.10.05.08.29.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Oct 2024 08:29:41 -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=k8e89w4C; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sx6fb-00026t-Qh; Sat, 05 Oct 2024 11:26:11 -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 1sx6fW-00023q-Ig for qemu-devel@nongnu.org; Sat, 05 Oct 2024 11:26:06 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sx6fU-0002Nq-P7 for qemu-devel@nongnu.org; Sat, 05 Oct 2024 11:26:05 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-20bb39d97d1so27185265ad.2 for ; Sat, 05 Oct 2024 08:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728141963; x=1728746763; 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=TZFSB9ZUy/VXACo96L3HUXARpyVU9ywq9XNxX+p9inM=; b=k8e89w4ChnXsaaKuSvUeLM6mkPAACCHbS+9FlidKqQgd+wb5Q/DAcEuxSea960KejT vtM3vjfD9pFXwr3cUBleFYsWycRv36cwKxbj1Ehbl/Q5KiQ+XBJKBxNttCSyfWYduI1I FEXsYM791iSqMo1rDKcqyOc5Sx6d6egYPPwEZ5GbzZ3MexPW77E9LF6CGZpjzrcuO16N eFm6SUdQbSCjd16ngAzqzS9KuqG2tDhnccNIGagQTKk1oPe6/4vZPE675OFQy2Nz+RGI 7tgLm++/8FpCltRLMHyLVGm7Iik67QUANJ7RbtqUNqHFrIWYT/vsfbXm9hX9VwOD55se ub+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728141963; x=1728746763; 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=TZFSB9ZUy/VXACo96L3HUXARpyVU9ywq9XNxX+p9inM=; b=PRavDROkaZXjn9UKMcMBcHRZngGl1X0J5p1tU56GLleY0dCUYyIF6HXFpICZgNlvrw XwhXtawtqsvWEdoi9EVCw3P18k/gE324m+Y1jXShi3gtiGBOd7RmI2kHI0dxYSGHQ0CP 0Zmaiv+dir7r6HDqXGWaiRxDFW4lHPJgW3x9YTIASRIx/ROHWTrbBrdM9u/INJb3/Nhu LCP15Fe0UTsuuRjsFA2rndcY3fWFmK9tmyWgHBduOyFoqTHITqerFB0qOhg8h1bPap59 8OsfxDgti+LgdR6/xeGTowUIx8Ykc0IwmtCpyTM6yJfBl5VBD6x/a0mEw0kJaBhqgYle MHyA== X-Gm-Message-State: AOJu0Yz78vBajtdtRwRHRUFjNNbgesPMpENJp5KuicX/4K6YlwbVPzLb d0I/3q6787meHMUzV1zZAioOYhTFuMEXwNdME77+4U7Qkin80hWNb4xfhwE47pc7QiSXuLbWWsP n X-Received: by 2002:a17:902:f788:b0:20b:8ed8:9c74 with SMTP id d9443c01a7336-20bff1cb9d3mr97600185ad.49.1728141963574; Sat, 05 Oct 2024 08:26:03 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c1396948dsm14351765ad.225.2024.10.05.08.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 08:26:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org, peter.maydell@linaro.org, alex.bennee@linaro.org, linux-parisc@vger.kernel.org, qemu-arm@nongnu.org Subject: [PATCH 11/20] target/hppa: Handle alignment faults in hppa_get_physical_address Date: Sat, 5 Oct 2024 08:25:42 -0700 Message-ID: <20241005152551.307923-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005152551.307923-1-richard.henderson@linaro.org> References: <20241005152551.307923-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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=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 In Chapter 5, Interruptions, the group 3 exceptions lists "Unaligned data reference trap" has higher priority than "Data memory break trap". Signed-off-by: Richard Henderson --- target/hppa/mem_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index f71cedd7a9..d38054da8a 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -221,7 +221,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, g_assert_not_reached(); } prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; - goto egress; + goto egress_align; } /* Find a valid tlb entry that matches the virtual address. */ @@ -323,6 +323,11 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, } } + egress_align: + if (addr & ((1u << memop_alignment_bits(mop)) - 1)) { + ret = EXCP_UNALIGN; + } + egress: *pphys = phys; *pprot = prot;