From patchwork Fri Oct 1 17:11:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515088 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1020553jaf; Fri, 1 Oct 2021 10:42:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQjsI5MOzcB72KLOrri4UpmkBjzkB9kw214rMZ4INxeu9+60vk2OxipbOFA+F6+PndeQv0 X-Received: by 2002:a6b:2c51:: with SMTP id s78mr9244218ios.73.1633110165349; Fri, 01 Oct 2021 10:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633110165; cv=none; d=google.com; s=arc-20160816; b=Le7WF4mpTcc7Zc59wvqtoJw8F2RsKzU3lKLMJOor17v2PfvTqadYF0h3NezVoaRTU/ /Wqfon4oJOsjAiX4eWu7icgvCcRy3Alc52qV/f3axSEySQEnPCdETi/UMZSp4jCaHy6E XROXQhUYk34QbMTx6iFrrkPeks6arO/emYqwMWfdZE2QKGa3ukIgFy+JvqxMH2XZIgVB yV2UoLT1w9ODsKiF8zMp2qgFQ5lmqKzUFKkTsl7zkO5PdGjfCLzdhFBp+owpnOHrwxUO +ShYlWMxyzPqSkEmI1iTK6STVaRddnEb4b58Pf+zqeXQGM05S3kajVSGAfgKu2Cy8L/D KzEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Jdc9xUljuMqC9v+WfiNACe7k1BrlAm8+Ia/kMx84Cy4=; b=DwjkXsSuaSoHaaf+ZKjInNXTdxDf3oowBm7rdzjnvMXPCQt6TKA8ienwneogV0OrB9 5zB1UJeriCnDjiA3U0OboxrpL4LRKy52tsB10Ucaa+ueZmFz94d+Vv5ZeO8jb3RW8x9B hM/glRCaeJdQ5DmOav6AOuC5oLuh9OV/+pTU7T19QHKLs/gECHO6xQPo7SS4mzQKEADw NQGqILL/0okDW5liCYB0QT/2LtjHTtmc+BQVimn5mrD2oKV9+Q1nKSm5lHEbuttJy3ho w9YvwK9VEi0FIUQ5U2fhlYqq6t0dplLwXZvF1UUFJELntScEJy9P+srBDDvh4bFBaMZU LnDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vVMy3Qv2; 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=fail (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 s11si10692162ilu.95.2021.10.01.10.42.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 10:42:45 -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=fail header.i=@linaro.org header.s=google header.b=vVMy3Qv2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMYW-0001IB-Ni for patch@linaro.org; Fri, 01 Oct 2021 13:42:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWM54-00054R-RU for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:12:20 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:42629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWM52-0005E4-S4 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:12:18 -0400 Received: by mail-qk1-x72e.google.com with SMTP id x12so9811156qkf.9 for ; Fri, 01 Oct 2021 10:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jdc9xUljuMqC9v+WfiNACe7k1BrlAm8+Ia/kMx84Cy4=; b=vVMy3Qv2zCl393tPfHiMTEvfTN325WQlNvLAtnHJ7Nfe0QPAVPQ18wIFJBgzChN65n VeNmMeyOMHBDQ3KvRsXW7F5KPnRLC8KPNl9+FTSV+AY/WmHsrrRS/t9aeLdWuopuFqEw Kq+FXiZ5uOwgIPYzzNxiIjIcw20e3q9vQvuWzUap+F71FjpP2jVAQlwS5MAyhF5aICg7 9onyuWKKi7/8nvOGXUQEPJ9JzRiG23mMnqWcA8g3utoAAZ7NUukZMbYELmcuojqMcxoK aBJTc9+E5WypqCUegxq9jWNODTPjP5cP1fc2s8tcRnHycyWaZP3ke1kZVzUKsGQIgtJS ZSfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jdc9xUljuMqC9v+WfiNACe7k1BrlAm8+Ia/kMx84Cy4=; b=nZDw/fXV748YqF0Nv6YYvy2m8MC80+uy0+26O6BPa1pVCvcls70JNMzqbsBzbO93vs JmHtCpg3kLg2ERZcfp26rrqlzDB8H4sv5JoQpRG6Wk+MEXZjthmnbCzQHLAvfpyi6ncV o/j0MQAKwjJ3IhDOfVssI5pVqpFqwZfI01aPog00vUHXLZ6fAz8OwIwzc4xQB3Tq57OI 2JC7z6WEmXCVGKsMb3iXsQmXenzrprRW2UfyrLkkMRmLUxqzeQsqaJL2agJLfKSxsWTw Da+31innWvP0YAaYCwTwllPfL8HbHlDqlzyzRK8iF3/jcc4UvBBDopjzzuiPt7VVphJo lw2g== X-Gm-Message-State: AOAM530McqEhHegALN3sLL/jHjr4DjUuBW+WIwMbDxgf+6NzsuETUOn9 +v1rftUIcPBIMynx4g2OsfBZCrGFcn6ZxA== X-Received: by 2002:a37:64ce:: with SMTP id y197mr10665772qkb.399.1633108335904; Fri, 01 Oct 2021 10:12:15 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id y15sm3557250qko.78.2021.10.01.10.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:12:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 26/41] target/hppa: Make hppa_cpu_tlb_fill sysemu only Date: Fri, 1 Oct 2021 13:11:36 -0400 Message-Id: <20211001171151.1739472-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001171151.1739472-1-richard.henderson@linaro.org> References: <20211001171151.1739472-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72e.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fallback code in raise_sigsegv is sufficient for hppa-linux-user. Remove the code from cpu_loop that raised SIGSEGV. This makes all of the code in mem_helper.c sysemu only, so remove the ifdefs and move the file to hppa_softmmu_ss. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 2 +- linux-user/hppa/cpu_loop.c | 16 ---------------- target/hppa/cpu.c | 2 +- target/hppa/mem_helper.c | 15 --------------- target/hppa/meson.build | 6 ++++-- 5 files changed, 6 insertions(+), 35 deletions(-) -- 2.25.1 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index d3cb7a279f..294fd7297f 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -323,10 +323,10 @@ hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); int hppa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void hppa_cpu_dump_state(CPUState *cs, FILE *f, int); +#ifndef CONFIG_USER_ONLY bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -#ifndef CONFIG_USER_ONLY 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/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 81607a9b27..e0a62deeb9 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -144,22 +144,6 @@ void cpu_loop(CPUHPPAState *env) env->iaoq_f = env->gr[31]; env->iaoq_b = env->gr[31] + 4; break; - case EXCP_ITLB_MISS: - case EXCP_DTLB_MISS: - case EXCP_NA_ITLB_MISS: - case EXCP_NA_DTLB_MISS: - case EXCP_IMP: - case EXCP_DMP: - case EXCP_DMB: - case EXCP_PAGE_REF: - case EXCP_DMAR: - case EXCP_DMPI: - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_ACCERR; - info._sifields._sigfault._addr = env->cr[CR_IOR]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case EXCP_UNALIGN: info.si_signo = TARGET_SIGBUS; info.si_errno = 0; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 89cba9d7a2..23eb254228 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -145,9 +145,9 @@ static const struct SysemuCPUOps hppa_sysemu_ops = { static const struct TCGCPUOps hppa_tcg_ops = { .initialize = hppa_translate_init, .synchronize_from_tb = hppa_cpu_synchronize_from_tb, - .tlb_fill = hppa_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .tlb_fill = hppa_cpu_tlb_fill, .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .do_interrupt = hppa_cpu_do_interrupt, .do_unaligned_access = hppa_cpu_do_unaligned_access, diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index afc5b56c3e..bf07445cd1 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -24,20 +24,6 @@ #include "hw/core/cpu.h" #include "trace.h" -#ifdef CONFIG_USER_ONLY -bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr) -{ - HPPACPU *cpu = HPPA_CPU(cs); - - /* ??? Test between data page fault and data memory protection trap, - which would affect si_code. */ - cs->exception_index = EXCP_DMP; - cpu->env.cr[CR_IOR] = address; - cpu_loop_exit_restore(cs, retaddr); -} -#else static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) { int i; @@ -392,4 +378,3 @@ int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr) hppa_tlb_entry *ent = hppa_find_tlb(env, vaddr); return ent ? ent->ar_type : -1; } -#endif /* CONFIG_USER_ONLY */ diff --git a/target/hppa/meson.build b/target/hppa/meson.build index 8a7ff82efc..021e42a2d0 100644 --- a/target/hppa/meson.build +++ b/target/hppa/meson.build @@ -7,13 +7,15 @@ hppa_ss.add(files( 'gdbstub.c', 'helper.c', 'int_helper.c', - 'mem_helper.c', 'op_helper.c', 'translate.c', )) hppa_softmmu_ss = ss.source_set() -hppa_softmmu_ss.add(files('machine.c')) +hppa_softmmu_ss.add(files( + 'machine.c', + 'mem_helper.c', +)) target_arch += {'hppa': hppa_ss} target_softmmu_arch += {'hppa': hppa_softmmu_ss}