From nobody Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) client-ip=209.85.128.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595845; cv=none; d=zohomail.com; s=zohoarc; b=HYLD7iyEbC5O7H8fM5MxhsgAvOgdEX4AS02FqCEll+dMtpQo7jwYmshHbwLlDpMbXuYjJwuWynqZjvLpbBwlZ2TxOIGWSc/OiW26aWZWlUAVhSgXNtfwLY6ai+E9Sbok+/9k8AGLrEBSMdQbNhhZ5waQbsCnK5wwTIHzJG5wPKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595845; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bzANSLmsGdJwadQ2kXgbZKI1Q8VNrscDKhhidFGsH+0=; b=LiEbAk4nH6w/cf0OOcaopH2GVdkiwwmVr2WwahDHafvwuQl3o/9MyTfK6ZR8mmn8FBsR5zJJYSQrdYZRdyJhMSlZb9GQxeSdrVEJkE9Il9dxPrFvX+4GZauH/r1mDGYzd1OuS3Rooaj2/hzCW9fpiy9oIP/ysC6hSV5FUA+WW4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.zohomail.com with SMTPS id 163059584508160.35614865976834; Thu, 2 Sep 2021 08:17:25 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id v20-20020a1cf714000000b002e71f4d2026so1324524wmh.1 for ; Thu, 02 Sep 2021 08:17:24 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id u9sm2193592wrm.70.2021.09.02.08.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17: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=bzANSLmsGdJwadQ2kXgbZKI1Q8VNrscDKhhidFGsH+0=; b=Z9k4vsPonRy5FhjiFYfve2//ax9zYfyyVD5a9Cugem8J8WsROLTUdxZhjQFB3fG7QL sF8pK/9U253NoTliZREGwIL5xU/HTdrvfwZATynAdrFDf1Oe+v6ovXnPzIwYG9U1myxB T+xcHCUrk19Oie+upTR4GwXVKPit/JG8EJu2v4/Vjp2yguR6XjnRYwoEyparRbJndYQ/ p43ara3grrooC7fr3CTKdaFEjlBBtgKk2Opczzode5eea7w5PrHD85pJa6PPKyOGYEF0 1e/3eV34c+knvvn3gFyAglCLRJ4MKFqF3/QWNxmPX0LfhiJa0kv8uleIl7riSopsOR7F f6ow== 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=bzANSLmsGdJwadQ2kXgbZKI1Q8VNrscDKhhidFGsH+0=; b=I55B1XBh0cuAwMK8WO0YUY/8ouqBUSmLMN4RB1G1Wo2aXZGh83hROF5UBkjdk4jmNj slwP7ENSs01iLamTufnQV+oOR7/ey3HavpABZmvfD9MgtG1UqACxlRAI42A4pAou/bYa 4qghSjQ5Mx2aZ5gsAKlSQqMGhLBCRUmWP+Zo5Xx6biWjsbJ7+fU1tmEh8I0VOLzL2JzZ +LCzoTksWIj3Lmzg0z4+PvTVjbon5/RgSgx9U7DIViIweJUU9VG1K/n698fMxPpnQCy3 4aslnCJyItVrsYRsoQxDoVdY0DskrnKY25+W4/EifCXET0S1HHNONV8VaXN6wSdYo4Jw 7Djg== X-Gm-Message-State: AOAM530nVicdrFiuO17c0L6TFoOpiTFEUyhInvAxRMG7NuCs+3D6avwa KuUE365XaocBVqTxqXPW1ZM= X-Google-Smtp-Source: ABdhPJzMo21Pzl41j9dPeTF/HOgeSp6Vq/rN5gij0WhUptIJSXfvP67peFo+YjUwUaQEAxUKbLSroQ== X-Received: by 2002:a7b:c097:: with SMTP id r23mr3761544wmh.114.1630595843307; Thu, 02 Sep 2021 08:17:23 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 01/24] target/xtensa: Restrict do_transaction_failed() to sysemu Date: Thu, 2 Sep 2021 17:16:52 +0200 Message-Id: <20210902151715.383678-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595847496100003 The do_transaction_failed() is restricted to system emulation since commit cbc183d2d9f ("cpu: move cc->transaction_failed to tcg_ops"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) client-ip=209.85.221.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595850; cv=none; d=zohomail.com; s=zohoarc; b=K9FHAw3tbanpWxTthHBP+HSZQRlOt8+hVMO5/dTVRAK+lzU1MkyFMF8jmBo3+HrXte6XsX2Mfc/iUofGslD6SzZ28+Bq61M3CFaU8xJ6QKfsHRVnKgNeb9LCwCoDGUApOiPOvYeAZQf2t1rqmU+YqU9z2YLqX3w4S8q5KMt2JfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XTFlYRzsNmSx1w84TAaQNKIszVXBPzQdffXX/N6ByQc=; b=HGoEZ5L5pnLd4qVAccYEQMWts7qE/PD4hqgJwFy4f6tiwlbm24ofDKhPejC99gA55CHo6wIOaZriX9XfR9ODp6MkxdG877YD+yrsxKR6rEdjZnfkSlt1dk6OFXz9y3u9qo12TeZYcNCy6dqYRIrZd9norWWwqPS3gCzhcE+gCMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.zohomail.com with SMTPS id 1630595850507698.6035281590507; Thu, 2 Sep 2021 08:17:30 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id b6so3522078wrh.10 for ; Thu, 02 Sep 2021 08:17:29 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id f23sm1773453wmc.3.2021.09.02.08.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17:28 -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=XTFlYRzsNmSx1w84TAaQNKIszVXBPzQdffXX/N6ByQc=; b=binZUo7/bHMGSoxpON5VJ8GEdo3Al7bMt62SwTTxKOxX5oq0oIhUfcLCaFB4Cyuzd1 LiZmr45oEQbFEm76NnaC0xaAd591rmcBV0A+9j1mRolMSW+PRlryz/xmFYySSfjLUlAD hekSncN+3jw2QUQqC3EWxpyhwJHohVwmIG32WpTWLjYf3c9AqpDRnImfTX6c727mGHMC u6mWY4WkK5T8Uceh/4z2YugTz7GH4gpqQpYeJnusOW6Xoa5e7h9+w/nbMYwlAER1ZjPQ aGTdhNAyvfDz91ZJ+1PKRR8TBqj+toLBAmtmev1hIfWSDL9PmtDS8DilXzu+ShD1jnc4 SrzA== 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=XTFlYRzsNmSx1w84TAaQNKIszVXBPzQdffXX/N6ByQc=; b=PHXbGbmEu5QVlt9f74wYPg2AZQSOmCc0qlKUFP8aRcJJ4llQ7K0JUtQUAVYH1Trha6 lZwRBRvgVaZwE2foopA1GZbmnR2pP+ynatwBvsCSNOzn6HA2iBzgiMiFhRxKq6cvi4DW C1814Vggrg9+UFDQfSQu9wXVS55+OH+woQ3UjiT0CEZag1s3l78G3LInHMKemBANzMAZ N9/cXDeTPGRUNi58IQT/Cz47v+BzbdZvYtHM/5651soM2/truV/GtvLnRLCZYUTzIFx9 SRmY8FboilgY1+XXr7Zkrd2RteeTgWBn9zfNDlZ7jG8gTntMDMO2KQSYxl7KlBMEYuPx 7EjQ== X-Gm-Message-State: AOAM532OTrezA6IOqLjUyq83NUu6zmO1s/S8BT1AwwjhI6z/I2vHVn2s KG3Rs0WffX+S6A04H+P84I8= X-Google-Smtp-Source: ABdhPJz+65J2x0mlNjQAOZfmvYaWNxrWT3wUSmYXSZ0hqXdvMzf5FGS79hkN07RU86xwoHWwWCUnXg== X-Received: by 2002:adf:9e49:: with SMTP id v9mr4319908wre.39.1630595848631; Thu, 02 Sep 2021 08:17: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 02/24] target/i386: Restrict sysemu-only fpu_helper helpers Date: Thu, 2 Sep 2021 17:16:53 +0200 Message-Id: <20210902151715.383678-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595851857100001 Restrict some sysemu-only fpu_helper helpers (see commit 83a3d9c7402: "i386: separate fpu_helper sysemu-only parts"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) client-ip=209.85.128.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595855; cv=none; d=zohomail.com; s=zohoarc; b=ez9L1Xq9TBSdMUJuf2Obq30yY7jE60zHgLfeGlB6zb847MpFxQQHZrnSfSKfuvRFWIIoyAwzKEdw1lAeYtp/Su8uvfN+S95SUW95lFqjWLO3IkB1wgLiqx33x/1/yEbLZawCwLktnFeF+ckagFiwpvxWn8N9N2I3TvNisHe5FzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595855; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CsKFO6zpXeyiIJnaYsonUL0fU8Qtt9qHYNbRlJRsUy0=; b=VUltecTAMKmwKEkwlW3yWAQFFklzsIiCZON6ZwC2/7Un97VbnWJp/vBuFD5rMTpjWpVWLMTYfx2fUN3yX1Bom4TAVsKdX5nsofXQG3EBgBJmPztL4+Bb5poA+k7jR6vhJKiKcMW5kfc3yLW9qfvu0cSSolX3tWpXVJ5XEDI2xPM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.zohomail.com with SMTPS id 1630595855866806.910569091165; Thu, 2 Sep 2021 08:17:35 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id 79-20020a1c0452000000b002e6cf79e572so1735230wme.1 for ; Thu, 02 Sep 2021 08:17:35 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id y23sm2023304wmq.30.2021.09.02.08.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17:33 -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=CsKFO6zpXeyiIJnaYsonUL0fU8Qtt9qHYNbRlJRsUy0=; b=msgoovyFZuYTFvHAVUWUcCjWeKOKX4/fQ6x5iV8uVuCuT5rENjJGT7Fi8gKdKImTio DTpGFYCfw4rll3/rw28+7h/IaCPuko7zVIUcFE0tQsdNOZfJ2wQjzKdS4Xfx4UTWbO+7 DGFf/PpopUkXuymVg6YWsO6N3YLJF8uh4vvV+trJgaEzbQGXX/gyiLlggAPNmBngw2tl YLsB/DFcIgycuwYBpuMl9JRZ+k8EZ/6TW42fGwY+XJMvHn4lwe3XKDAaHmIJVqNMN/Bp gAtfXhq/PaIsaRo4z+o2UGnxJeRORTSUr5BKUhFZufBsIeEFGjPyToZ1JIVE+fuT37wj LDBA== 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=CsKFO6zpXeyiIJnaYsonUL0fU8Qtt9qHYNbRlJRsUy0=; b=F6zS61aTvOxQwL6um4A6o/xjIeCFi2ejrR05hloeFMgttZJRGXQEPnk2LuUR9yFFmv JXwa1v6fuqsaEd7vVIhaYeOVaUmQhf35JW9kbjFUwAM581JQ2szmHaySXmNizpRF51SS mJzJKP74ppiESwyjHGetaCtNVCdEQbHRDIqaxhuKfStFgFMux39KDdg3tTszkvfpCaQk J4eFaCD/gRfPL5HxLIJ9BW5cOL+3Ybhc9qsY9cDTuGePwTMRb31KmpWeEdSwB5mRz9Iy b7OhIvGFsQO59IWxbsn2HMyiISbOTMl68Y1+fenTScwugI6nns+HOXG8gwstwcSXFI3g rAyQ== X-Gm-Message-State: AOAM530UILAogNeQ1qyULe3Jw0p3dm/YnJ1QNZ07N+eVYvh94dkTaJeV 2i52Jjuug4T44MRUPy8rFPE= X-Google-Smtp-Source: ABdhPJzg8hVRFyP0FkM7hBwLY6gryRcnsYlqDYRSHpQuo4OZJkYpIQrU140K4ZRlnTTpvOqGl5YOrg== X-Received: by 2002:a1c:f709:: with SMTP id v9mr3768889wmh.124.1630595854067; Thu, 02 Sep 2021 08:17: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 03/24] target/i386: Simplify TARGET_X86_64 #ifdef'ry Date: Thu, 2 Sep 2021 17:16:54 +0200 Message-Id: <20210902151715.383678-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595856708100001 Merge two TARGET_X86_64 consecutive blocks. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595861; cv=none; d=zohomail.com; s=zohoarc; b=VRB/Qdfgwb//SaqYcdRbGPm5ueRplfcRvbAliDtJEeFzykRQVrbZzFVI8A3lSPEPV2VQgm8pp0BQw51wnhGpC/lyeRKUMUyBZSKNOOWubbHgy1vmP4F0/NadtFF8IUN7BTs2GLGzl8BVhwaCEpeNn5iiMJN3C6l9i9LtafcQEm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595861; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rCmT1/gj4ujp3EJ6HnKnll+PX2FEvZCPZXd6eJGewIs=; b=ORYiE0GbC+RUrz2QzOE5+YmluULcsRZ7SRccnOgxuUESRPfYUtOY7vnphu0yoz8/sqCLqckuHDELKQBSecscBAs2HuGRGzxABFKTlmUPLTuaOfFi0tx30rqrR3Oo/1GoJZtcpA6wmePJdMl2hKEqjU0Ld32tuL/ef9Qc+ojm3aY= 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 1630595861375313.9196194727266; Thu, 2 Sep 2021 08:17:41 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id v10so3524315wrd.4 for ; Thu, 02 Sep 2021 08:17:40 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id d9sm2033778wrm.21.2021.09.02.08.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17: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=rCmT1/gj4ujp3EJ6HnKnll+PX2FEvZCPZXd6eJGewIs=; b=K5H1sTW1GKDrNxhnd1MRkJo2wQvX36QUw+Qh2zrY+4rmjtrOffaaaFEGdTTR6dil62 giCofM4EMWwoBGwla1naHVMHmrzDda0EkSP1HRrBOQLXCxaNc5xS12fhONL25RtfotJx 0lO16Vse+JjY3aT7O2bsw7IX7hGJxJSiWWv1NXAJXDO0u8E7CMROU13qf2nLt9eyK8AQ kDG7UG5yLnv0raH/qzsLTW4RMiX30ZxIGWpczh9j8bIRtTxw8weEtZYGsvuGBGwqAaSD huS0O/w0xB3XKyCV+IR+nv6KCXA8qS72499wpJggFbN8xnthpbkf6D3rKvmc8muhdOso f/wA== 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=rCmT1/gj4ujp3EJ6HnKnll+PX2FEvZCPZXd6eJGewIs=; b=YqEdeErIfgys3LvaUy4LDrDQ2oI4gA70OCS8r7mhm9UJofFYLiKAZSHSNzubjIebId nCAT7WlUw+cHDDuRTOOAKl5zVFbhYBHO9xOJmStoRO+N/FVR75b6/LUkiL+E8o8CLNq2 Eie2Fgz0tcfaXNotl8SGUsJaW/1oqM6aeYbN2Y9w5f0e2zWYIHwg4DsVmbjr4P0NnEdr pqgV25czq3gu5DgG8ub9fiPGUP5+Z+LCgCyjqZu/5GjaYy0JIoUBs+FWEH55YYSLelvS y3IhDslACmX42yJ8cWtmQEcAuLPnhUkd0aukMFdE3Eubw3RoIQs7KCxN8TxzpK2rGL13 MTBw== X-Gm-Message-State: AOAM533pX+nAaYafNvl7wG/BnrRUmcfdOfgdBf//xZsofmFc08VSCxR2 FvZgkIRMIMkNcUn1+6dojII= X-Google-Smtp-Source: ABdhPJxq9OxC39FWN2os/I7b6AoVcD7scypsit0B4vnScWs+gAUgdcSKDB8X90nejHSKyJ9RJz9KlQ== X-Received: by 2002:adf:ab0e:: with SMTP id q14mr4446562wrc.171.1630595859587; Thu, 02 Sep 2021 08:17:39 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [RFC PATCH 04/24] accel/tcg: Rename user-mode do_interrupt hack as fake_user_exception Date: Thu, 2 Sep 2021 17:16:55 +0200 Message-Id: <20210902151715.383678-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595863106100001 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_exception() and restrict do_interrupt() to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- RFC: Any better name / idea here? --- 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..600f0349659 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_exception: 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_exception)(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..3e387c944c5 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_exception(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..dce800a8953 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_exception =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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595866; cv=none; d=zohomail.com; s=zohoarc; b=i33m0b4mXvua+xMPqO8eWkHeQbA/Bvh9Yv+SakthfavPRqQN8uUSspv+fRRIBngYLnX6QG6YZJBWeTBGWGnoTzL1FKeSQAPoVVmo7RUfVtNHPKYfxU6PS2MtqXo6L1XSsGyXB4nKx4L9g33Etj1flYaBiDmCfX11mHVOglpiGrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595866; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BRVRoXmNXmCs6STtexNfP5aqtjz1BCQVthgUFpmXOsU=; b=BH1y6a1ncnNp7EK6k01+SC+jMiwpwKS6m8/HesmDAnbs6CCoOsGxtuBemjhzo2fh/TfDAZTd7Mrway78wzB0sFEd9TBXGFdK61DM1QkSOlfvHpOH+9Np2FvSN4LbA+FZBrmqqGl+aHN3prgQg2UjFeP7eMfo32SpdIb9geHezW8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1630595866579839.4871979873253; Thu, 2 Sep 2021 08:17:46 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id g135so1529588wme.5 for ; Thu, 02 Sep 2021 08:17:45 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id v5sm2036419wrw.44.2021.09.02.08.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17: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=BRVRoXmNXmCs6STtexNfP5aqtjz1BCQVthgUFpmXOsU=; b=EBlgQ7na5GU7TfCjhJOxtvlaJv/6+2seEqh1hD9lUOY8rAGpCNyI/X8q3C/kC6iNu7 y05gARaHBO7gR/CxagKwyxheW9EPWEU2KWmMPgTppkLRs3omrcg++9Q0C/lJ57q/T8qs 1PjJ7XdyMwImmeTQttV2Pysl/x1R+rsC665j7YdyvYPsNdGxOGAaIISz3pXw1gupS7Ec KLvbgUpCM5yWv9Ozrd3P+WxMVUtVWNkLZlPZZh4fLBCxbwz+4rkV1NSoGidtYyokPmen KcbF0cdAsBi6qiiG2uorvXkt8CmCZSSzTHFhZpDWChTTyq5PY+pDkMiGorFGuIxsflfJ J5JQ== 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=BRVRoXmNXmCs6STtexNfP5aqtjz1BCQVthgUFpmXOsU=; b=ORwy74ENPaMUZhLMg+Snac6vfjByVMpMo1lZiXqyTKzEv00nJbXvqhxkYx+9wdMce7 nMwPpiqKhWmaHp3mn4DQ7CWs6CzIjcf4zgxPxCJsZKKn7HMDDz///7v9b0ZaWOtBKXtR nGL6OtV919BteEvpOxr9KuKFaIf+pc8A/0cBPsyhQwLdLGQv+m7W5BRK80m3drKCIiQO daoJThQfPfOxJv7Otfa/V76TTBW9RKhJcj40YGcq2oYhhzLpR7dH9I5oYD661KDczF0Z 1sdHCSJWE+1uZucUdzwplPh2vRvE5kcNM8qSfSu/cMGMlcTdJK4NjYC1Ykce6JJEKh41 93VQ== X-Gm-Message-State: AOAM533JrV6/80EMlrOd7AM33gATxQe26dDoXVKzaZhBGEk9W0YMDE2E icPgUJw52y9e+OiImE1gmKo= X-Google-Smtp-Source: ABdhPJyUdZAO2VPuTAsej3+6kg3AOgh1R0QibZA0bSu1aty+aW8LszLySdtE0oBt4Ij6cQlS8ef/Ug== X-Received: by 2002:a7b:cbc9:: with SMTP id n9mr3704527wmi.50.1630595864791; Thu, 02 Sep 2021 08:17:44 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 05/24] accel/tcg: Assert most of cpu_handle_interrupt() is sysemu-specific Date: Thu, 2 Sep 2021 17:16:56 +0200 Message-Id: <20210902151715.383678-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595868130100001 To prove TCGCPUOps::cpu_exec_interrupt() is limited to system emulation, start by asserting it is not called under user emulation. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- accel/tcg/cpu-exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 3e387c944c5..5f4836946c1 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -725,6 +725,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, qemu_mutex_unlock_iothread(); return true; } +#if defined(CONFIG_USER_ONLY) + g_assert_not_reached(); +#endif if (replay_mode =3D=3D REPLAY_MODE_PLAY && !replay_has_interrupt()= ) { /* Do nothing */ } else if (interrupt_request & CPU_INTERRUPT_HALT) { --=20 2.31.1 From nobody Sun May 5 17:29:43 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=1630595871; cv=none; d=zohomail.com; s=zohoarc; b=fXYLm41M7W4YlFZBDt1GyN35yN5RtsywLlD7aw7E74I4kquqrDwHYgIXwtDtQNjt1kqr0LsFfGIzhkkI2KczuWzxTh4dA7WMPoua2G1vv/bIP+Xlzd4z1icMnyQcCfyTnI2kfxl0oNPUh/usjLTUUBpV/74m1pRd4XuHLbxThgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595871; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MA+BCTYyqK+9sz78Mv1qFMH8ilkc86l5KGXO2NGreho=; b=d7nTkYoM845gBS8jjkhC6wSF6mvu4VrPXxJU3SPJ+4PVQTG0iqW0XaxbZXWFRJOkNRqLsxrgyyOk4bOpvnZ3csQS3Ivr+9UFA29i0mMtnbAV2DDwIpFvEzFABb8eWn8h42xljq5RQFRgMrBNrq0R0rNPpl0xQcb0xxhdVBu3avo= 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 1630595871784815.7412303168933; Thu, 2 Sep 2021 08:17:51 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id u9so3519622wrg.8 for ; Thu, 02 Sep 2021 08:17:51 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id n4sm1200851wra.37.2021.09.02.08.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17: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=MA+BCTYyqK+9sz78Mv1qFMH8ilkc86l5KGXO2NGreho=; b=oUqcDGPVDflUwrHDbwUIXXAcNnAsyHW5IGmxT8VBf8GeYwqDwEZJmwmt/LiwcY9uUV dMpJSytBhhiumPbM1RkZ/zq4GHNkVhmfMrzfqmaihIZMv3YVipxRoIYqxZba4BugUueh uOs9e1IizyzQ4AXJmXrYcyHMAwFHsOficfyw6L+qsb3mZ1sAAEjEcPiuBD6BqADBOZYK vvqtLY/DxhDn0rlD6LhdUrsoeJtHiWw91XTU9o4go5UVd+HL7RhsI40C9PrXos8uzTWq G6HYkxiwrsopB4UGOcWIEQxOdiRYabP0w7jMH4w7ITZ7wWXP5ZP3HBUbHcOhByu3AMvP iDEg== 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=MA+BCTYyqK+9sz78Mv1qFMH8ilkc86l5KGXO2NGreho=; b=XjSjoKdzrN9CoiCJEod2tvBgDGrTOONqSCzB1rD0+X2qiXiFyBpTKTSIGSBRRR/I9b pdl5uXnNsEG4O8M4h26SCEXWVWdE7lHBUxdW8qmJMMwSeffLUnBNkmbr4WWl3tMFz4Sf lfFmQEbh5GPn2D66S0YpRMVRTuZu/KG01q7RBuniWJlTJ9eUwk2Mb6WUmsqgfaSTtj46 M337m6p8MgXVRIiWyiieqY6P1DF2LxpYsna6PqCNllmBDODRmb0c1taPSChvS/z9ljgD H9in4J4qHdDNOWxG3WZAhwhY/MtcuGd3R+9YkwSF3B+EqJvsrLN4m7ubCL9iSJcBKWta DlVA== X-Gm-Message-State: AOAM532Gmd9+XUpbIHRiwEuFgjDjc/+rptkHvB4oqwNm7uu3IA1QBjqH fD7grcQjrZ1asVboN80E2ZU= X-Google-Smtp-Source: ABdhPJxN6skH69/vZF7eQ4VXxF2lHz9zrv6BXlS8rKLOQK0bDW0Alo0k0ZE0Nq3ljolYkUXS0sthjA== X-Received: by 2002:adf:9e43:: with SMTP id v3mr4345919wre.274.1630595870054; Thu, 02 Sep 2021 08:17: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 06/24] target/alpha: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:16:57 +0200 Message-Id: <20210902151715.383678-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595872534100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595877; cv=none; d=zohomail.com; s=zohoarc; b=JzwpyAJgLh4gSwJx6cSTb9FDSRT9ZysfmSQqUvxFMaGGGcWTkeWALzPne4dHQAuIFoLIdnLiS+rqOaVwQTXIipizoTdLYMi5TkF++qyP6EY+CGsRge9PudNo3yNOOo3j+2B+kXj/QThW4Eb/0ruFbeRd8q0ATaiO5Yk3Z99Zc/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595877; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L069GLOwVevZIfbe69rrRhjD3OO/UZ2SAngHRNvFFbM=; b=jkf7e03x+SpEXCU4nKA8CnuXu+RQcmVOMsUOP6xJca/hLViITDRe1rNGiikK/d5PjLQgt1crYL2mFLX2E9k8OiF+yxUGAYQ345FL6QMvXHa2XHmVZl6Be7QOv9ag7z7X2t0sfnaHUW6juURW+LMNiCjNfF04C515tHLpCUuqaBA= 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 1630595877300178.9330225361623; Thu, 2 Sep 2021 08:17:57 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id x6so3498749wrv.13 for ; Thu, 02 Sep 2021 08:17:56 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id z6sm1922386wmp.1.2021.09.02.08.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:17:55 -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=L069GLOwVevZIfbe69rrRhjD3OO/UZ2SAngHRNvFFbM=; b=oGFhlU3W7icFTCQqe2vLdOfJ4i1IwyonfuGQJmHpWIxYYn6AxbA0Bq6McN7Ukka9x8 N4MdZBnDzDDsW3s7FyObSO5mqkiVznwF/lAiNeVZW0INDUZ43RMen1ZT0b1XKbV797pb gOKVBhjH4qKYlpXxoVtIenA+O4U5VVJmmB8G1u3B2nOwPmgE/mUswm9DFbCu2teNyHLV o0MYBUqDdiBBdW+B9ynEkrxcm4u1sjtLhBql8CeOj3S6KUR682jn+eMQH7I+r6WOA6ic J3egKeRS1aMqvL/3W29NICX9M3aTIUUZmJyiirUNSKf3lILUsqwjSp6QLIv6jzy2kCUY v+xQ== 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=L069GLOwVevZIfbe69rrRhjD3OO/UZ2SAngHRNvFFbM=; b=CPBoABaxt8glVqBwyewwbEgRrHWb0Qfi5v+/hCCFssZPGEYgK2nwK4ZN8xDyBbnyYH 3JW7Jd8orRUripKSuxo1ojq5EWULGI2qqOUyM7DtUr8OELDIgVtojvk5AH0NsexfR4+7 X4GMKQPknhvdQ39XC/QStBJMgkRS9oB3+gemXRlj8bff1lOAOSFEC3aghbkXSBX4kKjO TNBuAVAOfcw5KJrr53Pts2H0P/QKAQu/Ty05kPFoDOmhZcAA0OhiqQk4ot0gc4sMJZn6 1dZA+vhghRY00WfTitksJH4utxZAqKQbwUWg96/jurSdYrX4NUnRhBdoyBnQDOtIdFYv t3WA== X-Gm-Message-State: AOAM53233IA4gPtvJiaO9QkTyfY9CrSdjmuiFaHkp114cE/UHeYBy0Nb ZkAQfow06yiY03jdX4USnUc= X-Google-Smtp-Source: ABdhPJzGIrEP4bzDJ3hKz79TOWMgnxQnc9fJNmfYF0UysHnxKdEdFVRNKA5CCjHsB7svPHLZe0xYTg== X-Received: by 2002:adf:d1a8:: with SMTP id w8mr4440778wrc.306.1630595875567; Thu, 02 Sep 2021 08:17: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 07/24] target/arm: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:16:58 +0200 Message-Id: <20210902151715.383678-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595879278100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) client-ip=209.85.128.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595882; cv=none; d=zohomail.com; s=zohoarc; b=YLgPjHxRXay9mMR2gB22saq1Azk/1YZ1IVHYl+DwDbfpTOjdQsKdhG21x3rNQ/RAaL8tPk7sPlR35RP1JhXXYPDdtRWXrGk8XkCKj0VCtHVdyjr7VRKjrAgDzjDoZxtjBuc4qZNsbFi2aNV5xhCICfYn3b1yhzAQLDrbeSnW/8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595882; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qUI/GEcrThYL7vzCuO0R9Lw6aoERtFPxgcZzSbFzqgM=; b=lgjKBazoZbvsxD9AbI3W7q5SpXAXeNl7pBvIMh+gsGppzMoDUtkTHAMskAZoGtAR6WaYMGYLj4QS87mHid3GJONOJa95bEJwNy8wSijvCuAs4Tsv0cLkLfOcWkPXfjzOkeLWCVmT9dmBq0qBR2Cvs11i/Ix84nitcaKOTrmdJws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.zohomail.com with SMTPS id 163059588268629.77687199229547; Thu, 2 Sep 2021 08:18:02 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id o39-20020a05600c512700b002e74638b567so1628399wms.2 for ; Thu, 02 Sep 2021 08:18:02 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id c13sm2120248wru.73.2021.09.02.08.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18: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=qUI/GEcrThYL7vzCuO0R9Lw6aoERtFPxgcZzSbFzqgM=; b=iVe+9QqLylnt44FCv/N/bfyTajQ514saaLhXAzK5EeFT9xMeKMd1jEbb+vjCPqN5qN Hj6EIuaGURXyjORJmhtVPYv94Uen8vqsnqGTFcyOfRVX05r5frtEsMm5Pwi1nqEmK4/O X6p+NfV0JuQBExet9c7uVyJWb7XjxUfREWMA3BDlKCVF4Y4ZWpSP1QOErtpS28if2IQT h7KNQi0PSAFp1Pi6U1g93GYTTxirckdTDakyIKakBGWTT+g0v08azAwFuQHSj5+KPw0y O2ZbvWidpUAZ11OdgEd2kG5sJ4RF9TdP5/KngToSbEA5Uq1sG5Lt9nQdav43sDGf53yJ IrhQ== 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=qUI/GEcrThYL7vzCuO0R9Lw6aoERtFPxgcZzSbFzqgM=; b=jGVgVDjgDTz2M7MLmdjsqjUgqcAo85m0/ZwHctYJXReCwPeN/VQxDBupYEAZcyKKtj Ukg2f8nk34cG2gykbCSFFqa5QQkp07e6L8JQ81m7xDXXRwq27tK6EDW/FNejzmmn4rN9 fSc4CLoWswvz51K3i3Z/W/l49F450I5rpQa5e/YBHONECuv/LGCazl2vFxEE6OInFnMf nXH98y9nLBD7YrdHGnfr3nPu5Gz9hPmDi0jzbh4aOmSMRRKcOKG8S1JErvN++akYJMJv vyztcBoq6xVPHEuHwyVSJvXlQNgY8Cj+givCws9R7ftSm7SqX7pj5KQViBZAfUp1mbJb WArQ== X-Gm-Message-State: AOAM531/hFfBbItMS1yI+e4AEuKqrq+r4zQYlSo0D3LoodmF5395uQuj O+JZEuysD63h6t4zJJqcHXM= X-Google-Smtp-Source: ABdhPJzAnp+XZLE18wcnuwhy0fp4/okghnI04S0wrtOup0uMFI8bALRUb6vI89KXsNrtVvB7SCNy9w== X-Received: by 2002:a1c:4686:: with SMTP id t128mr3601905wma.183.1630595880991; Thu, 02 Sep 2021 08:18: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 08/24] target/avr: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:16:59 +0200 Message-Id: <20210902151715.383678-9-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595884051100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Warner Losh --- target/avr/cpu.h | 2 ++ target/avr/cpu.c | 2 +- target/avr/helper.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 93e3faa0a98..6f8c0ffd770 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -156,8 +156,10 @@ typedef struct AVRCPU { =20 extern const struct VMStateDescription vms_avr_cpu; =20 +#ifndef CONFIG_USER_ONLY void avr_cpu_do_interrupt(CPUState *cpu); bool avr_cpu_exec_interrupt(CPUState *cpu, int int_req); +#endif /* !CONFIG_USER_ONLY */ hwaddr avr_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int avr_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int avr_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/avr/cpu.c b/target/avr/cpu.c index ea14175ca55..e9fa54c9777 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -195,10 +195,10 @@ static const struct SysemuCPUOps avr_sysemu_ops =3D { static const struct TCGCPUOps avr_tcg_ops =3D { .initialize =3D avr_cpu_tcg_init, .synchronize_from_tb =3D avr_cpu_synchronize_from_tb, - .cpu_exec_interrupt =3D avr_cpu_exec_interrupt, .tlb_fill =3D avr_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D avr_cpu_exec_interrupt, .do_interrupt =3D avr_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/avr/helper.c b/target/avr/helper.c index 981c29da453..84e366d94a3 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -25,6 +25,7 @@ #include "exec/address-spaces.h" #include "exec/helper-proto.h" =20 +#ifndef CONFIG_USER_ONLY bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { bool ret =3D false; @@ -91,6 +92,7 @@ void avr_cpu_do_interrupt(CPUState *cs) =20 cs->exception_index =3D -1; } +#endif /* !CONFIG_USER_ONLY */ =20 int avr_cpu_memory_rw_debug(CPUState *cs, vaddr addr, uint8_t *buf, int len, bool is_write) --=20 2.31.1 From nobody Sun May 5 17:29:43 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=1630595888; cv=none; d=zohomail.com; s=zohoarc; b=fQ45xjQz4er0ikoUEwIJZBIONrAeL3Qxk11UN07P75h4gq1WqJhJ5u8Z6WKPDzJ5u1gsZOTgdFwVNBirvlcWXXpmQaD5u/THvzHhrQ3B12BkRNsGgX+5hB9ne38JzIoHmwjBxBF6gtDjqwZnqCK4rRtL9O0KUwmh8JKyMDGUzb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595888; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sS3i2uWlhC6Th2tekPb4X1SgXpgkBQycKSoBAZ7tQRs=; b=k6xg/JW+w4f6Fb4z3GdlFV8rjArTkQ198O6C0Cno8OCfKsoXVSQ1Uq94QZQn0o8E6Vm4SpE9DYWhQ6o1kV1h5mqJRNH9J1WrcLJfBckfzXn0iVXF8Cu51CER82ELPsv0gIP6ImbYn62jAghJwaCN8IM8v8liTGTBJ/bNhspK5Rk= 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 1630595888044607.6737579841031; Thu, 2 Sep 2021 08:18:08 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id u9so3521293wrg.8 for ; Thu, 02 Sep 2021 08:18:07 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id n5sm1870776wmd.29.2021.09.02.08.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18:05 -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=sS3i2uWlhC6Th2tekPb4X1SgXpgkBQycKSoBAZ7tQRs=; b=I0cbESj9MYfyAom2FvW1CF5AEhM1SW84X3lw3qtfipSZ5fPsIZv+smVyU9GoN5CLH/ KFHhUhGgNcosASgg2d0J4AdV8UXNCvxTNWjk8PeGuYtMiNyN6AJrrsZLXmABwG5dZ6lB 8bRALf1eTZfjstnXdJCKwssHXy6wXTM76v608XnZk9x6BIwOtk3PO6obcKrJH0ufiTcc W2x056SigVvWsY9uBzEPVdONxKCIoYgTNGOJNBUyoPX4Xva2AAAuMoQc267eb1xsMKYI MOjHbNVBLRFk1LA7ArYb3vM/2HQtFULqEESZGgc/xgjtrsvqz1SnRFmOnCq/FvVIT+Mv FfSA== 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=sS3i2uWlhC6Th2tekPb4X1SgXpgkBQycKSoBAZ7tQRs=; b=s+VQUtu383976R6QrLSIU47snGdvY7gr847V83pi8iupMudLRFfOlHwpDR2kOgn6VV Q9wG+b2hkQZjQaCHJVj9JFehlf09Td8LE6rAjTQLKnH2cYBX8DIhoVIEeZIh5WCukB6M IOX0Bcm80dqUlrMF6h1/pQTN9gWMxhNS0ym7M4SWwsBz7UYKLe0kp/6GOhOEhzYMRRSz r/trITz3WiinI38xPqzROPd0I+eYanb1SBYy8PIverL8O4OQnSIGjDC4y8zPyiL83sRs 41znMzBn4A90qsuL4PKlGJV7hYqRBnkU/NRLK4pgmwnmI3iphkEpasUFpneOHQqlUPbq Qfyw== X-Gm-Message-State: AOAM530G7n7ZMHv0R4KZbqz9rESfKPFKGAvF51595QM+ebKG/3uqR07b 6L+bMDbwCeEv2NVujOtUvJA= X-Google-Smtp-Source: ABdhPJw4SAbJhZJREw1KxGfT3cO5d+i72swhFiLJZpIt/PVGLXsw6xgVSz1yiQpiFRsRenYXVxkOLQ== X-Received: by 2002:a5d:554e:: with SMTP id g14mr4407181wrw.48.1630595886267; Thu, 02 Sep 2021 08:18:06 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 09/24] target/cris: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:00 +0200 Message-Id: <20210902151715.383678-10-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595889008100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595893; cv=none; d=zohomail.com; s=zohoarc; b=aqJPp8yHnz1mHNQEJvhJrsixEnEcmr71/7lA7DASZB5pA0ACFby/wcnjCpaW8SbhdaortH/0MvnxosJ7z+EzM141/H6/MqDFDpugxb4Shizc+YkLn6pF3GMDEoCXnebAq6WPfP5UM0kHI0UKWdIDtTTuTr8WyL61yCqbt2ZCZpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595893; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dnN+i5SQHDPtQiKzhJew7CvpvP6BIGZ5S+AtYPNrOLE=; b=MLwz5L1xJ3gQCU3tO/xKQzgXge0HpU1i4ZY2YbBLNPU0H2hqUDLTiPSxvJOU/YmJOnhZf2LyTdRPbhIOxzZaLpf43tIXj7TVzKTuxzIREfOj9WJGzdrYwkLSEk8J6YJ4crt1CCcPaEqU+zLG1hJS4t5Yhfo5IfroVflJHXhWloU= 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 1630595893315590.650431627827; Thu, 2 Sep 2021 08:18:13 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id i6so3536862wrv.2 for ; Thu, 02 Sep 2021 08:18:12 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id d7sm2103665wrs.39.2021.09.02.08.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18:11 -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=dnN+i5SQHDPtQiKzhJew7CvpvP6BIGZ5S+AtYPNrOLE=; b=kEJNGq5+y52RmEfLyPaM+2EQaUecD+RjYIrHyechfU3C7P/zoat/9C5KMK7hqyYhlE Qf0gb0A3fGNsIRA67U6lTpDEnkmFOP0G0V9hz7keKGq/seG4Wa5ZEtP4FuljfNG3VVeV po+eZtnaY4t3DCqe8fnKdGkFuuVcaVVin0rec0ZTKFJDfp38Je7jBzx8cEWJFkBEc79u JP1uyH5yZ2kerjkXeyX8e6jsE2906mTlm8n7J1ulmM0acE/saR7w0xaKA0CvsHN6Sej1 DzLDOb9wCHXwCkKrkYaw3ZRf0e3LbKWKUxpqfo+Z98JumEk1RSOfYIShMXGz3X0nHIlt Oc3g== 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=dnN+i5SQHDPtQiKzhJew7CvpvP6BIGZ5S+AtYPNrOLE=; b=pMXeNV2LLcBsVytwYHohQvLFog/j24O8fGOU3AI+AI0JwpdEsJTVB5zP7005pJ2dYR h2w34W2QRxVh3iwNmWt5BcgFrFOgrpgznNqEut1cPdBB4kqaLOSZ3dvG1n+GJ5TUx+5p TXSRlKbglO0FIiQnIKwJMRect4yXMih4xnoldsoc3DtAix73/1bRYxUROtweotJ7SaL4 stewuTHEzgmnZW2SUshOsOXJDpI+vNVkapZjOruNfKmMAXbzu9bymc0t8V0hlzgWBYu4 ZXxaI9rW4mtQwCFS4RjtU9ERYR7VI1179Izx9zpgVbDmv1hC8P4w3fb00T82E5vRfBiQ uUoQ== X-Gm-Message-State: AOAM533+sYILYpxDNwSXEptFWpityLkVEXEGPBPF9GLZ1T2s3vtce5+V I2rlvTfLkU1pbviNQTmjKD4= X-Google-Smtp-Source: ABdhPJxYIPxCclNCrRQ4GMcW40Oabc2JxsPW4A35Y6zIiI6b61jRK9z2oFaq399iRiy0poafmDE7XQ== X-Received: by 2002:adf:f743:: with SMTP id z3mr4416016wrp.211.1630595891506; Thu, 02 Sep 2021 08:18:11 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 10/24] target/hppa: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:01 +0200 Message-Id: <20210902151715.383678-11-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595893905100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) client-ip=209.85.128.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595898; cv=none; d=zohomail.com; s=zohoarc; b=X5E274KlsyIotuAnOTLS9RrIHjgRSGsO75+fLE/zoa4UF3EZrntwnK/HKK7hBPYIuVvBioBxrzW5+DRkChIDyCGCFYi4yt/gaVFif4omtHXB5JaivccIVoEeRGe7AVZxGYBERInaNP4mrUT6QHvgF4s6VAsJm/xk0IYISGoa2uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595898; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fcD3NEKxqm51zeSb+lOjnaiMKTAZvQ5t+y/MQ7dqNn4=; b=Vuea+BaQrK4pSS25ko8X0KGvk+SoEXk5ebo21cCHtz1kGQNw9+cV9Gpv2f4UOKb5uarT811GmFmS8Pm8oCeR+MNlhHXvwzS5+Hoc3pG9TZqLzbw9HwwAUVRXGx4v4gug7X8UkEeT/3W98u55pNKN2+YsBAq6pmyhYgdp0355Wpc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.zohomail.com with SMTPS id 1630595898944699.2900843311356; Thu, 2 Sep 2021 08:18:18 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id u15so1544532wmj.1 for ; Thu, 02 Sep 2021 08:18:18 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id i68sm2187724wri.26.2021.09.02.08.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18: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=fcD3NEKxqm51zeSb+lOjnaiMKTAZvQ5t+y/MQ7dqNn4=; b=SoWG2/wQj0ymZnxrkfnJDZKSuaHnBEMFz8bj97s4TV8NBQ32xc7+kcPUd2yLDhsC5w CegLWLfFZOULB2qsUNRjw+d2r+k3oF5emn6c+qVl/cYK5dAaqAfGfOr63WsjWUXmblZe 8lAXQg76gUsp7/QeheJxgFIDlfA3lzhHP8vaadbZZy65HaXI0jSTTilO+xsyM0ObpCaI 1WZYFfdRQSUI+DQiDYLuB3JRb6b+9HRuSpiCvCksshLQ9/SAHDt+4b2ts7wdAmx7LI/b aXd8JGK6rh9NXMW4PAkUxBdyjcCdcZFrQRWxuxxsnQZyyVx1N6Bq3sj1VDFaA8/6sewn fSIA== 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=fcD3NEKxqm51zeSb+lOjnaiMKTAZvQ5t+y/MQ7dqNn4=; b=PjT/yWtMd21vb+RPZxRRs6dg5222KCdoeyltzaYRvr71diEzpC4sNV//h/YC8bPD8Z he/gNjO1ZDijSqRRWG8VQD6kbQKs54Bezf/hOY8aya/eCSs50PGMd1sLntlz+x7Inbuq kzzxmEjnIMKQxQ0qjTuGhtWP1ikJXejNKHbH+93CQA9Ks1zJWsrLFnlZ68JbJCJX89A9 K62rNwCWutZ0n1b+xZQ67gAw2dddsP5VB5ntBIRbRpcR4J5cDPLczHEGFhLBalJC8xDR VROSASCO/6rQe1zkWijuabrd2iu1mtZDgQWtFMt0UT5+HTw4DRvAGhS6KyTNxbj3dDrP RzBA== X-Gm-Message-State: AOAM533NSufMpL/9nlMP+cJBTiD4gaup90kY8xlw2sNMcLy9v2J3pedu x7bdZa7tJ9RwTcYwXlMqo2c= X-Google-Smtp-Source: ABdhPJyMdX6G1vQy+2o7TKZglcvYLmKGkf97DRaIkpPbJyZVsKwfU5KX+Ng4s35R1vCWNozyEXOtYA== X-Received: by 2002:a7b:c94c:: with SMTP id i12mr3769142wml.111.1630595897048; Thu, 02 Sep 2021 08:18:17 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 11/24] target/i386: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:02 +0200 Message-Id: <20210902151715.383678-12-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595900182100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 dce800a8953..fd86daf93d2 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_exception =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 Sun May 5 17:29:43 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=1630595904; cv=none; d=zohomail.com; s=zohoarc; b=J1GQabxNmwIQNV5t2ZRBgiwBQxt9DQ/oIzvG8bsMLxyb3RWXeS4AZp2BSf3ie0Qb06WtDWnbbCb2eXIbfzOeQd8DyTdTWTfiUFpNUiy6ajqTV2leJ5+XsTPcz9H3XnuhWHbV2x9Q0lEkcRS6HDZvId7oSPNaljO1F1eBJdoFadU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595904; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4y+tkZcCyCTYKE/BQL6gLFY/AtMrXXFDFTBuQLK5lBI=; b=enfiCIubiHsOtao3hzF3o61JMbgZNSEaJ0QMCzXehSS3HSnm0xHhzjArk6d7U+YmqNFr7WjJb6ecNs1m31C3bo03Xu5msUQyJHefb2I0bnn4E3C2FE4HHS1wZT+/aZy5+18hCy5RKY3zIMxz0a3ZYraW2YvnSMHjf43jg6a3ChM= 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 1630595904159533.7659663868509; Thu, 2 Sep 2021 08:18:24 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id u16so3533852wrn.5 for ; Thu, 02 Sep 2021 08:18:23 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id c15sm1848337wmr.8.2021.09.02.08.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18:21 -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=4y+tkZcCyCTYKE/BQL6gLFY/AtMrXXFDFTBuQLK5lBI=; b=daEpV700sPQx6D7ryRZBP74aFbuEp5Js2zD0dQ6602tSFDOJ9VJmaX+77RTmHv6k/J HiEH/VnaeEvu8um+0NqP4S4h5G/LWlhmiI5Xu89MwFWSlEjGiDEfJg4RTVSUcl5YnO34 cAL+34Kraos5RHmxZjhCfqRiEzoQrYOPikwiwRGOAhnTeuoxNXxd8LR/sq/ciWCs912S orFQiZakKfSAwpHWKxxAKmDY99BEV+wU3KARM00Nw91239kaUr1Gbx+5xfGT08R+P8qA sC0jDjQ/vgqnwJklRFtU9gVQFWaF3B+8XRWB3reIJPMznW+0iDiOdXyHXVRNT6zAUSxz bd3g== 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=4y+tkZcCyCTYKE/BQL6gLFY/AtMrXXFDFTBuQLK5lBI=; b=gzIC1sy0C7ZPXk57Wg+/0+EiR+7XYE1X8dLlbuYYohPhxKyLZ79J/KWFaQ8z4H0mbx K0I8uy3Aiap07B02VY8J1NAYraEcQD7uMkDFTS4hKwXDf9XZ5rrH2gDJpxcc6uFE85OX F4gZujhtodHGGpM1d/hBqzypodhdCbsfDiM8YD3PNxajonxF8J0ybhgcZNMtCLFczx0H YEt/jJegX7A3VlZ6vuShmJP5Srr/LTwwu3ZQonC4FP2lCeNg6qRbCxOvho3H5WXswiAd csUYqLTuM2T0+XjWZFMID3J9GNU6eZQITDSBiQz1ZboOCCu1SzC2U7PfmxWNAEADnqqL i4aQ== X-Gm-Message-State: AOAM5304/89h9RTHDBCbsVhmGfLdDxk3WcNWRuFg0UMIyXP2THA+79Jb tt8q6w9dgBiuBeSVImSAuLo= X-Google-Smtp-Source: ABdhPJzuKSbbDi1oS+m6Wcn8WtiPfO0pSz9kRPIqlSgYw2A+GA7Idk0l89rGksaS3zRtHoQhwYvKXA== X-Received: by 2002:a5d:464c:: with SMTP id j12mr4291179wrs.27.1630595902416; Thu, 02 Sep 2021 08:18: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 12/24] target/m68k: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:03 +0200 Message-Id: <20210902151715.383678-13-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595904889100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595909; cv=none; d=zohomail.com; s=zohoarc; b=fyBlS7ciMIkMXwuewzekEeWJRXo3gIWEy2VZSMQ4PaOi7LM6TxImRCs9znNLQ8G2Zp/WTol+N6eo9x+bq82U+IMCMv1S1wq2YRNUGSz/+r2iXp04w7YSo9/t5oa+8C3rrwVAwttjrfzFYZv14bplaLi8SkoGB4WipMSm610vHUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595909; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ztcTTnkmE3Sy1SDB/uPjtWzU/LrMfSjAGUpWvTwvo3w=; b=UlS9MAUjTkzwJdfaBY3vC8oj3SuexZrZDrtxbNswG1Cq8wPllHwBvAOjUcdDLTwrqt1D+wD40/sihrUtk+RiEa/mcL6bYF6fNx6KM9ZjqQbjujRqr5uM/g4fDB1Bw6q12p+0AL+4KDarJKUv2vX3bXudDGfDBbFsvUZRJn5TMYg= 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 1630595909449365.65978334336285; Thu, 2 Sep 2021 08:18:29 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so1609722wms.4 for ; Thu, 02 Sep 2021 08:18:28 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id x11sm2016661wro.83.2021.09.02.08.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18: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=ztcTTnkmE3Sy1SDB/uPjtWzU/LrMfSjAGUpWvTwvo3w=; b=BUqC7PaF7PzoMYvp5taCbjdhSwKs5a3L3G6rE6UCOzDEFmY+e7iZ/tPOdsuPZ7RPLK XRGdfIMRn69UAeSJ//SsTfOz6FKq0wbS451YbfELFBQeVp5ajbEsjewt5EoLI1KnhGmK ey6vfKSr1f5lCq1YVjRlenq+Ik+N9xh4qkVdNJnRNSbv6zv8InbxtOmRKZrcU5y1jdl1 /rvp7qbhqsKhL4azgAIssVrG3DOUN3gkN9CVztK8/p0Y6FbmodAp/0SZ7WLhu/edxKoy jZ7Fc+NzXCUF31Nq0q4KkzhW0FfGahTZOqxVWuWXoBNIcfVhDH8ea54WrA8T2UcSxlyt Hi3Q== 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=ztcTTnkmE3Sy1SDB/uPjtWzU/LrMfSjAGUpWvTwvo3w=; b=PiO3456CRLpC8Kpuunb0LkiMbz1FNMLtaL7y2WB5911tk+c4fgFJBUabLd7WyJ908b yhQxHPtqB2Qh38h9hu8DkxFsW0BNtf5bFS2l/rtXhiIOzHsdaMSmhS3z0AQ9wnVaOgY8 3wv41w8wqhKnbaB7mF4LbAb5h3kuiBvu9BNXcPHFmydoovz9dIA8LHAPKVbwcpRUQzFR CdblZpthwkqc4yDDsDQPBcx+3KyZ4HGoauxKny59fIvd9JhW5u5EbU6QD+VcxH5IIrG6 mb7Dz8pdmmWAblN3KG9qRJh6ctuTx7aKE9oHc3DhIyqQp6H6xvPTcpmTXYVno+PAMe+U JFKA== X-Gm-Message-State: AOAM532wTNd+shdNx94adySCNTxyAhjYGze4bTLoyOuG9HuW+nA8mAKd 7gePbdQzFJxtlsVUC3gMTxE= X-Google-Smtp-Source: ABdhPJzAY+gEFr74wmw6KyBf2KbIWUrFnxTkLQzFaB4Bc1Ln2DAgVSsIVE0jXNvSrGRcCpuRlOL4Uw== X-Received: by 2002:a7b:c7c3:: with SMTP id z3mr3687535wmk.96.1630595907666; Thu, 02 Sep 2021 08:18:27 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 13/24] target/microblaze: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:04 +0200 Message-Id: <20210902151715.383678-14-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595910806100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595914; cv=none; d=zohomail.com; s=zohoarc; b=iJ9D5tqd/W+9882OsiziBCXTx9+0J4kTluzG6uSzYuPp0iIvgKMluWcnyvyhpWwPloaNhpUFl9ZSpqoAimDf4joHcBZUdgxFDBeuArKZjhPx9K3igTevaCV2oBY7Es9fI85Oakrlnv2/NzlheI2cEOZGhS4aRn42vjuHBtCM5mo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595914; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qOhbKOMLJQTnP4opOKzKRsGwickHkRFQACXPCZkwzZ4=; b=TobesCK5mlQG5VJxftwX5c/gMZvPD6aZUEvjEXBz28oqb3Xx6S7Zydm5Pi4ZtjYbrcrVfjs36liQdjH5Hx+/8KnaSU24A0yirE//Re0QROZOE+lJGV+JaebuyxP5V5qn4OxpWqiMtyy10QsjqnTTtLRzPY8jF51oUuBG7zIWeho= 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 163059591477659.87950050656514; Thu, 2 Sep 2021 08:18:34 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id n5so3502784wro.12 for ; Thu, 02 Sep 2021 08:18:34 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id 17sm1830515wmj.20.2021.09.02.08.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18: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=qOhbKOMLJQTnP4opOKzKRsGwickHkRFQACXPCZkwzZ4=; b=MVdpwWPCgzsfVptRrLWGxJCKhgwtHmICPzS+494nVY58reKdXIcLJv+nFCR2fBuT1c EjD/e/B480ZHjRxYaeZYH1BzttEuTjVRPsxJF7w9Kccd0dazIjJBO/v824FVwQi4SF/2 jPMOcbajzTFpJLAsqEhBGLKlZcWOkxIQPgQT1iMo3axxsNyT5tEHTnWQSsgnVAjKccwp 2Ahm0ebcztLvCmzqqJggnwUKp860fyqXzCaSmQkCSNNyIBLStSA5MyHENKpNYQ2c0soE jbhOrcKT278czFzvKqt4yZOM3QGSxResVes+LfOyb4cbpvhNkwOdnkSvXuK7E+talVC8 6N6A== 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=qOhbKOMLJQTnP4opOKzKRsGwickHkRFQACXPCZkwzZ4=; b=jZtXA2/1cDxr3J4PrsCujY6UWv5bXtUvqPicgiAtNextOk0wIOEbeno5Mf+s+Ys/3/ EYPWCS95tX221NS9hs+Sg1bxryE0MZiLe3hjbGEmkzQ9XJ9Xj81Tah9cSSNh2V0ueSCH w9k+O2DPDE1imb7Imbngacf4WbccrgmacHSSHwoRgfxEAsT0cV9CL31zgUrZp4B3HYyR spu+k/iSe6Ajm2cZLTyDRgSbGzcVMByTSwtvnhXg2iFZZiSoZRlp8gCyhJiprAaXN+/i cqcWcD1mTeoOTn1YeQKaNKeI+lOwDjrE5bVu/tsvN7xvZ5LYht0rDZI1oO0wqLVADTqv Ue2A== X-Gm-Message-State: AOAM533zp4m8swI+cLEpFDNHmdSx1DYPivO9Bx2uD6fDhhZ5o7jjzn/r yIW+6hi+mNtplB38F71SomA= X-Google-Smtp-Source: ABdhPJysv/O1nATy+Iu5ULEGo2DtI3bT2Rsk+0/uZ+uSNrF4KOuKlIytm6Z9sf/zOU+f6QI7ieRRvw== X-Received: by 2002:adf:c3c8:: with SMTP id d8mr4413659wrg.143.1630595912991; Thu, 02 Sep 2021 08:18:32 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 14/24] target/mips: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:05 +0200 Message-Id: <20210902151715.383678-15-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595915550100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 Sun May 5 17:29:43 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=1630595919; cv=none; d=zohomail.com; s=zohoarc; b=UksEUzEZwz0UGR7PScR7aCxGqvavHk8lCRQmxPOrFUlIv0QZvTgl+5MC1XUPOlVNIFE1JCbr9QWYFIBJtpcDfNQjbbpS4e/oFgS2OdnRqaogiby9Kk6YXhQQkRxuCBkEhJ8H+05/GnE//7w/5rKRYKo0nQOxMfUbgtfahD5jXkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595919; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0GktKoVpj+qe0HiWbp4icgBh99dDEcJX34VsG2pZhco=; b=Y6Tcl4roe+YlEBWoRFW3Y99vGLVqYkiAha5GyxF2EMoVK6gHGuDe/wk4Ku9cm2O5YjKlgZ6rOqS41QBZnD743UwGMaANuW0V4QfVP8NsB7X62FRxWxDw416utt0NcdzUcpBruhHTdBFKyzn2MTsbxeO8zkGSv5u/rTfhMxausxQ= 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 1630595919945428.5642686113422; Thu, 2 Sep 2021 08:18:39 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id b10so3586864wru.0 for ; Thu, 02 Sep 2021 08:18:39 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id c14sm2124839wrr.58.2021.09.02.08.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18: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=0GktKoVpj+qe0HiWbp4icgBh99dDEcJX34VsG2pZhco=; b=Is/bp5Fh3XIA6hA/dzYmAetUcNvoZbT2PMTJXGQenLZN+cEr8VtGUCBay42eDTze3D tozqjRYDGa+pvoWsszXjMC44TDjVW/DQ7RVegAPyGORPmSITzcbmFDQeIEXn0HPn8dTX /U/pe7aZ5r0VIsEOt1aP52anoSIYLNoIvT0SumWrSTHg+LuNZtDynarj1+o4iLhrF3Fd ghRIaQgQ4IEId94u70SN7rVMr7bpy5Cax5wQetz7Pg9VoPxDIMDbm9DAbnsMgSjMYcSl aBOM62R7gqMKq5F1pzyNNWWrZTNAHf1veMpmOS1eqWdgfVBX6ygwimJigWGVENkwEPkz /OZQ== 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=0GktKoVpj+qe0HiWbp4icgBh99dDEcJX34VsG2pZhco=; b=epo4NKkq8JQKIidSyT1d4Cj6xBnHnSCUJwK/f3xYiQKAySH/cYHSUpVpve7OL2FUko XV5iRSYMrkZIVKbo/gZGYzO/lABIlLbUgO5VmDmzfGcBLpvR5lUmiWq/o42KDLUg5KVA q65E+d/HBqSJ8njO3HW4iCtzE0m7zxaDAUoy03ugK5TTwxwfNJ9wT3EPG6H6LQWpxlbR DOkJA977zXymzKBtppYrkXoZNJ7ibadVBF9TfcpoBHoFwYXcY2r+5r6cNF+EpRgnFTiV aNibb6dwF+S+2U77/AbrvJTgXRH8dQLPHBCV217HG10by//N5Hmfoa2goFQz8Y92alIB wnwQ== X-Gm-Message-State: AOAM532cDqVNdag0dUHzN/ZH2+HJ3C+3CUXBP13xU9nGcMIq9/R0WW2D y7qvFmFwCEMiS7bQDsYttM8= X-Google-Smtp-Source: ABdhPJxF98exm7cfOJwkqDLOJqQCS6DDPr9eL3M6OveGJ6xGChb/WGy6cZX+lWoxEhy/T1+Z2Xnkhw== X-Received: by 2002:adf:fb8d:: with SMTP id a13mr4524803wrr.164.1630595918275; Thu, 02 Sep 2021 08:18: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 15/24] target/nios2: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:06 +0200 Message-Id: <20210902151715.383678-16-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595920485100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595925; cv=none; d=zohomail.com; s=zohoarc; b=LB5N7/OKHIgQ1YN+9a42WPIdvlcJvX3Uiq+Ic0HTejMgJCg9pPmuE+4WB0uxIRITUNj2b7DnM+aJscXk1rZM+k4k/uyKa5op4mVtQK6xpc0XWTY+aBKB56XTCIT3NE3RNW1opN0/SozYr9w029Y3QFiOTmgl+mspflMbTatuIMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595925; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oW3Bx/jZHjrRjkjqV/XQakbdfMLoBTULf12/vibH6+0=; b=cD/D6WFi2RTCJ4gaFGHn9ftgk12N+DWF9QZf+T1ZlhwWV6Fu+IaLKnJVr3i5VKXhgotFw9nJVmjfY4q/PWr7Z0nZPambGOfZzZJ7rbk2Hlrl9wOG9BWaJhh6ly/RNsyizCXd8C9fvtvwdbIaQfdzgRnoH3kH9xHFrPj/nA6eu5Q= 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 1630595925556103.27349379561963; Thu, 2 Sep 2021 08:18:45 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id g18so3513141wrc.11 for ; Thu, 02 Sep 2021 08:18:45 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id y1sm2000763wmq.43.2021.09.02.08.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18:43 -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=oW3Bx/jZHjrRjkjqV/XQakbdfMLoBTULf12/vibH6+0=; b=QU5qFe/i6VEoDMLVb8219jT/WtLTbQVyXNjZ+cedE0IXhZ/2ceBCu/K+3FWm9DzyYV mFVagGw+zjYAohDrlOvqkLyylUda6Gn1cFWe2AU7qKZu4EdyAwuMGf4d45zI2fgJz7+0 3zeOWtZUHZtpsfctIKwBu/u87R3XYppWiJWnm/bF1ar5pXunuK1Vfqa5UtGTHcqTmtKE t7rqj9NemiYOGJmryDvnJB5Ept1r85a/ZOhLPZ92+bvoGY7937uSjNTjzZ6If1wVOaTE +EfT4l7awhYYa5xRVbUdlZwAPsT66W/er1r/OEiWgH9nKTOqOaT67l2nQy/xtJL4RSzs YljA== 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=oW3Bx/jZHjrRjkjqV/XQakbdfMLoBTULf12/vibH6+0=; b=AJQk3dMG42i0ak1gRpvdUe1klfhb4G8eo+AFnNN38VeQrhHVaNwbKCgY5sa5zBTIIu LRsNQO6PrSATq4aOsipRMKgG+dTuOF1NoDJKVLat1bE14vQey4WjifmpfkxPgZFbNU1D jE4aDI4N8CLtQDoMal2lV/oOgDFditjKgroNyiHDz/ZXqGH/MQCfYOEWNqVJsWPZz5Zo cCoyUk+Ox4QxAGNrmPatYq1tdbdPuTT8oOKgUptRzTeMzouaBRg8R+mwe6jki4uWUhrd dm3JnVmu4A/o+r5z6Vpa33UVV6SciWNOxShSUBLhO7zJazs0VRm5GvTLQ5JqltJ689++ gl8g== X-Gm-Message-State: AOAM533VyZ5RvZUNToItGVV6NbLQw4eo2/HL7ljWW9/yCqvKtZeUBT+U +hMh29VxPUwqr/WYfanI/bg= X-Google-Smtp-Source: ABdhPJybEEYGgmzrncqPIMBrrmG4v326knpnDTKtu8KRXXp1XjQri0YIUz9e2bk93vsqIIz//ycB8w== X-Received: by 2002:adf:d4c2:: with SMTP id w2mr4509687wrk.235.1630595923879; Thu, 02 Sep 2021 08:18:43 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 16/24] target/openrisc: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:07 +0200 Message-Id: <20210902151715.383678-17-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595927305100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 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=1630595930; cv=none; d=zohomail.com; s=zohoarc; b=NUyB09yOltwjAEhXSBEBaW/6/Vy7ltv4t4uF6IvdRQl/0N1hCCEpbzqf7q5KJbFdtGfNt0VFRphuC3cZRs4IUNEKsmFAVsvNWcbs2ne1J0hO5F6JBaX6Wjqp9WrhZ+7UZQK/Ywgd9BeHrAYtrjnMPudsLRmhHpQ3ECQ64xoYr2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595930; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=13cqWBFlNB/vr07VKws8Wf/EaynvIPSt3qDKZcCeXuc=; b=KQLP255cpLWwQDHb0R5DT+weQi/tMjo6vVPQYndj9PxsxbyIF1OBJay8lvMMVhCWv0mvxh5vpOI+Qk0YSx8klvEaN/V9+1oGL1VbM5tPC1tHo8yqf+HFUf7CPD5hugIq/d/LCmJ0NdmGIWCS0gW2ss+qEzdHCuS1diRf6Gh7cNc= 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 1630595930891463.1195376657995; Thu, 2 Sep 2021 08:18:50 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id g18so3513678wrc.11 for ; Thu, 02 Sep 2021 08:18:50 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id 129sm1893960wmz.26.2021.09.02.08.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18:48 -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=13cqWBFlNB/vr07VKws8Wf/EaynvIPSt3qDKZcCeXuc=; b=DR/9kbV/tVfJIqCP1z6hn9Su24lAAqqSfbLsxeichAuBJCWbb6zzEJRbxSkaCjgrjU lBe63GKOzbizURuEDjOTHZeTn9O0PphS8T666A6nkD8zLBcnnjs1mrzZhJduLakmh9zy 85ST1wRQyL4CICK29MeT0h2cvS+EPtiKFQb1FsJL7FPsBP4fhVIqHGP8Xd/2dyguYxtZ pzbZJkdJEx4lnZyK1o2I/oWFyDxBRK7UjBqYrKU03um7wW1CmEFzb7dWRWaWtp/VQUCS o7CAlhMgXA9t4OohgKnMObhmI8FRTyI3DI1ved8VJ8SYPFCemYEw/li1Cja6LEOYSNni tl0g== 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=13cqWBFlNB/vr07VKws8Wf/EaynvIPSt3qDKZcCeXuc=; b=uRynR3vhYca7TxwzsLSNbGL+4vgJxyGhBPJq44K2F7sVHVEKryLwMkf029ccCx84ZZ f+5c36DdZ57Hm/DHaUJpa1saNs1WUHu5Th0f7dUebbgEAeLwjheIyqq5Vjjf8rgY4Q29 TFKtQDfzty0C+1/fpmHLqwcfSSIf1rrksQDo8SFCOBx7zt4bRsfBl9WElyaMLLC63z/p hyjm0AbUl9kTGUs2Ehj3dgW8P37tMuEWtS4UAI9sywwDFIzz+2Him5f+c7GRQF7hpx8Y ePu9tYjyazX8UDlAqv51Vczat2mIoCsnplz1ypwsXMLDP2N2aWhpJhYEEfz18xEpkWN8 /rPg== X-Gm-Message-State: AOAM533/YvmAmvsoTOyKQccijwqKPPnqrj/C+I1Gw90DlESEC5ihKaOR mfyG3fB/85lmsrvKWskrt9c= X-Google-Smtp-Source: ABdhPJxhc8HhOPDEGEsFKW9abzQtV4rKAI+TEEQLs1Rc/U1Pasux0Q+YgJ0sayfIRcFYW/yyr4LuaQ== X-Received: by 2002:adf:90c1:: with SMTP id i59mr4412316wri.88.1630595929164; Thu, 02 Sep 2021 08:18:49 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 17/24] target/ppc: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:08 +0200 Message-Id: <20210902151715.383678-18-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595931731100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson Reviewed-by: Richard Henderson --- 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 Sun May 5 17:29:43 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=1630595936; cv=none; d=zohomail.com; s=zohoarc; b=EvdtTyGXK0yQsx5WuKMDbe+i8Gv1q/NCl6jZlXa+W4opGH6gALYirFZxNy19D3O+wTrhpB0jx+DjMHHrEJrCazBn0hVaXVo593+KJsuoJ+BNbhJYrWDFVdxXApW2gCA5wyVeYkZsFBrQMStLR3f3qztrTKoPCklrUf6GgEd1PDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595936; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NjpYoE1+3YFnM0F4QDL6LEotiNFdmLxhe/DUiCLHaJM=; b=HxnAuMbi9UyTO76uIgvcgL0EwVaoTHArBepJsashBvh8fRPgkID1wY+85eLnE6fkhEhHdY5klaTMeTJ3JB67zsoUyd8V9C4wldnnXsYHsK8hbBFBwTIpztw9LOydcvbk9fyQcrltJjTCFF8yOk9th0R+aaHw468h/YizxtkOQ0s= 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 1630595936226142.80644616359893; Thu, 2 Sep 2021 08:18:56 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id u16so3536799wrn.5 for ; Thu, 02 Sep 2021 08:18:55 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id t5sm2171265wra.95.2021.09.02.08.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18:53 -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=NjpYoE1+3YFnM0F4QDL6LEotiNFdmLxhe/DUiCLHaJM=; b=OE2IJqZijkuAu/dtbUlP6NrY1EsKCVCfz038HJYOXGJ8EDulteUPVw6555LSquq8R6 UyBKsyS8TbxCG0tsSFJvYB9ADJXpRn70/xtWLjcmzdXfF7x/a5hVHd20QXgWS8llqbvf RQfWoj9R/B+AWCxkrIr1BZvlzLejShTHQ+YSmEdC+u9eoEHoOc8rShzTgKV2UztPduyH vKYYjTOxemAwBu9hCc1RW8h+NqDRzfy3q8VqTvyxqN1YiXtUBK/Y/vT5Cs4ZwKZBSpGD jfyBQyX4dtNCXA6loITIiM3OL24aV4kpGFstbBz9jIIxjgf5jpPsl389IKvPiDBZC5i3 TFpA== 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=NjpYoE1+3YFnM0F4QDL6LEotiNFdmLxhe/DUiCLHaJM=; b=GmL7ZwzmUdbPD/l6cjLXf3RGPubki3HbkxnzV5+HSafxKCtql0Cf+6UAmLNXmBs8oY QAqEKsJLKmUXNThOy4rut1wCdjuRjo8TiNV+DtL/stKx1FNNxjD//57oNCFEiFDuqi1f sc1ZaUDB87H8YpjZE67gWtuu2eu7ONUreoounQan66QFReg4U82hFUvRH9ciN29ys28D co7ffgF17swVuVjqx11shF/+805cw+S4bMgenXUOCtIsxGEW7W/uszmhZAL8C4ULWix4 Mo6mKeZoyM6C1HHpU9R5MLdG2KPNAaKRjAOF3XVnecKFVs6WB+utXPnJedSjOidtHMXp lznA== X-Gm-Message-State: AOAM533sBAGIY2xpckse1dKxic+cXVmF/Tq6YrC7R2mDZOsgZmskhu7z zLTLnRi91PqUbeXA4fw94C0= X-Google-Smtp-Source: ABdhPJxHGkPXjKBYhlTr35f7CR7AMmKVY8Al83O7nq6m8XUpAKzCtMrlY8MqhAltIqo0aoW6RI9a5A== X-Received: by 2002:a5d:638b:: with SMTP id p11mr4313614wru.257.1630595934445; Thu, 02 Sep 2021 08:18:54 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 18/24] target/riscv: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:09 +0200 Message-Id: <20210902151715.383678-19-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595938319100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 Sun May 5 17:29:43 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=1630595941; cv=none; d=zohomail.com; s=zohoarc; b=BvzlGDfUSX6164PjTxOV+ErlBokqPHPaH2D/15Vwzp/Csl4kkdIWvZ8u32pUzQc/BVrbs/ITY2rRn1DVMN6dtnyDIMHArEN6xbLhFIuGkA6uWzXnSj+fjrR+aILN04fO1fbdsWoUCTRScOu8piF6//TwdHo5glwoTlJq2xvjfeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595941; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yWzwMmzgtknOn/zDVw9ZMjlZX8g7FMUFvR1QvfAhY8E=; b=TV6o+1Te1kvS+ew8ilm8vfdL9w+KOxuKyZUpDhrDIM5K8kL7MPwe+FblKMjKHvvrvfwWOHyQaVP243ikJa8xEJqbiOstHroS8JYKOD6My5bUYUqAec2ZLj+3u3fL8Kr7b8CBzGgWNjwNP1nzbBsqz9esLR6J2NVz9XWkVdaz3zk= 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 1630595941551230.5665587365579; Thu, 2 Sep 2021 08:19:01 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id t15so3536436wrg.7 for ; Thu, 02 Sep 2021 08:19:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id s7sm2137638wra.75.2021.09.02.08.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:18: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=yWzwMmzgtknOn/zDVw9ZMjlZX8g7FMUFvR1QvfAhY8E=; b=XL6aED2lZnZF+iSRz2h+W+d5lk31scEEQIu7ZFZr7a4DAwfbFp9vFKKYKaMRLBTYe0 ozL+tRJbDl1PolsI21/eEKKM4L5Vm0QHXDY7fh742PqmfupsDm/e+6iYztFcpcuD3CUN eAxKQHzjkBw9jLLFM6woIBXxmr+spcq+bc2HhwugzWlkRK+aPrq0Kv2diuGeJUKFJ54y PnZi+XP7vbbb+yEeDc27xhClbS8UHJOFBNhR7IhAWiV44Fr57TarL486Z+xDsIx8HJTT CnPIuGsYkn3xr3j0fUpYG08ZOqxB75xU844oepVvpNhVtTkkokXtOFZB3T3hIBvwvXwC 2OQA== 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=yWzwMmzgtknOn/zDVw9ZMjlZX8g7FMUFvR1QvfAhY8E=; b=Fh6Mm4/JOCDjDwnvRtLlxdVRXetAQQl3Ybtf7Uleu5Q7KWVGPE7fsVVac9TWG7NOo0 gWLfj8adrtUpPPBRUoRWSpqthsDlwCIt3LlE8uNXjePuu/f/YAmhE2SS85PshuYa92lt p7J/JAskwu2ZK6PrOXQDBs9yYzYCGd8lZgIoAFneinI5qe229GcxEoJlU67RZoPUXfR4 FL9XO5FTiYr564uwQBMnSzOZdUPwZAjZpCmfnd/xSxH4rG4cAsq48dpHep0ORQS57HKA z/Od9H7nGfpGW001ko67fjs5XLIQeCwdrkpS0MKCQLkBfzYnC24y09GaQxKyPMp+jMID yn4g== X-Gm-Message-State: AOAM532E0xrXDyTtY346HVUjXGJeStIPo0nXeuum5Tp/MCJyPo0T3uPu bQX1+6ntCI+COFi7jl7xI/U= X-Google-Smtp-Source: ABdhPJzOKEjdbeMSJ9dEW35a0CRR6zbzkeoFfLzGKh6rzfiZeHRAhZKmrMV5Pi9tF4o2FxT4GTUCaA== X-Received: by 2002:a5d:4e51:: with SMTP id r17mr4596219wrt.308.1630595939779; Thu, 02 Sep 2021 08:18:59 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 19/24] target/sh4: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:10 +0200 Message-Id: <20210902151715.383678-20-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595943210100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 Sun May 5 17:29:43 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=1630595949; cv=none; d=zohomail.com; s=zohoarc; b=mKcWfNf3L5v7zmv1MKEuvs+F508lEv7l+hW6NSz/8JPo7rjaBp1TErxbAAwpZ8XvSGsq5WFFxBg22za8NWvkdRnxpE0BuYpnVSOZtGjd9+BByve3cEJOh7ksKik4igt+thuS+qC5ZrLnC6adIGAZyYx0jL/M+AJmIizz8E+si2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595949; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Sa/gUQ6OYKknFZJXebWF3T5b/QwjN7ANr4ohZjqAW3Y=; b=c2qM7DIOKDaJrPfxrqoAnkuAJ9lUva7UwH1BKn/U8kbeIHqyMDHp5W2ls9Wqhc1CYy7uRjpFLA+mcyPTlVk8ttIpXM95a4kTmm4HPvDUp14FBBdFAtDEwwPHqRikeTgbDw2csKGql4cqY9E1dbued3UJnuEwcvDGpaf+84ndJj4= 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 1630595949328544.7183971357601; Thu, 2 Sep 2021 08:19:09 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id z9-20020a7bc149000000b002e8861aff59so1752802wmi.0 for ; Thu, 02 Sep 2021 08:19:08 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id v28sm2145307wrv.93.2021.09.02.08.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:19: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=Sa/gUQ6OYKknFZJXebWF3T5b/QwjN7ANr4ohZjqAW3Y=; b=j3a0iuyUy4E79T5k3yBsMoOj/6C1m1jTCONb3yKqczOnDrsVZenqpRXrCKuM217KKU lWHJQ9caUSi5/emKyOoq3kN2iIt4xnrGo3X6KbBOyrw6k7v7kCXvn10Kq8y0WhRLecHE dbcwBMkHl+EfKaP46gUuzJg/An13U77AMavp/GDPoc/S9adEf2VFKNIILFNZz/PLqNwF 04HYNCmACZfFwTUaLYrDlcA+cttRg2RhQ9z537D8VKq4lOu1P9sqnDhe8kQv89o/3wnp dsnfI6iRP2OHPIcxoKcNnDi4BAYeuMNlJWEVP8kfU8GN17k/0GCpOPmSY7ccxGTGMyh0 tHCw== 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=Sa/gUQ6OYKknFZJXebWF3T5b/QwjN7ANr4ohZjqAW3Y=; b=msTxwnB1RUzZD5MwTIZvM6hAUZAA0eSF22+INgSxjr8lyFn3zRGy0Hk5VQjc6UE7cg IMHAlD/ZDYkGzhhsxSzr+Ri+8llEKZ7deIRem2cfrcL+Ocm6kD/niyzyxA6snkSfkgpB FxceuSb6rPfp1oBIGS8OPaKLm/Wzot9IZV5Q2ZqoIKmjpx4oEfkqoHP/5gzLnb13UHwT 3kbnXyyMKE9g8AVTVjxeKHqsxFZM94+6xiuW6r77Udl5Fm/+tqktr3YEU6S70tcvIT/e QUqX9TNquF9xVbD3YNqyIAj0OGnBS5d8W2lRMkJhsYuxR3df+EqbqoOkC2mo1ugil07K gUug== X-Gm-Message-State: AOAM530JnD9cTWgC1udz5JiKO03NFe7sOJLq7iG9x1Ccwqw4H8oLcRFn EGugiIwV+ATjDX5kXE9MFos= X-Google-Smtp-Source: ABdhPJwwuyQKfB5c6so0dNubq0TVgPK4gzzPQxLienQhrVD6WNBlMCSXow3/CNoXzZhSUmJsMGjBYg== X-Received: by 2002:a05:600c:2d45:: with SMTP id a5mr3707040wmg.125.1630595945284; Thu, 02 Sep 2021 08:19: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 20/24] target/sparc: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:11 +0200 Message-Id: <20210902151715.383678-21-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595951198100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 Sun May 5 17:29:43 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=1630595952; cv=none; d=zohomail.com; s=zohoarc; b=mcql29TLD8qi90gzd9wJm/zkEzovjXhqGIQu30c+RuuqQqOxwQq/euZi7+xsWeJfD2cbQVtfmXJdqvcyCbHo7vJ6JM25E0tYyOHI/5gdA1gd1QwI31Oan1GvXEc8YkzRZM1bcA6LckdFz6hefbp4tpB5M7ecX9PakoyxTJx32Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595952; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uKEDIK9jjR5E1iUtYoJzOCExU95HIVXUcHhHZVdYNmo=; b=lvZBrxlnpvzP1SKi/+59roftHt2t/0IXqGHs5bWpnsk3w3p3CfrZ1aRO7FUVL384ib9vtb7GTfHLNWwNgGQT+O/2kA+iSyMNUOVg40cnSBUFYnIxGrlPcn2SqiVtsCUasINoh4fAmC2DF2aByIKwrcidiAUeiinriTe2cHaecg4= 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 1630595952759202.2851132901527; Thu, 2 Sep 2021 08:19:12 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id b10so3589574wru.0 for ; Thu, 02 Sep 2021 08:19:12 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id 129sm1894649wmz.26.2021.09.02.08.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:19: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=uKEDIK9jjR5E1iUtYoJzOCExU95HIVXUcHhHZVdYNmo=; b=kVRbVDJ/iHkK+UJWM+aQI8SwF+fWKOVW0tAIGFSdzQQZn1dh1nEJFZgjFNpvOd540L tjHGWjmkWcPC/WzY7vKE86GqtdgxBIADD+MX2Wj+QaEyq2u1tf35R62+C4RvmuYz5EpL 9J4aVDsd4kSVEA1O+pQ6bb/7jYKpRxiY39bmtBUo/tzSXFJzBkooTN0gElSi5SJf43Hp sak74nA+KfkaW1UOBN/w4Jwlcf8ePZELB2k4UyHBBAf05zd7B97po+vMK8XKO4fb0ng+ jz2GCgWAienCT/Da8DfnWrzO7j7ryR84wwhtdP84Y42jOeTA0xsov6vq4+tTNHmgLSkS MKRg== 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=uKEDIK9jjR5E1iUtYoJzOCExU95HIVXUcHhHZVdYNmo=; b=WFkI8F61MFPYugnHyE2ZzSnydv7zKwFUtUhDJPX/4PjfbKAtuvAayiu1s+D553S1d6 8in58wGVTPrgh/UWhTwLb24HN5PTjqvzlsRUf/zh+rHC5TGbVrXpCWBPmIiSvLBC/vO9 9ndCR6g21h3GHsMqz/wWjaJVRPUTXdiByIYcAImvklzoj6bvimRSIJMtJUBEaygRn3hZ fInRrVLnBbn/vQUl6YCVKBQmsIojHJwxkA45ZOgwluiaP5iDzwyJm8aqEHIkwiNxhe78 n8vDvpZtY9001kej2MbmJVm7V4U3762OPpdtTKjNJQO/BJ7JTsRJ/VFhmfi3k8AikPpC QUPg== X-Gm-Message-State: AOAM531MVFc+WNJ/cYU12iFFX+klTZ4PuYWk7io0uIGMUy5IWNqZ8qdK Jn4199f74P8ol7vJ2n3n6xE= X-Google-Smtp-Source: ABdhPJxGTwTQtm2g8BjjsY6zwu4c16zdTLN4coyYNBf9pPdS6FRG626ytceIc3XrPOUKAd+7vNyUWw== X-Received: by 2002:adf:c10b:: with SMTP id r11mr4502786wre.336.1630595950995; Thu, 02 Sep 2021 08:19: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 21/24] target/rx: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:12 +0200 Message-Id: <20210902151715.383678-22-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595953537100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) client-ip=209.85.221.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595958; cv=none; d=zohomail.com; s=zohoarc; b=ekkEOfqbaBQaZCLaIkNKL4XWVsKvt3OCXrTbHS4kPCbfbeO7Nascv7TS6xJDYOxZRk/JWbVW8BVV9vk38n0p0IMLjekzeDGtwHMkJbnZ74f8Qd8rHWOQyPT3fbrliecHB1X7kZI8VKtHo+78P7xVR7D2wJCf1EsOYyVroqZAVAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595958; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mrF5SukyHScHMGv9yUoXnGkzs9h7YkYdd91g+an7xcY=; b=avTixLMrm8P5WpuCJ+rpED4MVdoWIIGLknUXmCMtJmalcbZf3DIvvUebJWszskTdHW6ZoN8dLUZgLVNRaEIcCP2fz9LzmxA/2pO4eNyqv5GpbmB5Odyou85UI6RjgXGiC/em7nbsdYHmiJEj0VlYEwPqu3ZUvZeAFMrwDviRGaw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.zohomail.com with SMTPS id 1630595958160999.323517603478; Thu, 2 Sep 2021 08:19:18 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id m9so3556639wrb.1 for ; Thu, 02 Sep 2021 08:19:17 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id y1sm2001968wmq.43.2021.09.02.08.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:19:15 -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=mrF5SukyHScHMGv9yUoXnGkzs9h7YkYdd91g+an7xcY=; b=euQk/R7VP0BnZrN9o6zV1gs7ds6m9N1lH2AjKEeoccv6ueHciNiN3Y2RszeqbO2FiQ L+5eAFzGlhfxt12PRiCu5tgKLil2Ch8ykV6xs5paIcuijNlZf+68kePK/JwIhJ5ak/X2 hDPC4IiBGzyusQNl6zVnOFHkPbCzgHvRRxfl6bAzdEg+yX6ryPrR+vDQMrE1aQawplPg Xcg2tFkELFvXSciz/SUz8DhJEWPX5UhUhylBtwVu9beyR/zKOTxFIH6ud/EwxXeQxcFd HDKbRulLLTMoxn/j3j54iyAcc/V+DW9gSJgVpzhSzX7eLEwWjx9u6TcROinYWsmhWSQ2 iOjA== 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=mrF5SukyHScHMGv9yUoXnGkzs9h7YkYdd91g+an7xcY=; b=Q7H7QeasBIU/SDgcx5jvs7L+DZ9wCdWdjPBmsJbO0ktuxR9sTjmTH3mEAZ+xh91xRG no06vV1sJQ1mo4cVBJkMQBDSjAASvv6RSwAU9Mj7JZvaW68HIoDhcL42TkVvVEGJIHUZ B607zgbTVzgMLrmpSsenPl+FRFVFR1saMjTBlWv5hiDn6s5BOGbIzeJJuk1yARpRU1LM E3F6Y9XuOAjwomtTJeEbt4SrpttGT32nlRUlNxM2oxidNA8inCZegSj4Zuhv9WHb5q14 pN6rG+vhdSqGZd6rHTOI/fmb/idLP8Swc+nkyNklmXaKSrGoIYijJrwnOgt0+wvR6WiS 3U/w== X-Gm-Message-State: AOAM533p1nxxg1T4Wo5o/XEHUwL8NXvSyDjRYpgh7xBE0eoK6k1V7LPs fe82twQjZHjOsPCJVbebE4Y= X-Google-Smtp-Source: ABdhPJyl4J7zWpE7CdemJYNKMioYPALttjFVrqr/njjpmxFX/FySPTGr6VDFc/bF4XAh0i+voTyL+g== X-Received: by 2002:adf:f747:: with SMTP id z7mr4521974wrp.194.1630595956417; Thu, 02 Sep 2021 08:19: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 22/24] target/xtensa: Restrict cpu_exec_interrupt() handler to sysemu Date: Thu, 2 Sep 2021 17:17:13 +0200 Message-Id: <20210902151715.383678-23-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595960263100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 Sun May 5 17:29:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630595963; cv=none; d=zohomail.com; s=zohoarc; b=Z3y/ZBQRdC0cRdi/FRSIx60Bjp+dvvkV8zgJ5BtM7xvilC6ojjMerav+ijJPfn10r/BIQumTo84g8sEcdlHOAZSVVAaUvtkY4dVjaRkFYOIEF+1NGZyFdAyofASGIhmT/BFaLuYTFNT6Imip4X5oFFpLeZljhsUxXjQOiMegAI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595963; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=J1dcdIQ9CGWzlsg5Dn15xdm5h+WWHlgv9y5poU7SILU=; b=Fo/wKqVTWZV3AIxTnSYaUYFvIWT8RFnmSSnh3dfm+NuTDQQ4GW2MTlpygQhLhn4Sr3TVkrN9zd6M/s915cADBI8Q9VoRxmiwiv+Xq1ru6L4IgqiYLZKmVpynRQCnjJ2HxsLGn9DxdGzMBuJvAd6d+RvXFavMDpW6M1Uu64PbNh0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1630595963807371.911232418335; Thu, 2 Sep 2021 08:19:23 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so1611508wms.4 for ; Thu, 02 Sep 2021 08:19:23 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id d24sm1844328wmb.35.2021.09.02.08.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:19:21 -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=J1dcdIQ9CGWzlsg5Dn15xdm5h+WWHlgv9y5poU7SILU=; b=nmHWhKQc4cQ8poiZOsBSVna/+IcTO76/Xgy6htZ11++IGvST+0vsj0Yb7T3Y89mA+Z Ffse1o14BVN8xQOzx9UrVrpulHJEIbxJo+VhEDYcG4roPcXCNeWBCGzS0+ZqG2PKRoJp re1il8Yv50undaZa04WF33qAcSwcJDW1gW4zjfHLEwJlPNsBllGQR10uHMurMAme+Wu7 dFOwtQ/73yXO+wgQoWR8acLVbUZadySXnfEB1iUNfHJu/NwOxSSvj+DpSi0d+fLM4F+T zGhDfAOOBkk+j/NeBeQhgE/JQ9yMtol8kcN+rCUNSZhAl6Xn0nDC1r6GKNff9D3WAikU NnHg== 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=J1dcdIQ9CGWzlsg5Dn15xdm5h+WWHlgv9y5poU7SILU=; b=FgJj0JoUtbpJDr0Nh+jE8gl+U6Tm/8vDjmBWVS1m4A6rmxF/iH/MMuys/x05S71e3C PRXGZj0X6j5YBF+GYnEspRav+XhA/6Pnf/HwJzseuqa2srLO8bPWzu2qOuEsMnMzow/+ L4QeZRqaYwmAnwHcxUUG/WxvW05W0/Sr4/6sa47QDrhLG3FS3QfrXPxVghYpE5eSdiU7 NoUwlXcQBEE3mlKpqNmvDae3Mb3qDgSGa2D1Gn6IxoJIDi4sd+GjvxPHA4NnXZhzyJR+ W2dqxokCxQbuta96DzwHhxS3RkzYcrpLElvdWC2m6D/IFyQqPSX/QJrHLsS327vOJT6G LMRQ== X-Gm-Message-State: AOAM530psEvQcCXCmyW3kBZ1tHnrEbqHzye7x8R8A77J5vbcfSJrHiTV um/zQpgTjopfXHKw4mJe6Qc= X-Google-Smtp-Source: ABdhPJz7sxKzV5VkLGVMCrMgJ5rFnNDYqoRSnoIdz+9dydA+a9qoHCb3bjm9MTLJEtE5jEYVwPeO+g== X-Received: by 2002:a7b:c5d2:: with SMTP id n18mr3773265wmk.97.1630595962055; Thu, 02 Sep 2021 08:19: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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 23/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu Date: Thu, 2 Sep 2021 17:17:14 +0200 Message-Id: <20210902151715.383678-24-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595965311100001 All targets call TCGCPUOps::cpu_exec_interrupt() from sysemu code. Move its declaration to restrict it to system emulation. Extend the code guarded and remove the user-mode assertion. Also restrict the static inlined need_replay_interrupt() method to avoid a "defined but not used" warning. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 4 ++-- accel/tcg/cpu-exec.c | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 600f0349659..bbec7760f48 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 5f4836946c1..7a6dd9049f0 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,9 +725,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, qemu_mutex_unlock_iothread(); return true; } -#if defined(CONFIG_USER_ONLY) - g_assert_not_reached(); -#endif +#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) { @@ -756,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)) { @@ -780,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 Sun May 5 17:29:43 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=1630595969; cv=none; d=zohomail.com; s=zohoarc; b=bwKQKqvw7PzpV6TqIySVVJYt4r0xL9gezNq7esQlOdtKoMbyMY+epzMnHinQwBEZ1HibSZBUtO7Kqc0Ih1TNw0dk/IzLoWBxc6CMC3SshUqIWVLM/JPBufTKmgEmKFV1OD/nAx+Frtq8q2n5QVKrBzqUWY2B1+Ku8R9Cw1i5tTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630595969; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vwS6/PSiFfORBC8iBDJIdxzHLNrE+ZV4b02jLjMiM6Q=; b=EwopwjezcY8lr/u5ewqNgDIhHM/7jJs+UHyB9NopZyrQYLJIj8lkqChhrMN1zNwa+CPuSOvT4v34796v1x7JARRgJwE5ymMu+oMmHsOngu4rQq7eAsQGAXeM5CfSKePNGjodmhe7lXczcd5eh162fZQRw/pa56/csrUyQ6Wu94w= 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 1630595969186749.425216385229; Thu, 2 Sep 2021 08:19:29 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so1611750wms.4 for ; Thu, 02 Sep 2021 08:19:28 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id o18sm2589844wrg.23.2021.09.02.08.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:19:26 -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=vwS6/PSiFfORBC8iBDJIdxzHLNrE+ZV4b02jLjMiM6Q=; b=qWE4fzBgWDNeyBRMwXb2DFthONkFk5E98iEerGQs32XoE/SqlksBPajM5cV7HOgMxK /NJCUFuN5ALKhHyRuHL8lpCNVVSvS3H9YyrX2yuGMR0DfbVjw0LqZpIUv1dp3hO1LrIF Z5G+E5Pk7bMWNGICP03wAO9geV0KChMLUM3cDgRUcREcnvPQdK+loUhQlw16a9Eo9TkN /PtMIxiU41A6GWGKR2Isz1nfV2i6+XcXLrv7JZ+PCyjVoCQrYWr/nKjfHzDpGq+hwzRa tiZk0rD8lQwu+cIYJTtB50sdK6m3IKWxrqxE0s8zkqBN6Q1CPR4nJawxAa5awG7ENeu6 ZJ+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=vwS6/PSiFfORBC8iBDJIdxzHLNrE+ZV4b02jLjMiM6Q=; b=tzBvXR6HM3SU5m5gdCUmSPd0PWUEDDaX9RfPFRA3KAGDzaD9CqJGi3kNpr5yhZgiKz zYhVlno44lzUAHmWQsHwDTx3mMSNI+RKFpnAP4yCpHvQRo1pitvB7QFiD/zNdjprHol6 NMgLOr22HMzzUsSssEyNcag/ZknqCm19yatUB5SakruJDj59cM5gCmTx20f3dbqKjdFu yQB73h4RO4zcwpCcXEO/Qp8nTp8TK371+uf8Itb1BUgYhtZ2AkEPDcAa3YuWY+deP22w mpojyDSRVCeGPbO9DZUK8bnec9JvrfQ1p9kcrTigWTjVfXOZzQPiLnsgG/Wj7BuQwEKQ 1pMA== X-Gm-Message-State: AOAM532bIwFsrolKbP1keYDwrrzuCeEzEUAw4QGq3K1Un+rUzVfWbBDo bXRlTUcn0JSG+aUId03dK4w= X-Google-Smtp-Source: ABdhPJwzQ14s0Ij9I8mn0ssyV2BdS8ifvRZmOham9iGtGc52aWPbbK7QIbF7Q+CwcDT9nFL7DjyS5w== X-Received: by 2002:a05:600c:3795:: with SMTP id o21mr3720284wmr.130.1630595967457; Thu, 02 Sep 2021 08:19:27 -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: Yoshinori Sato , Jiaxun Yang , qemu-arm@nongnu.org, Palmer Dabbelt , Max Filippov , Warner Losh , Michael Rolnik , Stafford Horne , Paolo Bonzini , "Edgar E. Iglesias" , Bin Meng , Chris Wulff , Mark Cave-Ayland , David Gibson , Kyle Evans , Peter Maydell , Aurelien Jarno , Eduardo Habkost , Marek Vasut , Artyom Tarasenko , Aleksandar Rikalo , Greg Kurz , qemu-riscv@nongnu.org, Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Richard Henderson , Alistair Francis Subject: [PATCH 24/24] user: Remove cpu_get_pic_interrupt() stubs Date: Thu, 2 Sep 2021 17:17:15 +0200 Message-Id: <20210902151715.383678-25-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902151715.383678-1-f4bug@amsat.org> References: <20210902151715.383678-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: 1630595970056100001 cpu_get_pic_interrupt() is now unreachable from user-mode, delete the unnecessary stubs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- 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 37ed50d98e2..f5c0a82427b 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