From patchwork Mon Mar 20 10:10:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 665188 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp1037028wrv; Mon, 20 Mar 2023 03:12:35 -0700 (PDT) X-Google-Smtp-Source: AK7set+2GUjjQU4yhqcPa5VPyaBpoNh5Sn7s1urQj/IqcQDci8S2s3FF9DeYGhNrzw1n1fCCv9G9 X-Received: by 2002:a05:6214:2584:b0:5ac:c5a1:7ced with SMTP id fq4-20020a056214258400b005acc5a17cedmr41556734qvb.0.1679307155535; Mon, 20 Mar 2023 03:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679307155; cv=none; d=google.com; s=arc-20160816; b=a/EXrL5HCW+K8yqSYdwbXHKwioHqLemIrOK/mu4telcxkI8oE5LwMbNYsybAcO7K07 X3ziuE8Lg3GoYaZPnne2dTsxRr5hmPdMpmKaJw5XbttDTcvYJqq6fSrKiK7Shxbtjbbw m4nHk+5Jdkj4xPlrMa4q6AhIxC5tpE39iMyGnoB1FuRAKVGn26rpsRX5olOfqGs5ajG5 gepL0qiDpqzauj7ACusxQ6f5mGlxCjvF4pm0HjPpdnPNJAPPPWopFetX4eXBy4wAgkZI OliRCQfMxInrDmVB7Le9PbCzUNB+yGVLaSHV9fzwS1u58Dips95Kap3ZOLwmslmxLqQF PKAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=zAnVh7k03xLE58mG3oLOMO1waepQbpwXIySIk1v3C+8=; b=rBpwGe7f1ZvqT0o/X+bOrPxxCz9ro2QoOiq8jRHpWWxSoeGv2X5kWNcVpXW+DUOvdd XfEI7JuBFDcn60SvAUjRRjJ3RLrO5yGKieHbF10PuW60IHNUs7YkAAFKF09E8gw39vfu gXwOyxZBtXJRsU+TrzgVYoXD/9NQZCQ7RmN1K8QkQTtlYFee2KcH6BghKySOWDIT9MT0 Q8tpqSp/hIdgSgwjCk7+L1XJhf37Tyu1175pecaCi4GvmI3Nvo4xLOcHy6eBQy2Ner5A 2mzEFw+t62RiY1oEVJLw8epeoW3Ghu4XaUz/cj9DVY3NC5O0C+uWCcD8Uj6H/MWJu/oq DLlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XsM+Jvwx; 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 i12-20020a056214030c00b004c703352c1asi5435770qvu.372.2023.03.20.03.12.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Mar 2023 03:12:35 -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=XsM+Jvwx; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peCTc-0003n2-2b; Mon, 20 Mar 2023 06:10:52 -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 1peCTT-0003ky-9r for qemu-devel@nongnu.org; Mon, 20 Mar 2023 06:10:44 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peCTQ-0000Cx-Cy for qemu-devel@nongnu.org; Mon, 20 Mar 2023 06:10:41 -0400 Received: by mail-wm1-x32e.google.com with SMTP id u11-20020a05600c19cb00b003edcc414997so2243909wmq.3 for ; Mon, 20 Mar 2023 03:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679307039; 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=zAnVh7k03xLE58mG3oLOMO1waepQbpwXIySIk1v3C+8=; b=XsM+JvwxxH19827PpcXWEDIJjix0RtoE9yXcg4ijCoInDv9eI16r7WM1GW4XQJa3ca rMsQzCuv+cR1BR92rTJTX0gDV9c1O5i6gPNtrsJoq56QbujCUbW7OGIwgsg0aHqhlwv2 XUReo7yMYVJmVaG7rhjES27BkOhBtl0oEXdZIk0oOXHJJTjlxnD5Y+AX92ZFACDqkKmx upPZ3Knpxq2EwghLQnJIeB0PgMMh4H8WjDdMNVM2SesFXnrtuGL/hJHxDVY+imb/OW1p wASJgMbtvayTgdHy2qTbZiMgml6nOCR1czBTgE1pUZMMtQOV17CJVh9ypwM3xKpLaEcA DLLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679307039; 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=zAnVh7k03xLE58mG3oLOMO1waepQbpwXIySIk1v3C+8=; b=xpILFA7U/0vpjXv8r9Q4iED3yuWno9NaGlwIzbG3Uwi/gcvYpNbBGXnh+J30lDGkjB 816GkSjh1MIDBJqhQRXXi9HcurIe7cb9bhEqLhgQCvgjRKaWj3BH1mDgPsdlYC0fJjw9 xfztqB8+6Q6lS7i31lZY63pZfvFIBLsQYvA98beiE76ST6vddtUf2m/ijAa8JhvGRnNY 0vNEGYAlHSTfWrjDU3mbaugOc0ZVNfk6wRLENMWmlh8OCBRi4aydD4K3k1KWvXc7FccO zbCezzrE8TVO4hmcqhyL9R+ADL6oin132m0rAenb8i1oko86SLuZQ1l+T78o+1EmPqgz 0iSw== X-Gm-Message-State: AO0yUKVO3yxqOvuDk28QfWXn/s3DqFblyjiEuRBkZtl9ACMrsU6hiRFW Rwh0rTINuuSYsEKnIMEqgrFGqA== X-Received: by 2002:a1c:f601:0:b0:3ed:8bef:6a04 with SMTP id w1-20020a1cf601000000b003ed8bef6a04mr9687377wmc.27.1679307038981; Mon, 20 Mar 2023 03:10:38 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q8-20020a1cf308000000b003ed4f6c6234sm10016207wmq.23.2023.03.20.03.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 03:10:38 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 592A51FFBD; Mon, 20 Mar 2023 10:10:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Alessandro Di Federico , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Eduardo Habkost , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 05/10] accel/tcg: remove the fake_user_interrupt guards Date: Mon, 20 Mar 2023 10:10:30 +0000 Message-Id: <20230320101035.2214196-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230320101035.2214196-1-alex.bennee@linaro.org> References: <20230320101035.2214196-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.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.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 At the cost of an empty tcg_ops field for most targets we can avoid target specific hacks in cpu-exec.c Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 2 +- accel/tcg/cpu-exec.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 20e3c0ffbb..66c0cecdde 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -50,7 +50,7 @@ struct TCGCPUOps { void (*debug_excp_handler)(CPUState *cpu); #ifdef NEED_CPU_H -#if defined(CONFIG_USER_ONLY) && defined(TARGET_I386) +#if defined(CONFIG_USER_ONLY) /** * @fake_user_interrupt: Callback for 'fake exception' handling. * diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index f883be197f..ea2e7004fe 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -698,13 +698,13 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) return true; } else { #if defined(CONFIG_USER_ONLY) - /* if user mode only, we simulate a fake exception - which will be handled outside the cpu execution - loop */ -#if defined(TARGET_I386) - CPUClass *cc = CPU_GET_CLASS(cpu); - cc->tcg_ops->fake_user_interrupt(cpu); -#endif /* TARGET_I386 */ + /* + * For some user mode handling we simulate a fake exception + * which will be handled outside the cpu execution loop + */ + if (cpu->cc->tcg_ops->fake_user_interrupt) { + cpu->cc->tcg_ops->fake_user_interrupt(cpu); + } *ret = cpu->exception_index; cpu->exception_index = -1; return true;