From patchwork Sat Oct 5 20:05:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13823507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9880FCFB42C for ; Sat, 5 Oct 2024 20:08:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxB2f-0006Oq-Vh; Sat, 05 Oct 2024 16:06:18 -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 1sxB2e-0006ND-CH for qemu-devel@nongnu.org; Sat, 05 Oct 2024 16:06:16 -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 1sxB2c-0001m9-5k for qemu-devel@nongnu.org; Sat, 05 Oct 2024 16:06:16 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-20bb610be6aso36805795ad.1 for ; Sat, 05 Oct 2024 13:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728158773; x=1728763573; 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=ZC78gVrHhnobGyYxt0y01dTaw24akCBzHEV+MREDyk+pTKhVFoPJ0LYKcyiP0yoj5w NltfYMwUcvfw3MpYNpzV1WFHq1683PT9zRrL6kZ50ymy9GFKK3XfAgUpXvRPluQROipK NDmk5m+6oMAhUOc8MrAq59Qw4WFviFlkZ61Wj/3fzmPmMCJ1v13uy6ZbvLloEFtlHbIw QxC5uOZNh/08ScUse/6xO9HxJsmzTGT7zBsFVl4zkJRHlaVmpifa8jQA46eFlOMzPMGa eXwXmvxa1C+uSpwSB9Q7+LJLAwGIUsIXdt97aMqp35CvVSa5nPJMmoZ/KV6k9L03/Pr/ DVzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728158773; x=1728763573; 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=m0CxWZUyZMu0PbBF9A0GW6JonqkR0BJUpXVEw28vJ8XaYPe3L+jhepJy70gkBcIMGi KDTdcBjnwuB2q017qtIz1S0L9OMwqO9DhhhEjuxoDJ+m423HuclM18vNoowrBIYPjdV9 5AmiJrUWspxfUn9X+CA0vkvjWckopybDNDM4ozwW/DkXgA+Bc2kV65mtUzM/7e/z45HP wgHJ743Fauz+ZicyyI3h46VbFjB6SQkgeibIp7g1tOteq2Guaswu2ULbk7W/kss+uYha F7sikWzjJUOkwFq67dSLvRG4UdGg20BPoSnB5c61acCA8s3CGuBtbzcn/EwqkkWs/jt9 bC6Q== X-Gm-Message-State: AOJu0YxHoN+z9eqNhH2Vkr/F3rvzGZslpSZikTGf3Ol+Yr9uZEQaRXpi 6ghKr6FUvNyMivRTo9npHEd/VCSIkA+cMez/G5JzomWi5BBgCTLDxJpEmjWvQbeIytWxNMY5uw9 O X-Google-Smtp-Source: AGHT+IGHEK6fjBSmL22oUUwIkylcWSfEnGAMH/PbqEEDgjtyaqNVMTdBmg2DLFABo2GcKikjZC9wnw== X-Received: by 2002:a17:902:e54f:b0:20b:9698:a234 with SMTP id d9443c01a7336-20bfde65b4dmr91370085ad.8.1728158772729; Sat, 05 Oct 2024 13:06:12 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c13931055sm16493405ad.139.2024.10.05.13.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 13:06:12 -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 v2 12/21] target/hppa: Add hppa_cpu_tlb_fill_align Date: Sat, 5 Oct 2024 13:05:51 -0700 Message-ID: <20241005200600.493604-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005200600.493604-1-richard.henderson@linaro.org> References: <20241005200600.493604-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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Reviewed-by: Helge Deller --- 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) {