From patchwork Tue Sep 14 00:14:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 510437 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1050057jao; Mon, 13 Sep 2021 17:33:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyDkZ4R3cEsxoy+niPurmytWnAa1Oksrn88QrZvev0CoWaDMjNzevWpK2M0checpPM9MGb X-Received: by 2002:ab0:780a:: with SMTP id x10mr2355208uaq.24.1631579623475; Mon, 13 Sep 2021 17:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579623; cv=none; d=google.com; s=arc-20160816; b=BDLCxO3E2uQJLLNBPqKjrY/idSGVTpS2T6IriNedB10os1MjnTKA9wRS70LTXMpC1h XTkAFyRZ1p17xeNRuxM1aqQkU0RR0RFt6HYWRXAJWlLLLxfWUu7V/r5aLIzKm0bWLhb3 sJrjjRpy/Scv+OSBqxr9zvO5qzVPSibgfcxEw32ErMlg9wnil4v5nGFbE184hjqL+ElS rWyX6a9ZLTFx0vAjenYWAiytOHRAFxAk5ywHmrX3sDWK3ASltVQ6JFKfHxd1q1y5RS2i t1uGcIuaDBGtTqQgaJmvE1Ktp4Ay2+t7POi6gyNu1oT1jJmVsKXBlGtDRl5V7hjbo2pe j+gQ== 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=96+yjCsm8YeUrpyWCuPcD+HMYxAClVzCyhU0lunkMlQ=; b=a5B5CeVYsZVZWgLrbChaJhoRpGGssue1b2S4/S+5KNMg0fsDBVVKy7xQXdoIzof9PF w4JdfET9I1IKIukiu6ZyllszxQDUAVd2q8FlVgz86C+1ZoT0kz8izI3pyqr07aNEHBFD rzGXmDBEYvRqNN5scr9wa15h0LHdRbuFKGdk3SgfCql3LaSl6hyX23ogvlhBY+ar3PGT sXxFw1XT2htmp+raXXTd46VHntXfvFG0AVAt3x6UCs1twNqaz10tbNmOR+kMlJ4D9ECY zxKmD/OUbB0VUtz8xGtmlRETo2jNU+npW7HLi3ohdLCymwXr1EdactIpkhTKDe2JastI rhIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HVm2q8jd; 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 s24si2523078vsa.441.2021.09.13.17.33.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Sep 2021 17:33:43 -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=HVm2q8jd; 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]:59868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPwOM-0004Oc-Sa for patch@linaro.org; Mon, 13 Sep 2021 20:33:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPw6b-0001n3-3W for qemu-devel@nongnu.org; Mon, 13 Sep 2021 20:15:23 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:37739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPw6U-0007k6-1Z for qemu-devel@nongnu.org; Mon, 13 Sep 2021 20:15:19 -0400 Received: by mail-pf1-x436.google.com with SMTP id j6so10139764pfa.4 for ; Mon, 13 Sep 2021 17:15:13 -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=96+yjCsm8YeUrpyWCuPcD+HMYxAClVzCyhU0lunkMlQ=; b=HVm2q8jdSlGzu5PXrz57iDkfT7nges8rgF+0CuZca1KNk+QOqWwCx8WeEtseoeFU8y xazc9ti9mrYAcsncJuCQcYYpxrnT6fTKuKaB2RdsU1RqmQaZi1VxrjXz7E6Nj6XYGfTW 3qkfQxramrE8JQLneTyvfnDec4cQoJ7NA6oY3t06UJCm9/2jh6G1C0IpIW9qgu7OaTMR 8ihAixGqhpTDdqRBqr4LKObM7CyJ9LV5kRD8t6jHk3RK/moCrv2qThI9Ny0zSPd6bihS RWtr/hRbBK+x6+aeyka8+hfrc98sBKpzwaIMEEluU06rmcwnGwryEw/q/EH8KVBJ9g4X fz6Q== 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=96+yjCsm8YeUrpyWCuPcD+HMYxAClVzCyhU0lunkMlQ=; b=pZ10aXMOo7tNngd1QwzZD5B22A260ghzY7zDBdaRtwEznN8IMs+hIasM08YH89VH/d lMh5c/ZVhxr9Wyym7hbvqmvw55xFcuSBSAsPleLNeydeCK2pFP3sR0yQiac4/BdTnbmD yhe7Hl9/B9PFJ90pLapdyhbGaM6WItDmLkqRZ/OZ3K+lox0BuMLbQZ7WP2ApEXXnTkf0 A1FmbNGlw1dFTBd807Kl+FPDdl38dkhcHRraJBmiq/ysUmCpqOJxicnJ1pXr4vLoQwPh swE623pIEMmFp+nzPU8rPb1l35G9WCgULn0hT8UH+e+N6wcbL7fSIV/t0uh0tqJ65fHs JTzQ== X-Gm-Message-State: AOAM532kMH/cdX98ZSNIz1VUov3xIYvLfBP6Y18Y4+nEPLvFewt+Ekq+ onuyiPpxQdSYXlpQKhktS5DX+DN5gWkIlA== X-Received: by 2002:aa7:8ecc:0:b0:434:d4fe:311b with SMTP id b12-20020aa78ecc000000b00434d4fe311bmr1970136pfr.22.1631578512745; Mon, 13 Sep 2021 17:15:12 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id m7sm9334179pgn.32.2021.09.13.17.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 17:15:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 20/44] target/m68k: Restrict cpu_exec_interrupt() handler to sysemu Date: Mon, 13 Sep 2021 17:14:32 -0700 Message-Id: <20210914001456.793490-21-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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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-13-f4bug@amsat.org> Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 2 +- target/m68k/op_helper.c | 16 +++------------- 3 files changed, 6 insertions(+), 14 deletions(-) -- 2.25.1 diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 997d588911..550eb028b6 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -166,8 +166,10 @@ struct M68kCPU { }; +#ifndef CONFIG_USER_ONLY void m68k_cpu_do_interrupt(CPUState *cpu); bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif /* !CONFIG_USER_ONLY */ void m68k_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int m68k_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 72de6e9726..66d22d1189 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -515,10 +515,10 @@ static const struct SysemuCPUOps m68k_sysemu_ops = { static const struct TCGCPUOps m68k_tcg_ops = { .initialize = m68k_tcg_init, - .cpu_exec_interrupt = m68k_cpu_exec_interrupt, .tlb_fill = m68k_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt = m68k_cpu_exec_interrupt, .do_interrupt = m68k_cpu_do_interrupt, .do_transaction_failed = m68k_cpu_transaction_failed, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index d006d1cb3e..5d624838ae 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -24,18 +24,7 @@ #include "semihosting/semihost.h" #include "tcg/tcg.h" -#if defined(CONFIG_USER_ONLY) - -void m68k_cpu_do_interrupt(CPUState *cs) -{ - cs->exception_index = -1; -} - -static inline void do_interrupt_m68k_hardirq(CPUM68KState *env) -{ -} - -#else +#if !defined(CONFIG_USER_ONLY) static void cf_rte(CPUM68KState *env) { @@ -516,7 +505,6 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, cpu_loop_exit(cs); } } -#endif bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -538,6 +526,8 @@ bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request) return false; } +#endif /* !CONFIG_USER_ONLY */ + static void raise_exception_ra(CPUM68KState *env, int tt, uintptr_t raddr) { CPUState *cs = env_cpu(env);