From patchwork Sat Oct 5 15:25:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 832982 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp1256560wra; Sat, 5 Oct 2024 08:30:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8+1z1A/PlF4N174nHKhk32eAlpgSR2AMN2F4QT6ODf7B3OXW6S6PGkqU3zsmRnVdgGPiNRw==@linaro.org X-Google-Smtp-Source: AGHT+IH0hEMJkJoEa3W+EzEyB8ctanl7CwXljFBTVXjeuQTC8eX7rs6lsQCOR9vZEZLIQCARnPXh X-Received: by 2002:a05:6214:4803:b0:6cb:50d0:56ae with SMTP id 6a1803df08f44-6cb9a30e901mr85216896d6.29.1728142201980; Sat, 05 Oct 2024 08:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728142201; cv=none; d=google.com; s=arc-20240605; b=h5fSPVS7UyS9tEWQH9Mn0+g+e9r8dU4Rz63Ry56ftlWaH8a1IBUQKVpfxoi2yGBUMu A9DtkTXtOXV8rzvLGE9nbRd7AxNCJ+XIcfz2n5KQYNcqCz0P4BvX2HvCLphNqv61R/4D Rbcfvn2N25EA40vK0VulkHdsvmZOZIZG8SXMcZUsGwOzOsjS8YGK06bZ0dVoPt2A8v5D 6C1dh8Pl8Qz6FTPaWD0ix/jBZ++dP6QUelOdGDhsjdM8L4rqI8R/0DC5vtvqsQRMYDf0 pmTQTJ5ojpcIW9HE/vVytqu0SjftCf0OZS/YKg0KIubIfn9bFgarmzsXxTy8hflt/J5d RWCw== 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=Rc7m2CC+o/vfg9459Vx/ro/giFzSXc14VGjLvy+03yM=; fh=rQg8EQ8KH04w/0VkDYF6/ktgEyHJ2dqn1eatHCfBaLw=; b=PeIaIAtVgWwf8fi0C+D97jF3remm0Vhz57ck6aMCIYAUqP9Skdn+LY2h3a+o/d/fuR cHi6rHLbV4SIRNAVDTAR9D/x893yGXZ2SaZrEpr0PIQgzwBkzCvbNk35yzvh2SPXuLdP nGsorCaPVcIIPR3Hvrg8NjaJnIp1AWClH8nMJ7bDZLKZ7gSNtLBfF1uqfy6qs7vMAXRT 5TD884xnarF93hpnB782W4hH0+qDrJl9X0sfINaqfok8JuNbnhK7QKo7glpIg3a/jpl/ LkkIpYP/ZLyy7uPgacjY5eUxQpIlwO2eWvYxxglIlPzeRIDz8gh1LSsRl6mH8RIdk1u1 D/BA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RGG8ZX+/"; 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-6cba478f38asi22711046d6.534.2024.10.05.08.30.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Oct 2024 08:30:01 -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="RGG8ZX+/"; 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-00026q-Pu; 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 1sx6fY-00024p-87 for qemu-devel@nongnu.org; Sat, 05 Oct 2024 11:26:08 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sx6fW-0002O9-9y for qemu-devel@nongnu.org; Sat, 05 Oct 2024 11:26:08 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-20b90ab6c19so33845305ad.0 for ; Sat, 05 Oct 2024 08:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728141964; x=1728746764; 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=Rc7m2CC+o/vfg9459Vx/ro/giFzSXc14VGjLvy+03yM=; b=RGG8ZX+/MqLNYXDfLP15/ANLNc65VPRwR3KzFbN3af0xA2e5ROyFd2XeC2/Lt1TwZm V2dz+vxSngftG+64OLK1zXC8HJzEmDEDu3HUTk0expctHzWMWHw3yixx3w+DSvkK3+A6 a5VWGlfF5QwB84qAMwv/49Pm1WKoWkfidLBUiJAnWv/P8ZtlwvVOi8b1th/Z6VfuAE/t smI6poTYw/liJiC34tA+gCdqCcmAwDmkA+09Fk6x9OvoE5H/wT7jRvFKM8yHqDxjl7fX HDWlhtTtzqq+Fx4fE5ZyXf6Uect8x9VgNpJOsPcBIW4rf0gcvioe27LiXHnl0g2eer3Y 5lVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728141964; x=1728746764; 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=Rc7m2CC+o/vfg9459Vx/ro/giFzSXc14VGjLvy+03yM=; b=SLynjWMJWAF49kqvQ/Nz89uqdQsdhf7Cd5LQGjAWK2GAh7VWYbgLOY5tRwFmp86SJ+ 9LLLLyejJrGwz67/pqCSC3DksLTn6JtB3C2yJxMQGCXesiAJFB495Ode6+OtwOlM5t8a wK0+WjKs8PK//u9zPCTLZK+uy4FwyeQ9ipKasZPJ/Hp+2i950N0pacOH19pxgM8If3lk 0vQpN8iHqJNceBS8NKdNNeWh4nuXTeRUBviFH8/4TUpNHBihnOk7pcBnnfKhUe8HOGEI 5iRL3fWrrkdlTpkvl3DSmlBBfRHKLaysMgc6LBaw0sgXBhDTyLCm/gQzirRWdzOBGSHe Pm8g== X-Gm-Message-State: AOJu0YzzpgVyqtnqYuLNS3erxDSIUrKrm6wpFHiM+EwpCkJKG34BBTcI Uc8sOXAH8UGH2aVl4t/+IRoQDfX0GF5NDhGSGusMjZeWKNzaGncquvRqqoaPro+nRyjHlDU8MsK F X-Received: by 2002:a17:902:db04:b0:205:709e:1949 with SMTP id d9443c01a7336-20bff04dd11mr92195455ad.57.1728141964403; Sat, 05 Oct 2024 08:26:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 08:26:04 -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 12/20] target/hppa: Add hppa_cpu_tlb_fill_align Date: Sat, 5 Oct 2024 08:25:43 -0700 Message-ID: <20241005152551.307923-13-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 Fill in the tlb_fill_align hook, so that we can recognize alignment exceptions in the correct priority order. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 3 +++ target/hppa/cpu.c | 2 +- target/hppa/mem_helper.c | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 526855f982..c0567ce0ab 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -366,6 +366,9 @@ void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled); bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); +bool hppa_cpu_tlb_fill_align(CPUState *cs, vaddr address, MemOp mop, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); void hppa_cpu_do_interrupt(CPUState *cpu); bool hppa_cpu_exec_interrupt(CPUState *cpu, int int_req); int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 3b6c325e09..768abc6e5d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -226,7 +226,7 @@ static const TCGCPUOps hppa_tcg_ops = { .restore_state_to_opc = hppa_restore_state_to_opc, #ifndef CONFIG_USER_ONLY - .tlb_fill_align = tlb_fill_align_first, + .tlb_fill_align = hppa_cpu_tlb_fill_align, .tlb_fill = hppa_cpu_tlb_fill, .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .cpu_exec_halt = hppa_cpu_has_work, diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index d38054da8a..35e9170bf3 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -424,9 +424,9 @@ void hppa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, } } -bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, - MMUAccessType type, int mmu_idx, - bool probe, uintptr_t retaddr) +bool hppa_cpu_tlb_fill_align(CPUState *cs, vaddr addr, MemOp mop, int size, + MMUAccessType type, int mmu_idx, + bool probe, uintptr_t retaddr) { HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; @@ -445,7 +445,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, break; } - excp = hppa_get_physical_address(env, addr, mmu_idx, a_prot, 0, + excp = hppa_get_physical_address(env, addr, mmu_idx, a_prot, mop, &phys, &prot); if (unlikely(excp >= 0)) { if (probe) { @@ -473,6 +473,14 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, return true; } +bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, + MMUAccessType type, int mmu_idx, + bool probe, uintptr_t retaddr) +{ + return hppa_cpu_tlb_fill_align(cs, addr, 0, size, type, + mmu_idx, probe, retaddr); +} + /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ulong reg) {