From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) client-ip=209.85.128.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799752; cv=none; d=zohomail.com; s=zohoarc; b=aIL077WN8Nta9LUdSJD51M3nt4Yiyu5/4R1uiGdGUqFR6ih9LqE7xScAo5yhrcqP4B7pkr596uC7NhGXHiEgNNcWvj8t679UJWJms2JvnkS9jXPF0pwBIYR0TNLmOf4GLfKwrBJ/2Rh9bkhi8sW7AkpY6Y+Fea7tQJYFSVlkp3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799752; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HFwy1VjY0DuV7GMSXePF1zARrTAXU6u5yh5umJi4mBw=; b=IUOXBLgPXANbpjJB2fqfG4ZH8IexepDsTIWfvW+Pv4aqYwtmplCrKlMMQyvMxFQZQbbyh0dBJCpWPki0PoGOrkXb4xIlQOQ2lYDtj8g4/hVXXvnpxGtoshUG1zwwy1lHEkmL+wLYHgmaeoZnbBiDfSJSumHuxV2RA4o5LUa2Wo8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.zohomail.com with SMTPS id 1630799752020538.7990880711218; Sat, 4 Sep 2021 16:55:52 -0700 (PDT) Received: by mail-wm1-f42.google.com with SMTP id i3so1883169wmq.3 for ; Sat, 04 Sep 2021 16:55:51 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id t64sm3080451wma.48.2021.09.04.16.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HFwy1VjY0DuV7GMSXePF1zARrTAXU6u5yh5umJi4mBw=; b=n8eYG9jkhmbS17V9Zqx0SOB1AeTw3wwpUZv1LwXrAbEPiEufKaJCPdfXDL018l9DSC 4ZrSoER+k15uM04pQRWoAIA9e068AHPuUFsf/cDTNl/ARSeVocWiWtximKHL75G6gTaY /U96EudF0anIc9e7N28tvaImBpKd+P4LCDQo7JL8r7mnPEnjLOkBImAjV5daN7al880c qGsK6TaOc8dMp+tlRbYRrppcGOU863gXzTQOAnSRpep94jWSsOkesMvgc7OT3rxgIIR5 A1hk+Y0K2yiaVfewDzcXNHdFMBB+8HEe+LPwMs59RNNjqiMeSLcxycRr1tupoMoJJEc4 PPmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HFwy1VjY0DuV7GMSXePF1zARrTAXU6u5yh5umJi4mBw=; b=J+rzp0eeQcP7NTbxm/d7A/OzwffssfGZaj6K+WMttZhEt0PSeFdhW2o29QLV1HTZjE C/wBBSzsQsAFZ6Xc1Y8dnogTqSaghUEQQFMhgHJia5uZEifawJ4R8DqV3z4obIaUpg5O D4Tj6ynOfuN5Mena1k00Rj7Yol8hNyDPGfIhBZpWaASSyZk9bmnurBz+m3ucqkSwzGga oJqxeLeTY5qjb5N/mS4XpzD8c18pCjb+8t/+YwpKQZGPIPJommGoif7NV2dnC0x3PQVv vcyYTjn3xaeqfkvSQSCiPyEsX/syy3WCsTtW32jwEkTcQbkMyRK9YMJ8dV6wl+sRpskF QQVw== X-Gm-Message-State: AOAM530YegtM+m35dDs5shhBoDTtybpV2nNo2aQNmP+6mUd9L3pFxapS x2l7iYJetCuYb/lpssuf2aU= X-Google-Smtp-Source: ABdhPJzkSx+6bTHUvPZHsyO/KLjy2PAEeRnijNmIpNWvvXry2/6r53UyG/U5dsylCq200NfmbyqC8g== X-Received: by 2002:a7b:c769:: with SMTP id x9mr4820494wmk.75.1630799750236; Sat, 04 Sep 2021 16:55:50 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/24] target/avr: Remove pointless use of CONFIG_USER_ONLY definition Date: Sun, 5 Sep 2021 01:55:19 +0200 Message-Id: <20210904235542.1092641-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799753104100001 Commit f1c671f96cb ("target/avr: Introduce basic CPU class object") added to target/avr/cpu.h: #ifdef CONFIG_USER_ONLY #error "AVR 8-bit does not support user mode" #endif Remove the CONFIG_USER_ONLY definition introduced by mistake in commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-By: Warner Losh Reviewed-by: Richard Henderson --- target/avr/cpu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/avr/cpu.c b/target/avr/cpu.c index ea14175ca55..5d70e34dd54 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -197,10 +197,7 @@ static const struct TCGCPUOps avr_tcg_ops =3D { .synchronize_from_tb =3D avr_cpu_synchronize_from_tb, .cpu_exec_interrupt =3D avr_cpu_exec_interrupt, .tlb_fill =3D avr_cpu_tlb_fill, - -#ifndef CONFIG_USER_ONLY .do_interrupt =3D avr_cpu_do_interrupt, -#endif /* !CONFIG_USER_ONLY */ }; =20 static void avr_cpu_class_init(ObjectClass *oc, void *data) --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) client-ip=209.85.128.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799757; cv=none; d=zohomail.com; s=zohoarc; b=FrWA3D1xrJCVqsZ+4eqKYMR1aNSme4vAx20W9HP3LuD48M2vg5Cd3iXXLCyGczlHNabaY2GFAZhVLXwFLf1/yj2dhIjEw/D+7wdblVn7zhxcRN3aV5cDWZkopeEG7MxoDNwGJZqrsSglQ9gz6cmUEbYwS91+inVEWyFOR/j3Ap8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799757; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=l8Jx1m6Bv2t518ZIG2TWOXwbWEoTAme9VK7NQaY4YX8=; b=O7Y5QHghCzL5JKTgSpwf5b+Ho7QOK16KACvA/3cTHQv7W+DEcTdqeVhSBjJbPOiEBI1IH2+4t8TatWM5T9WvEihqjPOjQhfPxqFTy3W/LVYIdDzD0sahW2Q9pl4IhvGH38pilVvIZRmD1Az1BqVoFVY+Lp7BiLENfsPs+PdKBf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.zohomail.com with SMTPS id 1630799757118525.1030003815652; Sat, 4 Sep 2021 16:55:57 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id g138so1884333wmg.4 for ; Sat, 04 Sep 2021 16:55:56 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id c9sm3385529wrf.77.2021.09.04.16.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l8Jx1m6Bv2t518ZIG2TWOXwbWEoTAme9VK7NQaY4YX8=; b=pRLwYMGvYgm/K8oXON2CF751FZXzXwrdAtLKSL52ET56e83kf59D+iskzYkRCkJozp Th355l9Z2Xp9KsaXzGM/TytSumIDd0dW3lY4bNagbNLqKAycjKWEgG8OBzLN9Lvet/t6 tg9qyece9RrcuGDm7l7bnJ3bLqhoc8G4fOCZXegJGo/AxPLm5s72awulOeSwCaCTOpmo MDrQmOBhs4jq/6Ip8gXFDgRhOByDNKgBVM6uVegY9Mt2wuUGGquvkmlAGqVkJOwV28hB YLtgJHHDhh/MpGO7HHvq/Vd4Y15s71GlDDHOxMACtiBXnQBTFrWXT87oD+Pmi3DbuTpW i41Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=l8Jx1m6Bv2t518ZIG2TWOXwbWEoTAme9VK7NQaY4YX8=; b=YDlOA6LkQ9JlfQwKvLmoqAJrH3LnRn70NomjBG8roTa3I9CObCEoIlHGCwby9CYH9U DRbzIVb7aZk9ozRGyekAIc9F+h5Of6Vu3uAPHaJnVVWdU5ssgdF5mJJgFtVyYFDAtvKd gzIkYdFDWRTGqBJdnnj8gaBUkDGUXPl0Pdt84dIV6kaHWNO/xLtBGfzQeI1GQmQSjJzF JOdJbpOf3tOcedYfoPzCQKMy5hJVNCaRroUX9uKlCYDxsXXO+GSiBB8fvQ7Pc5Jfv6aj u7AWqJfgGq7vUrMYjFJ4zvQmX/n/5N6Rxv6U0QH3TUwiCdBCQcSdVZ672hWe0YJnIOxD xS/A== X-Gm-Message-State: AOAM5316ehbpMmmTX8qztaGHd1FFjGRdcf+cKVf16TukvWwjUsee1FhL +vsDEdZ5yhpRoKyWTJ+u/+A= X-Google-Smtp-Source: ABdhPJzA77sCaaWBppdNkvw3E/RyModmRCPDDjqWkuwSF8cMTF2aN9qibXy3FA/YUjlORRC0+Kw8mQ== X-Received: by 2002:a7b:c212:: with SMTP id x18mr4770089wmi.115.1630799755347; Sat, 04 Sep 2021 16:55:55 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 02/24] target/i386: Restrict sysemu-only fpu_helper helpers Date: Sun, 5 Sep 2021 01:55:20 +0200 Message-Id: <20210904235542.1092641-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799759193100001 Restrict some sysemu-only fpu_helper helpers (see commit 83a3d9c7402: "i386: separate fpu_helper sysemu-only parts"). Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 6c50d3ab4f1..c241bc183d2 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1833,11 +1833,14 @@ void x86_cpu_list(void); int cpu_x86_support_mca_broadcast(CPUX86State *env); =20 int cpu_get_pic_interrupt(CPUX86State *s); + +#ifndef CONFIG_USER_ONLY /* MSDOS compatibility mode FPU exception support */ void x86_register_ferr_irq(qemu_irq irq); void fpu_check_raise_ferr_irq(CPUX86State *s); void cpu_set_ignne(void); void cpu_clear_ignne(void); +#endif =20 /* mpx_helper.c */ void cpu_sync_bndcs_hflags(CPUX86State *env); --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799761; cv=none; d=zohomail.com; s=zohoarc; b=OcqnXg1FYQAQvWg6y2YsalGZbA/fUeCJPbfWc5PBcjAK7ZNWWP6D0OXEFITtqLR/1BT+o/U+6LiUh0byuldt5FKFlx35y5rnbSTNbjOWDTawDGBOnD+txkEihDpUFwQPry3cRCfy1AS6tLXVb13UUO/Y7NyGKy7lTHs5kXXytgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799761; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NZvvlRpa8DC97DN+aH7Pj/vVpZZsHFPzTcOdAGwjWjs=; b=HPpFiSe0GDGRToJ9iZ7mtOga46W9uYAnfJiKOSRf96DrfV0LhI6c9Gj4ws9FfJRAfGstwylgb/5URwMyVg4DKNaczeuFt22zdREKaikjySGnwHUvVbkb4NoZ2nbA8Kc/2GfekBKatFdh1iBzK2Gzm+MDZeTZGjCgLBra0ZU4+Tk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 1630799761791179.50251024879458; Sat, 4 Sep 2021 16:56:01 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id x6so4021328wrv.13 for ; Sat, 04 Sep 2021 16:56:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id o7sm3100271wmq.36.2021.09.04.16.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NZvvlRpa8DC97DN+aH7Pj/vVpZZsHFPzTcOdAGwjWjs=; b=XW8I/h4eWrBw9c6yrVw65c1frN7Vwmw8cmKYS/hxeKTVM2Oh8i3hEwVJjlQS8GwkiJ A1SK1zR2oV/tGQMzF7F7UDNYNAjmytkc1D3pi1QwPTMXROBllWFkJs7SJW/fJA9ZaRDi lzH/fomUXRmugqZedeGlH+gNQl1mS5XTTLtWzl+4tOGXrZo0HD6VLm9CP3YvZywjABTB rZC905wtFgbtjrA/FbJ+6czurfgt6DHxwfJerbuRVXhD3UPdEbbZpCTQO9uFY8f8Nt/I aCJAbr17AQR5Ax786KLvhd6uvwtKEtdMTydVgEszamtnA/zC1F5urBZ6VBGzasiqiJQC vFAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NZvvlRpa8DC97DN+aH7Pj/vVpZZsHFPzTcOdAGwjWjs=; b=b3CgQnW6SRiJDc5IPgpiVTE24SmEU+jmpoZsvPBJ33OYgVBs7YHvG0h6oEiNrj97Bp CPbEG0EIjVSTHtLMJ+oB6EBnmpLgyAKbi6i7PmNlWrnvUg1F0EKg94g3tUWrByfAjKB9 n/MtwUmZmvP0HGd1ab3mtCdMfYEC/qQCKgb17pdG0Ha2SuXvEOTZHDaPhW2YX+9AQJFY wQn/8YTBvUMQKPU+05V9bggkEqJpbIPETwqJXn1INGbOFNOtWRHJfsiMyEOZLlidc2g6 i48r5qhkfyl9CSDDH0OC4A0Lp/qcV+6CEqQitoszMgxd5B3J644BPnetx1oeRKL6oSX3 NSfQ== X-Gm-Message-State: AOAM5332Pg4R76VXd5FwAs6iGrQWMCpHlmlMBx8ZHvJqLK2PuuuB4PaU gTnX+We2bZ1APkPSNrW2mww= X-Google-Smtp-Source: ABdhPJzLeBumLslvdggp9vQd/aW9HJUURPIuRQ6qQuA2hfQ5+He0OzIkKmHxf4XZMAyuG454/MF4MA== X-Received: by 2002:a05:6000:352:: with SMTP id e18mr5764908wre.238.1630799760166; Sat, 04 Sep 2021 16:56:00 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/24] target/i386: Simplify TARGET_X86_64 #ifdef'ry Date: Sun, 5 Sep 2021 01:55:21 +0200 Message-Id: <20210904235542.1092641-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799763192100001 Merge two TARGET_X86_64 consecutive blocks. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/tcg/seg_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 3ed20ca31d7..dee7bef68c6 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -929,9 +929,7 @@ static void do_interrupt64(CPUX86State *env, int intno,= int is_int, e2); env->eip =3D offset; } -#endif =20 -#ifdef TARGET_X86_64 void helper_sysret(CPUX86State *env, int dflag) { int cpl, selector; @@ -984,7 +982,7 @@ void helper_sysret(CPUX86State *env, int dflag) DESC_W_MASK | DESC_A_MASK); } } -#endif +#endif /* TARGET_X86_64 */ =20 /* real mode interrupt */ static void do_interrupt_real(CPUX86State *env, int intno, int is_int, --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) client-ip=209.85.128.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799766; cv=none; d=zohomail.com; s=zohoarc; b=cnzymnxCz3WgFni8lT/uRNVTCSBAXp1DygtTUm888ylrqYR0pGpdXF30Q2EfMr2U3tmqDdSmFsfDg0xLVUw4w35Vblgsbf2gEuhKy4cdOXlStaZEdyXVvWOPGmrd960SkvyAgeuSo5usAX9aTrU6iSl6vOBWYwoY1wxppCKYfVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799766; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/LWud8OdJVFwV057VSOD2zPTsJ4r3xLQGTPSjELmcjM=; b=Vew+pFxBL87OP9mU4NRnTrn3ZxFe6py3pTxdpQqt2uLlPqEU+ioYymhbtWjnGrgXKSFXuVAys8VbFw3xiHw8xxDGy8GU03JBAzhiDFOQj03roLbWvsaJro898ifTid9fFsqSodEv18sSc4qRqi2tU11VSh09xpjxqsE2AeDBPVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.zohomail.com with SMTPS id 1630799766690929.6882069811753; Sat, 4 Sep 2021 16:56:06 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id e26so1894658wmk.2 for ; Sat, 04 Sep 2021 16:56:06 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id g1sm4379251wrb.27.2021.09.04.16.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/LWud8OdJVFwV057VSOD2zPTsJ4r3xLQGTPSjELmcjM=; b=buEvoCUTzfIJSaaVc24FrMk37gdaMrvf3aWU/RNXtMsnvv7OSTBkxZbtzJ7a0qKr3K /4MEOJc9A6FbIbqSK8iAh1hNqiDfb+T4iXFRYGT+zv7Q3vE+9oNG34mVfWTD5PTj3pae 5wgbl6o4FF4Ki0bX74YwA5sN2r+UhO9FnOGpCe/2h40Y1Egqg8nlpqDuc1hk/96J83SR q7lIB2bu09mpO1+lWw7EgbB53kRmwsho49E9880qndgDOT0xc5JvIrsopuBityE9V0Bf 7DU25Fm5aqIgfxB2QWYBo13UlwsbtR2ab7p1dd3jptCnLHwxy/y4MZHSz/88WQhA0i7s hbKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/LWud8OdJVFwV057VSOD2zPTsJ4r3xLQGTPSjELmcjM=; b=JB5bgNO6XSxo7HUF6rVNCGgx5q+FA8W9pfeRuJHt8nX5NUQofjc+jPjUPB8YeYFH4/ Kd3uZiNeAB7NAnugmGaQ00mJAPNNxptzzZH04vlPoNZxcG8OG5Xr6z2g9AtaKzPGMGa0 LAJCuGvNP5is+7z/b3TLv5/CapWpB6b/Mi5f6LZ6mLcKJt6jUx+oM1TzOvI6F3J30oNd 4EzJiMA2MD3EsGPYFiPphzoQkF0PxgEn+YeN+34SdZnbplq5Rca9YPi0mJ02WxHRIRTT /aYmPdmCj44ZqHL3meGNnn98eeVOMNkodQBkv9ZE+eKB15NMSdN1bhphbl75DTbiT8oA VgxQ== X-Gm-Message-State: AOAM532CJpUfvf7VdEH2YRGFjgstsN1o/4h7jj7ebPwbqK2NUZQsSaaM tAevuZshN974QJaQA/VFWmg= X-Google-Smtp-Source: ABdhPJw+uDwoP19T2xtaELhXKdMGQ1EQIcrL5LtARjFU7gdYFtu+mE7jmScipuyt9nvkquRoyOZ8bg== X-Received: by 2002:a05:600c:414f:: with SMTP id h15mr4932425wmm.124.1630799765054; Sat, 04 Sep 2021 16:56:05 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 04/24] target/xtensa: Restrict do_transaction_failed() to sysemu Date: Sun, 5 Sep 2021 01:55:22 +0200 Message-Id: <20210904235542.1092641-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799767318100001 The do_transaction_failed() is restricted to system emulation since commit cbc183d2d9f ("cpu: move cc->transaction_failed to tcg_ops"). Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/xtensa/cpu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 2345cb59c79..1e0cb1535ca 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -568,10 +568,12 @@ bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address,= int size, bool probe, uintptr_t retaddr); void xtensa_cpu_do_interrupt(CPUState *cpu); bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request); +#ifndef CONFIG_USER_ONLY void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr= addr, unsigned size, MMUAccessType access_= type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t reta= ddr); +#endif /* !CONFIG_USER_ONLY */ void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void xtensa_count_regs(const XtensaConfig *config, --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) client-ip=209.85.128.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799771; cv=none; d=zohomail.com; s=zohoarc; b=nBafNhqe/lvMt7euPKXnZ9nbW9GCZjgzdJdFKzp4gMHEYvV3nX9SCywXlMmnkFhYnMiGwxJOk0M6rnV2V121NyPrPjDJ1P4B9YOFjkQmKYqeXVGfzgUjXangIF0yB1L36DCxz4Tyf5d2CATFsAaMIWpmZn65BmWS5gvHsuCs/18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799771; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=82KmkOHInD6T32/MBrAXuGha1mEQ9aTunJA89epWqX8=; b=VRxYhGfvr0bc+C7ICfHrYA1i1czcXmvTyCmLKwHVZDjNaGs9tjdWjXJ/hfmoly0prt9mwPqpogmfZSM42Dt2JHddjlRBtkSS6pOygThQJpRvYbbc8zLFr0d8AuKLrZztMUaIKyN1eRLmZ7axpWUf0BHyIKPir9zhY948aQq9n84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.zohomail.com with SMTPS id 1630799771516458.9783459490849; Sat, 4 Sep 2021 16:56:11 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id k5-20020a05600c1c8500b002f76c42214bso2191234wms.3 for ; Sat, 04 Sep 2021 16:56:10 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id s12sm3423506wru.41.2021.09.04.16.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=82KmkOHInD6T32/MBrAXuGha1mEQ9aTunJA89epWqX8=; b=Kn93JtMrWE65+Dwtq2r2ai4VuihprXioSaMgxmymKtW9ll2R/DY2c8BEFaK6ccGB0j etXFfgchXoBrOnD5yfgQDrABEggvDa384g7CJ9zzL1NxRq7PD8QP8xRX/022RCIOD0XZ 1/hpHPMri9eC23XA+LRmZB3Q+OCFclnC1VC5OqdzI3f76Po12AqsrFmqBYhYb4iBP/hM TvnbgU0kIt+ZscnxW7GS+ekZ4uKvfVzK0ES3+98MmDazCLjFHy/LYtj/ByGexmj3liul 9P4q8rvmiPDkrqNep11HeaY1lvHdd7gmODw2oqqptzfNUHTs+aFPgRqHvhXSUZwcclgu 08+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=82KmkOHInD6T32/MBrAXuGha1mEQ9aTunJA89epWqX8=; b=mGEORl43J6M0j8Et8Md7XERDWRpLp/HuR8UsF78YPVGR/OHAbNlZfoisARvWdoJzE8 /UgmY6HhwPzYEVdDSJ3QPMlpF9OM7VMH4Wewi/BNC1sguRH+7pTUOqg0UbuKmEZ+HtYv APZWJcBYpPvgwyvyeic0cpew3zjGvPtvb6xeQJhEkL1iksLUbuI5u2v07CUUjYp6IHxn Z0ieD7oMO3EeJ4dXt1NBiWl+ojlSfcOIXfCFTf6kt5500e0wurQm8BuAxPVd/Df3pnxn l2FY2SfEV4c6b6LamDrOSsWL7ox8wJqIS3u/QQ+A0303nqAQGZ++yvxF0B+4AyUm2CyR MNKw== X-Gm-Message-State: AOAM530b39qr+2XBVzt7unHF5ykKjo/o57z2AeYXHbMZGY5zdd31CrGL N5IpLpp6SpXrNJpV8b9+E0Y= X-Google-Smtp-Source: ABdhPJwst4L6LtqbIqiimTRXPOTq6XxTPm3Izm/4SP1dNz9JfR7Lw17lMRZ9duymzC3zNapRWxZRHg== X-Received: by 2002:a05:600c:5123:: with SMTP id o35mr4977935wms.153.1630799769864; Sat, 04 Sep 2021 16:56:09 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 05/24] accel/tcg: Rename user-mode do_interrupt hack as fake_user_interrupt Date: Sun, 5 Sep 2021 01:55:23 +0200 Message-Id: <20210904235542.1092641-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799773319100001 do_interrupt() is sysemu specific. However due to some X86 specific hack, it is also used in user-mode emulation, which is why it couldn't be restricted to CONFIG_SOFTMMU (see the comment around added in commit 78271684719: "cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Keep the hack but rename the handler as fake_user_interrupt() and restrict do_interrupt() to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/tcg-cpu-ops.h | 22 ++++++++++++++-------- accel/tcg/cpu-exec.c | 4 ++-- target/i386/tcg/tcg-cpu.c | 6 ++++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index eab27d0c030..6c7ab9600ba 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -37,14 +37,6 @@ struct TCGCPUOps { void (*cpu_exec_exit)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); - /** - * @do_interrupt: Callback for interrupt handling. - * - * note that this is in general SOFTMMU only, but it actually isn't - * because of an x86 hack (accel/tcg/cpu-exec.c), so we cannot put it - * in the SOFTMMU section in general. - */ - void (*do_interrupt)(CPUState *cpu); /** * @tlb_fill: Handle a softmmu tlb miss or user-only address fault * @@ -61,6 +53,20 @@ struct TCGCPUOps { void (*debug_excp_handler)(CPUState *cpu); =20 #ifdef NEED_CPU_H +#if defined(CONFIG_USER_ONLY) && defined(TARGET_I386) + /** + * @fake_user_interrupt: Callback for 'fake exception' handling. + * + * Simulate 'fake exception' which will be handled outside the + * cpu execution loop (hack for x86 user mode). + */ + void (*fake_user_interrupt)(CPUState *cpu); +#else + /** + * @do_interrupt: Callback for interrupt handling. + */ + void (*do_interrupt)(CPUState *cpu); +#endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #ifdef CONFIG_SOFTMMU /** * @do_transaction_failed: Callback for handling failed memory transac= tions diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e5c0ccd1a2a..2838177e7f0 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -651,8 +651,8 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) loop */ #if defined(TARGET_I386) CPUClass *cc =3D CPU_GET_CLASS(cpu); - cc->tcg_ops->do_interrupt(cpu); -#endif + cc->tcg_ops->fake_user_interrupt(cpu); +#endif /* TARGET_I386 */ *ret =3D cpu->exception_index; cpu->exception_index =3D -1; return true; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 93a79a57415..04c35486a2f 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -73,9 +73,11 @@ static const struct TCGCPUOps x86_tcg_ops =3D { .cpu_exec_enter =3D x86_cpu_exec_enter, .cpu_exec_exit =3D x86_cpu_exec_exit, .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, - .do_interrupt =3D x86_cpu_do_interrupt, .tlb_fill =3D x86_cpu_tlb_fill, -#ifndef CONFIG_USER_ONLY +#ifdef CONFIG_USER_ONLY + .fake_user_interrupt =3D x86_cpu_do_interrupt, +#else + .do_interrupt =3D x86_cpu_do_interrupt, .debug_excp_handler =3D breakpoint_handler, .debug_check_breakpoint =3D x86_debug_check_breakpoint, #endif /* !CONFIG_USER_ONLY */ --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) client-ip=209.85.221.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799776; cv=none; d=zohomail.com; s=zohoarc; b=SwDHdwm9MLnlT3RLb8MTo1EJ9G72EVaXNDC8s+TxfPGjnKQb9tIWvGJAb5mKKelpMxz9yg4GEeudoEIkhsAn/L6gp881QH5zOcv7G9KRcC21TWk22bvpMuCZAqXc+S7HFl5kj4JSzNxR6tjphAdyTCntRjnjcGBwn5WVErcdw+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799776; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KL1Kqw8poO/L4JKKXeGzPnOl81Q/NwCgyvh1EIRZFV8=; b=ngEOKwaHh81bh4ZBr6h0WL3ZPi7N5bs8cbHQRrw4qzJQ9QaJYAylUdIRdXqKo89alhhZ0zdEDtE0EFWTxER063iisMj4Y5NPaUtPdE6pk06P/BBV2OpACYYHstpa0sOBTsLDWZhFDvQhCksoMOJa6RoupznKnMy8gXGBJZ0zR2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.zohomail.com with SMTPS id 1630799776627893.0736788421032; Sat, 4 Sep 2021 16:56:16 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id z4so4042703wrr.6 for ; Sat, 04 Sep 2021 16:56:16 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id a133sm3188581wme.5.2021.09.04.16.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KL1Kqw8poO/L4JKKXeGzPnOl81Q/NwCgyvh1EIRZFV8=; b=QJYJWXh1iPxPSpnG1LK/9/fjkrfbfOnaDhfQeY/YcriQW1O730RH1c10LmwQcn1IKg fP3N6vfNWwiewC8zvIHAR+SSldzqnTfLjI4Hb/i6Ryp9ADliNtQLDOSMJOWcdeZbMi+M DZWYCInxQuDl99LwFxWANmQjGtzByZis+s1LQZ3ntFzE0Y6g30qroED9c95NOT6meaIG 5QfBNpMYOvqOv428viHafjZnSlMG020krExsiY4qK67JfDWF6/iDJ3sTKNERr/pHk+O9 iqAjtWa5022g/nTzbzet+9cpvQiEPL6zW8POdrI5zG2tr5/2WPXRJDX6fwLDAc4OoP7u /L9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KL1Kqw8poO/L4JKKXeGzPnOl81Q/NwCgyvh1EIRZFV8=; b=P1fcuzhQBqAO+CdAh4Xa18jPLtmX/KFQwW7GbPWxUD/KWzUcZQJXU6CUbqs8tGimAr N9ozlVVgQnSQRQoxRClShgTEgX1vBG1rw9znidqG3I+oo2hKkmJSExaXh6tAOSV+HtEu KOXQJz/UhFMX2w1V7QgEnfaJ9Qymvij8IS2NZ630+enMwo/M2LnSpb5aBMFKDggqiCCv 1AVNzDecRq7rILiwFPKPRYW0y5wKrCFQY/E5wMJL77QA8z8ndydK1s9ElXVT/PRObkMV VXcyYl0uqCi+7OYYW9uAnIjYGshK8VGUgPFXd8hWfw1FJGyuL0LpGbNFp8xmzvSXkFYZ RIQQ== X-Gm-Message-State: AOAM533wQWJBvAjCzO5C84urWNw4sgLY4BOzfiC75UMq3YnK6P3zgYM/ eak/SQrZCtYmz3YuD51OKoA= X-Google-Smtp-Source: ABdhPJwX/Ro6pFfZPwJNZ4YRxwhikYZ86I9A0xVl8Ig6N5iopb7FMxWps5yrASl7f8D/UezeO+OO6g== X-Received: by 2002:a5d:5441:: with SMTP id w1mr5781218wrv.280.1630799774963; Sat, 04 Sep 2021 16:56:14 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 06/24] target/alpha: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:24 +0200 Message-Id: <20210904235542.1092641-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799777460100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/cpu.h | 2 +- target/alpha/cpu.c | 2 +- target/alpha/helper.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 82df108967b..4e993bd15bd 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -274,10 +274,10 @@ struct AlphaCPU { =20 #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_alpha_cpu; -#endif =20 void alpha_cpu_do_interrupt(CPUState *cpu); bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif /* !CONFIG_USER_ONLY */ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags); hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 4871ad0c0a6..93e16a2ffb4 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -218,10 +218,10 @@ static const struct SysemuCPUOps alpha_sysemu_ops =3D= { =20 static const struct TCGCPUOps alpha_tcg_ops =3D { .initialize =3D alpha_translate_init, - .cpu_exec_interrupt =3D alpha_cpu_exec_interrupt, .tlb_fill =3D alpha_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D alpha_cpu_exec_interrupt, .do_interrupt =3D alpha_cpu_do_interrupt, .do_transaction_failed =3D alpha_cpu_do_transaction_failed, .do_unaligned_access =3D alpha_cpu_do_unaligned_access, diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 4f56fe4d231..81550d9e2ff 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -293,7 +293,6 @@ bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int s= ize, prot, mmu_idx, TARGET_PAGE_SIZE); return true; } -#endif /* USER_ONLY */ =20 void alpha_cpu_do_interrupt(CPUState *cs) { @@ -348,7 +347,6 @@ void alpha_cpu_do_interrupt(CPUState *cs) =20 cs->exception_index =3D -1; =20 -#if !defined(CONFIG_USER_ONLY) switch (i) { case EXCP_RESET: i =3D 0x0000; @@ -404,7 +402,6 @@ void alpha_cpu_do_interrupt(CPUState *cs) =20 /* Switch to PALmode. */ env->flags |=3D ENV_FLAG_PAL_MODE; -#endif /* !USER_ONLY */ } =20 bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request) @@ -451,6 +448,8 @@ bool alpha_cpu_exec_interrupt(CPUState *cs, int interru= pt_request) return false; } =20 +#endif /* !CONFIG_USER_ONLY */ + void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags) { static const char linux_reg_names[31][4] =3D { --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) client-ip=209.85.128.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799781; cv=none; d=zohomail.com; s=zohoarc; b=cCb4PUDu3yOhbyYgmJo1z+qJwCAgDvtIPDiSD1j/GYGC+9uABPV7gtw8ci8ObPAy3++bJwfUYInLY5auqgGdKbI+xgFWWdTH2ptmWUEPYSYg4urd2ZjTbGCfMJu4O7mv2HFCuv5JebAwxJDABKXKyjUBoSJSTGa+/04Ux85UgIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799781; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V7zq9ygHOST6Surc7M7Rd7Muo9vEZYb0xO5KQYL2Z9g=; b=lGcygs2WvZ+nm48GG6OtuNr79zPJBkVnO6Tsq5qD6gkQ7PaCncqn4aIDK1LZsgjBd7JogB82lKqWWxURG1SUlp8oCYaIHGzICbm48rKEanJySpMR9qP9jahLmY5/yQIG7dsUK60HxQ3uz6yp54zKnIGHnZwsrZWXJ4PEU2Ds0+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.zohomail.com with SMTPS id 1630799781846130.8996001762497; Sat, 4 Sep 2021 16:56:21 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id g135so1880221wme.5 for ; Sat, 04 Sep 2021 16:56:21 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id p11sm3132354wma.16.2021.09.04.16.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V7zq9ygHOST6Surc7M7Rd7Muo9vEZYb0xO5KQYL2Z9g=; b=cx+KWWrR1gMduIOYOCqjGXVsJBRI1xAX8iV/agvrkFu8BlkRtUVHEW6vEXjeckuyk8 C1cK1+DBrsgGyfsM6bZdfPM03F39eODD3STHJE59206ieP16Flbd6xViEwaX/ppajBLk 6FizfavxNLgf0tIdEgCVvvGX/zxIGoDm7Sy16H3DSuVvnyo/p0maSxp6cEj7OXk7YD4f 1YYCSjLmq6Bb7BtfVpjRzxNr6U0MXReCMRRxLtYN1dWsskMB4FvFcGnwtxQqrpdpmMuS bXmM/ZG4jngHacEbIbjKJpS7Qv7cQxTq7hpVa1bH3CZccOwV6Tobu66hWR7xRnCqzYDo cRTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=V7zq9ygHOST6Surc7M7Rd7Muo9vEZYb0xO5KQYL2Z9g=; b=HasnmNcV6B3nAbsnIoSwqxrwPjAd1hVubru/UdOb1OgYWib5XOyoGp+6aVOaWRAlwl I2fOakdxyNdCai7nF4qgTRfzShJTGry0uCfQL60I/AJXfBI/NWv4uIxlOa/xuOX+GmnD SggAnJYQ/k0w538blmmhT5pLU4n9TlY6ZZMkX/5glngI1ohSfe80CDpcN0bSvblogc/n +Ush7EucOKlJjks8+Bh2h0DeV1dB7tGCLh+eTY0wpG/KKx22S6qGl86CHlZJBSdh6nDQ Dlwz6LxZ9uFsYDWt5ZkBoT26HHEROUgUoQpc0SzeUQE3jmCH9Ve5KrEq+JHkokJ7frSl zYPQ== X-Gm-Message-State: AOAM533hofRf6vyzMmvD+n5KDXCFj+2yXgAyRN/jiyqueKU4ZdX7VDVn vPRBUJVfZMjnEsNONfO01XM= X-Google-Smtp-Source: ABdhPJyv6/c3RPgV+LYikwkNPi3V7w25e+oFEfwCiTf1cqOvshNZrfu6x9rdzl/1p25fYwr2yEBS6w== X-Received: by 2002:a1c:f008:: with SMTP id a8mr4851799wmb.83.1630799780132; Sat, 04 Sep 2021 16:56:20 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 07/24] target/arm: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:25 +0200 Message-Id: <20210904235542.1092641-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799783628100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu.h | 3 +-- target/arm/cpu.c | 7 +++++-- target/arm/cpu_tcg.c | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 6a987f65e41..cfd755cff99 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1040,11 +1040,10 @@ uint64_t arm_cpu_mp_affinity(int idx, uint8_t clust= ersz); =20 #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_arm_cpu; -#endif =20 void arm_cpu_do_interrupt(CPUState *cpu); void arm_v7m_cpu_do_interrupt(CPUState *cpu); -bool arm_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif /* !CONFIG_USER_ONLY */ =20 hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index d631c4683c4..ba0741b20e4 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -440,6 +440,8 @@ static void arm_cpu_reset(DeviceState *dev) arm_rebuild_hflags(env); } =20 +#ifndef CONFIG_USER_ONLY + static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, unsigned int target_el, unsigned int cur_el, bool secure, @@ -556,7 +558,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsi= gned int excp_idx, return unmasked || pstate_unmasked; } =20 -bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request) +static bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { CPUClass *cc =3D CPU_GET_CLASS(cs); CPUARMState *env =3D cs->env_ptr; @@ -608,6 +610,7 @@ bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt= _request) cc->tcg_ops->do_interrupt(cs); return true; } +#endif /* !CONFIG_USER_ONLY */ =20 void arm_cpu_update_virq(ARMCPU *cpu) { @@ -2010,11 +2013,11 @@ static const struct SysemuCPUOps arm_sysemu_ops =3D= { static const struct TCGCPUOps arm_tcg_ops =3D { .initialize =3D arm_translate_init, .synchronize_from_tb =3D arm_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D arm_cpu_exec_interrupt, .tlb_fill =3D arm_cpu_tlb_fill, .debug_excp_handler =3D arm_debug_excp_handler, =20 #if !defined(CONFIG_USER_ONLY) + .cpu_exec_interrupt =3D arm_cpu_exec_interrupt, .do_interrupt =3D arm_cpu_do_interrupt, .do_transaction_failed =3D arm_cpu_do_transaction_failed, .do_unaligned_access =3D arm_cpu_do_unaligned_access, diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index 33cc75af57d..0d5adccf1a7 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -22,7 +22,7 @@ /* CPU models. These are not needed for the AArch64 linux-user build. */ #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) =20 -#ifdef CONFIG_TCG +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { CPUClass *cc =3D CPU_GET_CLASS(cs); @@ -46,7 +46,7 @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int = interrupt_request) } return ret; } -#endif /* CONFIG_TCG */ +#endif /* !CONFIG_USER_ONLY && CONFIG_TCG */ =20 static void arm926_initfn(Object *obj) { @@ -898,11 +898,11 @@ static void pxa270c5_initfn(Object *obj) static const struct TCGCPUOps arm_v7m_tcg_ops =3D { .initialize =3D arm_translate_init, .synchronize_from_tb =3D arm_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D arm_v7m_cpu_exec_interrupt, .tlb_fill =3D arm_cpu_tlb_fill, .debug_excp_handler =3D arm_debug_excp_handler, =20 #if !defined(CONFIG_USER_ONLY) + .cpu_exec_interrupt =3D arm_v7m_cpu_exec_interrupt, .do_interrupt =3D arm_v7m_cpu_do_interrupt, .do_transaction_failed =3D arm_cpu_do_transaction_failed, .do_unaligned_access =3D arm_cpu_do_unaligned_access, --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) client-ip=209.85.221.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799786; cv=none; d=zohomail.com; s=zohoarc; b=QSWT0jnBap/lqQp3QCz8+ubAAItMKIHBzFr8JgGf8aPPG76i8mYPsr/nZ7cL4tzHwrT+m1AWk0O0XNN1mC8mKdnBuhh7WHko/9HC0Uhnj2N1cI3JvdWPkKiw53IZD9YDOZZZTh9Wrj1HxjA+mx68bgIStWwhNSUzh75eQHDxdwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799786; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=geqo+TfqXlGgpu7vXFZNKLzFP6S151+7irB5AEU8QIk=; b=S6qmiX0CfDwspo5//QGe3tFq/VW9Ikvdwmy52f/HNbCDbc19YujYJXQ4zADD94wVpvJjkcfbePg0aMIXlntK7SsirGQos1Jwhl2uWcFivN6CPDeC6Xduw3++YBUNNKMzx5QH1AoJLZwkqiFQl1wpkIs8IK9t98dUrfPhA4AFoTg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.zohomail.com with SMTPS id 1630799786860129.3894460358472; Sat, 4 Sep 2021 16:56:26 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id u16so4052591wrn.5 for ; Sat, 04 Sep 2021 16:56:26 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id c2sm3356693wrs.60.2021.09.04.16.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=geqo+TfqXlGgpu7vXFZNKLzFP6S151+7irB5AEU8QIk=; b=QvDaWpvNc3QzhsUGsLuMFbO+6Tw6LGzgjstZcNtsVeiD4ewrieRAm1xjn/mF4b0i5w 4kuiy1yHEAEnGMXuSjVhZt7iGHpY3f3ThAYLUNYlSitRcVPkWGBaFPlf2aJ+M7IAIE5X fS6HOhXhgTDYh45XdQHC1/lJ2otniW9N+emEI38llMYINzM68/ucF7ObP/fDa57EwzS+ XCeCeN7f46PVSEZZgkdrdWTmfeM3H7N8pkO9jZfycTK1NQpdGUZnc2Cfc0VmBYXzbQdX RnLyB54TN9yvDVSQ1e/6LBnO4lzoQQnKNLo6fEumXspZ5l3zc7+xmZxJEiiV18QyyQBb lOFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=geqo+TfqXlGgpu7vXFZNKLzFP6S151+7irB5AEU8QIk=; b=orbnG6/uczUkxCxLrxMEgHXM+3GF34VLr2I4yUC/qZxyakd1rTrN8vBb1VNx9+pImZ 8nwqoYzKs5OEbWflZRQd+wrLYow5fVMBf7pwz0JnrYg2tMUN4mQPKpuNvhVGhGIPtvxh jyebqVPUVzL2phowvdhqJPmt9NCz6k1Z/w2d1i3ae5kH4t3W31jnNUL7djTYQNejULHh Q/aMt1cJ4rZInFzwPYbyYLStn58mQDb84q39v4XLha02QW19aUvRkci0gW4BCaIlWLQJ BtWRAd/WggTaIh+/LsQZXf21Ybhs/hSIovETH0egR7ehjmLcdYo+2hB57qpbABuawIji yTAQ== X-Gm-Message-State: AOAM530AZaMlSzfT+5luoqDliDaYU1l49fiya6oL7RZ0jkWFCvKqtaTh T/rx/E43x5bcMs28JKmFqfk= X-Google-Smtp-Source: ABdhPJzugCXCLS8qdOYpz+WXQIoUweWOOKeI51q95dTtoWc+yJOqB/h94mYckWNHj4Q93fsZRbuheA== X-Received: by 2002:a5d:51ca:: with SMTP id n10mr5946015wrv.119.1630799785161; Sat, 04 Sep 2021 16:56:25 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 08/24] target/cris: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:26 +0200 Message-Id: <20210904235542.1092641-9-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799787704100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/cris/cpu.h | 2 +- target/cris/cpu.c | 4 ++-- target/cris/helper.c | 17 ++--------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/target/cris/cpu.h b/target/cris/cpu.h index d3b64929096..be021899ae8 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -185,11 +185,11 @@ struct CRISCPU { =20 #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_cris_cpu; -#endif =20 void cris_cpu_do_interrupt(CPUState *cpu); void crisv10_cpu_do_interrupt(CPUState *cpu); bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif =20 void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags); =20 diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 70932b1f8c7..c2e7483f5bd 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -205,20 +205,20 @@ static const struct SysemuCPUOps cris_sysemu_ops =3D { =20 static const struct TCGCPUOps crisv10_tcg_ops =3D { .initialize =3D cris_initialize_crisv10_tcg, - .cpu_exec_interrupt =3D cris_cpu_exec_interrupt, .tlb_fill =3D cris_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D cris_cpu_exec_interrupt, .do_interrupt =3D crisv10_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ }; =20 static const struct TCGCPUOps crisv32_tcg_ops =3D { .initialize =3D cris_initialize_tcg, - .cpu_exec_interrupt =3D cris_cpu_exec_interrupt, .tlb_fill =3D cris_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D cris_cpu_exec_interrupt, .do_interrupt =3D cris_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/cris/helper.c b/target/cris/helper.c index 911867f3b48..36926faf323 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -41,20 +41,6 @@ =20 #if defined(CONFIG_USER_ONLY) =20 -void cris_cpu_do_interrupt(CPUState *cs) -{ - CRISCPU *cpu =3D CRIS_CPU(cs); - CPUCRISState *env =3D &cpu->env; - - cs->exception_index =3D -1; - env->pregs[PR_ERP] =3D env->pc; -} - -void crisv10_cpu_do_interrupt(CPUState *cs) -{ - cris_cpu_do_interrupt(cs); -} - bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) @@ -287,7 +273,6 @@ hwaddr cris_cpu_get_phys_page_debug(CPUState *cs, vaddr= addr) D(fprintf(stderr, "%s %x -> %x\n", __func__, addr, phy)); return phy; } -#endif =20 bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -319,3 +304,5 @@ bool cris_cpu_exec_interrupt(CPUState *cs, int interrup= t_request) =20 return ret; } + +#endif /* !CONFIG_USER_ONLY */ --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) client-ip=209.85.128.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799791; cv=none; d=zohomail.com; s=zohoarc; b=QdXG2EcgNSNJ9e+GCsjlBtgit5mXlVtNNJhOxsUpnoZNr1Nok4B+ArTocWUyTD+nWH5mRhFPa0nuQq8dplR7oOXKJjjw2Y0aFDGW7DYeS9qEe/O/3QCL34U1pDNpZUkLD7T1PGgCHUGWyEBYETcknBCQ+500/s3djwy6HebCdEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799791; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TN+Zrhaefhs3QjxEX21PjGTtA8lFVaKomYkrzGxUkf0=; b=L4PzQf99wPjlxZDIPoaD/DbfOzATT8jHXLyHt/mhwqxxsBzqbfmpb87/TLY5MXuwUpp0fF1eUWAgYvqcTjbK17+BPecXuNIq75FJPTSPp/dxCkDItAHR/uX5fGJbRnyx3rEPNg9zrBEIAXzZrB9nTvEI+R2IuPjrMxBl7SKJ+Yc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.zohomail.com with SMTPS id 1630799791743783.5811598299225; Sat, 4 Sep 2021 16:56:31 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id z9-20020a7bc149000000b002e8861aff59so2233210wmi.0 for ; Sat, 04 Sep 2021 16:56:31 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id w20sm764545wrg.1.2021.09.04.16.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TN+Zrhaefhs3QjxEX21PjGTtA8lFVaKomYkrzGxUkf0=; b=I7M3mepbjiSkIG0BIQcp/6w/8u0+quQ6gbgdrFnu6LkLzkkpIBWm5QUJYfvsSOGMfJ QAUFAGM2Z4jitnrbO4wAWbcXKiMhTzSw+XQLVUdIT+v5B19AixylKxhSXNtjzHM3b0gC dAPiNRhPPnRvqWNs+MDm6B5WleHiPTEy+McREc4sVqo9beMN7mKe5wAhT8JWa5Bgfzao 95QF7RYmOnhPSjCCJed2hc9m0Ip3kLEe2syG96qBe+0+lJs11ofrv5j8RPYagLuHM52b kMwoUPY8eVWtv9rwLI8gIJVRkJLB3iiSvulPLwwYposqVB6pr/nLenXk2pxJ9IA/dW42 DXNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TN+Zrhaefhs3QjxEX21PjGTtA8lFVaKomYkrzGxUkf0=; b=bSKQsiM66B7t/OGdCbHoKOFn3j7SJ7imDEX/HFsgdcZkXQK8fwm46cq+75bu8MDr/g X/6gn20CzcUFTkpXCl18smBsRLh0KCiJzYAEnWm6fhrDnQQTqs7sGrJfDHUhBISZkqkf j+lvJwN/9ZFDOK/ERa+qneiUTv6IFz7Wu39XN0hT2i9Qv3vLHcfx1GSMkpS2mQcSE1dB u6cdVNagzypGzuznPVU+6WiMR0rSXa1E8K3C+UmVmUQoEf6eymUAGNKcFwCy29AkKmvf 6G9fI9UyQygNRA6gw1ekLDrEFYiQsw70oGHnFz2GlNHU27aMpsVZ7z34OXv3GL+DfWn2 CP5g== X-Gm-Message-State: AOAM530KJE085BnpuNp36p7LQeUj1awZx9dXO9MowkvfjxcFdy1GIjbx hy4Agm/jUtubB5sfcbdDuqs= X-Google-Smtp-Source: ABdhPJzJCg/4VPH5vk5m8WfUjdWWc4RjiN/HoFZaDI3OFfUIA0EA6OkGcVq4297lEkUMvUpiSkgFEA== X-Received: by 2002:a1c:ed13:: with SMTP id l19mr4941636wmh.48.1630799790026; Sat, 04 Sep 2021 16:56:30 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 09/24] target/hppa: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:27 +0200 Message-Id: <20210904235542.1092641-10-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799793812100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/hppa/cpu.h | 4 ++-- target/hppa/cpu.c | 2 +- target/hppa/int_helper.c | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 748270bfa31..7854675b903 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -325,13 +325,13 @@ int cpu_hppa_signal_handler(int host_signum, void *pi= nfo, 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 2eace4ee124..e8edd189bfc 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -144,10 +144,10 @@ static const struct SysemuCPUOps hppa_sysemu_ops =3D { static const struct TCGCPUOps hppa_tcg_ops =3D { .initialize =3D hppa_translate_init, .synchronize_from_tb =3D hppa_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D hppa_cpu_exec_interrupt, .tlb_fill =3D hppa_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D hppa_cpu_exec_interrupt, .do_interrupt =3D hppa_cpu_do_interrupt, .do_unaligned_access =3D hppa_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 349495d3610..13073ae2bda 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 va= l) eval_interrupt(env_archcpu(env)); qemu_mutex_unlock_iothread(); } -#endif /* !CONFIG_USER_ONLY */ =20 void hppa_cpu_do_interrupt(CPUState *cs) { @@ -100,7 +99,6 @@ void hppa_cpu_do_interrupt(CPUState *cs) uint64_t iasq_f =3D env->iasq_f; uint64_t iasq_b =3D env->iasq_b; =20 -#ifndef CONFIG_USER_ONLY target_ureg old_psw; =20 /* As documented in pa2.0 -- interruption handling. */ @@ -187,7 +185,6 @@ void hppa_cpu_do_interrupt(CPUState *cs) env->iaoq_b =3D env->iaoq_f + 4; env->iasq_f =3D 0; env->iasq_b =3D 0; -#endif =20 if (qemu_loglevel_mask(CPU_LOG_INT)) { static const char * const names[] =3D { @@ -248,7 +245,6 @@ void hppa_cpu_do_interrupt(CPUState *cs) =20 bool hppa_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { -#ifndef CONFIG_USER_ONLY HPPACPU *cpu =3D HPPA_CPU(cs); CPUHPPAState *env =3D &cpu->env; =20 @@ -258,6 +254,7 @@ bool hppa_cpu_exec_interrupt(CPUState *cs, int interrup= t_request) hppa_cpu_do_interrupt(cs); return true; } -#endif return false; } + +#endif /* !CONFIG_USER_ONLY */ --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799796; cv=none; d=zohomail.com; s=zohoarc; b=LZxqFDmCIOwy1WthcBwwGZA46psaBpgfJShTt8eS3zZwR255fLwBTohA1pVzmoTHUCr5r0Ai3cO5fiT5xtPeuYVDq0LMFwEF/aUg2ykOKS2VZdczRymexzy7mmK8IZKNJVr8dBmAG7dQyvoy6PLaQSICbIBCw9weI6yDbB4UK9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799796; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ySPqMD9ZyNtG7iqcl+Yn5bN0IEHkMFklgd5QFPSdjlQ=; b=SuOMfXTt2A/GMWsZuvJbI6Ew/CdFO3/ao3xFdrFck6CKyABGeTJhYSQTvpFlDm2Kzul6JOHgRhu3TJ4sADuFjmQIV8geIsI3NyqkUwbKcX0uGvO67lmRpaH9LVXdulq4JxhUoIjxt97Vm/Uz4Vy/9dxwXgNIt2/MRw5T37KR/74= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 163079979663242.098073860924956; Sat, 4 Sep 2021 16:56:36 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id n5so4028377wro.12 for ; Sat, 04 Sep 2021 16:56:36 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id n15sm3419601wrv.48.2021.09.04.16.56.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ySPqMD9ZyNtG7iqcl+Yn5bN0IEHkMFklgd5QFPSdjlQ=; b=kKgIzj/DPKMar9KljMMzuQSjrHa20C21lLIqBZcCe7qNLCTowgHvPgrgGH04PbeKlh Xsaa19MWt1E5XGvDb3dQwe2/Qg8oFDjNY0OO7nWLb6pGu0VC+eaaPZPlSPRtfo9qbnPg UeghxZskgcMyzOFSEiLtzkeSqa1Uqu6F/DQG/y7aiyFZKXUJT6bMu12F7aTnaZ/lFCSZ zOSmB30KV7bdKVIfdXvfbGcOyUT/mKDzJ1D8oM8Wz+YAtFfaFJWkqaztGuj4LbyjEdEO CEyvE5A5p05MZY+Aodb2p8HBNcxeQifiP7Mv9252xAMaG/8Hg0oTmGw9ghZH6ay65w2H lTQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ySPqMD9ZyNtG7iqcl+Yn5bN0IEHkMFklgd5QFPSdjlQ=; b=lRzNRLN2L84cFQp8x98Dx+tXG2KMF4kzaLLfxRXYq8XRhaqBxkv0hZEnCKBw9ahjcg LdjaKtvaFTPza/i5yvqrW5QLd+XczKXfaXvlbibyIA8CFAYpFK2KpkgsD1fyasOyfBUN UyBDboLhtnYQQjRQiivftUmeieuRezo3PBoXqKi02vIj++1fiTFHFsxfPB99CEYUnpEl wbL/lNt/Sr1ekdz8D1y1+lWfKHpW1zGWPyl8FDszccWnnBCDzI9YdbcOEUpWgLEiU0Hj udDRCeTpkg0VGU0cBeDvJyOHugyMTqalPf/fwM74tr8ipTAMCwt1SvIp1Lfe77A2OIDi 2erw== X-Gm-Message-State: AOAM532YecG4XejS0A3322Hj5pD3Uv3BME6tFlY4my17tudeuSvaA6aV pH0G/eVDAoa6GwuukSPV3+E= X-Google-Smtp-Source: ABdhPJz9YkZVUxalA3avtcO2LlGECaBQwd6HoLe8UGG7af86yk+/NpV0RisAjcq5R6qEKP89UJcPuA== X-Received: by 2002:adf:9ccc:: with SMTP id h12mr5580036wre.385.1630799794865; Sat, 04 Sep 2021 16:56:34 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 10/24] target/i386: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:28 +0200 Message-Id: <20210904235542.1092641-11-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799798023100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/tcg/helper-tcg.h | 2 ++ target/i386/tcg/seg_helper.c | 10 ++-------- target/i386/tcg/tcg-cpu.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 2510cc244e9..60ca09e95eb 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -38,7 +38,9 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_S= PACE_BITS); * @cpu: vCPU the interrupt is to be handled by. */ void x86_cpu_do_interrupt(CPUState *cpu); +#ifndef CONFIG_USER_ONLY bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif =20 /* helper.c */ bool x86_cpu_tlb_fill(CPUState *cs, vaddr address, int size, diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index dee7bef68c6..13c6e6ee62e 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -1110,6 +1110,7 @@ void do_interrupt_x86_hardirq(CPUX86State *env, int i= ntno, int is_hw) do_interrupt_all(env_archcpu(env), intno, 0, 0, 0, is_hw); } =20 +#ifndef CONFIG_USER_ONLY bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { X86CPU *cpu =3D X86_CPU(cs); @@ -1125,23 +1126,17 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int inter= rupt_request) * This is required to make icount-driven execution deterministic. */ switch (interrupt_request) { -#if !defined(CONFIG_USER_ONLY) case CPU_INTERRUPT_POLL: cs->interrupt_request &=3D ~CPU_INTERRUPT_POLL; apic_poll_irq(cpu->apic_state); break; -#endif case CPU_INTERRUPT_SIPI: do_cpu_sipi(cpu); break; case CPU_INTERRUPT_SMI: cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0, 0); cs->interrupt_request &=3D ~CPU_INTERRUPT_SMI; -#ifdef CONFIG_USER_ONLY - cpu_abort(CPU(cpu), "SMI interrupt: cannot enter SMM in user-mode"= ); -#else do_smm_enter(cpu); -#endif /* CONFIG_USER_ONLY */ break; case CPU_INTERRUPT_NMI: cpu_svm_check_intercept_param(env, SVM_EXIT_NMI, 0, 0); @@ -1162,7 +1157,6 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interru= pt_request) "Servicing hardware INT=3D0x%02x\n", intno); do_interrupt_x86_hardirq(env, intno, 1); break; -#if !defined(CONFIG_USER_ONLY) case CPU_INTERRUPT_VIRQ: /* FIXME: this should respect TPR */ cpu_svm_check_intercept_param(env, SVM_EXIT_VINTR, 0, 0); @@ -1173,12 +1167,12 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int inter= rupt_request) do_interrupt_x86_hardirq(env, intno, 1); cs->interrupt_request &=3D ~CPU_INTERRUPT_VIRQ; break; -#endif } =20 /* Ensure that no TB jump will be modified as the program flow was cha= nged. */ return true; } +#endif /* CONFIG_USER_ONLY */ =20 void helper_lldt(CPUX86State *env, int selector) { diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 04c35486a2f..3ecfae34cb5 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -72,12 +72,12 @@ static const struct TCGCPUOps x86_tcg_ops =3D { .synchronize_from_tb =3D x86_cpu_synchronize_from_tb, .cpu_exec_enter =3D x86_cpu_exec_enter, .cpu_exec_exit =3D x86_cpu_exec_exit, - .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, .tlb_fill =3D x86_cpu_tlb_fill, #ifdef CONFIG_USER_ONLY .fake_user_interrupt =3D x86_cpu_do_interrupt, #else .do_interrupt =3D x86_cpu_do_interrupt, + .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, .debug_excp_handler =3D breakpoint_handler, .debug_check_breakpoint =3D x86_debug_check_breakpoint, #endif /* !CONFIG_USER_ONLY */ --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) client-ip=209.85.221.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799801; cv=none; d=zohomail.com; s=zohoarc; b=F/0XQWaRHK2298IrBOlV5hvqmfHtIowoz3uxCFn+IeqQ9tG3O/HKbkiOOQjwqXExUY9fEub+EHE8s0gfXKyMTeFzG2zIGBXuJyxM8KISLoNLkeip0xTsBrNRI9r8TCYyYxg6xAknczYJj9W7uUAKrdE6Djg8sKgTddXriaxoEw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799801; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=++sCcKA+nb4t/Nwj9iAwDTLzoK2jI2fRSX4bKx1OpXQ=; b=LQWDNL6rEXVu8jot+PHoe4x9To0dFXLXpDMSYnZNYJhE6CBB5jlJdPIMeRGKu0JEyBsy8xFbyY8w+6I5Md2wsbronrOJvPOhZVZmRxS1zf3TsIlzarIa47D7JQofxsO+fAXTTAHhhgsC6l3DAXz8dO82rSxDWMkVHJ+aGDb/YbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.zohomail.com with SMTPS id 1630799801919485.14739401093925; Sat, 4 Sep 2021 16:56:41 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id i6so4079538wrv.2 for ; Sat, 04 Sep 2021 16:56:41 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id m11sm3413261wrz.28.2021.09.04.16.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=++sCcKA+nb4t/Nwj9iAwDTLzoK2jI2fRSX4bKx1OpXQ=; b=mYoSEWPgkoorG8HIY3kec2j3PAL39cn2XiaY1EaCcIlsVZ8D4ySR9Rq7dQoJt5qqFY LhghVxLaX3a4+o+IfIyPvwuw2t0nMNS2+LDh7Sx6Q6wfvFihCgrK1n6h1sBqCEdfII29 Sph5z9DhoB3cxjrkFWjBSJP8DFqhflfrwga6V5dwxkSLlArznIg0e0aLbRcW6yni/wt2 iSRwbn8aG6e1n9UDKtO+spQ+jrbHZSMsPyiYQnmBQGqnJLd5RqCRuj9eIrYnR5WWsNRe VDWQcJ9i9/aGrqtl+XIem+x+ge3ebaj6IvAC4Ow+1DLjBn1W3SMb7wnCUmEfKvajvVe/ Qhiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=++sCcKA+nb4t/Nwj9iAwDTLzoK2jI2fRSX4bKx1OpXQ=; b=Rq1Jw/ZUUs1Q1YuiJehewF9vWQzQ+UnNtDQAVBf7DsIrEoVSwX0NOXnEneo5gWRUhm wqXlYuO7sMQIjaRphvQIGd8LZ3XtrgWHu4HIF66x62QqDEaxmvrSZHt2Ds9tMOG9t1t0 IfLu+Q4ua8am2UodLNUBat8rwX8DSqRebf+bfL3+/xm6hkklANWSpe8UycHcYDJXfPby FibXBbhrzmsGve1yd87U7ORFR4kU7C5lUUM/S80f1PX4eB5sgcCvEjWOYgBI4WNfzyAW BAR3iSDF66XF1DPeeJH4ulo7II4tdmgY24fD2A9JDANFzR1iCu4VXKMZo1/b9KnmpKOZ Upzg== X-Gm-Message-State: AOAM530O7Hj9yHMgMhAoDGkfJ/KRxw0m+v+mnSm8i4mDH1b1iaAYqJiR krrxSlgOy+JBgFeovNRtO1c= X-Google-Smtp-Source: ABdhPJzZ/xlnRBdj+AGz06EWxEZSL4moXQCbJlYE0W4qjodP6NiWIwpXv426O4BwRbwloW00muMdPg== X-Received: by 2002:adf:c44b:: with SMTP id a11mr5860809wrg.416.1630799800176; Sat, 04 Sep 2021 16:56:40 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 11/24] target/i386: Move x86_cpu_exec_interrupt() under sysemu/ folder Date: Sun, 5 Sep 2021 01:55:29 +0200 Message-Id: <20210904235542.1092641-12-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799804068100001 Following the logic of commit 30493a030ff ("i386: split seg_helper into user-only and sysemu parts"), move x86_cpu_exec_interrupt() under sysemu/seg_helper.c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-By: Warner Losh Reviewed-by: Richard Henderson --- I prefer to not squash this into the previous patch because the ifdef'ry removal (in previous patch) is not trivial IMO. --- target/i386/tcg/seg_helper.c | 64 ---------------------------- target/i386/tcg/sysemu/seg_helper.c | 65 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 64 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 13c6e6ee62e..baa905a0cd6 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -1110,70 +1110,6 @@ void do_interrupt_x86_hardirq(CPUX86State *env, int = intno, int is_hw) do_interrupt_all(env_archcpu(env), intno, 0, 0, 0, is_hw); } =20 -#ifndef CONFIG_USER_ONLY -bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) -{ - X86CPU *cpu =3D X86_CPU(cs); - CPUX86State *env =3D &cpu->env; - int intno; - - interrupt_request =3D x86_cpu_pending_interrupt(cs, interrupt_request); - if (!interrupt_request) { - return false; - } - - /* Don't process multiple interrupt requests in a single call. - * This is required to make icount-driven execution deterministic. - */ - switch (interrupt_request) { - case CPU_INTERRUPT_POLL: - cs->interrupt_request &=3D ~CPU_INTERRUPT_POLL; - apic_poll_irq(cpu->apic_state); - break; - case CPU_INTERRUPT_SIPI: - do_cpu_sipi(cpu); - break; - case CPU_INTERRUPT_SMI: - cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0, 0); - cs->interrupt_request &=3D ~CPU_INTERRUPT_SMI; - do_smm_enter(cpu); - break; - case CPU_INTERRUPT_NMI: - cpu_svm_check_intercept_param(env, SVM_EXIT_NMI, 0, 0); - cs->interrupt_request &=3D ~CPU_INTERRUPT_NMI; - env->hflags2 |=3D HF2_NMI_MASK; - do_interrupt_x86_hardirq(env, EXCP02_NMI, 1); - break; - case CPU_INTERRUPT_MCE: - cs->interrupt_request &=3D ~CPU_INTERRUPT_MCE; - do_interrupt_x86_hardirq(env, EXCP12_MCHK, 0); - break; - case CPU_INTERRUPT_HARD: - cpu_svm_check_intercept_param(env, SVM_EXIT_INTR, 0, 0); - cs->interrupt_request &=3D ~(CPU_INTERRUPT_HARD | - CPU_INTERRUPT_VIRQ); - intno =3D cpu_get_pic_interrupt(env); - qemu_log_mask(CPU_LOG_TB_IN_ASM, - "Servicing hardware INT=3D0x%02x\n", intno); - do_interrupt_x86_hardirq(env, intno, 1); - break; - case CPU_INTERRUPT_VIRQ: - /* FIXME: this should respect TPR */ - cpu_svm_check_intercept_param(env, SVM_EXIT_VINTR, 0, 0); - intno =3D x86_ldl_phys(cs, env->vm_vmcb - + offsetof(struct vmcb, control.int_vector)); - qemu_log_mask(CPU_LOG_TB_IN_ASM, - "Servicing virtual hardware INT=3D0x%02x\n", intno); - do_interrupt_x86_hardirq(env, intno, 1); - cs->interrupt_request &=3D ~CPU_INTERRUPT_VIRQ; - break; - } - - /* Ensure that no TB jump will be modified as the program flow was cha= nged. */ - return true; -} -#endif /* CONFIG_USER_ONLY */ - void helper_lldt(CPUX86State *env, int selector) { SegmentCache *dt; diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/s= eg_helper.c index 82c0856c417..b425b930f9d 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -125,6 +125,71 @@ void x86_cpu_do_interrupt(CPUState *cs) } } =20 +bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) +{ + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; + int intno; + + interrupt_request =3D x86_cpu_pending_interrupt(cs, interrupt_request); + if (!interrupt_request) { + return false; + } + + /* + * Don't process multiple interrupt requests in a single call. + * This is required to make icount-driven execution deterministic. + */ + switch (interrupt_request) { + case CPU_INTERRUPT_POLL: + cs->interrupt_request &=3D ~CPU_INTERRUPT_POLL; + apic_poll_irq(cpu->apic_state); + break; + case CPU_INTERRUPT_SIPI: + do_cpu_sipi(cpu); + break; + case CPU_INTERRUPT_SMI: + cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0, 0); + cs->interrupt_request &=3D ~CPU_INTERRUPT_SMI; + do_smm_enter(cpu); + break; + case CPU_INTERRUPT_NMI: + cpu_svm_check_intercept_param(env, SVM_EXIT_NMI, 0, 0); + cs->interrupt_request &=3D ~CPU_INTERRUPT_NMI; + env->hflags2 |=3D HF2_NMI_MASK; + do_interrupt_x86_hardirq(env, EXCP02_NMI, 1); + break; + case CPU_INTERRUPT_MCE: + cs->interrupt_request &=3D ~CPU_INTERRUPT_MCE; + do_interrupt_x86_hardirq(env, EXCP12_MCHK, 0); + break; + case CPU_INTERRUPT_HARD: + cpu_svm_check_intercept_param(env, SVM_EXIT_INTR, 0, 0); + cs->interrupt_request &=3D ~(CPU_INTERRUPT_HARD | + CPU_INTERRUPT_VIRQ); + intno =3D cpu_get_pic_interrupt(env); + qemu_log_mask(CPU_LOG_TB_IN_ASM, + "Servicing hardware INT=3D0x%02x\n", intno); + do_interrupt_x86_hardirq(env, intno, 1); + break; + case CPU_INTERRUPT_VIRQ: + /* FIXME: this should respect TPR */ + cpu_svm_check_intercept_param(env, SVM_EXIT_VINTR, 0, 0); + intno =3D x86_ldl_phys(cs, env->vm_vmcb + + offsetof(struct vmcb, control.int_vector)); + qemu_log_mask(CPU_LOG_TB_IN_ASM, + "Servicing virtual hardware INT=3D0x%02x\n", intno); + do_interrupt_x86_hardirq(env, intno, 1); + cs->interrupt_request &=3D ~CPU_INTERRUPT_VIRQ; + break; + } + + /* + * Ensure that no TB jump will be modified as the program flow was cha= nged. + */ + return true; +} + /* check if Port I/O is allowed in TSS */ void helper_check_io(CPUX86State *env, uint32_t addr, uint32_t size) { --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) client-ip=209.85.221.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799806; cv=none; d=zohomail.com; s=zohoarc; b=DxHn+JSBHMrLFCIzgmWJk8rAyetaC9wTaPkahDaWzYv7T0j+AWjDmYBoYg9jKP0fRJw8QOqzJdWf53i4hqXHzb36tGQBG96gigUN/o8hYVIZ7TxQ+YDmcCAz7k59REv0zrs1+Ovc2Miq4hq2OHa9GAk17EokGdJVb3UCm0F9x8A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799806; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H6+WFk4l4QrgCDS0Vj4M4XW6RAkhPWPQKWOhbJqzIFQ=; b=Gs8NMonS2GogzgUF9F8WJ+qNlk1GxJB9QtoLvgzptpTiye7r420srcbQ0uDpnbPMTN1RIow7p1GEDYrOPfEboDbrS/fWJZPENa9luJhY31/qB3JVOvuWXaaNQv6ej7MIbqB2fjcP0Rgx7wlK4msp3hJHYD8wA3JVQIhQVoc+a/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.zohomail.com with SMTPS id 1630799806803398.02565752023884; Sat, 4 Sep 2021 16:56:46 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id x6so4022557wrv.13 for ; Sat, 04 Sep 2021 16:56:46 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id z2sm3046403wma.45.2021.09.04.16.56.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H6+WFk4l4QrgCDS0Vj4M4XW6RAkhPWPQKWOhbJqzIFQ=; b=hbU8NdPOKuAtywimJn30ouhXovYZvTq6qfIjhkiFk3kE2kOUGi6x8/wWrmLBv9rKe+ Kt9Qp7aoZlq+uRskpiDobrQPHkzm5rrHnY2zMD05jNHTUeAu4cYBsrJbPSj465Xdbn5Y Iq0nRNZ51GH8Rf298OIjqVY+CqPi4jDrbokySKoqKYp4WzcEpmCkANAJXmvLfu62d9uU ypKg4y+EQL8jM8Kz3iwr9CVElrscr0vhE5XOdjO4pFTBkOSx0TJp/xyKWNBWuWlbittH z1GnI9U7uXap+cZcXaK9K+4eTUZkfFaR0tsPiRkEQryyBIUPmg70uH+I861qGzjSugph ZBGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=H6+WFk4l4QrgCDS0Vj4M4XW6RAkhPWPQKWOhbJqzIFQ=; b=Me/rK2oIs6r11+K6EmzdBitVSTZYukO9N7yLT0vNuYu9F4MTVn99OfYPQRt59OVNVg eRS60nLFVu476mPrxbZcxfr0Kzzmel8gG4UQ5fJXxnZxQuybaIFwRk9OIP7fx/ZeMsaq so0ssUf0gu/TRzn+6uzzb5ZLo18ZHCoFmIoImzml5neaqFYqkKcohHuuiXI2J6z9tG7H BZ3GF2ic2KtttriVU/1yD8L2QBBCZ2/D3DlYd1WmOgK5wndUiLLNvfLTw6oeY442OhXz qHECV5COaASNpFI+e2ElfV3z0X/H34v1sUitwWpgphdZ4yaY1nPAXkE1cNG4XtSqdBsj 9GHg== X-Gm-Message-State: AOAM531iuLWn6i819KMxV2eUhYtKwUmStmwJxh+tw9DAp5JAkYK3nJKI OH+j++9xJtqkTtV6/X6JZcY= X-Google-Smtp-Source: ABdhPJxYFoWP0toe9NKUAlrnZjPVilbOaa7Tj/sMpOC8QiHSJsvIXOobRLbkIbxv/WDGcn+nu4pf/Q== X-Received: by 2002:a5d:63ca:: with SMTP id c10mr5950991wrw.16.1630799805136; Sat, 04 Sep 2021 16:56:45 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 12/24] target/m68k: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:30 +0200 Message-Id: <20210904235542.1092641-13-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799808241100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 2 +- target/m68k/op_helper.c | 16 +++------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 997d588911c..550eb028b6e 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -166,8 +166,10 @@ struct M68kCPU { }; =20 =20 +#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 72de6e97262..66d22d11895 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -515,10 +515,10 @@ static const struct SysemuCPUOps m68k_sysemu_ops =3D { =20 static const struct TCGCPUOps m68k_tcg_ops =3D { .initialize =3D m68k_tcg_init, - .cpu_exec_interrupt =3D m68k_cpu_exec_interrupt, .tlb_fill =3D m68k_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D m68k_cpu_exec_interrupt, .do_interrupt =3D m68k_cpu_do_interrupt, .do_transaction_failed =3D m68k_cpu_transaction_failed, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index d006d1cb3ea..5d624838ae6 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" =20 -#if defined(CONFIG_USER_ONLY) - -void m68k_cpu_do_interrupt(CPUState *cs) -{ - cs->exception_index =3D -1; -} - -static inline void do_interrupt_m68k_hardirq(CPUM68KState *env) -{ -} - -#else +#if !defined(CONFIG_USER_ONLY) =20 static void cf_rte(CPUM68KState *env) { @@ -516,7 +505,6 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr p= hysaddr, vaddr addr, cpu_loop_exit(cs); } } -#endif =20 bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -538,6 +526,8 @@ bool m68k_cpu_exec_interrupt(CPUState *cs, int interrup= t_request) return false; } =20 +#endif /* !CONFIG_USER_ONLY */ + static void raise_exception_ra(CPUM68KState *env, int tt, uintptr_t raddr) { CPUState *cs =3D env_cpu(env); --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) client-ip=209.85.128.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799812; cv=none; d=zohomail.com; s=zohoarc; b=W3YbFTPKdnbICyCLY3EeO32ctKiAvhjq0V0wczTl5nBvH2yUf5+o8WapOExpeTx1w86so4/Td6q4tg/byg9KGjtXy5PjsXi/8MHr312SqvnmLWWs7ZyCYH3wRFR4P6cza8ZTzbd+as/ofIsg6iR0LTdpEbR6pHaf9Amn0BYl1xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799812; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rO0D2OFkHiHdtobaxK4sUMpGxbIKEwY3AB/t5R4+r5g=; b=V8YJPK/zTsLCY2pLrIMYraEfOagmgftx4syPSaz0SBhMHGgAc6zOQcK18ZPppNa+UQdMP1mYXiABqx5ikI8AUlNKqs2zv1A0vURr3QxZb3QGaW9JdRVBzjLRZYKEpfoXerYBN7okK94nBqCID73FYJPo2xfjyg62ijRj2JS97oM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.zohomail.com with SMTPS id 163079981202295.96453839525964; Sat, 4 Sep 2021 16:56:52 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id g138so1885141wmg.4 for ; Sat, 04 Sep 2021 16:56:51 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id f17sm3959699wrt.63.2021.09.04.16.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rO0D2OFkHiHdtobaxK4sUMpGxbIKEwY3AB/t5R4+r5g=; b=SZqhicDPnz72V/kqSkLbym42y7rDf6RKaugmlKvPH3OMF7MlF3tmXI5mauBIWU1YVB 1/GOh5TOxc/Me7wjELL9ZHDhXUnbYBQiyAxLxNo2Nf+mQNRvz6NyLSKbw13ROw6Jw4u3 +hCFDw4WXj+5Tj3oj/RuixZ2qLA5vSuWt7b78x91mAmnh6La3Nf0QC02tiIRpKW92JHp TJz+ChXAsAYAjZZ7QM4Kzjt4Mmev0nIG4Q1Zlnft4WmxKSbGu0bYycBpMksqe1M8KFJL 2fIhb0FzE6Dr29/ypwWbIoqqqgS4Ckz9x/xuEFzjiG7q0dQd8kClMKTT6lCILhkn7DEj faww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rO0D2OFkHiHdtobaxK4sUMpGxbIKEwY3AB/t5R4+r5g=; b=Fmfc50ZwFDepTUvKWy+YWG2CwjqhpipKepp7b0dLWNQs00T+0KfrW1GVSUWb44LU1a /Sa5HRjIILK0PMNHqrBJXdKSwKa6PZnOe5EZ6Uw0Awcplhry6ysfTr12p6f6ALHxU7Hg HtavPVRTG7w9DsfbDWQAHATsIaRAwNAViIZ/r03ErYBd04xODNEa6n64YnJ9KJOgJkEX 53ehfuk+YT2f+4wugvfRnFZErIGAqgK1fZcs/Em6hZ/6+elZqtBj/quRrsxXYJciCQOP zWoMLS94S/3qz5XNdxQgyegKv8N+KYxNq3hVeRv0be23tP9jkIyGV0OuwM2bneTsEsdC tjyA== X-Gm-Message-State: AOAM532gBmSmMDFV6msf4meg5KDhOWHuwXzOzt2KSRmSGT5bSl1cm7tb p/PDzZh8iY2gVU5wn0mVY6I= X-Google-Smtp-Source: ABdhPJxYe5B8DZmeQjNPFDIDOP6tXaPwbTpmhmE1M62XIe3LsWF136A6IHJqvEqq97NqsOWQen73JA== X-Received: by 2002:a1c:318b:: with SMTP id x133mr4951188wmx.191.1630799810346; Sat, 04 Sep 2021 16:56:50 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 13/24] target/microblaze: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:31 +0200 Message-Id: <20210904235542.1092641-14-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799814234100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/cpu.h | 2 ++ target/microblaze/cpu.c | 2 +- target/microblaze/helper.c | 13 ++----------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index e4bba8a7551..40401c33b72 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -355,8 +355,10 @@ struct MicroBlazeCPU { }; =20 =20 +#ifndef CONFIG_USER_ONLY void mb_cpu_do_interrupt(CPUState *cs); bool mb_cpu_exec_interrupt(CPUState *cs, int int_req); +#endif /* !CONFIG_USER_ONLY */ void mb_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 72d8f2a0daa..15db277925f 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -365,10 +365,10 @@ static const struct SysemuCPUOps mb_sysemu_ops =3D { static const struct TCGCPUOps mb_tcg_ops =3D { .initialize =3D mb_tcg_init, .synchronize_from_tb =3D mb_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D mb_cpu_exec_interrupt, .tlb_fill =3D mb_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D mb_cpu_exec_interrupt, .do_interrupt =3D mb_cpu_do_interrupt, .do_transaction_failed =3D mb_cpu_transaction_failed, .do_unaligned_access =3D mb_cpu_do_unaligned_access, diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 20dbd673136..dd2aecd1d58 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -26,16 +26,6 @@ =20 #if defined(CONFIG_USER_ONLY) =20 -void mb_cpu_do_interrupt(CPUState *cs) -{ - MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); - CPUMBState *env =3D &cpu->env; - - cs->exception_index =3D -1; - env->res_addr =3D RES_ADDR_NONE; - env->regs[14] =3D env->pc; -} - bool mb_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) @@ -271,7 +261,6 @@ hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cs, v= addr addr, =20 return paddr; } -#endif =20 bool mb_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -289,6 +278,8 @@ bool mb_cpu_exec_interrupt(CPUState *cs, int interrupt_= request) return false; } =20 +#endif /* !CONFIG_USER_ONLY */ + void mb_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) client-ip=209.85.128.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799817; cv=none; d=zohomail.com; s=zohoarc; b=bF9H7iQx1etQlEJLWk55vjC/nJZL2WyTDphU7Qwwh9dv1QdkB1zs8K04mUw/hq7IKAxnMugVnzqXO71Upq0xRMbLtmGM9s+rUWb8HNxP0d9pa4jph/RmwTwQ0/I2o7uHUrWbmcP0YLbcSaSqwbETPTZ6lh0vRKOjuGmbFJimzX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799817; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oAm0Jcp7Dg3eAE8iWKGhR4SrU9JkFdpvVtk43FQam+A=; b=NQNAE3TfEIPhugHCsSrQNfrajO9APyiTiubER4J+WUin6P5amWr43y/UIIyM+biPlBVmchZ6heS4LyFJuRoN1lRMFRXgTXhDivjZkFqXjcEWWV+ucX8xTYYwhYUwkLnFscYJd8GA9B5eym0l3RyB8ik+NagchaiRwCCU3CGlzn8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.zohomail.com with SMTPS id 1630799816951823.9221895566839; Sat, 4 Sep 2021 16:56:56 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id x2-20020a1c7c02000000b002e6f1f69a1eso2183738wmc.5 for ; Sat, 04 Sep 2021 16:56:56 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id n5sm3159991wmd.29.2021.09.04.16.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oAm0Jcp7Dg3eAE8iWKGhR4SrU9JkFdpvVtk43FQam+A=; b=cXIDF3odHta0j0Fzb1PYK5RpFFANHq8rGgYAhVIzgw61xVTpP4d2oeuc8+QiGeqYsY +ciVZHr4+1JFIQXj9Blw52DxB5fQQZeI+vEfST8RHNo83EM1wRa5JMLCuilM7mmzJDFe a3rvhS4MDfnG2km7hgWF2hWX3BitCVCOMcMZww/8SSGomvgDhQJ856QyIi8VB8JXha8h XD+4xnDWKOhpHwVpb6SfwBFmk73F1uH7gWINyeLrZ8dr6hsecy7FbTZGqF9ClOXEtC1X 07oa3Ua2no+vV/SueeHrIjSeyNliLUKfmTW27AGL2DFN++yglX6dciQ9fMtbsVuYDdkl HF/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oAm0Jcp7Dg3eAE8iWKGhR4SrU9JkFdpvVtk43FQam+A=; b=Z5O/BbfxuTvKCas2C04phgXVDNCYA/UUUcubBFrKDGrdvi1t/DwfRjvUqH2+s8AzJT h4oe6VddmwA02QkJHavvrqK+dmvgc/aZKH24nL7XB59h96l3QH0SxVq4vQkCEqngmVfm qbuEf3tVPnmMH/sOjamxzexl3l5kfbYgrOheRwRPh7t81iA7vWUfWJtu51TvD4oynvSi qaSF4dD7Z9k52tKCBoMbJSBSSVCc0hp0/AvTi/YlI525HXZHNsVghVekpaew6PB7TBbu ZqLLPcUMaZc8+x3eGht02HNLgL2dfzW4lhsQi5EC0of2/3TbjuuIWWv4GNN+RLEpNO69 kpaQ== X-Gm-Message-State: AOAM532IMEg8vAbxJ5gaAx346XKTOw5AZnrlkiZTepptD3gaHqGCzmRb Lp2F2esVgfJiIyMcG5uQ7Kw= X-Google-Smtp-Source: ABdhPJxWAlrL7Vc/PGlHggj/SXnh19x34VG28FDVGTn4aPuDqdeF7n/49VNgn89Q8aJtB1cB5nRm4g== X-Received: by 2002:a1c:1b10:: with SMTP id b16mr4782389wmb.194.1630799815248; Sat, 04 Sep 2021 16:56:55 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 14/24] target/mips: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:32 +0200 Message-Id: <20210904235542.1092641-15-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799818385100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/tcg-internal.h | 5 +++-- target/mips/cpu.c | 2 +- target/mips/tcg/exception.c | 18 ------------------ target/mips/tcg/sysemu/tlb_helper.c | 18 ++++++++++++++++++ target/mips/tcg/user/tlb_helper.c | 5 ----- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h index 81b14eb219e..c7a77ddccdd 100644 --- a/target/mips/tcg/tcg-internal.h +++ b/target/mips/tcg/tcg-internal.h @@ -18,8 +18,6 @@ void mips_tcg_init(void); =20 void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb= ); -void mips_cpu_do_interrupt(CPUState *cpu); -bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req); bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); @@ -41,6 +39,9 @@ static inline void QEMU_NORETURN do_raise_exception(CPUMI= PSState *env, =20 #if !defined(CONFIG_USER_ONLY) =20 +void mips_cpu_do_interrupt(CPUState *cpu); +bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req); + void mmu_init(CPUMIPSState *env, const mips_def_t *def); =20 void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagema= sk); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index d426918291a..00e0c55d0e4 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -539,10 +539,10 @@ static const struct SysemuCPUOps mips_sysemu_ops =3D { static const struct TCGCPUOps mips_tcg_ops =3D { .initialize =3D mips_tcg_init, .synchronize_from_tb =3D mips_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D mips_cpu_exec_interrupt, .tlb_fill =3D mips_cpu_tlb_fill, =20 #if !defined(CONFIG_USER_ONLY) + .cpu_exec_interrupt =3D mips_cpu_exec_interrupt, .do_interrupt =3D mips_cpu_do_interrupt, .do_transaction_failed =3D mips_cpu_do_transaction_failed, .do_unaligned_access =3D mips_cpu_do_unaligned_access, diff --git a/target/mips/tcg/exception.c b/target/mips/tcg/exception.c index 4fb8b00711d..7b3026b105b 100644 --- a/target/mips/tcg/exception.c +++ b/target/mips/tcg/exception.c @@ -86,24 +86,6 @@ void mips_cpu_synchronize_from_tb(CPUState *cs, const Tr= anslationBlock *tb) env->hflags |=3D tb->flags & MIPS_HFLAG_BMASK; } =20 -bool mips_cpu_exec_interrupt(CPUState *cs, int interrupt_request) -{ - if (interrupt_request & CPU_INTERRUPT_HARD) { - MIPSCPU *cpu =3D MIPS_CPU(cs); - CPUMIPSState *env =3D &cpu->env; - - if (cpu_mips_hw_interrupts_enabled(env) && - cpu_mips_hw_interrupts_pending(env)) { - /* Raise it */ - cs->exception_index =3D EXCP_EXT_INTERRUPT; - env->error_code =3D 0; - mips_cpu_do_interrupt(cs); - return true; - } - } - return false; -} - static const char * const excp_names[EXCP_LAST + 1] =3D { [EXCP_RESET] =3D "reset", [EXCP_SRESET] =3D "soft reset", diff --git a/target/mips/tcg/sysemu/tlb_helper.c b/target/mips/tcg/sysemu/t= lb_helper.c index a150a014ec1..73254d19298 100644 --- a/target/mips/tcg/sysemu/tlb_helper.c +++ b/target/mips/tcg/sysemu/tlb_helper.c @@ -1339,6 +1339,24 @@ void mips_cpu_do_interrupt(CPUState *cs) cs->exception_index =3D EXCP_NONE; } =20 +bool mips_cpu_exec_interrupt(CPUState *cs, int interrupt_request) +{ + if (interrupt_request & CPU_INTERRUPT_HARD) { + MIPSCPU *cpu =3D MIPS_CPU(cs); + CPUMIPSState *env =3D &cpu->env; + + if (cpu_mips_hw_interrupts_enabled(env) && + cpu_mips_hw_interrupts_pending(env)) { + /* Raise it */ + cs->exception_index =3D EXCP_EXT_INTERRUPT; + env->error_code =3D 0; + mips_cpu_do_interrupt(cs); + return true; + } + } + return false; +} + void r4k_invalidate_tlb(CPUMIPSState *env, int idx, int use_extra) { CPUState *cs =3D env_cpu(env); diff --git a/target/mips/tcg/user/tlb_helper.c b/target/mips/tcg/user/tlb_h= elper.c index b835144b820..210c6d529ef 100644 --- a/target/mips/tcg/user/tlb_helper.c +++ b/target/mips/tcg/user/tlb_helper.c @@ -57,8 +57,3 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int s= ize, raise_mmu_exception(env, address, access_type); do_raise_exception_err(env, cs->exception_index, env->error_code, reta= ddr); } - -void mips_cpu_do_interrupt(CPUState *cs) -{ - cs->exception_index =3D EXCP_NONE; -} --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799822; cv=none; d=zohomail.com; s=zohoarc; b=n4auDC9ZhB2SQGMMKDpYeor/h1tGvL+Am5c4Xmxdr/HnFW7WxkIzsDggsHbhy/2fEUlBXvNTZGU8yKLSCgTEXrwJJZ2JOlSap+kw/faQJPBMsO0bLoqub+9XSDVSVeCA7tHIq8ADjSSqQuU1lAiUqFqEyCo7GXgp+HSF/7nzGGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799822; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=J5rx4TkBW8G8gScO08U1pK8zY4A0mljSOlfasCw3q/k=; b=FD/tCMpk38KUY9uLK5oLVqYCbKdGNZeek6vpGs5Qe0bbjAzo/05E0KWyeSzpnPWrqZ1mFl1Hxnkcp8eLr2ukI5fj7tPiwdy77Z3EkoZ6c6nEkucXmwZ5WMqi1Qzro077ctoQkImgPL6f/F7DVe37EEZgEyj+owyRY0nbj7SvB/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1630799822104248.61585335702955; Sat, 4 Sep 2021 16:57:02 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id x2-20020a1c7c02000000b002e6f1f69a1eso2183815wmc.5 for ; Sat, 04 Sep 2021 16:57:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id n5sm3160143wmd.29.2021.09.04.16.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J5rx4TkBW8G8gScO08U1pK8zY4A0mljSOlfasCw3q/k=; b=AuyheoyuZazP4kI2PH8GHsJRYkHleeKG5b2oDvmrET7f/peL3y/JDPbzr/c6/ZHve+ dWfdDDhXm16yxcu0kWFxbkX99rCJcObxiNEzMnimVStG6Jgkj8dwY1hYJahtaHUXYria A+TvaIOl7aln4AGDI9S4DKdBCNpyZ90pgCQkuC8ioZXOchRLYUs0pW74Iq10fmB7Ktu7 u0tkVp50ob3vmiO6GxmV9wEOaO6z+gKnQqfLkisgeXbuY2C16o+Z4/sDb1Nkt42ySn72 Y85UkcQP20Fitb5Cw4tJsr9Ke6xBNpOZNKOJMHtk/sviaCkfosg6wU7SibopghwoFsDe mSGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=J5rx4TkBW8G8gScO08U1pK8zY4A0mljSOlfasCw3q/k=; b=P+brU1uhwNA5m0T2EingwHjNDIXaUHJjfKduJCaf2CfCxfRLw/uOW89rFjE1lM0ihb 29s4C4nN1EzR6qOtly/6UF8gEjXZNl9YaugV1/isfK/cqfpPplQ076RPoEhIqdw2uNGY E9T66vtS9FY/TaCulL5kkhhlsCwdj9s5YmgNxUmC1egxWGa89CY+y6QkkyQ7IQjci1xG 79v32a6G6sLZPCAOMHFRL4zsTqOcOtZqUl6DxBXdMBnnUCGxBBQSS/8lnXyzOcEVlfX2 W8tAnZfTIF8DMG1Y4v2TNiLWg8ivIAoA5Uig5mGlH9QS0bnBDt2NSg63pvVC/XC9zIOl HF+g== X-Gm-Message-State: AOAM532S4fTtch5gdPI0LdwCJp6COGxe6xU8XFJ4hpOawClEMJtJPF0z 8C+qTlRmuCCNho80s5Nig7I= X-Google-Smtp-Source: ABdhPJzfbV1iNt4JR0a3EEC74iv9yplAJJVQRC/qbvTDtKD94HACq9TPHfWMSaS+Wzg81836JdUZwA== X-Received: by 2002:a7b:cb89:: with SMTP id m9mr4932773wmi.123.1630799820464; Sat, 04 Sep 2021 16:57:00 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 15/24] target/nios2: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:33 +0200 Message-Id: <20210904235542.1092641-16-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799822651100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/nios2/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 5e37defef80..947bb09bc1e 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -127,6 +127,7 @@ static void nios2_cpu_realizefn(DeviceState *dev, Error= **errp) ncc->parent_realize(dev, errp); } =20 +#ifndef CONFIG_USER_ONLY static bool nios2_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { Nios2CPU *cpu =3D NIOS2_CPU(cs); @@ -140,7 +141,7 @@ static bool nios2_cpu_exec_interrupt(CPUState *cs, int = interrupt_request) } return false; } - +#endif /* !CONFIG_USER_ONLY */ =20 static void nios2_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { @@ -219,10 +220,10 @@ static const struct SysemuCPUOps nios2_sysemu_ops =3D= { =20 static const struct TCGCPUOps nios2_tcg_ops =3D { .initialize =3D nios2_tcg_init, - .cpu_exec_interrupt =3D nios2_cpu_exec_interrupt, .tlb_fill =3D nios2_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D nios2_cpu_exec_interrupt, .do_interrupt =3D nios2_cpu_do_interrupt, .do_unaligned_access =3D nios2_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) client-ip=209.85.128.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799826; cv=none; d=zohomail.com; s=zohoarc; b=QGD/WOIvc9Mu1YK7+VQYLJS0X16zYSO8RopXBA5bZU8HH88XG6kMjbPUH8OwfxjW+VIlSK206J5ATcdTIkCYFxZVx4AjRdY21dg9gZabGdNeVeHzhA7qZgksUCxMM8tX/bHPp8EtAISO9y+POwlANTzyIQztEl4TD9YN8ki82As= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799826; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SlXQUNKS3c3ZKazmS/+w3RMtDhurrxUzxhSxeew26+k=; b=de1tPl0c/QEdmxRSZNizaQzj7joR6nGb6mmWEUaJNzesIFQwz2MHOHmGSFVo2V+bWXj8ndvWwc/TOlfHAO7yRe3JKn7UhynMN57KrjuwxvsEylZ7ddmyGCOEK9t+BhgaxmlpstoRn8RGhiOAFxuVoPLzlXBk+C+f29Mqv6/ZT3g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.zohomail.com with SMTPS id 1630799826829804.0582880593105; Sat, 4 Sep 2021 16:57:06 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id 79-20020a1c0452000000b002e6cf79e572so2206378wme.1 for ; Sat, 04 Sep 2021 16:57:06 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id v62sm3217263wme.21.2021.09.04.16.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SlXQUNKS3c3ZKazmS/+w3RMtDhurrxUzxhSxeew26+k=; b=hzIGgxznm9H3VaTKcqWpCaJk0VM0aT5ZLdSRcpKPHj8yFRKoBUxYl5v6gwZAmnshaD 5UdGU/aWMNECkt6kqxWcEvSX/zkgpQIi5nuf9GPU+hmKCAveF81fbMBcyiX08Ge85jaK Ow/YaaMTDtmhBDus/zBrylHXfdCyD22Uvry48xTb2mFjmmBXOatptbxO/ffz75IZ3blY rY8ZwemjMHUpWKH2n7DmmjAMi9nQueNlzqTaF7+qLjBzyYuQxP/u9yPgQmytEtN3i9AG 1JZ18o2Nu2Jr3sccHt5cFo+8/yol0OA52JsBe2yB0vByu5wTjPw2FWku+5SJ/a1ziH8F OsRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SlXQUNKS3c3ZKazmS/+w3RMtDhurrxUzxhSxeew26+k=; b=dc+pHR1AO2tIOdX2AxSVZ6HzXNxj2S95bZSy/DkCFXLkjzXro4OzBC3tYWZnroyp7H TaFjKDJ12PwSXvMNvLx7VgfeFkMmoJaeof+VRpoLGx98BP50bxcKiDIdS+tDMycjUcaY hNoca/mwKg70YU2tcWEjpPKtrLWvqe7yO1LpT0sf7gPe22Qp6YIdyi8AJb2jo3RUZ/97 FsreT7gq3hP3VH4SBFEFB7VFe22Qnamw94zUD/6tBXP/+Q+lNZ8PzCaRjODNYJbaZuV5 2gZ6v3iFx/UpkvFxzbZ6APy6wLpcc1yRZGRX/89HU9/sOgnbuYGtHOSO5joNUXx1UBJD pm+w== X-Gm-Message-State: AOAM533kGw4eJp/A498TTqzIuuQmQVOdahLG9R5NOqtwZr+IJ/8cVhKl hGcHx3kpxUMYTZ4wx9IC6Hg= X-Google-Smtp-Source: ABdhPJw/b4mwGZnqKAEaY+w+qhp89QkO6wW04HmMLf9ZebjXjhDi85HS32WkUpCFkkF5S6rtJdohgg== X-Received: by 2002:a05:600c:5123:: with SMTP id o35mr4979879wms.153.1630799825152; Sat, 04 Sep 2021 16:57:05 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 16/24] target/openrisc: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:34 +0200 Message-Id: <20210904235542.1092641-17-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799828616100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/openrisc/cpu.h | 5 +++-- target/openrisc/cpu.c | 2 +- target/openrisc/interrupt.c | 2 -- target/openrisc/meson.build | 6 ++++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 82cbaeb4f84..be6df81a810 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -312,8 +312,6 @@ struct OpenRISCCPU { =20 =20 void cpu_openrisc_list(void); -void openrisc_cpu_do_interrupt(CPUState *cpu); -bool openrisc_cpu_exec_interrupt(CPUState *cpu, int int_req); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg= ); @@ -331,6 +329,9 @@ int print_insn_or1k(bfd_vma addr, disassemble_info *inf= o); #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_openrisc_cpu; =20 +void openrisc_cpu_do_interrupt(CPUState *cpu); +bool openrisc_cpu_exec_interrupt(CPUState *cpu, int int_req); + /* hw/openrisc_pic.c */ void cpu_openrisc_pic_init(OpenRISCCPU *cpu); =20 diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index bd34e429ecb..27cb04152f9 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -186,10 +186,10 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = =3D { =20 static const struct TCGCPUOps openrisc_tcg_ops =3D { .initialize =3D openrisc_translate_init, - .cpu_exec_interrupt =3D openrisc_cpu_exec_interrupt, .tlb_fill =3D openrisc_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D openrisc_cpu_exec_interrupt, .do_interrupt =3D openrisc_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index 3eab771dcda..19223e3f25b 100644 --- a/target/openrisc/interrupt.c +++ b/target/openrisc/interrupt.c @@ -28,7 +28,6 @@ =20 void openrisc_cpu_do_interrupt(CPUState *cs) { -#ifndef CONFIG_USER_ONLY OpenRISCCPU *cpu =3D OPENRISC_CPU(cs); CPUOpenRISCState *env =3D &cpu->env; int exception =3D cs->exception_index; @@ -96,7 +95,6 @@ void openrisc_cpu_do_interrupt(CPUState *cs) } else { cpu_abort(cs, "Unhandled exception 0x%x\n", exception); } -#endif =20 cs->exception_index =3D -1; } diff --git a/target/openrisc/meson.build b/target/openrisc/meson.build index 9774a583065..e445dec4a00 100644 --- a/target/openrisc/meson.build +++ b/target/openrisc/meson.build @@ -9,7 +9,6 @@ 'exception_helper.c', 'fpu_helper.c', 'gdbstub.c', - 'interrupt.c', 'interrupt_helper.c', 'mmu.c', 'sys_helper.c', @@ -17,7 +16,10 @@ )) =20 openrisc_softmmu_ss =3D ss.source_set() -openrisc_softmmu_ss.add(files('machine.c')) +openrisc_softmmu_ss.add(files( + 'interrupt.c', + 'machine.c', +)) =20 target_arch +=3D {'openrisc': openrisc_ss} target_softmmu_arch +=3D {'openrisc': openrisc_softmmu_ss} --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) client-ip=209.85.221.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799832; cv=none; d=zohomail.com; s=zohoarc; b=YYaX7vgR3TFiu6QBEre0Y40wyDgpnioAHgYYKqgwQSWEy8LdqJqzkJ1exziFxNINz5BQz8JrNwwmrKcUnyhjNTPpR/ubfcbyTLDx9VhXof7PrTSDHXIekeR0Sbbhs03uDmEqoIHhgRCkeGmlN9g6J3CQmuUt8VeKo40YaHeo3KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799832; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ckzIrTOGwucKvNX/l+ogfKjL1PFJKsWDkPt+s6zjYCI=; b=BslH6j49cAVC3kdliDf+uzZYScotFadd9O1aoLhpZI/kqltTBWQ+jLC89XWD065oVKYqt1N+W7DwjRqnwRPv7ZIgFdWTFGlp8uCO7G66hRCAvrEWWRY+EIA56K4z0ctdKdudCbbuXPPSxez5q0+2fEA2KruwdVEU9TesUZk2kl4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.zohomail.com with SMTPS id 1630799832356515.8196131653184; Sat, 4 Sep 2021 16:57:12 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id q11so4048923wrr.9 for ; Sat, 04 Sep 2021 16:57:11 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id q13sm3181245wmj.46.2021.09.04.16.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ckzIrTOGwucKvNX/l+ogfKjL1PFJKsWDkPt+s6zjYCI=; b=lA+9iHko3Ovh78WSMU3zEHLFc2MPyYzzQVCIsN+IHi4Cx4B5nsIV1c8hYWvy3LSF+O amxIc1ggJR0LtCEIEGl3qXDZ1jnHcotbhkzZ9HizFbqm9GV5/tysrksWdRUKUhkUeZBl 2rdTz20aGxXYDwPCZ20qq/8sEhZojtHux5jC4A910lasYZDI7XH3iP6F8SBAoQiXoSej u+s06oAN0BzkjIqioYquGj0DA3/Y5MEREclpvHQJxb9DIU6TWcSwE0qZtufdE+IeE/Y5 G3ov2NfNvGmhHJdoRGPejU/V1GADxqMhApHN/vmBHJGn+d6vD10aUOElZIl4q3KNv6m3 VcmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ckzIrTOGwucKvNX/l+ogfKjL1PFJKsWDkPt+s6zjYCI=; b=ng13SMBcSJBBlRRzroPc6p9Z6yp2Zkn8tugtCucbCuDmrU1YmuLwzlWv3+FfjdgHx0 GeHDPomnBDVygOfHO/dTlv4Y5Sxh98GIpu3ecaypTvNzl4Xknkr0ld8Dv1/ZvUiW+yG6 Q/gH57+Z/gSHnPmtudw0rEfYkqEL//LnUxJnWbeJ1ufe4gAz7aw7NJuilg/uo6veNhLw hHLiC0JP/ZV4JDy8ImmpkgWa75ABxVjYpNu6KzzBo3JhkfTQanDF5hkXubPear8fNvJo FjBi26HKC9tAHZyZ87OnAeAi7ccinqJnE5/Aoex5BnTK1NucyiD5CgDm8iea8mo5YU8i wdNQ== X-Gm-Message-State: AOAM530S8Ja7gJ5hiyJ1Xx1Uy6yiMXNxezwnqIlo3C+u2EgiLWRHhZkn 74MBTVYfdnfmnxCzUP9vK0I= X-Google-Smtp-Source: ABdhPJwrTWI1zpRfnqsZWh3l1qnan3Qqy7/PU5H56XTshlWPe+1OXWql/dYZkaBnZ+wTmFZC/nl4Xw== X-Received: by 2002:a5d:4d8c:: with SMTP id b12mr5784073wru.232.1630799830661; Sat, 04 Sep 2021 16:57:10 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Subject: [PATCH v2 17/24] target/ppc: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:35 +0200 Message-Id: <20210904235542.1092641-18-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799832750100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Acked-by: David Gibson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/ppc/cpu.h | 4 ++-- target/ppc/cpu_init.c | 2 +- target/ppc/excp_helper.c | 21 +++------------------ 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 500205229c0..362e7c4c5c7 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1254,8 +1254,6 @@ DECLARE_OBJ_CHECKERS(PPCVirtualHypervisor, PPCVirtual= HypervisorClass, PPC_VIRTUAL_HYPERVISOR, TYPE_PPC_VIRTUAL_HYPERVISOR) #endif /* CONFIG_USER_ONLY */ =20 -void ppc_cpu_do_interrupt(CPUState *cpu); -bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req); void ppc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int ppc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); @@ -1271,6 +1269,8 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction = f, CPUState *cs, int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); #ifndef CONFIG_USER_ONLY +void ppc_cpu_do_interrupt(CPUState *cpu); +bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req); void ppc_cpu_do_system_reset(CPUState *cs); void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector); extern const VMStateDescription vmstate_ppc_cpu; diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index ad7abc6041a..6aad01d1d3a 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -9014,10 +9014,10 @@ static const struct SysemuCPUOps ppc_sysemu_ops =3D= { =20 static const struct TCGCPUOps ppc_tcg_ops =3D { .initialize =3D ppc_translate_init, - .cpu_exec_interrupt =3D ppc_cpu_exec_interrupt, .tlb_fill =3D ppc_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D ppc_cpu_exec_interrupt, .do_interrupt =3D ppc_cpu_do_interrupt, .cpu_exec_enter =3D ppc_cpu_exec_enter, .cpu_exec_exit =3D ppc_cpu_exec_exit, diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 7b6ac16eef7..d7e32ee107e 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -40,24 +40,8 @@ =20 /*************************************************************************= ****/ /* Exception processing */ -#if defined(CONFIG_USER_ONLY) -void ppc_cpu_do_interrupt(CPUState *cs) -{ - PowerPCCPU *cpu =3D POWERPC_CPU(cs); - CPUPPCState *env =3D &cpu->env; +#if !defined(CONFIG_USER_ONLY) =20 - cs->exception_index =3D POWERPC_EXCP_NONE; - env->error_code =3D 0; -} - -static void ppc_hw_interrupt(CPUPPCState *env) -{ - CPUState *cs =3D env_cpu(env); - - cs->exception_index =3D POWERPC_EXCP_NONE; - env->error_code =3D 0; -} -#else /* defined(CONFIG_USER_ONLY) */ static inline void dump_syscall(CPUPPCState *env) { qemu_log_mask(CPU_LOG_INT, "syscall r0=3D%016" PRIx64 @@ -1113,7 +1097,6 @@ void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, tar= get_ulong vector) =20 powerpc_set_excp_state(cpu, vector, msr); } -#endif /* !CONFIG_USER_ONLY */ =20 bool ppc_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -1130,6 +1113,8 @@ bool ppc_cpu_exec_interrupt(CPUState *cs, int interru= pt_request) return false; } =20 +#endif /* !CONFIG_USER_ONLY */ + #if defined(DEBUG_OP) static void cpu_dump_rfi(target_ulong RA, target_ulong msr) { --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) client-ip=209.85.221.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799838; cv=none; d=zohomail.com; s=zohoarc; b=IQYXfL9EGsPYXIVE1v9MO8sNOzvK3p2O6CD/q+IzWLFoAAbaR+e5PmLe930Nk6XDAxzXsqG0lSZQR91dMzpjgUZT6P5cOlu2Xx4WVSIvI4XKIya3C+8zmiDJ4B4gOoHcdwr2MT3JwP5aSLaj++0pIRsr5YcJumfrBOIUOUYNR/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799838; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N+NN7MUp81y6VS+L5YAPM+yHuTskNuvr3OHs0wj0LLY=; b=mxWNXlvmx0vFkugrY+T/EZRsleH7jyaYqQFtHkR8woSZLtQgksuijeeITRBK4fW1qNtk2cfSp5eS80TXzoQQOr3iMCu+ioD3xBieh+o9NI2owca4OLAZMp8UEXO8GHsYl96ED6+bXC3awmYBxIfNmfoEtSovepj5vp5l8XSx+uQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.zohomail.com with SMTPS id 1630799838433502.1846943701339; Sat, 4 Sep 2021 16:57:18 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id b10so4114934wru.0 for ; Sat, 04 Sep 2021 16:57:17 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id f20sm3113680wml.38.2021.09.04.16.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N+NN7MUp81y6VS+L5YAPM+yHuTskNuvr3OHs0wj0LLY=; b=apFOtQou0JAltbc5UjR6buWuyhK+sKx/jKhsd5/Hqy+28LwqdnK42IyfopgCznlnq4 aFcnm23wfgrDyIt/rD+Boi8lx9XxuR6b3lOyrLkqoQmnWHmzLJKNQsDibguKgx1G9JW9 Hs5befKhdN8pbpx3hogL/b97FaHb2zt7Ah0TDLku1VCbaaKIHdmcCeLTOds725vcRZqX UI+noNbrcnH4SJTuApENvsl5KNs/tW0+abew/6U2LdmIvtNhRWREmBbcs/WdwLvzOUpg k/SPH8Nk5iibWP6Ho5xVGQH88R2GbjvSLNULgflsEPi2vHIPQUs32OJG4xsiHCFXnJuq qxEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=N+NN7MUp81y6VS+L5YAPM+yHuTskNuvr3OHs0wj0LLY=; b=Y2F4sZw1yi54UDU7Ob3DXLM5tgjjNHh/Q8A9wPTHWeBUWy7Ub6teSsWQkOoznBJaxl f6L5NTN7ZOT1rPzTjEeZkuljnq9MVXdwfZf4bYLDLwX9MvogF4OAiZD2Fh/zbFNIpt6a nK46WklCN5zKlJyOu+8Me62PjHgOOyFI92z9jHBAG4cj/QPBlntqBHPlgQn8wwjcLNGf 4gtTqdz5S6Dd8cRLbyH+TYyU2BUuoQTG/tYl7HdVrXuUlu36H2mMmq3hJTbAjSefvPqW bSe2m0IeljQLfm1rcR44a5rWXbnHxOutP8PHJOhhi69RHzYVBt5/tv8b9mXrIQB219h1 liVw== X-Gm-Message-State: AOAM532TPVs2YDpdkOqI2TjDxfpK7p2OdyFscPEy8mKRJY+I6KyixTW9 T1ZeUJuDTv9TpM+mjXSbouBdEA0/YIE= X-Google-Smtp-Source: ABdhPJyvWTFPlTZd+GgoSoudIyJeUY7QUpIzGO/siqVWlfGZ7HgmNLUoVCVKKmzJhNgjE5dGdLwVCA== X-Received: by 2002:a5d:67c3:: with SMTP id n3mr5994964wrw.201.1630799836698; Sat, 04 Sep 2021 16:57:16 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 18/24] target/riscv: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:36 +0200 Message-Id: <20210904235542.1092641-19-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799838860100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bin Meng --- target/riscv/cpu.h | 2 +- target/riscv/cpu.c | 2 +- target/riscv/cpu_helper.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index bf1c899c00b..e735e53e26c 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -334,7 +334,6 @@ int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f,= CPUState *cs, int cpuid, void *opaque); int riscv_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int riscv_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request); bool riscv_cpu_fp_enabled(CPURISCVState *env); bool riscv_cpu_virt_enabled(CPURISCVState *env); void riscv_cpu_set_virt_enabled(CPURISCVState *env, bool enable); @@ -362,6 +361,7 @@ void riscv_cpu_list(void); #define cpu_mmu_index riscv_cpu_mmu_index =20 #ifndef CONFIG_USER_ONLY +bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request); void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env); int riscv_cpu_claim_interrupts(RISCVCPU *cpu, uint32_t interrupts); uint32_t riscv_cpu_update_mip(RISCVCPU *cpu, uint32_t mask, uint32_t value= ); diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 1a2b03d579c..13575c14085 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -644,10 +644,10 @@ static const struct SysemuCPUOps riscv_sysemu_ops =3D= { static const struct TCGCPUOps riscv_tcg_ops =3D { .initialize =3D riscv_translate_init, .synchronize_from_tb =3D riscv_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D riscv_cpu_exec_interrupt, .tlb_fill =3D riscv_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D riscv_cpu_exec_interrupt, .do_interrupt =3D riscv_cpu_do_interrupt, .do_transaction_failed =3D riscv_cpu_do_transaction_failed, .do_unaligned_access =3D riscv_cpu_do_unaligned_access, diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 968cb8046f4..701858d670c 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -75,11 +75,9 @@ static int riscv_cpu_local_irq_pending(CPURISCVState *en= v) return RISCV_EXCP_NONE; /* indicates no pending interrupt */ } } -#endif =20 bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { -#if !defined(CONFIG_USER_ONLY) if (interrupt_request & CPU_INTERRUPT_HARD) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; @@ -90,12 +88,9 @@ bool riscv_cpu_exec_interrupt(CPUState *cs, int interrup= t_request) return true; } } -#endif return false; } =20 -#if !defined(CONFIG_USER_ONLY) - /* Return true is floating point support is currently enabled */ bool riscv_cpu_fp_enabled(CPURISCVState *env) { --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) client-ip=209.85.221.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799844; cv=none; d=zohomail.com; s=zohoarc; b=LPQvvg5hYUD5xidPrKnLkDanyZUQ5vjeGNik+nWu7AySccSKSVA88X+/xIUaIbOTchIjl83jtuqTWAx1ht9e0pT1dbFfBiHInO9fDuqNBlTO9vXrUsndA07sgxMPfNzR1Bp8O4lsPIDMMYDaz7/kJnPNLoKNre5Id1ULLNGpVZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799844; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UtJq3N+o/FB/vJogkj3xMiVffE8zdE5GfFgTZhZFv9U=; b=IyxTKTAhQUgTXpeaFYkedTxz7qMSLHYULQIYyCX8O2ZzVtu6hV7DndZg+eXNAX35k7c8FI9cGvcGXReQI4mBKZbFWuaUozwMrRdzex7Va9MK0qYB5dw3z+K6E7lANnkPX1VdnL2XBVjWfJ3xjqgmq3Jly7/ODTRC9Ynjy6wpQjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.zohomail.com with SMTPS id 1630799844588631.8232851996461; Sat, 4 Sep 2021 16:57:24 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id m9so4086491wrb.1 for ; Sat, 04 Sep 2021 16:57:24 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id t14sm3131396wmi.12.2021.09.04.16.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UtJq3N+o/FB/vJogkj3xMiVffE8zdE5GfFgTZhZFv9U=; b=HWv43/txbtJKq05lxWF+BOLIB0+ibtEKxhnu4bvWJXVTqr/V1BvAxsjoDdHRAHrUqN TzkoLoazP/f4SIp0zfilcYhQ+kAVSt8phPs5pLbmyhEBaLKqbMnrtOEI/UDzBp0qVdr7 mnAuSqRywbnLoW+8PEaI9sVe7iCZVoxnC2hfcl8iLerXJBHqvISayySSO5+NaRU6W6QE g1GsRDcRTfQ7bAKBN0soVnW9eUGGyXsRfmFOAVQjwvgLKWPovZsH8aeTk5yCl6ORT/vE fJuxw3t6xunvJqnbX2J8QkQYiW8W/1YpypclUWCGy7HyWFxa2f/t6eJQQudUvjMSY1mD RKGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UtJq3N+o/FB/vJogkj3xMiVffE8zdE5GfFgTZhZFv9U=; b=TQIXTHnKhX4/Wm1LR0PR8ow6M/TDVOHwtToxrTgXeqR18iVJNZ2eGXkyQSAyyTLf0i uE0ImrSAoLX94vz8X9h3rLj703JUOyITJKeOIaIBDcuHJ8eFgcUJulVaMZBPSPTYySQU e1HEu6JD0ZMM6zg1xUGKiZpEKwTfWlrUDHINTAaNfmioPXZ/sGrf2OPSjtDoyaeRgI+U y7oGKUOGKWtJG2xC41cEtd7uJIm6PXWQBW3x734ugBDrhVkefQ1zldcCh0P0z8rpvHgv nna13ZFOTDSZ8AWDOpYZXsIqKqc87zmwsAjT2NANaiQ8zbLnVSgc65en3fAWAMg8GCSy /OTA== X-Gm-Message-State: AOAM5323jcHAFM0cnUa62mdLbdDBEOU2om5W5Cgbscw0OkDqlVs6LJ0l vhG1aW92dTCeHRKOUN+uXlE= X-Google-Smtp-Source: ABdhPJwwL9NDxUZIDEFOsizg0m9BEPjX0/BwpNCUDsynMy9WIE+WZldToWx1SMs2zm9Aw8U+71VXCA== X-Received: by 2002:a5d:6781:: with SMTP id v1mr5836550wru.249.1630799842956; Sat, 04 Sep 2021 16:57:22 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 19/24] target/sh4: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:37 +0200 Message-Id: <20210904235542.1092641-20-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799844955100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/cpu.h | 4 ++-- target/sh4/cpu.c | 2 +- target/sh4/helper.c | 9 ++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 01c43440822..017a7702140 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -204,8 +204,6 @@ struct SuperHCPU { }; =20 =20 -void superh_cpu_do_interrupt(CPUState *cpu); -bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req); void superh_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int superh_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); @@ -223,6 +221,8 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, =20 void sh4_cpu_list(void); #if !defined(CONFIG_USER_ONLY) +void superh_cpu_do_interrupt(CPUState *cpu); +bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req); void cpu_sh4_invalidate_tlb(CPUSH4State *s); uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s, hwaddr addr); diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 83269229421..2047742d03c 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -236,10 +236,10 @@ static const struct SysemuCPUOps sh4_sysemu_ops =3D { static const struct TCGCPUOps superh_tcg_ops =3D { .initialize =3D sh4_translate_init, .synchronize_from_tb =3D superh_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D superh_cpu_exec_interrupt, .tlb_fill =3D superh_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D superh_cpu_exec_interrupt, .do_interrupt =3D superh_cpu_do_interrupt, .do_unaligned_access =3D superh_cpu_do_unaligned_access, .io_recompile_replay_branch =3D superh_io_recompile_replay_branch, diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 2d622081e85..53cb9c3b631 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -45,11 +45,6 @@ =20 #if defined(CONFIG_USER_ONLY) =20 -void superh_cpu_do_interrupt(CPUState *cs) -{ - cs->exception_index =3D -1; -} - int cpu_sh4_is_cached(CPUSH4State *env, target_ulong addr) { /* For user mode, only U0 area is cacheable. */ @@ -784,8 +779,6 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong a= ddr) return 0; } =20 -#endif - bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { if (interrupt_request & CPU_INTERRUPT_HARD) { @@ -803,6 +796,8 @@ bool superh_cpu_exec_interrupt(CPUState *cs, int interr= upt_request) return false; } =20 +#endif /* !CONFIG_USER_ONLY */ + bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799849; cv=none; d=zohomail.com; s=zohoarc; b=AxaC8MlxNixz9Ms2lwh5aE98drSJpf0q76VvayoosH8iluMiOWF6WwU2MfrRm5OJ4PQcKuITsRxIKeDP7POCoRRl85i0fFRTykU4Ur8Tzq0nPUrS/b8VcUokwmaxGOMIpui6U64+McJWbeXsH0AVkOxECwzUlvBLss+weIM2iUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799849; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HTLBpMUvcY2BxzZIjZoxS//8tbEgCAlf+xtbD3ElAZQ=; b=kX6HbLpNsUXAe2RbDZvCrByygNeFuogIFgd13EICUXHkhmrGy4/noe7wvWPU87OkyJ9S6tXdq/zxepKcm84cxTzkqlZFE+6Rrf/WNzsXfvK/ByCEuwbVNK10UG67XvfePMnlVriH2De3oUiv7Me0xsj4xbHoxnPKho9I2OodphU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1630799849705358.3355621311309; Sat, 4 Sep 2021 16:57:29 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id q26so3119791wrc.7 for ; Sat, 04 Sep 2021 16:57:29 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id o5sm3375071wrw.17.2021.09.04.16.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HTLBpMUvcY2BxzZIjZoxS//8tbEgCAlf+xtbD3ElAZQ=; b=pq9aAglyW8MuUPlQwX3TauQrHMG8wTcyr4tl4LYnHZlPzEJZeZunnf6Wv8Dnq4Y70A QMO+NIreZwwP2sx0WLT13aqjma5LIBhfRK7ytp85B70tiB2IgeDo2wmFwWS4jzuDLzlw zhe39uLXac0nZ9AW82Y/Gc5ZE+PyrXZ638dbcjxnqRIDGV8ActIdZQJb1FfGtMVMotp9 pmU+pwfqaub/D4tG70xGVX2PhGE1ri+0zT/YVkLIMp+Cn+yccovJKIKobeJY3N4zEMDC C+hzmiA7w+yU37OJoJ0P1JlTMkyhiWg9eo8BkljiXqDINUKEk7FA4XfOBeTDOgQGrZkq 5ZCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HTLBpMUvcY2BxzZIjZoxS//8tbEgCAlf+xtbD3ElAZQ=; b=GjuJfiz04W7l0kJsYzTOXdpk92wfLwJW832jaxfvrN7qvxqxdvaxLo6TaF/zGcUlDX fvQ3DCe+5GHUZ1nIHMTMomZ9PrLk30SDu6vL5qau43bvmy8feo+6mB4e3Uy9J2snAWQy o9eZucxVdr3KZhiNBg9D30DampjoZoekR01a4u5+8g7Z14xbWWsRuSr2mmjoPvKb8ppC P+nhdlcBR48WcbPfKj1LTyDfJqIpxFfNDbGyfr6CG/0Vb3UtCopsLTsEHurQ4BoKrjGR U/vloCEX1eC2BsZOBOMtgvPswBkRpbn6i8OwGA5M+2W0YrZL52UKCslFoEcVpLo46Sry E4pw== X-Gm-Message-State: AOAM533FD3lzfwrvGZE5UAHDwkm+gHIBMYAC+YrjnXt+wuy7/y+FPELD sjMayzqV68CoFmWR12I4/3g= X-Google-Smtp-Source: ABdhPJws4P0V5xn8NwD9CaJVpPAZ9rz7tmBAgiXsD12JJpoTpmeaX6Y2ftjzvxzXKWWoFC6boGaPiQ== X-Received: by 2002:adf:8169:: with SMTP id 96mr5972995wrm.207.1630799848009; Sat, 04 Sep 2021 16:57:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 20/24] target/sparc: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:38 +0200 Message-Id: <20210904235542.1092641-21-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799851255100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sparc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index da6b30ec747..5a8a4ce7506 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -77,6 +77,7 @@ static void sparc_cpu_reset(DeviceState *dev) env->cache_control =3D 0; } =20 +#ifndef CONFIG_USER_ONLY static bool sparc_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { if (interrupt_request & CPU_INTERRUPT_HARD) { @@ -96,6 +97,7 @@ static bool sparc_cpu_exec_interrupt(CPUState *cs, int in= terrupt_request) } return false; } +#endif /* !CONFIG_USER_ONLY */ =20 static void cpu_sparc_disas_set_info(CPUState *cpu, disassemble_info *info) { @@ -863,10 +865,10 @@ static const struct SysemuCPUOps sparc_sysemu_ops =3D= { static const struct TCGCPUOps sparc_tcg_ops =3D { .initialize =3D sparc_tcg_init, .synchronize_from_tb =3D sparc_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D sparc_cpu_exec_interrupt, .tlb_fill =3D sparc_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D sparc_cpu_exec_interrupt, .do_interrupt =3D sparc_cpu_do_interrupt, .do_transaction_failed =3D sparc_cpu_do_transaction_failed, .do_unaligned_access =3D sparc_cpu_do_unaligned_access, --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) client-ip=209.85.221.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799855; cv=none; d=zohomail.com; s=zohoarc; b=T7ov0Clh80YZEviG0kTWzMNXlWFn5/ZCgGtT1ztrXDzeVgjUGEQH3Oy7mQrIeQ3YMIiT9pLrLybv8qAevlhbLyHYaPJVMSI+BYCfZuQtGtcz8KScfmuBKgnf2EOQbN1altBaOlp8s1amHQMGIO++ZV/ZGT295z/jfuLDVcHep8A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799855; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LgdMlt85/dxzemJRBccypcQeoOnrjCkyjoaKtxyctHU=; b=V1Mc1ilEJ6VCZRQjS5+lv0TQKyzdSDXOvPkmQWrTcFvQkc85sSLpaxec9XonyoPL7ZJkXwqrJrRb8D+39wowo/A7OP9TmRwZPz82sv8DbCb9Sp1xx4xFxpl/TBg/dBn9ZTph/wG3LJIPjU3WgDRlsBnnR1SKUSqAF+KfbBH5NNE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.zohomail.com with SMTPS id 1630799855032344.0562071560631; Sat, 4 Sep 2021 16:57:35 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id b6so4040731wrh.10 for ; Sat, 04 Sep 2021 16:57:34 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id l17sm3506944wrz.35.2021.09.04.16.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LgdMlt85/dxzemJRBccypcQeoOnrjCkyjoaKtxyctHU=; b=bEB8PhQYz0yoAqCKy+emXqLGlOdHKvOxYZyJrTlWgDN1qAF4dRRdJuXswvdZ3jGmbh BcMTgIiydNgxClYAznD0wdP5Tkm0yk0wBEgcnI+krnBx0j75ExG9F5jv/WJTHHLG/Pj7 zoSxA8vcrnHKoVyjUTiVpwvsITgZ5FTFaXGHcvipOeaoAjU3lTD24PSMBIQ0MW4Uz2V1 JnLE76GfxVgXifUAVyWeS5ackvneKXC7GJf84t58y7IZA3NFMNTF896cv1tCAtPIrq4v QmhTVelcA79d76qODp1aDQ/mk7I8bswqmMpdMipnuCOg2XNlYA6RBQXT521cuUdsCh1j NZdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LgdMlt85/dxzemJRBccypcQeoOnrjCkyjoaKtxyctHU=; b=epdR+mthSOUQhi8moCm3y8e4ERz8a8i6D7oVIORCLKRjbcWjLyJwPiFAWfDfov8wFk a7JGd1PMRm9vDQdWHRJFohYntpI1d4RGauiSEbNWNf4ShozlYuRcQzH/oOr4/DgT0PH/ 6QzMexRnpB6hxQjNr9DIfCuuwRm7opDzOA6gCsdjLm91nfwOCoQn9blzfH+7uQrmOHv2 /mMN+u5cQazRc+b/tvuZIp3KfQmgJ2naRyfs1GS94WCuCoRp2yU1dE+K4RjobkGnodsn zazj/3q19lB7iWqKkvXN4Ow1ce8IZWmu38srvTqr337OIiJVb8FaNm3UX4M4wGhn6dRj tZeg== X-Gm-Message-State: AOAM533fp1337wswf/fMi66uOrHi0bJSox+P2Jwnmy83G3qh4yTs/u3Z jotD1QtkIHBlQniYa0zCzWs= X-Google-Smtp-Source: ABdhPJzB6qRcGAqkWAcMtB9YLX2hpHqleUXZsl6Qhq8Dl9pcbEuD6/dxCINlaDSYjnjk146fuLDVrg== X-Received: by 2002:adf:9063:: with SMTP id h90mr5836113wrh.121.1630799853323; Sat, 04 Sep 2021 16:57:33 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 21/24] target/rx: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:39 +0200 Message-Id: <20210904235542.1092641-22-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799855430100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/rx/cpu.h | 2 ++ target/rx/cpu.c | 2 +- target/rx/helper.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 0b4b998c7be..faa3606f52f 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -124,8 +124,10 @@ typedef RXCPU ArchCPU; #define CPU_RESOLVING_TYPE TYPE_RX_CPU =20 const char *rx_crname(uint8_t cr); +#ifndef CONFIG_USER_ONLY void rx_cpu_do_interrupt(CPUState *cpu); bool rx_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif /* !CONFIG_USER_ONLY */ void rx_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int rx_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int rx_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 96cc96e514f..25a4aa2976d 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -186,10 +186,10 @@ static const struct SysemuCPUOps rx_sysemu_ops =3D { static const struct TCGCPUOps rx_tcg_ops =3D { .initialize =3D rx_translate_init, .synchronize_from_tb =3D rx_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D rx_cpu_exec_interrupt, .tlb_fill =3D rx_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D rx_cpu_exec_interrupt, .do_interrupt =3D rx_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/rx/helper.c b/target/rx/helper.c index db6b07e3890..f34945e7e2c 100644 --- a/target/rx/helper.c +++ b/target/rx/helper.c @@ -40,6 +40,8 @@ void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int= rte) env->psw_c =3D FIELD_EX32(psw, PSW, C); } =20 +#ifndef CONFIG_USER_ONLY + #define INT_FLAGS (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR) void rx_cpu_do_interrupt(CPUState *cs) { @@ -142,6 +144,8 @@ bool rx_cpu_exec_interrupt(CPUState *cs, int interrupt_= request) return false; } =20 +#endif /* !CONFIG_USER_ONLY */ + hwaddr rx_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { return addr; --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799860; cv=none; d=zohomail.com; s=zohoarc; b=TPzDe6ZkUyoSX1YGbbPNyYs0SseVkr5c5t0W9DhQtmF5lh6dUsdK2z2LLtUG68KFNVzMECS1EKzwng8d5777jG4aKJK9rdebojAHviKHsfXmOjuvbo+8+tL6FcdybKJQLbiMnId34Gmdv8cPLhZbUTzLakqyWlkFZ0xpksmJlgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799860; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xbkBh1p97u6mIkTKAA2kHg2qUMQVayjkKn9c7GCbY1E=; b=YcSQLrXugOga9pP3wcGe4wUJcH6WJwH8JkBP1qH0FqeznfL+7PQlDCHG/FPC8vhqu4LC0A1cajdOC6Yo0j8/GsjaOW4Osz8kIlKIyU1lfgyxCiWg64ygIAMcFe+m+FepgWAcC5yJE7S9n3BMW/9LxF6D5IhdQth/2SLxw0M6sSM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1630799860101453.1432701998674; Sat, 4 Sep 2021 16:57:40 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id n5so4030095wro.12 for ; Sat, 04 Sep 2021 16:57:39 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id r25sm2243268wrc.26.2021.09.04.16.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xbkBh1p97u6mIkTKAA2kHg2qUMQVayjkKn9c7GCbY1E=; b=liicJy3HDokXxTxtoAkZF3mKr3GJOuPJWh+VuvrskAiQVhGnR+kud/sJi/EdWg0ZWe oVZsuM0Yy+jvpNxjxoIKFQDTZO93/V8mJmd/ql56zFlwtTq3EdDDAI23sWGD0rc6KZ75 nJslE40hnXxb3HcTaF0F0+pAGjiUZBzq3c5hIgbdTjB6JNViUeOYWZtIuYSfTEP0IFNK 4Dkwll+iltiCtPt2hy2sekL/FD3lV+gXlEgi5JU6g+mC4K2WrxJdAIVyrlzCaDCm+3pB 7Bj15StYpg2UpgcFE4gbYEH+Gyg3ucIHbUzV7dQaaVt1ZgIQZuo7oFezoL+jHQhcBrbA FbCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xbkBh1p97u6mIkTKAA2kHg2qUMQVayjkKn9c7GCbY1E=; b=aGiuugjxnJURpLnKiaQQOBxL+f6d9GIUyoU3ogBHu//wSW+zyck8hZkJRYpOGaJPY/ PrPqyfBTuCsmU9TaRo/8TzaVGHvWDc0MZD+0BYPcseG49J4QvaHhE6zWPytctLo7xuD6 PuxXo+Zx2KHA2vhfstlLtNQc5iDiCu7CzyVzo0s8Wp8EiPk1WFID232oBQJbDxLok7X9 IPMQUCriI62ByxlGoeEFfGXEAbxQ2ghRB+OLshdcUj40oLTHHjLqoOusaOPqJhy1aHJE lvR/QrepnphQ8XVUz+tF8i5J9TSI0XOY1TEgJbzbw1mQSdR2XRXJjyCodINA/+5kOQX7 MAyQ== X-Gm-Message-State: AOAM531qf8F9HHUlEKEC/Wy1umI/Fed2Fs3s7EQM9bbJ1SRtn4jMgA60 GcXEvxwsSw+f2AA+mbQlZ1+RN7rnyaY= X-Google-Smtp-Source: ABdhPJzJey5n/hPtlOgCqkrUJcGPbn4g5ZR3cVbbnEc9rubNanAorF6S6RoCOlvK7bwPvncfQvzZCQ== X-Received: by 2002:adf:e712:: with SMTP id c18mr5856448wrm.438.1630799858327; Sat, 04 Sep 2021 16:57:38 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 22/24] target/xtensa: Restrict cpu_exec_interrupt() handler to sysemu Date: Sun, 5 Sep 2021 01:55:40 +0200 Message-Id: <20210904235542.1092641-23-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799861722100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/xtensa/cpu.h | 4 ++-- target/xtensa/cpu.c | 2 +- target/xtensa/exc_helper.c | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 1e0cb1535ca..cbb720e7cca 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -566,14 +566,14 @@ struct XtensaCPU { bool xtensa_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 xtensa_cpu_do_interrupt(CPUState *cpu); bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request); -#ifndef CONFIG_USER_ONLY void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr= addr, unsigned size, MMUAccessType access_= type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t reta= ddr); -#endif /* !CONFIG_USER_ONLY */ +#endif void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void xtensa_count_regs(const XtensaConfig *config, diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 58ec3a08622..c1cbd03595e 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -192,11 +192,11 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = =3D { =20 static const struct TCGCPUOps xtensa_tcg_ops =3D { .initialize =3D xtensa_translate_init, - .cpu_exec_interrupt =3D xtensa_cpu_exec_interrupt, .tlb_fill =3D xtensa_cpu_tlb_fill, .debug_excp_handler =3D xtensa_breakpoint_handler, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D xtensa_cpu_exec_interrupt, .do_interrupt =3D xtensa_cpu_do_interrupt, .do_transaction_failed =3D xtensa_cpu_do_transaction_failed, .do_unaligned_access =3D xtensa_cpu_do_unaligned_access, diff --git a/target/xtensa/exc_helper.c b/target/xtensa/exc_helper.c index 10e75ab070d..9bc7f50d355 100644 --- a/target/xtensa/exc_helper.c +++ b/target/xtensa/exc_helper.c @@ -255,11 +255,6 @@ void xtensa_cpu_do_interrupt(CPUState *cs) } check_interrupts(env); } -#else -void xtensa_cpu_do_interrupt(CPUState *cs) -{ -} -#endif =20 bool xtensa_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -270,3 +265,5 @@ bool xtensa_cpu_exec_interrupt(CPUState *cs, int interr= upt_request) } return false; } + +#endif /* !CONFIG_USER_ONLY */ --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) client-ip=209.85.221.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799868; cv=none; d=zohomail.com; s=zohoarc; b=SKYorhDFuA+73g5Hgvtd8K7z4a4vL4rA8whRvi8+3lxxqg2uyI9fv12ptCpysdq6pa1rw/JzRPNYZbthtLyGYLL9Kx41fp7QwvU74WOoBA3veoo3nW/wshVRI8OaAiGQ5bwLtxOmti1w+uD0fS3t16ulMsAhBlt9PXc9d6mpn8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799868; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JWKBtEMqz5hUsAPJr5foR0KE5eQgXFRtLCwxDOixiMc=; b=I5guIpQw1HD4NJVrTRaxRol2ZLX0X5dCidtmRDb5ImSEgxERoDyzStXjACYvXsQXsMDuPEh6FvYzmTHTgax2HClgf4xu8yw1D0TjrCzKwZRMnHDbBsRlqNVBAxxTX2wu6tSz3uA4T2gqjq7g7ZfDoC6Wz2396uh7fpalwhG2AGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.zohomail.com with SMTPS id 1630799868319180.03537008370256; Sat, 4 Sep 2021 16:57:48 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id z4so4045425wrr.6 for ; Sat, 04 Sep 2021 16:57:47 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id z1sm3243475wmi.34.2021.09.04.16.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JWKBtEMqz5hUsAPJr5foR0KE5eQgXFRtLCwxDOixiMc=; b=Mol2KChTYyXAjwtJtg8BwAy3uL+yd6pCeL91yapgIA6uWpjlmF4HOK9LlTp6AIh1jM Fg3lr5zZiub1Mg2CJl/H5j3uzhTau2mfQlowbi94t/i5ALNzLOJLDnb7N+edfWSz3rqw fuJBwa3IITfWmNGo7qSujvqSuQ4AHv5a7NG+SRDU3W81i8F4cTRw8UdqYinpv2RwQ56g EyyGscnc0xuKE1mGUryCmKsPWUSwFK44OwmcA1CDBg7orj6dHXkj33meNGVRgqMxAsIA m4pXgepr8ySuI2Rzd1LJvzYHxzZAU9jeicPE8lCTm37PdPqwCdkgpR3kCeDjSpRHPsW5 8ezA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JWKBtEMqz5hUsAPJr5foR0KE5eQgXFRtLCwxDOixiMc=; b=Q313zydA1h31LfyYs5FQS2IK1zVrQ7rb61t8k+RBLW5EywXtyqpMFxK0NhcbuNzqKG DLPmWtv3rEMUDj7gdOYRL0FyKlVKQ3tzBODp2XnGNegMoEbBeQucDG5I7xxH7QOgbGUt zkx5vrYZLEj4o48BSZM97CGzIgEvGVYpbGgeT2caZoCtHHZ/pOum/cEh1xD3Wi5CjMyS mvdDEaHOx7btwZpokbg6orQnkhw8Xm0e70MTH/GuPG/nw7IqGzlgI+RFJOnXKtF4BmA0 odIivUGAdVkglsJh47g/uE9GoVooz2JfdD0J61zsbl9Vztbji/NZVf8HHnZelNOJDEp5 rwww== X-Gm-Message-State: AOAM530hM8kiITHaBMZZZonGE5ypTpolqo9gQ8Zm5Hh1N4sghpxM7gpP pjQXvve1eRRIrGz6efARPwY= X-Google-Smtp-Source: ABdhPJxxZHg1o3r7Jm18JFxf7I6oOjJ8kD0EE4Rd0HSDCX+GJ4F/1O2xYo6K2LeNAr0Fao9iVIxBng== X-Received: by 2002:a5d:4f02:: with SMTP id c2mr5712629wru.311.1630799866551; Sat, 04 Sep 2021 16:57:46 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 23/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu Date: Sun, 5 Sep 2021 01:55:41 +0200 Message-Id: <20210904235542.1092641-24-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799869777100001 All targets call TCGCPUOps::cpu_exec_interrupt() from sysemu code. Move its declaration to restrict it to system emulation. Extend the code guarded. Restrict the static inlined need_replay_interrupt() method to avoid a "defined but not used" warning. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/tcg-cpu-ops.h | 4 ++-- accel/tcg/cpu-exec.c | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 6c7ab9600ba..55123cb4d22 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -35,8 +35,6 @@ struct TCGCPUOps { void (*cpu_exec_enter)(CPUState *cpu); /** @cpu_exec_exit: Callback for cpu_exec cleanup */ void (*cpu_exec_exit)(CPUState *cpu); - /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ - bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** * @tlb_fill: Handle a softmmu tlb miss or user-only address fault * @@ -68,6 +66,8 @@ struct TCGCPUOps { void (*do_interrupt)(CPUState *cpu); #endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #ifdef CONFIG_SOFTMMU + /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ + bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** * @do_transaction_failed: Callback for handling failed memory transac= tions * (ie bus faults or external aborts; not MMU faults) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 2838177e7f0..75dbc1e4e33 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -685,6 +685,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) return false; } =20 +#ifndef CONFIG_USER_ONLY /* * CPU_INTERRUPT_POLL is a virtual event which gets converted into a * "real" interrupt event later. It does not need to be recorded for @@ -698,12 +699,11 @@ static inline bool need_replay_interrupt(int interrup= t_request) return true; #endif } +#endif /* !CONFIG_USER_ONLY */ =20 static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); - /* Clear the interrupt flag now since we're processing * cpu->interrupt_request and cpu->exit_request. * Ensure zeroing happens before reading cpu->exit_request or @@ -725,6 +725,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, qemu_mutex_unlock_iothread(); return true; } +#if !defined(CONFIG_USER_ONLY) if (replay_mode =3D=3D REPLAY_MODE_PLAY && !replay_has_interrupt()= ) { /* Do nothing */ } else if (interrupt_request & CPU_INTERRUPT_HALT) { @@ -753,12 +754,14 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, qemu_mutex_unlock_iothread(); return true; } -#endif +#endif /* !TARGET_I386 */ /* The target hook has 3 exit conditions: False when the interrupt isn't processed, True when it is, and we should restart on a new TB, and via longjmp via cpu_loop_exit. */ else { + CPUClass *cc =3D CPU_GET_CLASS(cpu); + if (cc->tcg_ops->cpu_exec_interrupt && cc->tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { if (need_replay_interrupt(interrupt_request)) { @@ -777,6 +780,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, * reload the 'interrupt_request' value */ interrupt_request =3D cpu->interrupt_request; } +#endif /* !CONFIG_USER_ONLY */ if (interrupt_request & CPU_INTERRUPT_EXITTB) { cpu->interrupt_request &=3D ~CPU_INTERRUPT_EXITTB; /* ensure that no TB jump will be modified as --=20 2.31.1 From nobody Sat Apr 27 06:29:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) client-ip=209.85.128.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630799873; cv=none; d=zohomail.com; s=zohoarc; b=LDSF4e3HzNqwrRgASEoyDUEvkBGeexAPlFSk2klW8c3aSb0+jUEFssCob4yxEsJjoMplMA5u9auEgIXuk/7WMeQ1YjR2qxZhULwVfkFFIgYM/Y0rqYHAe5qZ3DlUsoNu9rcIo8ZI54dgCwoZarlBSZjTVPgriBnwPMlIgVNE9Kw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630799873; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T4pI+gOIoQYZd9V+8CX82xC3q0nWNwipfLf26DxJ+o0=; b=Xclb/VF1+9+e9OlcwU7Z/j0ctKtdhG+1krfnmN5VS/POl/80em9qAROjiE+NxtuZbcMTXvyLEFS7O0sTtGW3Li95DssO8RILUWhpdz9dltJhf8nXOLHjUkJok5FpkEOKb8JX+Anu8xMSx03kbU+kdKXTcibfbR8jZ46lT+uTi5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.zohomail.com with SMTPS id 1630799873246196.90341058294757; Sat, 4 Sep 2021 16:57:53 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id n39so178454wms.1 for ; Sat, 04 Sep 2021 16:57:52 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id o7sm3103135wmq.36.2021.09.04.16.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 16:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T4pI+gOIoQYZd9V+8CX82xC3q0nWNwipfLf26DxJ+o0=; b=mXRnsAjuAqm/gT+4wkjZXtF0DdDaULHnPfzz1dGRo/XmpdZ5E88KhVn6uZEmVEQEUZ vSemyVe+m6jDSUP1DEqSBMJZJUkwDup6USpAV4OSPh+3ZqtbfvwaoFUexZ2lhxRR7CPv uG5OnSQei2LsvTzrVsjnnL5qj2P8AMAkbhIL+PJaQASfHRQKhNPm+N1N6PHE+E2H41Iv 6trQjzqS/yymzGhskZSvCQCE7xTAzOsPw1L6D4xLh7zGOUNMTBWp3+BryqfB0yZeUgBB EvDp8DsBRz6kRc4mUV31zWRj7i2tZpCqXursUoTEdIRcZvjFuool/hVwcRf8tPk84wfJ GtjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=T4pI+gOIoQYZd9V+8CX82xC3q0nWNwipfLf26DxJ+o0=; b=BL6Iib1xT2f4Qsmce8XyYYQYqn94VvgJ2hZtgyzYSu5ov1V8SRXSUUDYIInxXXxtrt ma1E2Ltf/ChA2yTYPAXr42Gup2zlbEJD9vKQGqkyKQ8bD88lQyGpxX01rFLU0mxP9Ka+ iRM+ePWxEPqrCha69OpE71o64uEttyUGAU1MTLz63xq2h+GZn2wzQoOPDRueJkEhHXBQ 7jQlTPOOkd+rzicg2p/cHyvZdrtumeE1IlLjMM88wg/KkaNuj+KSEYMMNRp0HHyb+X+w npfowlfoerphTIdUdgsy1yUp8MDNIYkwADbbBdOS1ULOfktZKFLztnVCS3pCHceVMSdn Al9Q== X-Gm-Message-State: AOAM531XxggA4H3lps//VlMtTrwY9YFwWY20wM4gjznQ4EqtCC2L205s fdb1SNw0U57jZRHjNnsSCjM= X-Google-Smtp-Source: ABdhPJzUZm2LVbjLZmE+YuJ1P3RafsFif54wS/sGvbQfkGQARS7TzrnlKF1WlosUCwKCiU15DFWa8w== X-Received: by 2002:a1c:a9ce:: with SMTP id s197mr4867407wme.173.1630799871471; Sat, 04 Sep 2021 16:57:51 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 24/24] user: Remove cpu_get_pic_interrupt() stubs Date: Sun, 5 Sep 2021 01:55:42 +0200 Message-Id: <20210904235542.1092641-25-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org> References: <20210904235542.1092641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630799874004100001 cpu_get_pic_interrupt() is now unreachable from user-mode, delete the unnecessary stubs. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.h | 2 +- bsd-user/main.c | 7 ------- linux-user/main.c | 7 ------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c241bc183d2..c7cc65e92d5 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1832,9 +1832,9 @@ int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t= *buf, int reg); void x86_cpu_list(void); int cpu_x86_support_mca_broadcast(CPUX86State *env); =20 +#ifndef CONFIG_USER_ONLY int cpu_get_pic_interrupt(CPUX86State *s); =20 -#ifndef CONFIG_USER_ONLY /* MSDOS compatibility mode FPU exception support */ void x86_register_ferr_irq(qemu_irq irq); void fpu_check_raise_ferr_irq(CPUX86State *s); diff --git a/bsd-user/main.c b/bsd-user/main.c index fe66204b6b7..e358c38c353 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -66,13 +66,6 @@ void gemu_log(const char *fmt, ...) va_end(ap); } =20 -#if defined(TARGET_I386) -int cpu_get_pic_interrupt(CPUX86State *env) -{ - return -1; -} -#endif - void fork_start(void) { } diff --git a/linux-user/main.c b/linux-user/main.c index a6094563b6b..45bde4598d5 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -120,13 +120,6 @@ const char *qemu_uname_release; by remapping the process stack directly at the right place */ unsigned long guest_stack_size =3D 8 * 1024 * 1024UL; =20 -#if defined(TARGET_I386) -int cpu_get_pic_interrupt(CPUX86State *env) -{ - return -1; -} -#endif - /***********************************************************/ /* Helper routines for implementing atomic operations. */ =20 --=20 2.31.1