From patchwork Tue Sep 14 00:14:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 510385 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1044870jao; Mon, 13 Sep 2021 17:26:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMu+1JE6hDXQB5BEbXc+dxI9Pl1DrtSym6Hc9u0avpr1qplpehMurhWRITM2NzxbWXdm6E X-Received: by 2002:ac8:6112:: with SMTP id a18mr2187808qtm.120.1631579199577; Mon, 13 Sep 2021 17:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579199; cv=none; d=google.com; s=arc-20160816; b=keao1tP5H3X1exWtWN6B50MCh2ZL41Py6RTZOWMiPYnm9Y27+s3vbeUUyBRv2jpenW r/3e5KpMa3L7Arp6yEmkkrYIbKXcIGrDYADESIYd81jAtMCgltc/tEKfuhZnZj6Q0Uly tOscvIOtVgz+kOFARFP++CRycYqmvCCOnJjvF8hR1ppLbKJj0IhQQlY8tKKcJQKHOoud TBwung2ZiWYWeHJYb63At8AatmAQGLqy7dgQW87sfnsvz4FZg/BxJJLMX9GbBO/AcodE 0Afg5QlWV9/ifYD4c9SqDWZy1us/f+T6YMHaTSmuZMNYXPZRpiV0v9ODsjGfSbPnCEPz Dzgg== 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=7H3s9naaE5Pm4o1Tcyi1dehPa7k9YSZMkc4DsTx2LCk=; b=hxcGjajErDqAdEXfimw4ZxwQEkk5m/tVFKEKSnbWVbshbgJD0kxQ+S9yYSYtxn/Ere 34ABZImHKd9OYwzBQkhvpjlLSEvaV7WaD24QoncRwY2DA2cKYUWLF+p30coPDi11XG2L nZs9gjwjesjynmHn04qVFCRPGxFYGiJos4GWjIhcw3xI29ZtZgPQDXEztYVK3tTVrRg+ a+1szDKMwNmj5HdGlh6pUbHGmo9BOcWsA0h0XsL/n8W53O4FgmevJ0cd/eiuQnMAJEz1 vO5sm0UsHPyCeLtpgz1l+CoSBVGslMHUQ0gsU5LKswSUUkI2IQmoFPhYBgkjMkNtrkQt LthQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RO5Uw6td; 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 r7si5102580qvc.3.2021.09.13.17.26.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Sep 2021 17:26:39 -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=RO5Uw6td; 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]:44624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPwHW-0002Km-Qr for patch@linaro.org; Mon, 13 Sep 2021 20:26:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPw6X-0001mo-QZ for qemu-devel@nongnu.org; Mon, 13 Sep 2021 20:15:22 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:44806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPw6R-0007hp-VF for qemu-devel@nongnu.org; Mon, 13 Sep 2021 20:15:17 -0400 Received: by mail-pl1-x634.google.com with SMTP id d18so6970141pll.11 for ; Mon, 13 Sep 2021 17:15:11 -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=7H3s9naaE5Pm4o1Tcyi1dehPa7k9YSZMkc4DsTx2LCk=; b=RO5Uw6tdnNDFAVhOIAe0wkHWAaCIreZGXcgWZzOc6iolZSkqp9ddu1j3+Z03Ojt5Oh o/X5QTWtKMKzf3eQWzsSNWbH0pdxJ9h0n4/ABztoL8zzggXon14W5TSUOhcgnNncXSoZ ZzmhfgLXXF25Ukn4w6w02tPDh5Sp9P4rcXLl/BNtXJHNfxSvQ0NuEx01A1GN3CLJY7y8 92sYLszucCzjJKJ3SclVrTRRLzPzeBOJsqzc33K+TBBSxPE1fPzSvK1ZXg0fHW32j6lC EhMhCMpCj4tiCKn1qgiUBKOuWFDMS/p1GcXryjvDPIbtzazG91fQHqXkISrNxJzzsRNP B71w== 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=7H3s9naaE5Pm4o1Tcyi1dehPa7k9YSZMkc4DsTx2LCk=; b=uijooDGafNM4m7jgXBG4ZIGpsWcOl6lPt6xnHKroQAb8grC1YWRGcc/7qYcPAS0qXD d2iAK0eIzstwDpKOCZLwVGl5yreo8Vh2PtSZc76ODwB55DduKjNjyON1p9An4jFA0k43 ZT7t4wbtyksEH7frrFmf4nA5k9ltE8nBJUt0xB8JllRGUB/+rNC0fing5s3zl0u92qZ4 LfWN584DgRg6kLgSs5EoZt9ucsZmTqszN8KJBN2v99bxoC6tUk1G4psc/KQui/1sQP5r RjhQgjmiyOHjlETJlIokkGL9P3hNRyHLLN/tk6cZbdOslzqNYDqQ/PIZNRPOiZGgbRq5 HthQ== X-Gm-Message-State: AOAM531fdRb8OB0XHuZwIIEg5pAja6yzJCB3qfPAAaDbP6qvQnpHrnxk z42cvORFnYBB11Kv9ig6utGRYe9qxTWuQg== X-Received: by 2002:a17:90a:1a50:: with SMTP id 16mr2401278pjl.164.1631578510691; Mon, 13 Sep 2021 17:15:10 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id m7sm9334179pgn.32.2021.09.13.17.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 17:15:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 17/44] target/hppa: Restrict cpu_exec_interrupt() handler to sysemu Date: Mon, 13 Sep 2021 17:14:29 -0700 Message-Id: <20210914001456.793490-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210914001456.793490-1-richard.henderson@linaro.org> References: <20210914001456.793490-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Message-Id: <20210911165434.531552-10-f4bug@amsat.org> Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 4 ++-- target/hppa/cpu.c | 2 +- target/hppa/int_helper.c | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 748270bfa3..7854675b90 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -325,13 +325,13 @@ int cpu_hppa_signal_handler(int host_signum, void *pinfo, void *puc); 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_do_interrupt(CPUState *cpu); -bool hppa_cpu_exec_interrupt(CPUState *cpu, int int_req); void hppa_cpu_dump_state(CPUState *cs, FILE *f, int); 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, int type, hwaddr *pphys, int *pprot); extern const MemoryRegionOps hppa_io_eir_ops; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 2eace4ee12..e8edd189bf 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -144,10 +144,10 @@ 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, - .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .tlb_fill = hppa_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .do_interrupt = hppa_cpu_do_interrupt, .do_unaligned_access = hppa_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 349495d361..13073ae2bd 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -88,7 +88,6 @@ void HELPER(write_eiem)(CPUHPPAState *env, target_ureg val) eval_interrupt(env_archcpu(env)); qemu_mutex_unlock_iothread(); } -#endif /* !CONFIG_USER_ONLY */ void hppa_cpu_do_interrupt(CPUState *cs) { @@ -100,7 +99,6 @@ void hppa_cpu_do_interrupt(CPUState *cs) uint64_t iasq_f = env->iasq_f; uint64_t iasq_b = env->iasq_b; -#ifndef CONFIG_USER_ONLY target_ureg old_psw; /* As documented in pa2.0 -- interruption handling. */ @@ -187,7 +185,6 @@ void hppa_cpu_do_interrupt(CPUState *cs) env->iaoq_b = env->iaoq_f + 4; env->iasq_f = 0; env->iasq_b = 0; -#endif if (qemu_loglevel_mask(CPU_LOG_INT)) { static const char * const names[] = { @@ -248,7 +245,6 @@ void hppa_cpu_do_interrupt(CPUState *cs) bool hppa_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { -#ifndef CONFIG_USER_ONLY HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; @@ -258,6 +254,7 @@ bool hppa_cpu_exec_interrupt(CPUState *cs, int interrupt_request) hppa_cpu_do_interrupt(cs); return true; } -#endif return false; } + +#endif /* !CONFIG_USER_ONLY */