From patchwork Sat Jun 11 10:32:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00A77C433EF for ; Sat, 11 Jun 2022 10:34:57 +0000 (UTC) Received: from localhost ([::1]:39332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzySH-0003bF-2P for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:34:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyQl-0001LB-CB for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:23 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:46615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyQj-00069H-Pg for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:23 -0400 Received: by mail-wm1-x32f.google.com with SMTP id r123-20020a1c2b81000000b0039c1439c33cso758100wmr.5 for ; Sat, 11 Jun 2022 03:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uo2YIfU574dI280rF8iVMdiygQnubCcepIz3cr4Oar0=; b=c3L1/UeJEz6RFaBZ/FhjBz2hATTnJhv1wKyfgx4EfWOM/4j5WiHyuC3qEPC+XymQi1 Lv6wHmt0dwFh3KzL92S4Z6WBMYZbtIVQn4usMt1MZ4FsQL/2X9qnATzUTFHprQ+MjrHG t0UZ9fq9+gB0BMovvLfoVw7fVyP046RYWYBc5mTxcGgD/vRRt7aqxeR+ANLsyiXbP74H dfOGPlsGTfnhcC1FaEmLxX87859suSHwYg23AwW81hFyXzYY2bCc3guefo33MLN0dT1Y l81+ZojhGrER9PtL8K6c3r1CagLU/dIZqMzj4jlNdV/cGpYPFkvxatK/WXM9ogSXYUVa RY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uo2YIfU574dI280rF8iVMdiygQnubCcepIz3cr4Oar0=; b=ZmEwrhro/8im/kh+yyQrImJTFjd7c1/J1rJvjJI3IzAHCt0JYaIy5SEzNofTJ3eiIZ ohkgAAb7vjfuwDBaqeI1DJSZOMKwtwpSeUrt23yPvzIzOXtdH9UwuX0scA5kDy65UKax zXZ6Pv9h5nOzfHJ+WND4uZXNZFknMh3XYp4S+iuRFOtaNQc4Je9VGoJnLS83pyY3o1Cw aZ97VYg2bhaeMwbg0ohtLu5PMzuB3aisYfN7Mw7/APrl7KH3EIGKgB+OF9CS7lQdMQIo mWunb2Anxh/lvV/sYiMlfD/V7Ux3Aw3DrBsdbDSQKsCN49g02AtCqGGTWOaUfBV+O2Jt x6rg== X-Gm-Message-State: AOAM531eF9JQbT3YBr/AG7XF/TQYOxOzYZEf8KaMzCk81MtikAbUcG2/ NWQk3uTd6oNWSRahgfeOtp5uqK++KTc= X-Google-Smtp-Source: ABdhPJyupcpBKF4PerPKlrcfAbuvJsrUriDiOJGS2DSVXQaSRtTbLwJCwhPOKGfvZxqvfKQZiQ4+Aw== X-Received: by 2002:a1c:7901:0:b0:39c:4252:d7f1 with SMTP id l1-20020a1c7901000000b0039c4252d7f1mr4136851wme.178.1654943600146; Sat, 11 Jun 2022 03:33:20 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id n39-20020a05600c3ba700b00397342e3830sm13180059wms.0.2022.06.11.03.33.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Marcin Nowakowski , David Daney , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 01/49] target/mips: Fix WatchHi.M handling Date: Sat, 11 Jun 2022 12:32:24 +0200 Message-Id: <20220611103312.67773-2-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marcin Nowakowski bit 31 (M) of WatchHiN register is a read-only register indicating whether the next WatchHi register is present. It must not be reset during user writes to the register. Signed-off-by: Marcin Nowakowski Reviewed-by: David Daney Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20220511212953.74738-1-philmd@fungible.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 2 +- target/mips/cpu.h | 1 + target/mips/tcg/sysemu/cp0_helper.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index ad74fbe636..c15c955367 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -305,7 +305,7 @@ static void mips_cpu_reset(DeviceState *dev) for (i = 0; i < 7; i++) { env->CP0_WatchLo[i] = 0; - env->CP0_WatchHi[i] = 0x80000000; + env->CP0_WatchHi[i] = 1 << CP0WH_M; } env->CP0_WatchLo[7] = 0; env->CP0_WatchHi[7] = 0; diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 5335ac10a3..6b6b8776d1 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1005,6 +1005,7 @@ typedef struct CPUArchState { */ uint64_t CP0_WatchHi[8]; #define CP0WH_ASID 16 +#define CP0WH_M 31 /* * CP0 Register 20 */ diff --git a/target/mips/tcg/sysemu/cp0_helper.c b/target/mips/tcg/sysemu/cp0_helper.c index aae2af6ecc..5da1124589 100644 --- a/target/mips/tcg/sysemu/cp0_helper.c +++ b/target/mips/tcg/sysemu/cp0_helper.c @@ -1396,10 +1396,11 @@ void helper_mtc0_watchlo(CPUMIPSState *env, target_ulong arg1, uint32_t sel) void helper_mtc0_watchhi(CPUMIPSState *env, target_ulong arg1, uint32_t sel) { uint64_t mask = 0x40000FF8 | (env->CP0_EntryHi_ASID_mask << CP0WH_ASID); + uint64_t m_bit = env->CP0_WatchHi[sel] & (1 << CP0WH_M); /* read-only */ if ((env->CP0_Config5 >> CP0C5_MI) & 1) { mask |= 0xFFFFFFFF00000000ULL; /* MMID */ } - env->CP0_WatchHi[sel] = arg1 & mask; + env->CP0_WatchHi[sel] = m_bit | (arg1 & mask); env->CP0_WatchHi[sel] &= ~(env->CP0_WatchHi[sel] & arg1 & 0x7); } From patchwork Sat Jun 11 10:32:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878414 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E384C43334 for ; Sat, 11 Jun 2022 10:35:27 +0000 (UTC) Received: from localhost ([::1]:39704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzySk-0003qv-3G for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:35:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyQq-0001Vi-M5 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:28 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyQp-00069b-7T for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:28 -0400 Received: by mail-wr1-x436.google.com with SMTP id p10so1446475wrg.12 for ; Sat, 11 Jun 2022 03:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SACkiBjVkJuP+3/mIjXwPAlOEqhF3Us8szON11U9anU=; b=iAioCFDEQhinfcPgPy8G8aFAALkgGPuQcs63e8K33ZfA5vo40n9p8MtJxDIpwsqeAD uyjaR4v1BUi4dj0hi2ThRf7NJMyXyI9ACD/qvONabwgh9gP+GfEfGnr1pRDt9QGx8JIK 494rOXfvUL9NfG7VN0yMEBv5jk/wGePcI/jZMsTJRvIDNFQUarVzNWI61Ri3S01F0Svy 9zmvGF0UgkJfFnzB+vfgycmt5fULR/cF2IWYwPfzCnTrAo266Fwcz03CZP3JZ8t88kDw 6WkaiK20Lk3iNdRb46e30E4t3yjqJBbuukuKntSSrVD0zKy3oXeWZ405sn7sllbHEFpJ tnlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SACkiBjVkJuP+3/mIjXwPAlOEqhF3Us8szON11U9anU=; b=xBQrciOSMWolvMx3WhMsswKFd0Hevj5HfT1wqt8fu8hZSkvUwbXWkgfzPfm94A0aZM TdW1kLem+Zu2PYYQ4aa7et81tpNXnaG36w7kkOiZ6/Vum5PffTpIv2ioua9QquIk49IU RLybNZCUcWj7mge+/R+jh51M1XEYQfPg6k8SKIE/Lex7riAo/iYimaxUQCpPh2y9YCIF xaJlUSPn5MbLb2fsRv2aMiQcMaNfMtqVBuDuTwOwglSzsOKRQB467eXJtNhfZxg2zNWJ rdu1QwwelptHe/itRiPkpQ2eLWq4F3k4OEaObOmRpnHHDErqqCkdn4+fUK3CqDeU8tPq kezg== X-Gm-Message-State: AOAM532bK3q/Phits0xC26aZbSfmwyBUjFMOerLAghxPDWBvyONPh6tE z/90OseLSkjLFbk+FHkLXpffw4v1EVw= X-Google-Smtp-Source: ABdhPJzJoRavryDW2x2cFaxYOLGGJAraAWaZWukTB/nSCeIKo9daAeUO31aL9kNqLlWuvuZ2P3uS0Q== X-Received: by 2002:adf:ea82:0:b0:213:bbe1:ba4e with SMTP id s2-20020adfea82000000b00213bbe1ba4emr41560480wrm.387.1654943605310; Sat, 11 Jun 2022 03:33:25 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id p21-20020a05600c359500b00394708a3d7dsm6269458wmq.15.2022.06.11.03.33.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Ni Hui , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 02/49] target/mips: Fix SAT_S trans helper Date: Sat, 11 Jun 2022 12:32:25 +0200 Message-Id: <20220611103312.67773-3-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Ni Hui Fix the SAT_S and SAT_U trans helper confusion. Fixes: 4701d23aef ("target/mips: Convert MSA BIT instruction format to decodetree") Signed-off-by: Ni Hui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220503130708.272850-1-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/msa_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c index 7576b3ed86..76307102f2 100644 --- a/target/mips/tcg/msa_translate.c +++ b/target/mips/tcg/msa_translate.c @@ -399,7 +399,7 @@ TRANS(BSETI, trans_msa_bit, gen_helper_msa_bseti_df); TRANS(BNEGI, trans_msa_bit, gen_helper_msa_bnegi_df); TRANS(BINSLI, trans_msa_bit, gen_helper_msa_binsli_df); TRANS(BINSRI, trans_msa_bit, gen_helper_msa_binsri_df); -TRANS(SAT_S, trans_msa_bit, gen_helper_msa_sat_u_df); +TRANS(SAT_S, trans_msa_bit, gen_helper_msa_sat_s_df); TRANS(SAT_U, trans_msa_bit, gen_helper_msa_sat_u_df); TRANS(SRARI, trans_msa_bit, gen_helper_msa_srari_df); TRANS(SRLRI, trans_msa_bit, gen_helper_msa_srlri_df); From patchwork Sat Jun 11 10:32:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64085C43334 for ; Sat, 11 Jun 2022 10:39:46 +0000 (UTC) Received: from localhost ([::1]:47604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyWv-0001e7-8q for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:39:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyQv-0001eE-PO for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:33 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:43994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyQt-00069s-R9 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:33 -0400 Received: by mail-wr1-x435.google.com with SMTP id m24so1462912wrb.10 for ; Sat, 11 Jun 2022 03:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LUQm1G/YoYYdcDAMpdSCPzpkrH7lQMIOWr/thgjiHhg=; b=T6x7iklRF5UEQo0T1o5mZMWyEcL/yDByZ27juKOiXmqCVAqqjt5n/1NRNnvOX/F8hC 4KEguKQqfC1qpkwXXDzN8f5P/WueIKWj3B3NDW546q05rOLIPK5WlQpiFPurue2/Igc4 XBMRbqnEv7rkSkK9qNAcX1U2ogHm2RCLe7ApkCo1q5WT9paNt7k3UZOUYzxblBdtbyce QxsYDHn4xFzPaYUV9P7ZL6Q2CbNKKX5U/ZrH+fugqu86hVWVRTM7ubQseAIj4I0TvMv8 exfN6x53hnecN2XJ9SxQjpcY+jZWDIv8vhHY2OMcTQHoxVGdYOTI74GBIUSI1FvHjVjR KB3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LUQm1G/YoYYdcDAMpdSCPzpkrH7lQMIOWr/thgjiHhg=; b=wWcVVcKPraU5PgNel8lzaUOUC/quj7H+HVkJFk6GKHVppWdrVBy8R+cQbHPAfsQ+qp BmNVH57h36vzkJbwBvhDXpUsplLlE9RcsI9SyXTmRhbYgUFZ2RdOOtAjK7rIyOzh8Ozk G+KCho3wulcsyMQh5Auw/KgO738ulM5bhYClL1a4hP6TXQsbKd9yhEVC7b3WTH21qAs3 5gZ2Zad6HSR8d2ROq0K3HjCHIObICChOsgYpKsqenqDlSVTtCrrjV9R7bay+xVbZqU+C c0IBDqcUXVYHd78sRCkP9gTm1lNdho+kP0j7r3FfqHshffb+7tk4tzKaNm2miYc+Xdho UmqA== X-Gm-Message-State: AOAM530bFPtg2cF8AyQwtCND8wAbFisXNDZzgjv1/2AnOzhBqe1QIL0V 7Kwmg2rSMJD7DAukyEJE9txDfRRAfsI= X-Google-Smtp-Source: ABdhPJwKsxTOHLr2vDBA602rrKc4c+ipLXF2RlBtvNVy9rrfPdjAFd0YwccP9SVy08rS/Xjs+qTtJA== X-Received: by 2002:adf:dd8e:0:b0:213:bbe1:ba56 with SMTP id x14-20020adfdd8e000000b00213bbe1ba56mr42076062wrl.559.1654943610331; Sat, 11 Jun 2022 03:33:30 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id b18-20020a5d5512000000b002103a7c5c91sm2189074wrv.43.2022.06.11.03.33.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Ni Hui , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 03/49] target/mips: Fix df_extract_val() and df_extract_df() dfe lookup Date: Sat, 11 Jun 2022 12:32:26 +0200 Message-Id: <20220611103312.67773-4-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Ni Hui Actually look into dfe structure data so that df_extract_val() and df_extract_df() can return immediate and datafield other than BYTE. Fixes: 4701d23aef ("target/mips: Convert MSA BIT instruction format to decodetree") Signed-off-by: Ni Hui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220503130708.272850-2-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/msa_translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c index 76307102f2..aa45bae0aa 100644 --- a/target/mips/tcg/msa_translate.c +++ b/target/mips/tcg/msa_translate.c @@ -68,8 +68,8 @@ struct dfe { static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s) { for (unsigned i = 0; i < 4; i++) { - if (extract32(x, s->start, s->length) == s->mask) { - return extract32(x, 0, s->start); + if (extract32(x, s[i].start, s[i].length) == s[i].mask) { + return extract32(x, 0, s[i].start); } } return -1; @@ -82,7 +82,7 @@ static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s) static int df_extract_df(DisasContext *ctx, int x, const struct dfe *s) { for (unsigned i = 0; i < 4; i++) { - if (extract32(x, s->start, s->length) == s->mask) { + if (extract32(x, s[i].start, s[i].length) == s[i].mask) { return i; } } From patchwork Sat Jun 11 10:32:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E6CCC43334 for ; Sat, 11 Jun 2022 10:39:57 +0000 (UTC) Received: from localhost ([::1]:48230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyX6-0002B7-Er for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyR2-0001l4-2l for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:40 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:54873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyR0-0006AC-Kh for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:39 -0400 Received: by mail-wm1-x335.google.com with SMTP id n185so621092wmn.4 for ; Sat, 11 Jun 2022 03:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1VVOBQ8vQMV6sQsstcumZsHOhdXzv9pz97cTwTA93UQ=; b=WjcCWNymjSW+GufpHDiQiFnQ1OYFjnwEYJy4E/7aO2fgZg7dtPpRL251rXXP6ntup2 dJ/OlWCyjTcOlOU3gAFJ1nMS/H3U/N1lcqxsKnI+Y2X4ZkJ956eBJ1KkOD1NWr/vIn3I MtGdbLMvlUwYS3qYhLF3I7odVdI/n9x/dZR9dlVzVfBlyazfAOdReLicX5rQtRpF8BS3 s6OZhvN0gSI4GNJdPvGDLF5XZrpeIhDJlDiAaYQ8zFWsFWJohaGC9Jv83EpwQs/08bDl GmQrm8XX11A4Bxbl0g8PINO/XuKgyf24PJI+XwV3ITXU4qWUZxW6WeDSklY2x6nPO3Gn 1grg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1VVOBQ8vQMV6sQsstcumZsHOhdXzv9pz97cTwTA93UQ=; b=TsfxEuAazIJGkIuTdsbkXDuooVM/kczF2KDkVXhEaI/gc07ArudGtqA/X8QmWnSfCj uyof4xbSB+a0VS8yYSPayCmq1eWAHF1vTT+5jv+h+Kx4W808bMSiVGtIRwi8F2Cv90ep 2Jenb9pSall6GXoW87zQeCan94bLrUsJ1Qswb96zZoicsGQyi+KHlqj/pLPMPWMYd2mI 8oxuNECa4lfKVQBH2n9JxpgFI4ainRibmKpyeS9lVBK8gDTez5J3zQEQkhzUBMY0UnGL CneGYmTy6AfAxBj/9WgqscvZDx5lwIUECKXCp3ul9gCl60tQ05QUso7m5JmQKoFFBfwt iD5w== X-Gm-Message-State: AOAM533yw4IELce0oG34q99ldO/7XxPw/2U5AIlGBVWEpWAPeQEv7L6z hysGGiRuHzLxtS3L2qLB1qWpguMCdVU= X-Google-Smtp-Source: ABdhPJxy2VIMBnsCU4bQZCUPLo3vX0a2SdV3IyIJtG1Rp2zkbuWPRpr57Oa0ZL/H55R+T/My40FBrw== X-Received: by 2002:a05:600c:1c10:b0:39c:4708:648d with SMTP id j16-20020a05600c1c1000b0039c4708648dmr4212322wms.85.1654943615646; Sat, 11 Jun 2022 03:33:35 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id p21-20020a1c5455000000b0039c2e2d0502sm6131471wmi.4.2022.06.11.03.33.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Ni Hui , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 04/49] target/mips: Fix msa checking condition in trans_msa_elm_fn() Date: Sat, 11 Jun 2022 12:32:27 +0200 Message-Id: <20220611103312.67773-5-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Ni Hui Fix issue that condition of check_msa_enabled(ctx) is reversed that causes segfault when msa elm_fn op encountered. Fixes: 2f2745c81a ("target/mips: Convert MSA COPY_U opcode to decodetree") Fixes: 97fe675519 ("target/mips: Convert MSA COPY_S and INSERT opcodes to decodetree") Signed-off-by: Ni Hui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220503130708.272850-3-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/msa_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c index aa45bae0aa..92ccc6f921 100644 --- a/target/mips/tcg/msa_translate.c +++ b/target/mips/tcg/msa_translate.c @@ -599,7 +599,7 @@ static bool trans_msa_elm_fn(DisasContext *ctx, arg_msa_elm_df *a, return false; } - if (check_msa_enabled(ctx)) { + if (!check_msa_enabled(ctx)) { return true; } From patchwork Sat Jun 11 10:32:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86DA4C433EF for ; Sat, 11 Jun 2022 10:43:58 +0000 (UTC) Received: from localhost ([::1]:56816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyaz-0000nn-HM for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:43:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyR5-0001pp-Ks for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:44 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyR4-0006BC-76 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:43 -0400 Received: by mail-wr1-x436.google.com with SMTP id o16so1489527wra.4 for ; Sat, 11 Jun 2022 03:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bal8ZKCqz3Fet60H5OB1zckPM9A11UHakCg63aKImjc=; b=FNBbzwaTMI66qoaWq43e4lIlLntyx9vNqC8fKuWpA9xZ9TNqqTPfOp8WDupka3o6S8 A402pK18HTU2HgrpZ/gGmc3svjEhu+hl+XK9fhXNbmByFts/6a2JGNyy6m591NYzuyc9 4+dvIHYtXmcllXK66gsIxlOf/j79kN8EFEhbTynxyV5+4tur+3SXRu4jxXhGfaLXxMhl mF7YIapvkHqme+mjfQS0rb9DnLl0Kd8qpYFQE9X541BGp3E1XxPrcNvbTNWtbbkc4Glj 0itAUbKRADsmpg5piaCsoJCrI2J9atNybsMoBfcK/nq3OcUwJBvMdhHAt5Ie10EcGHkk zWfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bal8ZKCqz3Fet60H5OB1zckPM9A11UHakCg63aKImjc=; b=zhSsdD3/WpCF+EfS7FA70ZG4qF6grvn09fX/BKSnIxpncW4bqiddnNvdCXede36XfP lTtoULXfDq2RuUxV/dyzWKj5HiDbZvDCcLqMwE93rFNLgNU9Rke5UVaB1i8fbIEej0QD FKsohLwNAu61+hxQs1/MC7tA7IMO9SBqhOp15+wl+JIYyzEG6aemGF6hgyjUbxbNANrF d3jwm5LuKfk0vhydjQGvq5x4toEZ0p6jwBcnr0zovPHdQDL/g+EKDmCga+/a4kBYEDhO j8pQbpZ/tXrSZWoiyNOaj0cHKCGwo0+TV1POGdvER9E8F/7X9O5HZ5RanVS+Ph0EXMTl mMWw== X-Gm-Message-State: AOAM530BWbNwp+6s2BFJa1WvcbRIBUPwEpPMqkI+2dMf6CNV9hp0Cbqa r3NWUk5f50Tf1yeXH+VH4d33WgWqSa8= X-Google-Smtp-Source: ABdhPJyPt4H2CoLt4ZxkUuiTSON9fgk4ILfVskN5s7NoXVgWwV0uvZJENztYuBDBmbGK8oqTZWLHlQ== X-Received: by 2002:a5d:6283:0:b0:213:b939:826d with SMTP id k3-20020a5d6283000000b00213b939826dmr43591535wru.543.1654943620716; Sat, 11 Jun 2022 03:33:40 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m5-20020a056000008500b00213d75491b0sm2128554wrx.48.2022.06.11.03.33.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Ni Hui , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 05/49] target/mips: Do not treat msa INSERT as NOP when wd is zero Date: Sat, 11 Jun 2022 12:32:28 +0200 Message-Id: <20220611103312.67773-6-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Ni Hui Only for msa COPY_U/COPY_S with wd zero, we treat it as NOP. Move this special rule into COPY_U and COPY_S trans function. Fixes: 97fe675519 ("target/mips: Convert MSA COPY_S and INSERT opcodes to decodetree") Signed-off-by: Ni Hui Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220503130708.272850-4-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/msa_translate.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c index 92ccc6f921..0b3dd0957c 100644 --- a/target/mips/tcg/msa_translate.c +++ b/target/mips/tcg/msa_translate.c @@ -603,11 +603,6 @@ static bool trans_msa_elm_fn(DisasContext *ctx, arg_msa_elm_df *a, return true; } - if (a->wd == 0) { - /* Treat as NOP. */ - return true; - } - gen_msa_elm[a->df](cpu_env, tcg_constant_i32(a->wd), tcg_constant_i32(a->ws), @@ -624,6 +619,11 @@ static bool trans_msa_elm_fn(DisasContext *ctx, arg_msa_elm_df *a, static bool trans_COPY_U(DisasContext *ctx, arg_msa_elm_df *a) { + if (a->wd == 0) { + /* Treat as NOP. */ + return true; + } + static gen_helper_piii * const gen_msa_copy_u[4] = { gen_helper_msa_copy_u_b, gen_helper_msa_copy_u_h, NULL_IF_MIPS32(gen_helper_msa_copy_u_w), NULL @@ -634,6 +634,11 @@ static bool trans_COPY_U(DisasContext *ctx, arg_msa_elm_df *a) static bool trans_COPY_S(DisasContext *ctx, arg_msa_elm_df *a) { + if (a->wd == 0) { + /* Treat as NOP. */ + return true; + } + static gen_helper_piii * const gen_msa_copy_s[4] = { gen_helper_msa_copy_s_b, gen_helper_msa_copy_s_h, gen_helper_msa_copy_s_w, NULL_IF_MIPS32(gen_helper_msa_copy_s_d) From patchwork Sat Jun 11 10:32:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07A34C433EF for ; Sat, 11 Jun 2022 10:43:40 +0000 (UTC) Received: from localhost ([::1]:56116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyai-0000JG-1K for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:43:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRA-0001u1-Uj for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:49 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:39586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyR9-0006BU-FP for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:48 -0400 Received: by mail-wr1-x42c.google.com with SMTP id x17so1480821wrg.6 for ; Sat, 11 Jun 2022 03:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GoasRVFb2BlfBxlq+erSiANRPbzQryTPUnnof92UlaM=; b=p3jLhGBxIRgGn1aPrI25Qp3/H3CWeZC34gVcb+fGrVJI3Yd6AlhLxJz4GSl6eI/7ck Suvuo7Bk8nmEfxqEs64QnzBPxxoojWuDM//NSY1qzHCqUdteWHLqGMXDaCcg6oTAkovw oxMn2Kx9AzejsqO0KLWPz/TdAjowARvxAnIu1mrkwcXueHMrrZT0wwkKquepTf+dUao+ CbLjOwP5SAhkbYcMhFK77ajTBx75bn4iGIPi2EE0SH3E1c3erx4xbQRoUNlFB2bHpnal eRb3CmvWbP1bSl6cl6lYhkeXtYVhNR5agZ4hRa58vE5tyOOOyLcceUg136sXGHWXtoba xXXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GoasRVFb2BlfBxlq+erSiANRPbzQryTPUnnof92UlaM=; b=VFlle4gLNSArUP/WBhB2hkVWhQLSmKkzMVOi4V5vuTnPTC30DGYwkesmEmxXSNOtWr EgZYtQl9Uu05Omdj0IhYAdAtZKsy7PhNtYSF5SbMa5quYw+u9BcJ2YZ63BVDBrMP7BMo pC4NSb8ftnG6sDJm/4ZSfR4GYF9krL37vyBbNiQVeoUTfBCFt5/7HGqVHOGBhrvdxy9x WgENi3hH+ey1CebwAbczfjfF5dtI9K/3ApjwsK1Ol9VrEFDTOWDqRwaLSkd6Oqxm9KnE 9K0t7FqipCJ0t2z+SbtekH0Rf4coeF2OR5pby8GnB7Of3kcWJS796uibTIWhKk0s9BHf 2CZw== X-Gm-Message-State: AOAM5310JCImZjxgZfHSdPdS76FZwN+aKf2TBtzlKIQAIpLqk4OODXCt B6pJhRuw8p/8Y1RvdTW1Q6m/IGPs5Xc= X-Google-Smtp-Source: ABdhPJz5zAej6VJX0qqxCsNHSK6iBmv9EHalf8lJhXQzQt/fDlweUwC8C9E4+cY/PX6lYS4b9pmf1Q== X-Received: by 2002:a5d:47a4:0:b0:218:5829:dced with SMTP id 4-20020a5d47a4000000b002185829dcedmr21151077wrb.56.1654943625879; Sat, 11 Jun 2022 03:33:45 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0039c4ba160absm15116177wmq.2.2022.06.11.03.33.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Ni Hui , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 06/49] target/mips: Fix store adress of high 64bit in helper_msa_st_b() Date: Sat, 11 Jun 2022 12:32:29 +0200 Message-Id: <20220611103312.67773-7-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Ni Hui This patch fix the issue that helper_msa_st_b() write high 64bit data to where the low 64bit resides, leaving high 64bit undefined. Fixes: 68ad9260e0 ("target/mips: Use 8-byte memory ops for msa load/store") Signed-off-by: Ni Hui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504023319.12923-1-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/msa_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/msa_helper.c b/target/mips/tcg/msa_helper.c index 4dde5d639a..736283e2af 100644 --- a/target/mips/tcg/msa_helper.c +++ b/target/mips/tcg/msa_helper.c @@ -8329,7 +8329,7 @@ void helper_msa_st_b(CPUMIPSState *env, uint32_t wd, /* Store 8 bytes at a time. Vector element ordering makes this LE. */ cpu_stq_le_data_ra(env, addr + 0, pwd->d[0], ra); - cpu_stq_le_data_ra(env, addr + 0, pwd->d[1], ra); + cpu_stq_le_data_ra(env, addr + 8, pwd->d[1], ra); } void helper_msa_st_h(CPUMIPSState *env, uint32_t wd, From patchwork Sat Jun 11 10:32:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDFA6CCA47A for ; Sat, 11 Jun 2022 10:39:47 +0000 (UTC) Received: from localhost ([::1]:47714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyWx-0001k3-2P for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRF-0001xd-Th for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:53 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:45633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRE-0006Cm-Dx for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:53 -0400 Received: by mail-wm1-x335.google.com with SMTP id x6-20020a1c7c06000000b003972dfca96cso759667wmc.4 for ; Sat, 11 Jun 2022 03:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DGNhLhGMFXQBby0dxvCxSCWiyVyDO+c5E5Fgg3cWQxI=; b=JRnDMAAcBqpXBJ71U/rOU59tZ3Cj55v4d8/mRkoA3Ojra5KF9vfOg5E7M7IsvhIE/6 CZeNBoPgJjmpW6bqJe5j3DQBgl2k4hon+CuINkUAmu1oqA1lH7ISqyP8okMzD7N6kbC3 rB/06cMLO60iyWs015v8PP2SO1r/4hqW43QE18ski3blKAVmdew+UJaQoLavZDHW7m4t R8T4XjvyveKZJhsRCHr/0PzyXHJxkDbeMUOiNQ6mmvujyB9Y1Vj6YEsNWIxfAiOYXjs1 nF0HWBUf7RuKfFrNK14QdMF0UlPtCvHCb4Qq55AY45Kqiy09iuOBHVaNd9di0X3Hu4A1 TwiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DGNhLhGMFXQBby0dxvCxSCWiyVyDO+c5E5Fgg3cWQxI=; b=wYDnQDq2krxfSXNfWHYdlFpC+cZ2u5QuM6ZIZPosK9ve3PADc7PlCdPptA+kumnwnZ 7CSJnAAZU7Ilg6fHFUsjN/G+6rTi3Cn3kaf/0N04pnC3q38tlzdplBKIocFSQJy6B80w BvHqnDzDrE3NyHKX/sh5n/C9YX/KaGAHqizhy4dBsSxgpFSdcQWpHELeiKHWUCVa2S0m LM8aIRrn2zv0EpFF6+drAQAY0PbxiEZw97KalZuKoPFfn1zIAEiKzPjaIhGSUASeucWM URXpza1C5IcXlcSYlR3Ol9NMzMG98hRPHVRJr0mi9Pmt2Oz6h9quD6pSYBn/uqBXWHD8 C6Gw== X-Gm-Message-State: AOAM53348Q4R/g6vBJlXM0YYu0QOnUgSMq42UzKRvOFVvYS4h4qOzB9S 1lO/bk/17xfTjBiofq0OAtJuqpIa5Wc= X-Google-Smtp-Source: ABdhPJyhk3IG6upFrHunpm74c5wFfzT5H+o7wyyc5SnoxTr9QDPKhvj05FvUSIvJn360WpgYORQ2VA== X-Received: by 2002:a7b:ce87:0:b0:39c:5509:660c with SMTP id q7-20020a7bce87000000b0039c5509660cmr4105375wmj.163.1654943630999; Sat, 11 Jun 2022 03:33:50 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id n10-20020a056000170a00b00219fb3a275csm354824wrc.16.2022.06.11.03.33.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Ni Hui , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 07/49] target/mips: Fix FTRUNC_S and FTRUNC_U trans helper Date: Sat, 11 Jun 2022 12:32:30 +0200 Message-Id: <20220611103312.67773-8-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Ni Hui Fix the FTRUNC_S and FTRUNC_U trans helper problem. Fixes: 5c5b64000c ("target/mips: Convert MSA 2RF instruction format to decodetree") Signed-off-by: nihui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220503144241.289239-1-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/msa_translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c index 0b3dd0957c..1bcdbb1121 100644 --- a/target/mips/tcg/msa_translate.c +++ b/target/mips/tcg/msa_translate.c @@ -752,8 +752,8 @@ static bool trans_msa_2rf(DisasContext *ctx, arg_msa_r *a, } TRANS(FCLASS, trans_msa_2rf, gen_helper_msa_fclass_df); -TRANS(FTRUNC_S, trans_msa_2rf, gen_helper_msa_fclass_df); -TRANS(FTRUNC_U, trans_msa_2rf, gen_helper_msa_ftrunc_s_df); +TRANS(FTRUNC_S, trans_msa_2rf, gen_helper_msa_ftrunc_s_df); +TRANS(FTRUNC_U, trans_msa_2rf, gen_helper_msa_ftrunc_u_df); TRANS(FSQRT, trans_msa_2rf, gen_helper_msa_fsqrt_df); TRANS(FRSQRT, trans_msa_2rf, gen_helper_msa_frsqrt_df); TRANS(FRCP, trans_msa_2rf, gen_helper_msa_frcp_df); From patchwork Sat Jun 11 10:32:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADEABC43334 for ; Sat, 11 Jun 2022 10:47:56 +0000 (UTC) Received: from localhost ([::1]:36428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyen-0006BS-Sd for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:47:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRM-0002BV-2o for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:00 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRK-0006D0-Kf for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:33:59 -0400 Received: by mail-wr1-x432.google.com with SMTP id s1so1462580wra.9 for ; Sat, 11 Jun 2022 03:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nIafIEbZr/KYiHZODOx9BpkQO+OqaLzsBcQX1foBSQQ=; b=Kx309NEk76DNojuqy060Xg7gow206kQgTFrdBpwm2WbHb+4JTRzlDV/vN+efc2zjm2 8vmmpqzIZIoSSrhWm4hawoZhaFS+xDMnxuHN/dPaYC0yvgAUJn+ZqDvSagtW5BSWPK6X HSA9MxZy8JCImKqBY06P3tvUE5c3rb1dVpl8GpIQbfeFLUYJQW2r+ALyeki4vE/ptcCA W4B70nCrqSMD6vQDWDDeiHc6nhW5hAbZqOybHvbblK2hoy0QInd94ccqQ6WhzAq8oJTu v+PD24R2Hs9FfQ0iJxLTlzDcAbPm2WycgGJ+FITWbXU1dvDi6Bg/Q9jQKGflygtXrAuU VIkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nIafIEbZr/KYiHZODOx9BpkQO+OqaLzsBcQX1foBSQQ=; b=3wHTqQE7HNP4edoQaqR2ypwsfIN0GtkgdqqNEaRJRKe4PfUum6qXsyoF/kOas24Tcr d8tQPsntGMV0AGvzTskaoSUvON/hvY+AoiPzaCQgf2SVpjAHmdV9NSag4FFhLxXb0sLY OKV4xjtjmguDljUlSMxVnFGMOVr9yFgEcnpELqkHAeQyUrEPtehDkEwx7KywWApUTNeg K6EpvVFMuDMH/eklrZDa5f/I87gVV84cYtwv2FwkKKdlakgM0OnUQGSFJS9RZ6QORf6V BIN4zwlrn1Ov70uwEZ4Q8zDIe+hRSWfT1LRAdKTuDoxNqDC0Ci0jIH1zrXaOKMUqdHaY ql6g== X-Gm-Message-State: AOAM532T9v+AjUr8kkmQwwt947f1pxk1r5V1z7opy6bVH3Oxu0bIL8ey itFKtw9+Q0ydV6vVcMUJS4ld88YVLo8= X-Google-Smtp-Source: ABdhPJwQuVYsLs0CkbRzQMHygG3U4YCEsmwOlDZJcuHv2qZkrTlvbRW+UBd9Ov0yr/rc/OnaXJPweA== X-Received: by 2002:a05:6000:178d:b0:20f:e84c:2f46 with SMTP id e13-20020a056000178d00b0020fe84c2f46mr47912515wrg.646.1654943636101; Sat, 11 Jun 2022 03:33:56 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id a10-20020a056000100a00b0020d106c0386sm2072927wrx.89.2022.06.11.03.33.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:33:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PULL 08/49] target/mips: Fix emulation of nanoMIPS MTHLIP instruction Date: Sat, 11 Jun 2022 12:32:31 +0200 Message-Id: <20220611103312.67773-9-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stefan Pejic The field ac in nanoMIPS instruction MTHLIP rs, ac is specified in nanoMIPS documentation as opcode[15..14] (2 bits). However, in the current QEMU code, the corresponding argument passed to the helper gen_helper_mthlip() has the value of opcode[15..11] (5 bits). Right shift the value of this argument by three bits to fix this. Signed-off-by: Stefan Pejic Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504110403.613168-2-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/nanomips_translate.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc index 916cece4d2..58ae35a156 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -1597,7 +1597,7 @@ static void gen_pool32axf_1_nanomips_insn(DisasContext *ctx, uint32_t opc, check_dsp(ctx); switch (extract32(ctx->opcode, 12, 2)) { case NM_MTHLIP: - tcg_gen_movi_tl(t0, v2); + tcg_gen_movi_tl(t0, v2 >> 3); gen_helper_mthlip(t0, v0_t, cpu_env); break; case NM_SHILOV: From patchwork Sat Jun 11 10:32:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC92EC433EF for ; Sat, 11 Jun 2022 10:43:44 +0000 (UTC) Received: from localhost ([::1]:56242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyal-0000Pf-UF for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:43:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRQ-0002NN-Dt for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:04 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRO-0006DG-Rp for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:04 -0400 Received: by mail-wr1-x42b.google.com with SMTP id k19so1472802wrd.8 for ; Sat, 11 Jun 2022 03:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zSo+culpJATZACSBmjT9Ra1U4oAMbiKli3IdqMT5z10=; b=ZNIaS2om+mJ3/Ap4dfBoAEJoXCFy6zjT1jsQRHbgo+aB3k7VFLzD2IVUh3ZJhezHnA u1fPshoH7VT1puHMwtva31eT8gNEPMoW+9e5QM4x+IFTorL+4J3kx/jeJ0wKOMdzLHwj KeoVS41axm4Fv72LPASksrW9CfcC091VZao4ccZtHInDNkasBlZXkwxefW8B00X9Oir5 RVZv36HS9xhBI2EwwE3trah4zTy+WzIPr6qBcnIxFn7PzuX4Be4kaiV6qhZEpx77VBhp Lkb98M+kdIKRipNxXhti/sY+4uxoWCkNaukRl2EwXy32F9bcp3j8XP482fUs2LdXIRmh dW3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zSo+culpJATZACSBmjT9Ra1U4oAMbiKli3IdqMT5z10=; b=NMwaapl1+ZVJSH0i/azwcCdnGfgbHJbcV2g7seg4y4TU0bbub+eAmKVw5sPADaVk8r hE2fHjSUHkTKwNoA78vkaHLCiVOH6LeVDMvW9d1tu2mVymxUOWKURCHdkyQPr+h/NE77 /XzEtXNsko5HuGbuospab+0ttkOjDMO2fXt3jIors6SIZ9/3wEG+c+wDJl1kb2zkkxyQ yGWXCtp8RqLOzSlAj14mRPdbX39HbBtjEGDD0iyDh/ZNeNycEkRi4s7TBKJtdLa/8xE5 kpfUto6VQVNCPoehuDj0MW6Odm0LnE6rwRXjnbPkWW/jJKLMOAP7ZakDOn8Gv4asYPCO pSiA== X-Gm-Message-State: AOAM533GfKKiPTycJIR7iYw+52n6J1OFGMr0gxxr1SqSh0OF15AOy+ZC LY8oU+OmBWA9upC288HzJs+IBZ8hQrY= X-Google-Smtp-Source: ABdhPJyLtn6IyGaVDIk08THrDNIjw9YsIxxEKmKt0AGxdMQ9CuKCyOPFnANAkCrruxar3yDGyAvsUg== X-Received: by 2002:a5d:67c2:0:b0:215:7a0f:71f9 with SMTP id n2-20020a5d67c2000000b002157a0f71f9mr41927621wrw.486.1654943641197; Sat, 11 Jun 2022 03:34:01 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id ay15-20020a5d6f0f000000b002183cf9cd69sm2144366wrb.15.2022.06.11.03.34.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Dragan Mladjenovic , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PULL 09/49] target/mips: Fix emulation of nanoMIPS EXTRV_S.H instruction Date: Sat, 11 Jun 2022 12:32:32 +0200 Message-Id: <20220611103312.67773-10-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Dragan Mladjenovic The field rs in the instruction EXTRV_S.H rt, ac, rs is specified in nanoMIPS documentation as opcode[20..16]. It is, however, erroneously considered as opcode[25..21] in the current QEMU implementation. In function gen_pool32axf_2_nanomips_insn(), the variable v0_t corresponds to rt/opcode[25..21], and v1_t corresponds to rs/opcode[20..16]), and v0_t is by mistake passed to the helper gen_helper_extr_s_h(). Use v1_t rather than v0_t in the invocation of gen_helper_extr_s_h() to fix this. Signed-off-by: Dragan Mladjenovic Signed-off-by: Stefan Pejic Fixes: 8b3698b294 ("target/mips: Add emulation of DSP ASE for nanoMIPS") Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504110403.613168-3-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/nanomips_translate.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc index 58ae35a156..9ee4df2135 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -2036,7 +2036,7 @@ static void gen_pool32axf_2_nanomips_insn(DisasContext *ctx, uint32_t opc, case NM_EXTRV_S_H: check_dsp(ctx); tcg_gen_movi_tl(t0, rd >> 3); - gen_helper_extr_s_h(t0, t0, v0_t, cpu_env); + gen_helper_extr_s_h(t0, t0, v1_t, cpu_env); gen_store_gpr(t0, ret); break; } From patchwork Sat Jun 11 10:32:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFAB4CCA47A for ; Sat, 11 Jun 2022 10:36:40 +0000 (UTC) Received: from localhost ([::1]:42044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyTv-0005UF-TX for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:36:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRW-0002cA-En for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:10 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:38982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRT-0006Dd-Qv for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:10 -0400 Received: by mail-wm1-x333.google.com with SMTP id i131-20020a1c3b89000000b0039c6fd897b4so1754348wma.4 for ; Sat, 11 Jun 2022 03:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JXGp9AEBGIcAPuqUO7kDAfXP5dRhKuWFhn6lRxbnldQ=; b=ajf0ZmtyTbXN2bM0Dc1a5vgSH27N0+T8VGtIxa6R8BtL7EB6owHZq7IfejLZhtEP6v eSFha7d7tFLdr6OPZUX06hJ1V1RMJoQM7n98OYOkvBIVOoeYWrS7yvSjqf/YpBGFbO7D oSREvV5wlwIYyFZA0lCnqgPHSfb+yxIpsxfBJ6sirGCsxrvm8XQFvILWTmDFGlLi2Lgn qHeKvtaBXebX/HOVDMWiJikXtnzoZlOeX9Ur9+0rbpSgnMvSAFntd4aTzodxaK+touk5 jKyX7wuoojoTAaEXT9NyR16OSBKXdqrb/icQtadAMc+y6y7/17sQ1JmyY8kDX3wvi5zL EPSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JXGp9AEBGIcAPuqUO7kDAfXP5dRhKuWFhn6lRxbnldQ=; b=rf70rYbSsLmTyPeSWwSJ1pSfuZaTXhI3MHXtVAtGLcjB6Jl7NSt25qF/UsuW2FdcbW xD7YzpqxYjVOWDD8NKg6VTvDMCtv06VvMvDP52PSMlUWdFsXXRarwEvZqICTlEsVYwwd 4RkfJJEo5SYPPJDR+pdWQhaFV2pqHMKjynqPNQDCKu50BKxSr7M5L1H+QEv5EZ1QoIvx kXmOTLnH0PWOA2mYvOsjxT7423EifQlI5kg4K9PWKdXPK8BXr4d3D4brBXxU5oMcLliR oms5MUnVyYlJas0kQXc6go1LlOfIrNSO55deamYN7YidZ1hnKf+oSzPiNf6CxQoXlMO5 Tl6w== X-Gm-Message-State: AOAM533IYQre9NnX/+3NSR3bb1arIDYHAEqxSESFpi6Hp6i1Ig27s72N ZUfu4pxJf6TNNJLzfzurzhS9MkChEKM= X-Google-Smtp-Source: ABdhPJz4UJ2Cp/bjwNocgIYBOHYa6jG5XF77jjEIEy8s3UoazE0alhPhcdMl9vK/lvq5LolBMqKLpQ== X-Received: by 2002:a05:600c:4fd2:b0:39c:1586:a2e0 with SMTP id o18-20020a05600c4fd200b0039c1586a2e0mr4113680wmq.62.1654943646298; Sat, 11 Jun 2022 03:34:06 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id q1-20020adff501000000b002117ef160fbsm2189441wro.21.2022.06.11.03.34.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Dragan Mladjenovic , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PULL 10/49] target/mips: Fix emulation of nanoMIPS BPOSGE32C instruction Date: Sat, 11 Jun 2022 12:32:33 +0200 Message-Id: <20220611103312.67773-11-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Dragan Mladjenovic There are currently two problems related to the emulation of the instruction BPOSGE32C. The nanoMIPS instruction BPOSGE32C belongs to DSP R3 instructions (actually, as of now, it is the only instruction of DSP R3). The presence of DSP R3 instructions in QEMU is indicated by the flag MIPS_HFLAG_DSP_R3 (0x20000000). This flag is currently being properly set in CPUMIPSState's hflags (for example, for I7200 nanoMIPS CPU). However, it is not propagated to DisasContext's hflags, since the flag MIPS_HFLAG_DSP_R3 is not set in MIPS_HFLAG_TMASK (while similar flags MIPS_HFLAG_DSP_R2 and MIPS_HFLAG_DSP are set in this mask, and there is no problem in functioning check_dsp_r2(), check_dsp()). This means the function check_dsp_r3() currently does not work properly, and the emulation of BPOSGE32C can not work properly as well. Change MIPS_HFLAG_TMASK from 0x1F5807FF to 0x3F5807FF (logical OR with 0x20000000) to fix this. Additionally, check_cp1_enabled() is currently incorrectly called while emulating BPOSGE32C. BPOSGE32C is in the same pool (P.BR1) as FPU branch instruction BC1EQZC and BC1NEZC, but it not a part of FPU (CP1) instructions, and check_cp1_enabled() should not be involved while emulating BPOSGE32C. Rearrange invocations of check_cp1_enabled() within P.BR1 pool handling to affect only BC1EQZC and BC1NEZC emulation, and not BPOSGE32C emulation. Signed-off-by: Dragan Mladjenovic Signed-off-by: Stefan Pejic Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504110403.613168-4-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.h | 2 +- target/mips/tcg/nanomips_translate.c.inc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 6b6b8776d1..42efa989e4 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1077,7 +1077,7 @@ typedef struct CPUArchState { #define EXCP_INST_NOTAVAIL 0x2 /* No valid instruction word for BadInstr */ uint32_t hflags; /* CPU State */ /* TMASK defines different execution modes */ -#define MIPS_HFLAG_TMASK 0x1F5807FF +#define MIPS_HFLAG_TMASK 0x3F5807FF #define MIPS_HFLAG_MODE 0x00007 /* execution modes */ /* * The KSU flags must be the lowest bits in hflags. The flag order diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc index 9ee4df2135..941cfaa6bb 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -4478,12 +4478,13 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) case NM_P_BR3A: s = sextract32(ctx->opcode, 0, 1) << 14 | extract32(ctx->opcode, 1, 13) << 1; - check_cp1_enabled(ctx); switch (extract32(ctx->opcode, 16, 5)) { case NM_BC1EQZC: + check_cp1_enabled(ctx); gen_compute_branch_cp1_nm(ctx, OPC_BC1EQZ, rt, s); break; case NM_BC1NEZC: + check_cp1_enabled(ctx); gen_compute_branch_cp1_nm(ctx, OPC_BC1NEZ, rt, s); break; case NM_BPOSGE32C: From patchwork Sat Jun 11 10:32:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7BE6C43334 for ; Sat, 11 Jun 2022 10:41:09 +0000 (UTC) Received: from localhost ([::1]:50624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyYH-0004Ls-1e for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:41:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRZ-0002nP-Kv for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:13 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRY-0006BC-7t for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:13 -0400 Received: by mail-wr1-x436.google.com with SMTP id o16so1489527wra.4 for ; Sat, 11 Jun 2022 03:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gC9YGRG/tq9ye99In2Mn5dKXrLY64Et8KE1X8rj2WB0=; b=qb9xBT3fYYcMgrTYqBUC3kkXbcj90PmI005eZRr5/uiOioEkPwzPr7mOnLS2hdP5eN QhmlGl5FdcG31/xUgOdTlaHxNoL+4i8y8davtpTtJJSgwmMVxwja9MIzAAJchGOZOzpd ZSvz8qYS5rYRLu9iPMs9RHMs5O4et8n3xkOgHmq8uxjjIOackDF/J8TA10w2hBo5/5da /vLgE1MP4IzYzhM+DtznBNTdg0wekh7awVJhIpELDk7/BeI1wDdhv/TihuoTov3D2GvP kx2nnaIz9PMyngaNoV+rjG5lqNYp6IHfCUx3TeBG//QzjMeVN5mUExMDhMyr4UBGvPNp NfYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gC9YGRG/tq9ye99In2Mn5dKXrLY64Et8KE1X8rj2WB0=; b=uJ6w2TdMaZBAonVl3WaBfp7rYqRRDCsFWNUe6o/hilsUKY7zvNKQf0TLL3DwD1RYAm Og25vkOQjf/xbUotEMZpKI5BeLGCjek2XvFElGaL6LCFXSfIAqInmbZAXay5Gr88oiq1 rHk3q3YetHjFnENpZlg5yQI1bm/ApdTT6H/uu0aBIAy9hMTWgZo7WlKeegeSJmMA6vCa lK+loktyCdsWUQVJfkflM0GZGRkHgCqb7a7IqaYY0BhCpy4k+KFHk2g3I3u7kSavtXK8 m5sG9EMc6/lpFjn+RfbrUl4zBwA0STkt9bLZBh71PhOH5AiqercnqtFF4YP3JllfCmd8 5HoA== X-Gm-Message-State: AOAM53348WwAtgw15LhuiAnT4okF6SfQL5uXjA3jss1J1Y7GmEhiynPX 3G5Y1JivOXnaB1OndQ8LedIz0qRrdsc= X-Google-Smtp-Source: ABdhPJxtPv/dti940qyu6CQ1iVdYgbBI0PRlCYsU2CAhuwsnI3oegFIWOSAtOO2T/gujIfgbjin24A== X-Received: by 2002:a05:6000:1e04:b0:217:88ff:eb86 with SMTP id bj4-20020a0560001e0400b0021788ffeb86mr34392980wrb.351.1654943651332; Sat, 11 Jun 2022 03:34:11 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id l12-20020adff48c000000b0020e615bab7bsm2166636wro.7.2022.06.11.03.34.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Dragan Mladjenovic , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PULL 11/49] target/mips: Fix emulation of nanoMIPS BNEC[32] instruction Date: Sat, 11 Jun 2022 12:32:34 +0200 Message-Id: <20220611103312.67773-12-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Dragan Mladjenovic If both rs and rt are the same register, the nanoMIPS instruction BNEC[32] rs, rt, address is equivalent to NOP (branch is not taken and there is no delay slot). This commit provides such behavior. Without this commit, this scenario results in an incorrect behavior. Signed-off-by: Dragan Mladjenovic Signed-off-by: Stefan Pejic Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504110403.613168-5-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/nanomips_translate.c.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc index 941cfaa6bb..1ee5c8c8d4 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -4528,7 +4528,12 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) switch (extract32(ctx->opcode, 14, 2)) { case NM_BNEC: check_nms(ctx); - gen_compute_branch_nm(ctx, OPC_BNE, 4, rs, rt, s); + if (rs == rt) { + /* NOP */ + ctx->hflags |= MIPS_HFLAG_FBNSLOT; + } else { + gen_compute_branch_nm(ctx, OPC_BNE, 4, rs, rt, s); + } break; case NM_BLTC: if (rs != 0 && rt != 0 && rs == rt) { From patchwork Sat Jun 11 10:32:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4715C433EF for ; Sat, 11 Jun 2022 10:49:16 +0000 (UTC) Received: from localhost ([::1]:37070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyg7-0006cJ-O8 for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:49:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRf-000354-2C for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:19 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRd-0006DG-IG for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:18 -0400 Received: by mail-wr1-x42b.google.com with SMTP id k19so1472802wrd.8 for ; Sat, 11 Jun 2022 03:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6MqcxIJN2+Zm3sGgLV3r2BkGN3s/2DTUZOjkjXVU9rE=; b=IW8cX0qAPqQs0xCHCPxBfYwyAZfRIKERUFIqHzUx2Ra4YXb/JTeADXl0bvinaJ37tt 4U8oqDh6K7cMd/qjtMm8NubddbboHeOjXCZgyjgP8YRCmE+i14bM1R48UonFLUqiTfEx nJ+TBg5U91JRIfH3Mqff8S6WJptAK+inN9TZRvsznwly3rafO8VIoMEmcqGbOkp/vs9z JXCWJJ98K9e1oZo/ClDnBHII14xUMrZSGVd6XXDyagT0ZyaCufKYl1rCD1W/q2t0baTz xsQbuzl+EUcGNC78/rvRmL0sDJhAXYXV41E7QFSK4qrcSEhlC47omkvq8wOxd9gURIwI 89vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6MqcxIJN2+Zm3sGgLV3r2BkGN3s/2DTUZOjkjXVU9rE=; b=JpsJlwOs9HfkBejcXEeFm8w2LrVcSkDwHRLTeT04dQLEn73dkWgFnPbaqSqcg3E7nb p8wvTyYuNYoShH4rWbDwOsCNcveqDIRCVdpfjP0fvTevHJyoKeoljLDSPeAoXJcOyTKG 1J5IaMuTwHXJ1z+upXLanPYkWlIVUbrT2Q6Por8yHXj9+OHMj4yGZ4hYTKXPXoXawk+D B9zWKczZJE1HjrsRTCL2/07Y2PBfCHKEVptLQTtqrTPhhX0VXAFaTknmk8C7aZG3WzNi kVtvFaQrGTMqmkRTaOBTwJ0cGNtAQcBPfhODDXBzRsZCXbxedf6Xp+bpzDu9MFXXvBg7 ndaQ== X-Gm-Message-State: AOAM531GSyOQsk3Du+IrQJsx2/flUz4VnqZ056ZOlsl8H+b3bflHSSlP ddNMIyMW0fWxvG7irK1pQGhSkrBdsFw= X-Google-Smtp-Source: ABdhPJxhTIC9Ouw093V5Xy93KMJCzBP+7NJfArD2+BZ+4OPUz8FKuX0h9yW5XcuwAsCoaGxyb99zwA== X-Received: by 2002:adf:ed49:0:b0:210:2b98:a539 with SMTP id u9-20020adfed49000000b002102b98a539mr47175423wro.118.1654943656618; Sat, 11 Jun 2022 03:34:16 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id z12-20020a5d44cc000000b00219e758ff4fsm2153067wrr.59.2022.06.11.03.34.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Dragan Mladjenovic , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PULL 12/49] target/mips: Fix handling of unaligned memory access for nanoMIPS ISA Date: Sat, 11 Jun 2022 12:32:35 +0200 Message-Id: <20220611103312.67773-13-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Dragan Mladjenovic nanoMIPS ISA does not support unaligned memory access. Adjust DisasContext's default_tcg_memop_mask to reflect this. Signed-off-by: Dragan Mladjenovic Signed-off-by: Stefan Pejic Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504110403.613168-6-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 6de5b66650..5f460fb687 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -16023,8 +16023,9 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) #else ctx->mem_idx = hflags_mmu_index(ctx->hflags); #endif - ctx->default_tcg_memop_mask = (ctx->insn_flags & (ISA_MIPS_R6 | - INSN_LOONGSON3A)) ? MO_UNALN : MO_ALIGN; + ctx->default_tcg_memop_mask = (!(ctx->insn_flags & ISA_NANOMIPS32) && + (ctx->insn_flags & (ISA_MIPS_R6 | + INSN_LOONGSON3A))) ? MO_UNALN : MO_ALIGN; /* * Execute a branch and its delay slot as a single instruction. From patchwork Sat Jun 11 10:32:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56370C43334 for ; Sat, 11 Jun 2022 10:53:05 +0000 (UTC) Received: from localhost ([::1]:45310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyjo-00043M-FB for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:53:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRk-0003Lj-TL for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:24 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRj-0006Fu-8W for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:24 -0400 Received: by mail-wr1-x432.google.com with SMTP id v14so1487127wra.5 for ; Sat, 11 Jun 2022 03:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0dDhWhwpaGDBK8Q4fbZrV2hDpstODQvC/cOd95qzwgY=; b=bn9UkCd7PQwVZLfUV3H71Ad3zbxv4t+sDpSqLJJYm2Afv3adRwnKaiaDUq7OE3Oo60 ukojDctVZKR0prdMbl/WBMw+x7qpWCL5UMCl/0Exh9x9goXcdsz/r5SsVrXeiTYZnVTu baBYpQaivOtWDjc1IOfxUyCUbEUCuOf2iwYnOOTWrQMsTVAWoRBjH06FJiICNcuyn6wP J55FGZKuqS8Qvteb8mmJEpLIkjxZ+yznavkrIFIRl+17KchzdAQh3k1N2vTl9Rkt4+Vn OZ+8Rg128qPy22u9r9ESouajKxJEQE0vuj80Ho5L2A2Oruq659Oj0pMG2p6KeA1qQUB+ x35g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0dDhWhwpaGDBK8Q4fbZrV2hDpstODQvC/cOd95qzwgY=; b=k6+4IrAf61xyCzFYdnF4T8yudYzFn+dvl0RXhiAzOsciM4rfdbqpDwuXgKZVJL9HTS gHQ68jdgY33fhw6mnjIO4b3kYvYIWJv7GHubjBXnAQ89IL9sKs5ZTJVV+WXXSCCzDBTn 9GjnMrtE0WZlmPtJKcZUsts/ZOljieJEsR6Vn2JOnP+psQK9KdyzHstxMVWsTqDhcPE8 gqzz1ayL6W4XHDhGuqavqm56oEdDE89qnZujM+XTn+EGzQqg3LKkpiJVrBh6GXkbhl3U 6HyN3mPealGIZUXNkK2zbAlIGF5FJRMHlsewGVfKyBy/m2aWG78f1JK3U4TlJ7edz/yN wcVQ== X-Gm-Message-State: AOAM5327xExNUhFDnlXJ/XJctEwr5F8OW0/46Q6d10fGcfS0CYOwauW1 7mpHLWj8y+kR30JCC4rAAQL8A4PPB7o= X-Google-Smtp-Source: ABdhPJyAiQCnqzdS2nEldarerE1AfG9AQs1lg4XdHBaVui/RgHhxu/kPrnAu92GZJmPlbWP/VnKfbg== X-Received: by 2002:a5d:6445:0:b0:211:7eee:2f94 with SMTP id d5-20020a5d6445000000b002117eee2f94mr47557555wrw.631.1654943661696; Sat, 11 Jun 2022 03:34:21 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id p28-20020a05600c1d9c00b0039c7f790f6asm4211647wms.30.2022.06.11.03.34.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PULL 13/49] target/mips: Add missing default cases for some nanoMIPS pools Date: Sat, 11 Jun 2022 12:32:36 +0200 Message-Id: <20220611103312.67773-14-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stefan Pejic Switch statements for the code segments that handle nanoMIPS instruction pools P.LL, P.SC, P.SHIFT, P.LS.S1, P.LS.E0, PP.LSXS do not have proper default case, resulting in not generating reserved instruction exception for certain illegal opcodes. Fix this by adding default cases for these switch statements that trigger reserved instruction exception. Signed-off-by: Stefan Pejic Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220504110403.613168-7-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/nanomips_translate.c.inc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc index 1ee5c8c8d4..c0ba2bf1b1 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -2707,6 +2707,9 @@ static void gen_p_lsx(DisasContext *ctx, int rd, int rs, int rt) case NM_SDC1XS: tcg_gen_shli_tl(t0, t0, 3); break; + default: + gen_reserved_instruction(ctx); + goto out; } } gen_op_addr_add(ctx, t0, t0, t1); @@ -2797,6 +2800,7 @@ static void gen_p_lsx(DisasContext *ctx, int rd, int rs, int rt) break; } +out: tcg_temp_free(t0); tcg_temp_free(t1); } @@ -3944,6 +3948,9 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) gen_shift_imm(ctx, OPC_ROTR, rt, rs, extract32(ctx->opcode, 0, 5)); break; + default: + gen_reserved_instruction(ctx); + break; } } break; @@ -4245,6 +4252,9 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) check_xnp(ctx); gen_llwp(ctx, rs, 0, rt, extract32(ctx->opcode, 3, 5)); break; + default: + gen_reserved_instruction(ctx); + break; } break; case NM_P_SC: @@ -4257,6 +4267,9 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) gen_scwp(ctx, rs, 0, rt, extract32(ctx->opcode, 3, 5), false); break; + default: + gen_reserved_instruction(ctx); + break; } break; case NM_CACHE: @@ -4265,6 +4278,9 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) gen_cache_operation(ctx, rt, rs, s); } break; + default: + gen_reserved_instruction(ctx); + break; } break; case NM_P_LS_E0: @@ -4371,6 +4387,9 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) break; } break; + default: + gen_reserved_instruction(ctx); + break; } break; case NM_P_LS_WM: From patchwork Sat Jun 11 10:32:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04B21C43334 for ; Sat, 11 Jun 2022 10:48:07 +0000 (UTC) Received: from localhost ([::1]:36530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyf0-0006Fa-1C for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:48:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRp-0003YG-V5 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:29 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:56208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRo-0006GG-C0 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:29 -0400 Received: by mail-wm1-x336.google.com with SMTP id a10so620597wmj.5 for ; Sat, 11 Jun 2022 03:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Is3ANV7KetILpxXaoCA2qsawFyqZ3ykoejNME1BEWxg=; b=pXVtKrWUpLWK6Cj81lY9P5VP1dOZIjrxvFEi4t369NL1J1wmc1MO49wO0aXkgLiB5S PKdS/kq257xCeSeWfVp6LAGaO6SQaTh3r3XlLWDW1b3LDBRiV3GNAznlINnBERL7nU1A DihEnt9tP6EGaZWxD7v9u2hh329N0jWAuRnbcWwgyer1fyz9dVqpeESP7q5UzkboVn8/ v0Qf5vJdc9gxpcieS78Tg0x6mUMRptbV4826DKlgOGEi2i7AcSZFu0GbYARhkZjYxQNU RIYBliGmGiSDFIWu7WvRtJdcX/48xGx8Q89tuWLbRuEtYmui5UnD0gCuUMbPIKPfko+d x7KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Is3ANV7KetILpxXaoCA2qsawFyqZ3ykoejNME1BEWxg=; b=d7PwwHUMZ5acZMQM6bgPL9vEiYoAl/XinDsebs4ivNy/0ZSAp3N9/2ccChjgMuZZw8 YjfaMG6JKH58r+vSvEue4owi52S7JZo53c3rFGJBmJZnm+e8fnnHnIIvZBh3m6TgLjSi K8i/5wqZF1pwpCb7ce2yKfEzXYOUnrCwMzJwQK8dL/BvIRqTxkSvAnXntXSie4ZYDcM4 FMc0cNZxojIVg90yqMZtc+tQeFnwOpg6WhbPktQfEKnVzXjvZI8E1hjyrr4LL2M8h8jf RU0lRBL/eKjuYagq/Yh1Ke2q+DbwAtQTGDoDlulEgn2dTvBeY6htPG3fLFVa/b0LaUnJ WQIA== X-Gm-Message-State: AOAM530sQTgRjOC+SyaC94MXBGheRxdpP1l3KDlTU0Jd1dXzFC0NmxdY irKG3SpbXIFR1SENr/HGd57ihTKmNVI= X-Google-Smtp-Source: ABdhPJz5E4hKZGWOKMQ3dQSl2i9Brg6CBGaF+pjd6ZXRBKLa5fTShBI++pigm1NTX4eenzMHd4fwwQ== X-Received: by 2002:a7b:c154:0:b0:39c:4f4a:79c0 with SMTP id z20-20020a7bc154000000b0039c4f4a79c0mr4201871wmi.152.1654943666727; Sat, 11 Jun 2022 03:34:26 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m127-20020a1ca385000000b0039c4f0c827fsm5869027wme.26.2022.06.11.03.34.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PULL 14/49] target/mips: Undeprecate nanoMIPS ISA support in QEMU Date: Sat, 11 Jun 2022 12:32:37 +0200 Message-Id: <20220611103312.67773-15-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stefan Pejic nanoMIPS ISA support in QEMU is actively used by MediaTek and is planned to be maintained and potentially extended by MediaTek in future. Un-orphan nanoMIPS ISA support in QEMU by setting a maintainer from MediaTek and remove deprecation notes from documentation as well. Signed-off-by: Stefan Pejic Message-Id: <20220504110403.613168-8-stefan.pejic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 3 ++- docs/about/deprecated.rst | 30 ------------------------------ 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b3af081c51..0df25ed4b0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -246,7 +246,8 @@ F: docs/system/cpu-models-mips.rst.inc F: tests/tcg/mips/ MIPS TCG CPUs (nanoMIPS ISA) -S: Orphan +M: Stefan Pejic +S: Maintained F: disas/nanomips.* F: target/mips/tcg/*nanomips* diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index aa2e320207..19a91b575f 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -213,17 +213,6 @@ MIPS ``Trap-and-Emul`` KVM support (since 6.0) The MIPS ``Trap-and-Emul`` KVM host and guest support has been removed from Linux upstream kernel, declare it deprecated. -System emulator CPUS --------------------- - -MIPS ``I7200`` CPU Model (since 5.2) -'''''''''''''''''''''''''''''''''''' - -The ``I7200`` guest CPU relies on the nanoMIPS ISA, which is deprecated -(the ISA has never been upstreamed to a compiler toolchain). Therefore -this CPU is also deprecated. - - QEMU API (QAPI) events ---------------------- @@ -337,16 +326,6 @@ The above, converted to the current supported format:: json:{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"} -linux-user mode CPUs --------------------- - -MIPS ``I7200`` CPU (since 5.2) -'''''''''''''''''''''''''''''' - -The ``I7200`` guest CPU relies on the nanoMIPS ISA, which is deprecated -(the ISA has never been upstreamed to a compiler toolchain). Therefore -this CPU is also deprecated. - Backwards compatibility ----------------------- @@ -376,15 +355,6 @@ versions, aliases will point to newer CPU model versions depending on the machine type, so management software must resolve CPU model aliases before starting a virtual machine. -Guest Emulator ISAs -------------------- - -nanoMIPS ISA -'''''''''''' - -The ``nanoMIPS`` ISA has never been upstreamed to any compiler toolchain. -As it is hard to generate binaries for it, declare it deprecated. - Tools ----- From patchwork Sat Jun 11 10:32:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5AD0C433EF for ; Sat, 11 Jun 2022 10:54:17 +0000 (UTC) Received: from localhost ([::1]:47920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyky-0005rZ-W2 for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:54:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyRv-0003k2-5C for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:35 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:45966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRt-0006Ge-Ad for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id p10so1448361wrg.12 for ; Sat, 11 Jun 2022 03:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sr6Q8Miis0Zz95uadtdvLHNB1UhMHAgNTb9kegUEzSE=; b=b1hg76HOZowhzRv3Vb3mcskZacy6WJs3qXQpSgB5aE9LIEquAFMQR2L4O9MRaYlDSS dp7xDEkpUTOwMi/5xXs21rekucikrKp81+ttv04rMp0Ww0DYN2N9FPhr5AcGQkEcNdfS 9qlPc0frF20eSegFnCPzQpU3048Rk5uvANzxPE8dU0zuc8eMc431oru+wfMK8tqkVXvp 6NsB5wKJy85HNVFFWClCh+V7V1EeoJirqLdO+Lq8TMdz08JrqhkCgCdvl/WJ3AWyvSi/ +6XVi7mpXhjIKhmmnQro9bi0N44rTeZgwaC/wTpJ8X9FFFzD20vTujlbCGGUWGME0/KJ F7Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sr6Q8Miis0Zz95uadtdvLHNB1UhMHAgNTb9kegUEzSE=; b=UIuHBep28HnytpPjln9cblboUiTKg3cbX6hg7CZz4ecXEK01DLnba9R++Z6pdfIal4 2MPUeebmS4IF9yErcNr5X63Wmd4RSLUBriC6cAE2PuWNDsvWl+S7jEWUHrWo9638ixIe 073Pe1JTpaBpYgOg0Ibo/qvj8t2qrVNsGke090Kk9PDwAMHqS286cvZZBiHX5w0HNh0m OkR+i0Kor3cVvs+YyuHoLM7T+ipgi/G9EpZzk89ju2E1eTGt8a6i1ITZWUxLGCbYgwL8 n4BeHgUAf7ECHjhJDSgljPtva/t9R1rQfSPmPvgGh0vIjd9Qi3JdbrTGjzLPKOWBRC3/ xmkw== X-Gm-Message-State: AOAM531kJpNfEOoX9QGnSfsmyBF0eCO+OmSNRPbOTPQ+r5sctDA2m4gA wr5U+QiXyhAn2KcThrcbNb7kDtRsDCY= X-Google-Smtp-Source: ABdhPJxpNoYzHQb/jMTUlZjMTC4u81FsGhXV6I48dCwjpXTdHEu6k8Jz6+osgaBsY+Y/hABvKdc3bw== X-Received: by 2002:a05:6000:1786:b0:217:c304:9f6b with SMTP id e6-20020a056000178600b00217c3049f6bmr34049556wrg.323.1654943671730; Sat, 11 Jun 2022 03:34:31 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4ccc000000b00219c46089f6sm2143409wrt.64.2022.06.11.03.34.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 15/49] hw/block/fdc-sysbus: Always mark sysbus floppy controllers as not having DMA Date: Sat, 11 Jun 2022 12:32:38 +0200 Message-Id: <20220611103312.67773-16-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The sysbus floppy controllers (devices sysbus-fdc and sun-fdtwo) don't support DMA. The core floppy controller code expects this to be indicated by setting FDCtrl::dma_chann to -1. This used to be done in the device instance_init functions sysbus_fdc_initfn() and sun4m_fdc_initfn(), but in commit 1430759ec3e we refactored this code and accidentally lost the setting of dma_chann. For sysbus-fdc this has no ill effects because we were redundantly also setting dma_chann in fdctrl_init_sysbus(), but for sun-fdtwo this means that guests which try to enable DMA on the floppy controller will cause QEMU to crash because FDCtrl::dma is NULL. Set dma_chann to -1 in the common instance init, and remove the redundant code in fdctrl_init_sysbus() that is also setting it. There is a six-year-old FIXME comment in the jazz board code to the effect that in theory it should support doing DMA via a custom DMA controller. If anybody ever chooses to fix that they can do it by adding support for setting both FDCtrl::dma_chann and FDCtrl::dma. (A QOM link property 'dma-controller' on the sysbus device which can be set to an instance of IsaDmaClass is probably the way to go.) Fixes: 1430759ec3 ("hw/block/fdc: Extract SysBus floppy controllers to fdc-sysbus.c") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/958 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20220505101842.2757905-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/block/fdc-sysbus.c | 16 +++++++++++----- hw/mips/jazz.c | 2 +- include/hw/block/fdc.h | 3 +-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/block/fdc-sysbus.c b/hw/block/fdc-sysbus.c index 57fc8773f1..86ea51d003 100644 --- a/hw/block/fdc-sysbus.c +++ b/hw/block/fdc-sysbus.c @@ -94,18 +94,14 @@ static void fdctrl_handle_tc(void *opaque, int irq, int level) trace_fdctrl_tc_pulse(level); } -void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, - hwaddr mmio_base, DriveInfo **fds) +void fdctrl_init_sysbus(qemu_irq irq, hwaddr mmio_base, DriveInfo **fds) { - FDCtrl *fdctrl; DeviceState *dev; SysBusDevice *sbd; FDCtrlSysBus *sys; dev = qdev_new("sysbus-fdc"); sys = SYSBUS_FDC(dev); - fdctrl = &sys->state; - fdctrl->dma_chann = dma_chann; /* FIXME */ sbd = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(sbd, &error_fatal); sysbus_connect_irq(sbd, 0, irq); @@ -138,6 +134,16 @@ static void sysbus_fdc_common_instance_init(Object *obj) FDCtrlSysBus *sys = SYSBUS_FDC(obj); FDCtrl *fdctrl = &sys->state; + /* + * DMA is not currently supported for sysbus floppy controllers. + * If we wanted to add support then probably the best approach is + * to have a QOM link property 'dma-controller' which the board + * code can set to an instance of IsaDmaClass, and an integer + * property 'dma-channel', so that we can set fdctrl->dma and + * fdctrl->dma_chann accordingly. + */ + fdctrl->dma_chann = -1; + qdev_set_legacy_instance_id(dev, 0 /* io */, 2); /* FIXME */ memory_region_init_io(&fdctrl->iomem, obj, diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 6598d7dddd..96dc6ab32d 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -353,7 +353,7 @@ static void mips_jazz_init(MachineState *machine, fds[n] = drive_get(IF_FLOPPY, 0, n); } /* FIXME: we should enable DMA with a custom IsaDma device */ - fdctrl_init_sysbus(qdev_get_gpio_in(rc4030, 1), -1, 0x80003000, fds); + fdctrl_init_sysbus(qdev_get_gpio_in(rc4030, 1), 0x80003000, fds); /* Real time clock */ mc146818_rtc_init(isa_bus, 1980, NULL); diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index 1ecca7cac7..35248c0837 100644 --- a/include/hw/block/fdc.h +++ b/include/hw/block/fdc.h @@ -10,8 +10,7 @@ #define TYPE_ISA_FDC "isa-fdc" void isa_fdc_init_drives(ISADevice *fdc, DriveInfo **fds); -void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, - hwaddr mmio_base, DriveInfo **fds); +void fdctrl_init_sysbus(qemu_irq irq, hwaddr mmio_base, DriveInfo **fds); void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base, DriveInfo **fds, qemu_irq *fdc_tc); From patchwork Sat Jun 11 10:32:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D529CC433EF for ; Sat, 11 Jun 2022 10:44:34 +0000 (UTC) Received: from localhost ([::1]:58946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyba-0002DD-04 for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:44:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyS0-0003ut-2c for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:40 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:33398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyRy-0006HE-I0 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:39 -0400 Received: by mail-wr1-x42d.google.com with SMTP id h5so1537434wrb.0 for ; Sat, 11 Jun 2022 03:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hINH/dDezmBfjoGGH2J6xkOiuvulvOYeQ1iTcTCy22c=; b=qGmU4gme/5kcF5CEOVGg3HS/iB09qyzrKnrJY7QZR9y6QiolLFhk6zHguEAOKXPjqr Bz3/OkpHKAOpIT+K8/iclvZKuQYvCXpWYshqw4N/gGiEkGb59slpkb1MHXRopt/wwx4R 0RSnFTGq+pe1g3UTKi9Dz0ke/0rjXallrWPILr+a4zo6AKmiTEII5tohfcpI5uy38WCb NmfMTTEJAXG838c6ZL9hJztwTezvn8gYX9EjACLot3miS8qqMJ7iSZC/MFzwTf3j0LnN wZbP7jeUskCAYhTFOaaLhSzKjsZmzRHQB5PhvnwmO0mFgPTz/cKFe1F7CW4mNJt/jYnk Ca7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hINH/dDezmBfjoGGH2J6xkOiuvulvOYeQ1iTcTCy22c=; b=2WyXBFNLzEuEu+P6FfTx8essqRjvpl9i/FVP5zoZRkhJiXz17yVThlCUjA6NmEJJjF aH9lYhA2Ln8huBHVRTNVrhDU+FEic0Ti8WEHSsVuJkWpGebcXk5XjiBu8o/owRPgketE Y1ICzDwnd43wyp1+ka7qR6NX4fXl21uJwXKB/MgMgyv45LzikKEWuehBIE0EYUR76Jpg WEJAXi2JBHfFtbkSGjIjjAQAUoVCZxiqCwY3Q6vYtugAgIzgAYSoeKhPCQWZXdjLwFv2 ui13xqdfNoQqpLJwCKSEmVGEBrHEy2De3eD24BdUNKX9rTc8+GAoorDBSBYyXlmyTZfQ 2N5g== X-Gm-Message-State: AOAM533NgZWBwkBaRLf+XB3LZUupiPwz2Mlqf80H3DyWoCBAoxKpSLuU Q0ZoRy9oFHP/cXEAbeJs2s3KJAvoq6c= X-Google-Smtp-Source: ABdhPJz+ZMJnx1jaU5sjRYt60BakkyQCGTxpMT9T6kvsISqJl66Y79xaBLfULXeuwhMOYy1UHb5p7Q== X-Received: by 2002:a5d:6d08:0:b0:217:1292:ddb8 with SMTP id e8-20020a5d6d08000000b002171292ddb8mr34520427wrq.693.1654943676977; Sat, 11 Jun 2022 03:34:36 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id d9-20020adffd89000000b002102d4ed579sm2142260wrr.39.2022.06.11.03.34.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Ani Sinha , Bernhard Beschow Subject: [PULL 16/49] hw/acpi/piix4: move xen_enabled() logic from piix4_pm_init() to piix4_pm_realize() Date: Sat, 11 Jun 2022 12:32:39 +0200 Message-Id: <20220611103312.67773-17-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This logic can be included as part of piix4_pm_realize() and does not need to be handled externally. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ani Sinha Message-Id: <20220528091934.15520-2-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index fe5625d07a..bf20fa139b 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -525,6 +525,10 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp) s->machine_ready.notify = piix4_pm_machine_ready; qemu_add_machine_init_done_notifier(&s->machine_ready); + if (xen_enabled()) { + s->use_acpi_hotplug_bridge = false; + } + piix4_acpi_system_hot_add_init(pci_address_space_io(dev), pci_get_bus(dev), s); qbus_set_hotplug_handler(BUS(pci_get_bus(dev)), OBJECT(s)); @@ -551,9 +555,6 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->smm_enabled = smm_enabled; - if (xen_enabled()) { - s->use_acpi_hotplug_bridge = false; - } pci_realize_and_unref(pci_dev, bus, &error_fatal); From patchwork Sat Jun 11 10:32:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99054C433EF for ; Sat, 11 Jun 2022 10:52:56 +0000 (UTC) Received: from localhost ([::1]:44842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyjf-0003ir-ER for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:52:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyS5-00047j-D6 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:45 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:42839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyS3-0006HY-QP for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:45 -0400 Received: by mail-wr1-x435.google.com with SMTP id s1so1463996wra.9 for ; Sat, 11 Jun 2022 03:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lDRaKNNA8Q7YJavQnTT5p+gRVU17PGzMwXMx9brphZ0=; b=JTHv5TCubVcG/ViYB6wVAybazBk86BXZiPn4zUZdfdIeoo0ZtUDQY3pTOtd81NN8K7 32WgYt/TkPUudIjR1s8uchG8W5SMV7+o0qkSa2Ao9P2r+FY7IEFZ8xi2504sKUFdP/Lz f/bq5mXMX6oKDhAYm0NxYK6A92CNc+gHqSfOjDw11oQpNHIUxHNWOPB1UH0kl6OH0dHl rhpRqMIWGMwZmaY/Ivrzify92HlYI4eIawSvek52ICubOSCzdGTD7QK8WwUHT/NAnzha vfa1VbUcd3IFOMUHrRrva3hf0gtUu9VAKpq1HVCFJEs8MGzFX42nM88co9joXt8hlmwp dWBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lDRaKNNA8Q7YJavQnTT5p+gRVU17PGzMwXMx9brphZ0=; b=UqaGINVvjfMw0OAvHIcbO8lHFqtip8sseCuTJBFoPoCeH5/AOKJGHis+iSh9eFTyrG Y+v9zlWrwLL0bYeWC9dlX2pDpewHi9YzqexdPbUr75Bz/pSLG5bpgxs8s6RssGgedMcW dhl2yOPczAQ8s8VXs1suXyTwmQnGo4erjmpDxfdC7bxEkHKepvvxkpLSdNsHkLbbmZjP pOSFLSNw8BU4VQrTgi2n5QWwft//ZAE5G+gcChNPOKrvGTkua7TldzDK/g/xbZDeJImD VAPoe9HtUQpUmqe/mO3J4u9CV3PcbAYDftag6RiozH9MXULa7Vf8/i9J2uuYCqa24Ta2 YcSw== X-Gm-Message-State: AOAM533aPeaPFHdGgb/l5azq2X7S/3yxqJQbP165q9kYxgdeycSxQt/l 2Y5DX9m5YBIPcca1GuTByRYUG0FfYVg= X-Google-Smtp-Source: ABdhPJyO7HAKkLKpaLgTRBtws/s2ya2VcM+SUTiuG8cibwdqVN7jTilGv9AnbypqTk3iS3zMes8gew== X-Received: by 2002:a5d:484d:0:b0:215:e7bf:3e71 with SMTP id n13-20020a5d484d000000b00215e7bf3e71mr39936645wrs.435.1654943682178; Sat, 11 Jun 2022 03:34:42 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id c6-20020a05600c0a4600b0039c5328ad92sm5802881wmq.41.2022.06.11.03.34.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Ani Sinha , Bernhard Beschow Subject: [PULL 17/49] hw/acpi/piix4: change smm_enabled from int to bool Date: Sat, 11 Jun 2022 12:32:40 +0200 Message-Id: <20220611103312.67773-18-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This is in preparation for conversion to a qdev property. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ani Sinha Message-Id: <20220528091934.15520-3-mark.cave-ayland@ilande.co.uk> [PMD: Change simm_enabled from int to bool, suggested by Ani Sinha] Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 4 ++-- include/hw/southbridge/piix.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index bf20fa139b..558c250884 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -74,7 +74,7 @@ struct PIIX4PMState { qemu_irq irq; qemu_irq smi_irq; - int smm_enabled; + bool smm_enabled; bool smm_compat; Notifier machine_ready; Notifier powerdown_notifier; @@ -538,7 +538,7 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp) I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, qemu_irq sci_irq, qemu_irq smi_irq, - int smm_enabled, DeviceState **piix4_pm) + bool smm_enabled, DeviceState **piix4_pm) { PCIDevice *pci_dev; DeviceState *dev; diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index f63f83e5c6..ff8d96ae8c 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -19,7 +19,7 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, qemu_irq sci_irq, qemu_irq smi_irq, - int smm_enabled, DeviceState **piix4_pm); + bool smm_enabled, DeviceState **piix4_pm); /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 From patchwork Sat Jun 11 10:32:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41A8DC433EF for ; Sat, 11 Jun 2022 10:58:02 +0000 (UTC) Received: from localhost ([::1]:55974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyoa-0003Ah-Ts for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:58:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyS9-0004O0-LL for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:49 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyS8-0006DG-8Q for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:49 -0400 Received: by mail-wr1-x42b.google.com with SMTP id k19so1472802wrd.8 for ; Sat, 11 Jun 2022 03:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6np3BLedlg1OK/sXq/p5/V+h9dM3mgNS6yYy04B8H3I=; b=XxqWmOBtRoguSTwVKRqWz4XiJTU0USMSJh0ijDoYgjzNDh3M89PlxdUJrRFYMY/Dp+ 7/PEIZbTkk8jpoLqYxA3Cfh9EGROnNteKljErrlWLEff1Pco2MNQN/7NYzYcnTyyJvU8 mKFjXL1rSFN/2trbU6n1hpyg+qnOK+fw6eLM5t+6NPNEDXlwRubj/0oIoCT6sVhPvA5O bcBaqFi/PO8dEI2V3gGhRLwmPU96mixXtb/+IyZSt01r4iCCopfzHwji4oKXDV6UvxJ7 kSA44vY6K2TbNsEJiA5YlgodT5pOZbgmI0NeDNbmzvk2EvQXkYlM8qeQSXQUuC9lAr6x 4m0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6np3BLedlg1OK/sXq/p5/V+h9dM3mgNS6yYy04B8H3I=; b=SZM3Mbl8PFMCjHXYkHB8Jt0Sb/8IdeIuK1TvaPBpmyE1m7szKtPnscHZYMdhGahSK+ AtQJSogTzHAcDzkHUxwFx4DwdUCtZwxP5Bf5DzDVdd/74L65ayL6XABkF5TWAZdHyUbl 63v4WmHTBMPuUZ9Kj4X6G5CTRHX86Im28mYXrkmsIlDMJHbuH4DdavDMGx8dTi6mteQv 98qvGxxsRxY1FSAB1JdsBTII5QFT+YD4ex+XhrAs61fXphaLnTu5+TyUGe9BYUUCwx+a ejjuTw4Hyb3+AKUr10x7ReBmSmk/475/TWfBGAqgaeQZCMHyKELkORJlnvseXuxz5TO3 B1Cw== X-Gm-Message-State: AOAM531r29BzP60TJVjr1CeiPQYnauIBaynMYnZ5pNK63DZRc+42n7T3 v4vaYkguOMWyxjUl14InhkojUftCaiA= X-Google-Smtp-Source: ABdhPJytxBYdE91kmtuXonm6hMiWkdPj63/saY218C6F1CtQd6/2hW/c7pI3/ArDiIyIkpLbBskKzQ== X-Received: by 2002:adf:d1ee:0:b0:218:3e38:78dd with SMTP id g14-20020adfd1ee000000b002183e3878ddmr32127186wrd.85.1654943687343; Sat, 11 Jun 2022 03:34:47 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id u9-20020a7bc049000000b00397243d3dbcsm1961082wmc.31.2022.06.11.03.34.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Ani Sinha , Bernhard Beschow Subject: [PULL 18/49] hw/acpi/piix4: convert smm_enabled bool to qdev property Date: Sat, 11 Jun 2022 12:32:41 +0200 Message-Id: <20220611103312.67773-19-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This allows the smm_enabled value to be set using a standard qdev property instead of being referenced directly in piix4_pm_init(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ani Sinha Message-Id: <20220528091934.15520-4-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 558c250884..316e41e1d0 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -547,6 +547,7 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, pci_dev = pci_new(devfn, TYPE_PIIX4_PM); dev = DEVICE(pci_dev); qdev_prop_set_uint32(dev, "smb_io_base", smb_io_base); + qdev_prop_set_bit(dev, "smm-enabled", smm_enabled); if (piix4_pm) { *piix4_pm = dev; } @@ -554,7 +555,6 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s = PIIX4_PM(dev); s->irq = sci_irq; s->smi_irq = smi_irq; - s->smm_enabled = smm_enabled; pci_realize_and_unref(pci_dev, bus, &error_fatal); @@ -664,6 +664,7 @@ static Property piix4_pm_properties[] = { DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState, acpi_memory_hotplug.is_enabled, true), DEFINE_PROP_BOOL("smm-compat", PIIX4PMState, smm_compat, false), + DEFINE_PROP_BOOL("smm-enabled", PIIX4PMState, smm_enabled, false), DEFINE_PROP_BOOL("x-not-migrate-acpi-index", PIIX4PMState, not_migrate_acpi_index, false), DEFINE_PROP_END_OF_LIST(), From patchwork Sat Jun 11 10:32:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A91EBC43334 for ; Sat, 11 Jun 2022 10:56:25 +0000 (UTC) Received: from localhost ([::1]:52856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyn2-0000tg-KC for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:56:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySG-0004an-05 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:56 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySE-0006Fu-4V for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:34:55 -0400 Received: by mail-wr1-x432.google.com with SMTP id v14so1487127wra.5 for ; Sat, 11 Jun 2022 03:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aka9zrKZ1Pu7z4eA5LJk1ldhlMt84LQmDaw8xmwJCYg=; b=dNc59ttl7MoYA3C+jATq7muSM7Olefyz1C2hec9dxqmhQegDrbjxilMstEwsmTzp83 EV3UaaUDJIKGXeNrJjjvFjHHFHLG+T7PQkYS1UtJHckRyJS/mJzJmW67FvtSownq4LYV 8JW8Nc7JwUXMO0LacDfTlbVk7bqZrvWDdox6jJgD6/KvGNrs/sGKMaxwFHeLFibTQXZZ 0INw0Sm5CMzZy1fkIy4P2g51IcAkM/MJq8a/Tc/o19AEh4TJ03/ZU0uGpeJ7kFsd3PNq AKjXw4n4NfeCQbT0GqroXBLu6my7sWW0gNVTzmTdGH0Hx+/RqNY9clljsSTp15bNB4Xw Re2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aka9zrKZ1Pu7z4eA5LJk1ldhlMt84LQmDaw8xmwJCYg=; b=16TfdH/veujWazXqrOe0UkTeE1mzzwtOg4XoYk0PaZ9vEHQ/ofcI+G6FTxLzEyzu+7 a969pe7ZX5XyIRTAmope46zmE/Vb1ebOzLr50WdWlI4pzdDQT4Amfg6ghao6XBGf+XtH NslRtOuuhj1a2vwthhWLijns4gMQUoRhpihsnIUGAfaT9vK517QqxLHAnWt71uzxczGO 8A76igluWWhSI0Lte9sWZbyajKUF0Bjie6XyO470EVYky94EObSUgmnJWVJjGYxg7Q6k eXv7dbgC8SbTa3E1h119zn/vIwjU05Vwx1UfBuIU5+hHURGAAsAVD9tEBr56C2mtPYM6 aj5w== X-Gm-Message-State: AOAM532GsBrNx1fwYSaN355Vpza3gk4RhAw3GivmHB9QZnT44Ar8w5Jj HvCwLx86fVPlIhA/zacUP5lwWY9PTqQ= X-Google-Smtp-Source: ABdhPJy+OmY2f/Wn4G8iE2pmOebJwjwd5kMbzyGeyWvvxmXetuNvfy7gXk5APso28Lty/4RUlISv/w== X-Received: by 2002:a5d:5492:0:b0:210:2f29:b1cf with SMTP id h18-20020a5d5492000000b002102f29b1cfmr48650563wrv.468.1654943692618; Sat, 11 Jun 2022 03:34:52 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id t11-20020adff60b000000b002130f1dfe0bsm2131489wrp.74.2022.06.11.03.34.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 19/49] hw/acpi/piix4: move PIIX4PMState into separate piix4.h header Date: Sat, 11 Jun 2022 12:32:42 +0200 Message-Id: <20220611103312.67773-20-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This allows the QOM types in hw/acpi/piix4.c to be used elsewhere by simply including hw/acpi/piix4.h. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-5-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 43 +------------------- hw/i386/acpi-build.c | 1 + include/hw/acpi/piix4.h | 75 +++++++++++++++++++++++++++++++++++ include/hw/southbridge/piix.h | 2 - 4 files changed, 78 insertions(+), 43 deletions(-) create mode 100644 include/hw/acpi/piix4.h diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 316e41e1d0..c2177c5093 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -28,6 +28,8 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/pcihp.h" +#include "hw/acpi/piix4.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" #include "sysemu/xen.h" @@ -56,47 +58,6 @@ struct pci_status { uint32_t down; }; -struct PIIX4PMState { - /*< private >*/ - PCIDevice parent_obj; - /*< public >*/ - - MemoryRegion io; - uint32_t io_base; - - MemoryRegion io_gpe; - ACPIREGS ar; - - APMState apm; - - PMSMBus smb; - uint32_t smb_io_base; - - qemu_irq irq; - qemu_irq smi_irq; - bool smm_enabled; - bool smm_compat; - Notifier machine_ready; - Notifier powerdown_notifier; - - AcpiPciHpState acpi_pci_hotplug; - bool use_acpi_hotplug_bridge; - bool use_acpi_root_pci_hotplug; - bool not_migrate_acpi_index; - - uint8_t disable_s3; - uint8_t disable_s4; - uint8_t s4_val; - - bool cpu_hotplug_legacy; - AcpiCpuHotplug gpe_cpu; - CPUHotplugState cpuhp_state; - - MemHotplugState acpi_memory_hotplug; -}; - -OBJECT_DECLARE_SIMPLE_TYPE(PIIX4PMState, PIIX4_PM) - static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, PCIBus *bus, PIIX4PMState *s); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 73d0bf5937..cad6f5ac41 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -44,6 +44,7 @@ #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h" #include "hw/acpi/erst.h" +#include "hw/acpi/piix4.h" #include "sysemu/tpm_backend.h" #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h new file mode 100644 index 0000000000..32686a75c5 --- /dev/null +++ b/include/hw/acpi/piix4.h @@ -0,0 +1,75 @@ +/* + * ACPI implementation + * + * Copyright (c) 2006 Fabrice Bellard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + * + * Contributions after 2012-01-13 are licensed under the terms of the + * GNU GPL, version 2 or (at your option) any later version. + */ + +#ifndef HW_ACPI_PIIX4_H +#define HW_ACPI_PIIX4_H + +#include "hw/pci/pci.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/cpu_hotplug.h" +#include "hw/acpi/memory_hotplug.h" +#include "hw/acpi/pcihp.h" +#include "hw/i2c/pm_smbus.h" +#include "hw/isa/apm.h" + +#define TYPE_PIIX4_PM "PIIX4_PM" +OBJECT_DECLARE_SIMPLE_TYPE(PIIX4PMState, PIIX4_PM) + +struct PIIX4PMState { + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + + MemoryRegion io; + uint32_t io_base; + + MemoryRegion io_gpe; + ACPIREGS ar; + + APMState apm; + + PMSMBus smb; + uint32_t smb_io_base; + + qemu_irq irq; + qemu_irq smi_irq; + bool smm_enabled; + bool smm_compat; + Notifier machine_ready; + Notifier powerdown_notifier; + + AcpiPciHpState acpi_pci_hotplug; + bool use_acpi_hotplug_bridge; + bool use_acpi_root_pci_hotplug; + bool not_migrate_acpi_index; + + uint8_t disable_s3; + uint8_t disable_s4; + uint8_t s4_val; + + bool cpu_hotplug_legacy; + AcpiCpuHotplug gpe_cpu; + CPUHotplugState cpuhp_state; + + MemHotplugState acpi_memory_hotplug; +}; + +#endif diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index ff8d96ae8c..04cbc3fe30 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -15,8 +15,6 @@ #include "hw/pci/pci.h" #include "qom/object.h" -#define TYPE_PIIX4_PM "PIIX4_PM" - I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, qemu_irq sci_irq, qemu_irq smi_irq, bool smm_enabled, DeviceState **piix4_pm); From patchwork Sat Jun 11 10:32:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55348CCA47D for ; Sat, 11 Jun 2022 10:56:54 +0000 (UTC) Received: from localhost ([::1]:53620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzynV-0001Q7-Ew for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:56:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySL-0004iY-9Y for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:01 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:40743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySJ-0006Jg-Lu for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:01 -0400 Received: by mail-wr1-x42f.google.com with SMTP id k16so1482865wrg.7 for ; Sat, 11 Jun 2022 03:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q1t9tYgatWt24bQaSrmnXZ4KfcWsmexzRBCbydLr6+Y=; b=NBScj0Q1eam0szZ/snIhmuEs/IbXpDIlDqBtX+eLtR8dcKa6Fr2S0+PMnwrjhFZMJX JxTRDB0raKfFReCYylLX9vEvIYv/G73s5JvPNOdrhMuqQTMWLM3kTNeRZLFi2J9wtwz0 hzNe9BcL4YvycKmOCbn3Ahq60dwTBSNaYinmZGYU6IrYYfORr3uGFYfU4IUkpod5H63I C4SimYMM+m0gIW+81R0sq1MIja/tA+7JY3lFRY78OnGlX3z+PASs85XpAaqK6AVn3zwV 1e7rXhCzLYXpLYrY0/sUUYRn0+eA84iorSDXBfiNoy+ieTNgC1tgJ1N15vactqLy3XXh cSzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q1t9tYgatWt24bQaSrmnXZ4KfcWsmexzRBCbydLr6+Y=; b=N3y4y3tvcY3x7SJGQHLj8IOT6XtExb0DVfZ3KG7ce60SjNEdwFZ2n2N+PFY+y/56+o MIbkTMZnVS90TUxpW+PenjPlTl89d8/Y5/bop4CJoZjq1M3ZpwKQcT8Kn6VawK2393Ic 6IllFH7ZqkzZpedniQ6ebJoZh4HrGLxfdB1zn51GVtJw3mCMjDDjjXDDCRLG9amg7PO6 ta6uTM6wZre/sj1NWQT2e3Z/2Mtw8dsFwfCNhBbXMZ4kkkrqp1WHte9dVhqZdJ4c41ht x51KyKiCPDS4+XOTS+GFdditWOYjCfzagfzQHsdPOtq+70BJT+8OqMuiiGmi1dsRHHuL NzCQ== X-Gm-Message-State: AOAM531mpgeHWXRBR0v0gwhKQFAfi1W7l73pQ+XQWFTFtPCV+97eSMLO zmsc7RjtDc9ri4fQJYFAdhP96xQf2P4= X-Google-Smtp-Source: ABdhPJyvjhsd9Nz02KwEkB5jMMPVfPE1bOudh8QOaxbuhaOrZFnCypnFTEyGfu8MwKpUu5ub8UqSKw== X-Received: by 2002:adf:e30f:0:b0:210:346e:d5da with SMTP id b15-20020adfe30f000000b00210346ed5damr47067400wrj.313.1654943697669; Sat, 11 Jun 2022 03:34:57 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m12-20020a5d6a0c000000b0020cdcb0efa2sm2159084wru.34.2022.06.11.03.34.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:34:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 20/49] hw/acpi/piix4: alter piix4_pm_init() to return PIIX4PMState Date: Sat, 11 Jun 2022 12:32:43 +0200 Message-Id: <20220611103312.67773-21-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This exposes the PIIX4_PM device to the caller to allow any qdev gpios to be mapped outside of piix4_pm_init(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-6-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 11 ++++------- hw/i386/pc_piix.c | 10 +++++----- hw/isa/piix4.c | 8 +++++--- include/hw/southbridge/piix.h | 7 ++++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index c2177c5093..c4cfb75020 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -497,9 +497,9 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp) piix4_pm_add_properties(s); } -I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - bool smm_enabled, DeviceState **piix4_pm) +PIIX4PMState *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, + qemu_irq sci_irq, qemu_irq smi_irq, + bool smm_enabled) { PCIDevice *pci_dev; DeviceState *dev; @@ -509,9 +509,6 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, dev = DEVICE(pci_dev); qdev_prop_set_uint32(dev, "smb_io_base", smb_io_base); qdev_prop_set_bit(dev, "smm-enabled", smm_enabled); - if (piix4_pm) { - *piix4_pm = dev; - } s = PIIX4_PM(dev); s->irq = sci_irq; @@ -519,7 +516,7 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, pci_realize_and_unref(pci_dev, bus, &error_fatal); - return s->smb.smbus; + return s; } static uint64_t gpe_readb(void *opaque, hwaddr addr, unsigned width) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index bd63511c1c..3359b40f54 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -280,14 +280,14 @@ static void pc_init1(MachineState *machine, } if (pcmc->pci_enabled && x86_machine_is_acpi_enabled(X86_MACHINE(pcms))) { - DeviceState *piix4_pm; + PIIX4PMState *piix4_pm; smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); + piix4_pm = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, + x86ms->gsi[9], smi_irq, + x86_machine_is_smm_enabled(x86ms)); + pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c")); /* TODO: Populate SPD eeprom data. */ - pcms->smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, - x86ms->gsi[9], smi_irq, - x86_machine_is_smm_enabled(x86ms), - &piix4_pm); smbus_eeprom_init(pcms->smbus, 8, NULL, 0); object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 8607e0ac36..7d9bedd1bb 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -293,6 +293,7 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) { PIIX4State *s; + PIIX4PMState *pms; PCIDevice *pci; DeviceState *dev; int devfn = PCI_DEVFN(10, 0); @@ -310,9 +311,10 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { - *smbus = piix4_pm_init(pci_bus, devfn + 3, 0x1100, - qdev_get_gpio_in_named(dev, "isa", 9), - NULL, 0, NULL); + pms = piix4_pm_init(pci_bus, devfn + 3, 0x1100, + qdev_get_gpio_in_named(dev, "isa", 9), + NULL, 0); + *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c")); } pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PIRQS); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 04cbc3fe30..a362ec7484 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -14,10 +14,11 @@ #include "hw/pci/pci.h" #include "qom/object.h" +#include "hw/acpi/piix4.h" -I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - bool smm_enabled, DeviceState **piix4_pm); +PIIX4PMState *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, + qemu_irq sci_irq, qemu_irq smi_irq, + bool smm_enabled); /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 From patchwork Sat Jun 11 10:32:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9704CC43334 for ; Sat, 11 Jun 2022 11:13:16 +0000 (UTC) Received: from localhost ([::1]:32986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzz3C-0006z2-Vo for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:13:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySQ-0004nk-2m for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:06 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:36591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySO-0006Re-EV for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:05 -0400 Received: by mail-wr1-x433.google.com with SMTP id o8so1497575wro.3 for ; Sat, 11 Jun 2022 03:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QtthewnhJjnvXmzUB1KbViQi6psKm9rJ21+vAD8TbEc=; b=TnzrWe2krVmv+X5UzXs5qgOtbCoFhVdgxXHbwoeteCFIGPoAuirZkEQ7tLJGcluMqr QvGCduqUqzBCZ6trausNQRHCqBOtXe5QVTyScEQQ6RSPk3IXiwR66cUca5DLW+e270hl g0mF1riqyG6eNNrjEXUGosQacqBvsuMfI3Fr2BOpTw82wYatmaU/mC/DoJTnJxUiI83g 9RQ//P9x/FDpvxbEcFTpJOgXKKYi9O3q+xiV0gvl3bXFeA2orT81sy4bUHL3DY5+MQNs 9OPsDRCzONoO41pmE96J5JCvEv/NbNdzM5IEfeiErLRlAZQC95VZ6oydaBRiqQEcWqng dQWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QtthewnhJjnvXmzUB1KbViQi6psKm9rJ21+vAD8TbEc=; b=6KNyDLfW220AEqdl3uEzECKgamOrTFhJa08VXD2SJHJnKZAjsWXqo23tN7JuTrqMRF IWWvMXAx6MxWhoitauACZDpqMkkl6+V9nL4VnvCfyNIX7FoE8/rl8a6gv+SxTYApcnUy qFjsV1VUYGqF//ffhaSKOoN6vaFsCWZe6vGz06xkPJBT3W8ALwp0hfbAG9qs00lB7rBn 2h6Dr/+ToqE1zJVO5vGMDKuGgyJEkxZ4o7Ycaa4xFG/ZmJe6twye4/DFOGlEHmsT51aT WkSEec9B96WpQlrGQuPioa5qDhAHd9hbrb+ggelQqywtrW5iyRPrrEswa/kLEtzjnZOW mAfQ== X-Gm-Message-State: AOAM532QCFACYOzPEwcrOLfue1V+MwrEc6SvAq9LNGpg4b+XuMsdLKCc O6Ro7nPiBHBk/MEtRZ9E9hSnJycnFf4= X-Google-Smtp-Source: ABdhPJxmBezNh2ieXx0WeR8/dbTlwu/Oj74HVzmA66tspPFWvipcpGoLJ87YjWVX79tyGO4hE20MJg== X-Received: by 2002:adf:ea87:0:b0:211:68d:7c93 with SMTP id s7-20020adfea87000000b00211068d7c93mr47285080wrm.412.1654943702864; Sat, 11 Jun 2022 03:35:02 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id i7-20020a1c3b07000000b0039744bd664esm6346760wma.13.2022.06.11.03.35.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 21/49] hw/acpi/piix4: rename piix4_pm_init() to piix4_pm_initfn() Date: Sat, 11 Jun 2022 12:32:44 +0200 Message-Id: <20220611103312.67773-22-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland When QOMifying a device it is typical to use _init() as the suffix for an instance_init function, however this name is already in use by the legacy piix4_pm_init() wrapper function. Eventually the wrapper function will be removed, but for now rename it to piix4_pm_initfn() to avoid a naming collision. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-7-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 6 +++--- hw/i386/pc_piix.c | 6 +++--- hw/isa/piix4.c | 6 +++--- include/hw/southbridge/piix.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index c4cfb75020..418ec4ee56 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -497,9 +497,9 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp) piix4_pm_add_properties(s); } -PIIX4PMState *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - bool smm_enabled) +PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, + qemu_irq sci_irq, qemu_irq smi_irq, + bool smm_enabled) { PCIDevice *pci_dev; DeviceState *dev; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 3359b40f54..fde0fdc088 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -283,9 +283,9 @@ static void pc_init1(MachineState *machine, PIIX4PMState *piix4_pm; smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); - piix4_pm = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, - x86ms->gsi[9], smi_irq, - x86_machine_is_smm_enabled(x86ms)); + piix4_pm = piix4_pm_initfn(pci_bus, piix3_devfn + 3, 0xb100, + x86ms->gsi[9], smi_irq, + x86_machine_is_smm_enabled(x86ms)); pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c")); /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(pcms->smbus, 8, NULL, 0); diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 7d9bedd1bb..33a7015ea3 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -311,9 +311,9 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { - pms = piix4_pm_init(pci_bus, devfn + 3, 0x1100, - qdev_get_gpio_in_named(dev, "isa", 9), - NULL, 0); + pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, + qdev_get_gpio_in_named(dev, "isa", 9), + NULL, 0); *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c")); } diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index a362ec7484..f75a4adf5f 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -16,9 +16,9 @@ #include "qom/object.h" #include "hw/acpi/piix4.h" -PIIX4PMState *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - bool smm_enabled); +PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, + qemu_irq sci_irq, qemu_irq smi_irq, + bool smm_enabled); /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 From patchwork Sat Jun 11 10:32:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7F73C433EF for ; Sat, 11 Jun 2022 11:17:06 +0000 (UTC) Received: from localhost ([::1]:36206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzz73-0002Cf-Ej for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:17:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySV-0004qv-BT for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:11 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:46902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyST-0006Uu-Ni for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:11 -0400 Received: by mail-wr1-x433.google.com with SMTP id u8so1448778wrm.13 for ; Sat, 11 Jun 2022 03:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ycvq963bj+0x7tuoq8vXuG7x1mD6FvAr2h3JjItEWiM=; b=kJOoRR3gG6FF2fcQfgU90hXUKVXgfHqiiLoBzTKJniJq5KkGG0jEoQ3/DtZwLAc+Dj JK+PGbuwdgRpoIf18B3yhlamRBRjg8X6PJQESUg5tDeMALLKQ4JDGhD1QgyeJezJQNmT ac2oj33QUefp+9gn8zrGaEMomzX3/nK5rhm+BroZy25xQ/gPnreth4NiTYVb5HiBmNlY cHLzBkXNnqGscwcKDyaTTgMYZAmS+Wesu38tn8fIccj1qsGP+nQSMcGPuNS4UGHUeBwt YeTMOtZI1WZ4uDppOBiuCdHl+C8Sq0b1Khk4yULIdUPzPV6GkT1YfsLnm6G5X7TsJgQ6 FstQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ycvq963bj+0x7tuoq8vXuG7x1mD6FvAr2h3JjItEWiM=; b=q291tpbS8FPRnyDZbl60Rv4N6Ah+s5YAwLdQC26ActIFK9kzyCKgHXWxWdyjVBT3o/ juzANIpgu+S6CMaUY/D7bwgCRIKVWONDbLdEr404L/4H/WfLnHHFvEcPzhXpRTbTF26Y dce7RtfHo1Q4YgItSFzaZkQGtee1ABWTRQ1rm1UGJmOt6CvBJUlDRj3VsF7mmo2EhIdn DT+EOAYaPlYMb3bSa1VGX+/fdU42qjA0WP1V9AFUwduigHWCnERINQ4AM7kn0YySF7nL DtbeQYkIIPiHc2TnwUJyd+Q9XjLJ16f393qan1jwxSCMMsvy5Fao1B1wkgpJpWACZw1d F0LQ== X-Gm-Message-State: AOAM5335qMrbi1oRNA8NL+KbtEXlyKL53jbq69bMZQJA6tpIzHLyOYE0 cqQlCqjzhWhwGmZC3un92MhgEc3TJlk= X-Google-Smtp-Source: ABdhPJymdh3U3gyzuNFI6EAJ5bKvQLV8BOzsVoNtZPA74X58Oen2c0K7sRtMvlJ1ibTxLs+0D9Wdww== X-Received: by 2002:a5d:59a4:0:b0:218:4a29:f12b with SMTP id p4-20020a5d59a4000000b002184a29f12bmr27370139wrr.145.1654943708265; Sat, 11 Jun 2022 03:35:08 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id 18-20020a05600c265200b003973d425a7fsm2247352wmy.41.2022.06.11.03.35.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 22/49] hw/acpi/piix4: use qdev gpio to wire up sci_irq Date: Sat, 11 Jun 2022 12:32:45 +0200 Message-Id: <20220611103312.67773-23-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Introduce piix4_pm_init() instance init function and use it to initialise the separate qdev gpio for the SCI IRQ. The sci_irq can now be wired up directly using a qdev gpio instead of having to set the IRQ externally in piix4_pm_initfn(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-9-mark.cave-ayland@ilande.co.uk> [PMD: Partially squash 20220528091934.15520-8-mark.cave-ayland@ilande.co.uk] Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 12 +++++++++--- hw/i386/pc_piix.c | 4 ++-- hw/isa/piix4.c | 6 +++--- include/hw/southbridge/piix.h | 3 +-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 418ec4ee56..fe5ec0a723 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -497,9 +497,15 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp) piix4_pm_add_properties(s); } +static void piix4_pm_init(Object *obj) +{ + PIIX4PMState *s = PIIX4_PM(obj); + + qdev_init_gpio_out(DEVICE(obj), &s->irq, 1); +} + PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - bool smm_enabled) + qemu_irq smi_irq, bool smm_enabled) { PCIDevice *pci_dev; DeviceState *dev; @@ -511,7 +517,6 @@ PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, qdev_prop_set_bit(dev, "smm-enabled", smm_enabled); s = PIIX4_PM(dev); - s->irq = sci_irq; s->smi_irq = smi_irq; pci_realize_and_unref(pci_dev, bus, &error_fatal); @@ -663,6 +668,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data) static const TypeInfo piix4_pm_info = { .name = TYPE_PIIX4_PM, .parent = TYPE_PCI_DEVICE, + .instance_init = piix4_pm_init, .instance_size = sizeof(PIIX4PMState), .class_init = piix4_pm_class_init, .interfaces = (InterfaceInfo[]) { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index fde0fdc088..27acba4146 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -283,9 +283,9 @@ static void pc_init1(MachineState *machine, PIIX4PMState *piix4_pm; smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); - piix4_pm = piix4_pm_initfn(pci_bus, piix3_devfn + 3, 0xb100, - x86ms->gsi[9], smi_irq, + piix4_pm = piix4_pm_initfn(pci_bus, piix3_devfn + 3, 0xb100, smi_irq, x86_machine_is_smm_enabled(x86ms)); + qdev_connect_gpio_out(DEVICE(piix4_pm), 0, x86ms->gsi[9]); pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c")); /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(pcms->smbus, 8, NULL, 0); diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 33a7015ea3..0b6ea22143 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -311,9 +311,9 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { - pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, - qdev_get_gpio_in_named(dev, "isa", 9), - NULL, 0); + pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, NULL, 0); + qdev_connect_gpio_out(DEVICE(pms), 0, + qdev_get_gpio_in_named(dev, "isa", 9)); *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c")); } diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index f75a4adf5f..105d158f78 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -17,8 +17,7 @@ #include "hw/acpi/piix4.h" PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - bool smm_enabled); + qemu_irq smi_irq, bool smm_enabled); /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 From patchwork Sat Jun 11 10:32:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06A90C433EF for ; Sat, 11 Jun 2022 10:51:42 +0000 (UTC) Received: from localhost ([::1]:41760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzyiU-0001av-2V for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:51:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySk-0004tx-3f for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:26 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySd-0006V7-F9 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:24 -0400 Received: by mail-wr1-x42b.google.com with SMTP id x17so1483414wrg.6 for ; Sat, 11 Jun 2022 03:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H9T0seqiej5ts9q+/AfTue9nmgfex5iUAMExD5ya6fo=; b=eibuUvIzvJ0EBEcyP4Jq38RRWsKtwiWktk2KQ6ET/dTACNVSyYQRTt0bIE1Y3jlVjS H3/7Ty3nes1d+mGx7Mimop5nkEgMopAARSSYrxUDi4Fn6uu7L/6881t0t5wYdZI+hIOp H4YG0FOlf95ah+MCto+wJl09f0Xzht6V0aFUI3si1gG2OKR33U88t5MImk+AkpkUfqWL Mj9yHxowUJYylCCJPYcYFo+ahPAQ/XcR2uBMtLOfyP3q9WUDrx4YDvFz5e2KicsD/MoA FNWyrpCXFuzJ1YSVI67GUvFhAh2HCicKnGJ5zD84N7K4VjHdS3DVyX5uC94rYmFIMUcp qvXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H9T0seqiej5ts9q+/AfTue9nmgfex5iUAMExD5ya6fo=; b=IhvMPGO7CTlHh4iKj67ZFLXFAbONyKepl6xr/IJYZkKUhI+oM5y9e900C5r8vyKVBQ 6mf9y7WBK7MJ24TsEeRwbrMuWobAv18WbaWre+7Re0vlI/dibwonaRi3Mg40WkYEujH0 i6UmIL+Ffz5VvbXZ+OJ8Y0owChdxdzyOLUL7m6Q4y0mShjm6z0Eq+EPVB4uRXx1X/X86 nR5o3SJb2lKlmQiuVhARibtR6vHgi6ZeACggexZ2LbJZ770yYP74udlevsktubc1mkIT qpImYYOenXTEwktP6uRJNCFjSMjr/JjjuvhWYgu5+QWV0F/G49drEAlZWQzisXltXBir 6oIg== X-Gm-Message-State: AOAM531UAN8N0YEyJIMVur3Ea5GTlzkD7KCH/8vV/a/P3itPfrzstul8 XVnj+hY/meoMtAJ3vIxZsbjyeruiA6s= X-Google-Smtp-Source: ABdhPJyg7D/pLvt9s46ZARaN36DpWzMbKJVxY64MUjYbZciM4KDlgGnXtPal5gyhhuiKzkqo4pnLng== X-Received: by 2002:adf:a55a:0:b0:219:e574:2ae9 with SMTP id j26-20020adfa55a000000b00219e5742ae9mr8364868wrb.158.1654943713385; Sat, 11 Jun 2022 03:35:13 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id g7-20020a5d4887000000b002184a3a3641sm2087030wrq.100.2022.06.11.03.35.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 23/49] hw/acpi/piix4: use qdev gpio to wire up smi_irq Date: Sat, 11 Jun 2022 12:32:46 +0200 Message-Id: <20220611103312.67773-24-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Initialize the SMI IRQ in piix4_pm_init(). The smi_irq can now be wired up directly using a qdev gpio instead of having to set the IRQ externally in piix4_pm_initfn(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-10-mark.cave-ayland@ilande.co.uk> [PMD: Partially squash 20220528091934.15520-8-mark.cave-ayland@ilande.co.uk] Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 4 ++-- hw/i386/pc_piix.c | 3 ++- hw/isa/piix4.c | 2 +- include/hw/southbridge/piix.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index fe5ec0a723..32033bc9d7 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -502,10 +502,11 @@ static void piix4_pm_init(Object *obj) PIIX4PMState *s = PIIX4_PM(obj); qdev_init_gpio_out(DEVICE(obj), &s->irq, 1); + qdev_init_gpio_out_named(DEVICE(obj), &s->smi_irq, "smi-irq", 1); } PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq smi_irq, bool smm_enabled) + bool smm_enabled) { PCIDevice *pci_dev; DeviceState *dev; @@ -517,7 +518,6 @@ PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, qdev_prop_set_bit(dev, "smm-enabled", smm_enabled); s = PIIX4_PM(dev); - s->smi_irq = smi_irq; pci_realize_and_unref(pci_dev, bus, &error_fatal); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 27acba4146..89c4f07c9f 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -283,9 +283,10 @@ static void pc_init1(MachineState *machine, PIIX4PMState *piix4_pm; smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); - piix4_pm = piix4_pm_initfn(pci_bus, piix3_devfn + 3, 0xb100, smi_irq, + piix4_pm = piix4_pm_initfn(pci_bus, piix3_devfn + 3, 0xb100, x86_machine_is_smm_enabled(x86ms)); qdev_connect_gpio_out(DEVICE(piix4_pm), 0, x86ms->gsi[9]); + qdev_connect_gpio_out_named(DEVICE(piix4_pm), "smi-irq", 0, smi_irq); pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c")); /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(pcms->smbus, 8, NULL, 0); diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 0b6ea22143..775e15eb20 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -311,7 +311,7 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { - pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, NULL, 0); + pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, 0); qdev_connect_gpio_out(DEVICE(pms), 0, qdev_get_gpio_in_named(dev, "isa", 9)); *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c")); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 105d158f78..b69e0dfb04 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -17,7 +17,7 @@ #include "hw/acpi/piix4.h" PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq smi_irq, bool smm_enabled); + bool smm_enabled); /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 From patchwork Sat Jun 11 10:32:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1B92C433EF for ; Sat, 11 Jun 2022 11:19:06 +0000 (UTC) Received: from localhost ([::1]:41710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzz8z-0005wU-Jt for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:19:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySk-0004tv-3l for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:26 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:44699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySg-0006WG-KC for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:24 -0400 Received: by mail-wm1-x331.google.com with SMTP id m32-20020a05600c3b2000b0039756bb41f2so763728wms.3 for ; Sat, 11 Jun 2022 03:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ubn8eHKOsbB27CggmjSzSBpH+DzKEWOoBQO+Gv9mZ/g=; b=Vjuj+MhiMeZ35ZdK9/F+yI8A7v02KLtCohopl53LttvYdtvLcJnNTQw0ubmhAgUviU 2P272dW1prlCYM8lFjshUalH3SKI0KjpoF/udyKtfPtGpjb+gwTPD6pUNvR5kICnpo88 OK8UOXUGdSQ0Kd/S+IPpS7j4wtScIG6QYw1x9p6Qz8E0UQ4JtmNQE+rmXfewnW36uwa6 4ofyR1k/PtFm66aYbThxYaUZxXS0BMsD64lTYMfoePwDN6YWstuExVCJvODaKcQI01xz rGWsdods2QJVXZyRCIAmywES81rMMVUKE2G+yFGdliJdTf3zgkBZ04gyD3Vka2KfZ7sk QlfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ubn8eHKOsbB27CggmjSzSBpH+DzKEWOoBQO+Gv9mZ/g=; b=qMGtqHsmD6ekUgC7jfSVfr3AP0GQByyJDGMBunUIOHsv3pxsuE95MuhHG0+iXfGbDe xr7eX6t/uMAaRANUAEqyFBZNhsYU514Jetx6q5GIj01705p906aPyJ1JB1S4vFew5/+9 JMPUI4nylgWU8ojCWg7C5uTtmDVh+Lm9v/FBFSHxnPxEqJCbYCVZalzhwGhkVDWMOFBd d05cingUHjJDLdDSFzkw+OTmW7K9P/x1dDBr+Zm5Q4zO4poNH7v4hMtw5+qe22kyqLCe uSlNlpPnzli2vKkFD0CDI+yxJfk5SGkVuxdWKylQCtksU0O2eUMn1zBL+tzsuur2nn9D H7HA== X-Gm-Message-State: AOAM532TWzJ387Blflp9JQI+8vLKWybWH4j9sgwPH1FGM8hx2u7IuU6x lgPEw8MdoKNxhkVoJUWoG4+/Qwhm8qE= X-Google-Smtp-Source: ABdhPJx4CuFyleKovbKl9l8eKUSlWU7Lp81r1vqFGIZac74mRQE+75IPNJNFG036vOSmDOS3xZsN2Q== X-Received: by 2002:a05:600c:6003:b0:39c:50ef:eff with SMTP id az3-20020a05600c600300b0039c50ef0effmr4156756wmb.122.1654943718509; Sat, 11 Jun 2022 03:35:18 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id u9-20020a7bc049000000b00397243d3dbcsm1962668wmc.31.2022.06.11.03.35.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 24/49] hw/i386/pc_piix: create PIIX4_PM device directly instead of using piix4_pm_initfn() Date: Sat, 11 Jun 2022 12:32:47 +0200 Message-Id: <20220611103312.67773-25-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Now that all external logic has been removed from piix4_pm_initfn() the PIIX4_PM device can be instantiated directly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-11-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 89c4f07c9f..7d5546600b 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -47,6 +47,7 @@ #include "hw/xen/xen-x86.h" #include "exec/memory.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/piix4.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "sysemu/xen.h" @@ -280,11 +281,15 @@ static void pc_init1(MachineState *machine, } if (pcmc->pci_enabled && x86_machine_is_acpi_enabled(X86_MACHINE(pcms))) { - PIIX4PMState *piix4_pm; + PCIDevice *piix4_pm; smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); - piix4_pm = piix4_pm_initfn(pci_bus, piix3_devfn + 3, 0xb100, - x86_machine_is_smm_enabled(x86ms)); + piix4_pm = pci_new(piix3_devfn + 3, TYPE_PIIX4_PM); + qdev_prop_set_uint32(DEVICE(piix4_pm), "smb_io_base", 0xb100); + qdev_prop_set_bit(DEVICE(piix4_pm), "smm-enabled", + x86_machine_is_smm_enabled(x86ms)); + pci_realize_and_unref(piix4_pm, pci_bus, &error_fatal); + qdev_connect_gpio_out(DEVICE(piix4_pm), 0, x86ms->gsi[9]); qdev_connect_gpio_out_named(DEVICE(piix4_pm), "smi-irq", 0, smi_irq); pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c")); From patchwork Sat Jun 11 10:32:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3108C433EF for ; Sat, 11 Jun 2022 11:20:15 +0000 (UTC) Received: from localhost ([::1]:44742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzA6-0007z2-QJ for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:20:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySl-0004xt-As for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:27 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:37866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySj-0006Zr-P8 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:27 -0400 Received: by mail-wr1-x433.google.com with SMTP id o16so1492663wra.4 for ; Sat, 11 Jun 2022 03:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cYa9Wyy8+NW3p95A4BL25JrfyHdT0y0O/3yT5378jVU=; b=PZesKQPTM94tgnQfCcUt5RXPxlrtOJ5HRMzZQSBURJffLtkPYOJ4af7RobIPMMuMHp 91oeBZpUB3f0HUym/MxrxMB5YxCYVMQ6c+iIbIHlPRzlap53DTluOMxc9A7Pts5M3YIy 7CC+cDtIge7sYJVM1pmY1zczYPonI24clpW1oQD5ZCGeTB2+3Ko/Fx3KVzejdg0lXjLW g2zoMWyDmyH5jukgSR7oe/G/dQL/gbs5qxODnYp4sjDwnNBFCZid10U8/vSMrnfp2IYM ux8A6EqX7w52rtb3ax+Jm7WsJPgEmbanC1FiT0AraqpFBA4VQr+qlxtHRm2bcEYyL9Ud nZRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cYa9Wyy8+NW3p95A4BL25JrfyHdT0y0O/3yT5378jVU=; b=NOAOl1Tw6ZWJ8v0MswdbxZ+eGmQOyBEDsm81TtxqyOttFjPuDFHAZEkS6pUnDPndDb bb0p1YiJKHofXU7Wu7soqbWYi9yaQjwREnVBFeuXGfq9Evzbv5Moy83XrLsdRInIqUry EqXCVEgOCD/T/FSorPPSPup98aK998XRsZMnuAxpInu6scsKS2NaLK6Y9VwxTInPMXk8 t6dHxK/D4ipiUiATe9qp39BjTj56O14v3TC4eE2Fuw+rECdch1kzRMjVv9V+schB4KXZ xQkQKDGMCYlUpO5liSTgDYMKQ8LqSmkk5FZ5NiFrAeN2I9IfDQV25zoW32tDwAaZwtb5 Q8JQ== X-Gm-Message-State: AOAM530qlQMRX9rAVFsuh+RysyraIEspFM3d8RhclH0BvdX1e+GS3dLs gHsZzgyirEIcNyIp8hBCOsBE1ZE7fQQ= X-Google-Smtp-Source: ABdhPJwermiMH2fYDNjlMcjeS4cEq6bMxDuGMokvaUsZWWbBM+kFtrp4zsrLPnwZDedZ2ZzyMkVZhQ== X-Received: by 2002:a5d:6c6b:0:b0:1ea:77ea:dde8 with SMTP id r11-20020a5d6c6b000000b001ea77eadde8mr48773188wrz.690.1654943723566; Sat, 11 Jun 2022 03:35:23 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id n189-20020a1ca4c6000000b0039c747a1e8fsm6069614wme.7.2022.06.11.03.35.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 25/49] hw/isa/piix4.c: create PIIX4_PM device directly instead of using piix4_pm_initfn() Date: Sat, 11 Jun 2022 12:32:48 +0200 Message-Id: <20220611103312.67773-26-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Now that all external logic has been removed from piix4_pm_initfn() the PIIX4_PM device can be instantiated directly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-12-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 775e15eb20..9a6d981037 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -34,6 +34,7 @@ #include "hw/timer/i8254.h" #include "hw/rtc/mc146818rtc.h" #include "hw/ide/pci.h" +#include "hw/acpi/piix4.h" #include "migration/vmstate.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" @@ -293,7 +294,6 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) { PIIX4State *s; - PIIX4PMState *pms; PCIDevice *pci; DeviceState *dev; int devfn = PCI_DEVFN(10, 0); @@ -311,10 +311,13 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { - pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, 0); - qdev_connect_gpio_out(DEVICE(pms), 0, + pci = pci_new(devfn + 3, TYPE_PIIX4_PM); + qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); + qdev_prop_set_bit(DEVICE(pci), "smm-enabled", 0); + pci_realize_and_unref(pci, pci_bus, &error_fatal); + qdev_connect_gpio_out(DEVICE(pci), 0, qdev_get_gpio_in_named(dev, "isa", 9)); - *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c")); + *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c")); } pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PIRQS); From patchwork Sat Jun 11 10:32:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DD16C43334 for ; Sat, 11 Jun 2022 10:54:49 +0000 (UTC) Received: from localhost ([::1]:50032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzylU-0007LA-2V for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:54:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySp-00059H-K5 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:31 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySo-0006dE-3V for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:31 -0400 Received: by mail-wr1-x435.google.com with SMTP id h5so1539023wrb.0 for ; Sat, 11 Jun 2022 03:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vxDpqHE64xiU7PBULWpDhZ2W7hpLNLw7sgQpjiAuru0=; b=jMN5kWIAJ4gFXemJhoGelZmZqdmTNwygKdGel9OSO/UyvY2V3UFlPIxs48LRid6r49 KyBtJj7b46W2CyuT6BhJTaJCqZ0aMhhU86PSZdvlRKeJ9OAWQ1CAeTFRp2wnnNdTRbTX uig3eEhAbyrLaPKCHM+kPf+qkKLparcUbJ9ta3RTDvBaPKdVIEK5nY9EWxKMdKg85H4g 6S6IrOS5HZsx2vlWVPWUp3nGUh3aU/Q10zCkx0Bh/sgzo/RDkq7QxLrWaLcAHOGAZMLK UO1kdgX7ylaKWbUSA1IUx3IuPWQakBhcnHABf0BH6jdEK3TwviGo1p70AWfB5p7Cgqbv 4F2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vxDpqHE64xiU7PBULWpDhZ2W7hpLNLw7sgQpjiAuru0=; b=qd3QTssPS7lM0Qn5hQ6nipORwdJqhPXZdRzvdfKeQZYGZMEuSqjYqDk686g71oofM7 c/UsZxbXSLzWpNtQ9EYsEN+I6MeAay8LbxLX20OnC3jhJFgFINPMGG37ZYE6XacF8tb1 IAlNvQonPO2PyQ940ITfExqZoOlu3reeNoZo6LGz2A3qIKKUMUYqmzHuhoWfGOMsmWgy byBHSzstgo14uKgirlPIYOvAlFUCLL+AJaC6aEzhdDi2PxDQZJjONH68KrCXF/WqXuL3 joxzJfxqIK4KyjUuB3AIaYBuDTAtdOrEkrDc6qYOudzYy+6y7HxQTUJxc0cCqOtWpQRw aeNA== X-Gm-Message-State: AOAM5300LzrCcQJhlDDOOE8OxpdF4Ka0/oPTuUKRtV71IJ9C3vypJ1HA EAWK9U702L1fJl3l1f2J7RULcie+9Uo= X-Google-Smtp-Source: ABdhPJxpy/wNfISiQxqZZvIk4hjpYDrc27zf6gDfhtZzA5ROD1fhY/zq01B5agnuHYkSdLdXLfotKA== X-Received: by 2002:a5d:47a7:0:b0:218:5a5d:6c55 with SMTP id 7-20020a5d47a7000000b002185a5d6c55mr19925010wrb.192.1654943728648; Sat, 11 Jun 2022 03:35:28 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id az21-20020a05600c601500b0039c871d3191sm1103006wmb.3.2022.06.11.03.35.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 26/49] hw/acpi/piix4: remove unused piix4_pm_initfn() function Date: Sat, 11 Jun 2022 12:32:49 +0200 Message-Id: <20220611103312.67773-27-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This function is now unused and so can be completely removed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220528091934.15520-13-mark.cave-ayland@ilande.co.uk> Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 19 ------------------- include/hw/southbridge/piix.h | 4 ---- 2 files changed, 23 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 32033bc9d7..0a81f1ad93 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -505,25 +505,6 @@ static void piix4_pm_init(Object *obj) qdev_init_gpio_out_named(DEVICE(obj), &s->smi_irq, "smi-irq", 1); } -PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, - bool smm_enabled) -{ - PCIDevice *pci_dev; - DeviceState *dev; - PIIX4PMState *s; - - pci_dev = pci_new(devfn, TYPE_PIIX4_PM); - dev = DEVICE(pci_dev); - qdev_prop_set_uint32(dev, "smb_io_base", smb_io_base); - qdev_prop_set_bit(dev, "smm-enabled", smm_enabled); - - s = PIIX4_PM(dev); - - pci_realize_and_unref(pci_dev, bus, &error_fatal); - - return s; -} - static uint64_t gpe_readb(void *opaque, hwaddr addr, unsigned width) { PIIX4PMState *s = opaque; diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index b69e0dfb04..976b4da582 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -14,10 +14,6 @@ #include "hw/pci/pci.h" #include "qom/object.h" -#include "hw/acpi/piix4.h" - -PIIX4PMState *piix4_pm_initfn(PCIBus *bus, int devfn, uint32_t smb_io_base, - bool smm_enabled); /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 From patchwork Sat Jun 11 10:32:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89257C433EF for ; Sat, 11 Jun 2022 11:14:39 +0000 (UTC) Received: from localhost ([::1]:33500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzz4X-0007LL-3D for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:14:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySu-0005MI-Q9 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:36 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:41689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySt-0006gn-5n for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:36 -0400 Received: by mail-wr1-x435.google.com with SMTP id k19so1475464wrd.8 for ; Sat, 11 Jun 2022 03:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FyJZ5mYGcMryi5EAJoqWLv4MwrXIaK5gIKWOY0dgxAI=; b=jzbGYoJ0PrE4WDVJ6mNdAe6NSy87WAs8z7oP1mbwI+z3420BBmYMeaguWkhyREKleY KXSitjy/j69v/duNh3PFEYNlN3ipAkQe2QHPgPX0y82NqNUSxFlqfIY2jOAw4Fm670vK dhZdlyPInqN/8MoyWSwp8xEe+KXl2qoGkV+NNIgXAfjWk8lppSAhrE9YxBQfIrxO36VY 9V8ReqcHLlWeqsfOWSG1wFX6E9czKFtngN5SZA4GZBESAqLziECC2hp69gE+hQjAnNKJ gGrqhFpXIrmBtC3kkayajprV0pG5GjwbNbUZBl7AAeYRN10hK7Bk56dNcOrTUZrHkinr /zOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FyJZ5mYGcMryi5EAJoqWLv4MwrXIaK5gIKWOY0dgxAI=; b=ZKmcDvId8LrKa6q/q2xeaHt+DUnEoteAyRkq4hT4V8hGjyi26oa1LFLkXoM6em7iDz WwF5U5i52tR3suf76FZQLdRMl32Uz7RkInboILE3T+KL6+WSFba/YpaMTySaHjxeTZRB rexj6smjrniUCQi4TMr0GFW6AbEaW06wk4DvnYJAmZlVYVb5u+yoxHenQvSAnO1JwcNr 7ulIaa+Htzdxcwj7eQfw2aegWcgafinlvqGhDfunDL2y9ZD2pwWHmTvhbkSZLpzZc6nJ Ad+qEtDPpj/mWNidm8lg2xaRy/hC0XWgInlesP+jJXk0Wgx2NJaWQZwlyGC/CUyq4JLh ZGTQ== X-Gm-Message-State: AOAM530y3sJ8ir4UqEIE1AV1JfI9I01JvXwUy+2ZTUljIRLhyp2aIdDz 7MNCiMG94dLkYWcpwfSgSO7VIN6ToOE= X-Google-Smtp-Source: ABdhPJyTlp8QzGlZAi7K1QV5jaNl0b1ypNMtI7z4Ho47Ot6nIY/DYexAvb4y4wBvmHn2/eHBRpY74g== X-Received: by 2002:a05:6000:156d:b0:210:3135:ce1c with SMTP id 13-20020a056000156d00b002103135ce1cmr48545546wrz.409.1654943733733; Sat, 11 Jun 2022 03:35:33 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id e5-20020a05600c4e4500b0039c4ff5e0a7sm1970356wmq.38.2022.06.11.03.35.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 27/49] hw/southbridge/piix: Aggregate all PIIX southbridge type names Date: Sat, 11 Jun 2022 12:32:50 +0200 Message-Id: <20220611103312.67773-28-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow TYPE_PIIX3_PCI_DEVICE resides there as already, so add the remaining ones, too. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220603185045.143789-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 3 --- include/hw/isa/isa.h | 2 -- include/hw/southbridge/piix.h | 4 ++++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index bfccd666d4..c92b36c4f2 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -36,9 +36,6 @@ #define XEN_PIIX_NUM_PIRQS 128ULL -#define TYPE_PIIX3_DEVICE "PIIX3" -#define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" - static void piix3_set_irq_pic(PIIX3State *piix3, int pic_irq) { qemu_set_irq(piix3->pic[pic_irq], diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 6f9380007d..6c8a8a92cb 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -129,6 +129,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d) return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); } -#define TYPE_PIIX4_PCI_DEVICE "piix4-isa" - #endif diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 976b4da582..3b97186f75 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -64,6 +64,10 @@ typedef struct PIIXState PIIX3State; DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, TYPE_PIIX3_PCI_DEVICE) +#define TYPE_PIIX3_DEVICE "PIIX3" +#define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" +#define TYPE_PIIX4_PCI_DEVICE "piix4-isa" + PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus); From patchwork Sat Jun 11 10:32:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878474 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A3DCC43334 for ; Sat, 11 Jun 2022 11:22:44 +0000 (UTC) Received: from localhost ([::1]:53130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzCV-0005Gk-Gm for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:22:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzySz-0005Wg-LW for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:41 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:37866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzySx-0006Zr-Pl for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:40 -0400 Received: by mail-wr1-x433.google.com with SMTP id o16so1492663wra.4 for ; Sat, 11 Jun 2022 03:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2I5JbZGTrIskB0/+F8X6yPWuOCPIAP2+ywVc/zA5MLs=; b=n+lEKs7EfyzFRJXx+maNA/JggZ5ikBK858hEC7O+uynqBcGGrhFE25dj8XgHxqqe8x NdrevwWKQbAKcgWnqfr7CW3olY2KtAZLxgGnZkYtYwYOIbTyLcExqLUUK33KcOJoGmUl I9+l+sbPbTgPFnk07kzSA+rFoK3X6MLNnTnLKkXkhp9sgzJaa+l5VLLO1BFcx9RvzHNg FTWYfbq+ln3x7FODEwULTD1+tmjbX46ExvccOLVLdlNFYD67VjCZ4Za9Zom7ShybtHgV WtLgaN5F7qclqC2oXeUy1sJtnwT6df9HIeACkUvfOUFJC9LY6YMGe9zP2FMHmJQjvo97 t9ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2I5JbZGTrIskB0/+F8X6yPWuOCPIAP2+ywVc/zA5MLs=; b=zvJXZ6SOEkJ43VyZWetsDVoPgkMZYP8+/hXyk7t53IqHXALYg3W+Y5/1A4KXw3kPoj sj6UV1q9tO/UXCulXfgxVXfzy8OBfN8F4DFV/qtBYdSxe+JILHx5d/v/o9XM3PMNC1SU Y+XZ4ec0XO5WzvktHoyJZxcvHiW9oIGfSsIorAT5yjmXe4BQA0td5XUQW6hN7Gns0S8n CGsiLDbbFVbchEPsY2VdAxGtX8pu7a2TFAK9F89IwlOzZpiXTjETy7gxyEcR7k3UjWVU nqfpm/7xhxLXv6rEpmKvy2f8u7o2sPedN0kimsH0kTHtNKBh7uiVaM42PjC7qrDAT8sw Y1bQ== X-Gm-Message-State: AOAM532gCZEX3uTNPQ7o8AdAAmyVh2WeL2zIpH+uKkbnMbWVQW+cJIsX Cp1cGiLJrVgX/DcPcKbfAxMODdDmM48= X-Google-Smtp-Source: ABdhPJyBEHV9CngziY9jPntRqfcVEFTdGoKQzz3b0+HI6XyLza9v5gk1Zfs1xe9Ixou7a42UDrXaBg== X-Received: by 2002:a05:6000:1789:b0:219:cb95:79a6 with SMTP id e9-20020a056000178900b00219cb9579a6mr10630951wrg.353.1654943738879; Sat, 11 Jun 2022 03:35:38 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id z16-20020adfec90000000b0020cff559b1dsm2162089wrn.47.2022.06.11.03.35.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 28/49] hw/isa/piix4: Use object_initialize_child() for embedded struct Date: Sat, 11 Jun 2022 12:32:51 +0200 Message-Id: <20220611103312.67773-29-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Reported-by: Peter Maydell Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 9a6d981037..1d04fb6a55 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -224,7 +224,7 @@ static void piix4_init(Object *obj) { PIIX4State *s = PIIX4_PCI_DEVICE(obj); - object_initialize(&s->rtc, sizeof(s->rtc), TYPE_MC146818_RTC); + object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); } static void piix4_class_init(ObjectClass *klass, void *data) From patchwork Sat Jun 11 10:32:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6318DC43334 for ; Sat, 11 Jun 2022 11:21:57 +0000 (UTC) Received: from localhost ([::1]:50104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzBk-0003AJ-FB for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:21:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyT5-0005ZB-6C for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:50 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:45980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyT3-0006hp-L2 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:46 -0400 Received: by mail-wr1-x430.google.com with SMTP id p10so1450559wrg.12 for ; Sat, 11 Jun 2022 03:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oZzVRGGAd0INWHy8SWgdbg6oLFPj3BVJRyqm8wOYtzI=; b=m0OV7QB3kfeiueXovHmtzRQr1gcPGgpyPmNgbxPz3kcXEc4/2+CPSaR+zWfrZIMiv7 Fc+TWs/msITEJMicaoVUKeiVnCRWwipzKGhZ0Ry5KMTa8+JzMphAE1AL5OCCJAX5fQtV MDNb82mM/HkYMvQLseIaII9drgFSuNChF98TtCrNspbSQkI95sM2yJwwNLE9D2n9wXOv EOUMiAq/epg4Wd7BcWIpxzNhkA/jCCAJQhcbDyDRQZJGDa8yrYMv13jW0VdkD+ATpJwT R0fsvhk2MRVykEiXXuek3cE/0gnWd+HOMbA9Mhvg1s7g85mmOEKZPN54Hje2aoiFm19V 3Fiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oZzVRGGAd0INWHy8SWgdbg6oLFPj3BVJRyqm8wOYtzI=; b=Sigxn/79WrH7sn7QXcYPc6FSp4+gnLogg78VMneOt8VElGP5R5NUibfCqD9Q4gLpAc PeXeTeR13lmcwZ2r0orAqK5Gh9+JHoq/cwo93icQ0t35GGAvpM37aiHNGhQIHhZoczBo j+GJ0o4VWkirNF/SoDhS+NYPro9z1bJN1uVpbZ3R/Lhkj+rVpPOUHYU9mt7uJAjYZ+v+ UU5BaeS4Nimisb91aM6kyzKtKLXfozN+tKl7X+Ed5AVFB1QQZYXkcnRm6tRKfBFuWmV3 jc7XZ8hbWMnsapdlRB8yKRpcSvLA+Y3GTk2Lk3KJ44i4NAzgK0pEiHMZF0YuPkxuOHgf dVSQ== X-Gm-Message-State: AOAM530oZuA0Fz69x6LlJZuXWsW00bd4yCo9QEuLOGUfai2SEc2Q/wz4 k9Df3pztsI3PWwPrx284fCZF66Ik2BE= X-Google-Smtp-Source: ABdhPJyTh8PU+MlL3+5yfFIXrwAXCtLKtdjxjtnyvsa2hqatFPtP8EAccUdVRIlrGBa1sqNOXBPJUA== X-Received: by 2002:a5d:5984:0:b0:219:e396:d3d1 with SMTP id n4-20020a5d5984000000b00219e396d3d1mr9203073wri.701.1654943743919; Sat, 11 Jun 2022 03:35:43 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m185-20020a1c26c2000000b003974d0d981dsm5910951wmm.35.2022.06.11.03.35.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 29/49] hw/isa/piix4: Move pci_map_irq_fn' near pci_set_irq_fn Date: Sat, 11 Jun 2022 12:32:52 +0200 Message-Id: <20220611103312.67773-30-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow The pci_map_irq_fn was implemented below type_init() which made it inaccessible to QOM functions. So move it up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220603185045.143789-4-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 1d04fb6a55..18aa24424f 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -74,6 +74,31 @@ static void piix4_set_irq(void *opaque, int irq_num, int level) } } +static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) +{ + int slot; + + slot = PCI_SLOT(pci_dev->devfn); + + switch (slot) { + /* PIIX4 USB */ + case 10: + return 3; + /* AMD 79C973 Ethernet */ + case 11: + return 1; + /* Crystal 4281 Sound */ + case 12: + return 2; + /* PCI slot 1 to 4 */ + case 18 ... 21: + return ((slot - 18) + irq_num) & 0x03; + /* Unknown device, don't do any translation */ + default: + return irq_num; + } +} + static void piix4_isa_reset(DeviceState *dev) { PIIX4State *d = PIIX4_PCI_DEVICE(dev); @@ -266,31 +291,6 @@ static void piix4_register_types(void) type_init(piix4_register_types) -static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) -{ - int slot; - - slot = PCI_SLOT(pci_dev->devfn); - - switch (slot) { - /* PIIX4 USB */ - case 10: - return 3; - /* AMD 79C973 Ethernet */ - case 11: - return 1; - /* Crystal 4281 Sound */ - case 12: - return 2; - /* PCI slot 1 to 4 */ - case 18 ... 21: - return ((slot - 18) + irq_num) & 0x03; - /* Unknown device, don't do any translation */ - default: - return irq_num; - } -} - DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) { PIIX4State *s; From patchwork Sat Jun 11 10:32:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878450 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64E6FC433EF for ; Sat, 11 Jun 2022 10:59:03 +0000 (UTC) Received: from localhost ([::1]:58150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzypa-0004i3-FT for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 06:59:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTA-0005f1-QX for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:54 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:56212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyT8-0006jR-Ol for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:52 -0400 Received: by mail-wm1-x336.google.com with SMTP id a10so621649wmj.5 for ; Sat, 11 Jun 2022 03:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8lIdpUuj53G78ixCb6Twke/OwYar2O+RvomykKgYH0s=; b=OofF122HXzPRZfqgtwU+LsrMgWdop7lUAVi1bbkBBJA6zO5iZg4AtlDHQW/6XmipCh ryJn5MzoKf7uj8Ml5VgDaSg0jtxrirx5HADFVnuts57Lk3LFmh9UiSBnQ8b2B3is5VG7 dKQc3SnE3IIrFdZjm3MXK1O1Ua4bbn72NFIB7HHPY5BwG6pdXVrXLYOG2xZFycij9bhk BZpNJw2DxpAPWF4QR9q6o+lFADjKtGaAOaIg/xR6wbm7QDt9iDJATISHIsppnqKgiWxX TZifviQLVsb5fK2p0nTlpeo9u3YEq4oGuZSEdRAcJma50xcAMhzKDJb1Cle+iqkP8iiF fsPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8lIdpUuj53G78ixCb6Twke/OwYar2O+RvomykKgYH0s=; b=vMWaIyDQcmZn2362b2zsrn8qAmJIqnUfB8dhEbSPz6j6qCKFRud4t68T2wFJmDHB2n vKhTzz9ZjnPI7/bK3LZZWLMZMW6QiSGDTRfKHVlA/XmUBaHgL92Fa37w4cPSqkWOB9SL beGgxUsfG6GcQBGqKLrYtHQSc5TliG54XfPLmiyJCZGkV/R79f3hCnMIR+EeA7cntn8Y iKcJsZFJfmMWGB+laigB/8v4FS0Zm5Xxg1EBthBB/pHBRrEAVDkDn1B1Kb2CVW9AUt0h McR+f3eMJsWNYOlc2Oa/0zlUlI+2ZdbK8QZb8Oy/m6758bzku3a44goqR5v9P6jSxnB7 2LlQ== X-Gm-Message-State: AOAM533Jr1i2EJCR33ERayXX5W3+73sD0bYzhUFr/h6b6mW7JFStbYAX HdKo0UmId95u7Odslkw0lsCxFnxQ5Ew= X-Google-Smtp-Source: ABdhPJzGO0HXwtKC55UEnjPS3CrGDx2H7OFDR9xSscloJelZPlA7TfzN2QCq2BDRFzG5VjaIRhpIbw== X-Received: by 2002:a05:600c:22d9:b0:39c:4b1b:5f99 with SMTP id 25-20020a05600c22d900b0039c4b1b5f99mr4160794wmg.151.1654943749185; Sat, 11 Jun 2022 03:35:49 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id r16-20020a056000015000b0021108003596sm2194837wrx.10.2022.06.11.03.35.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 30/49] hw/isa/piix4: QOM'ify PCI device creation and wiring Date: Sat, 11 Jun 2022 12:32:53 +0200 Message-Id: <20220611103312.67773-31-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow PCI interrupt wiring and device creation were performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 18aa24424f..058bebb5e2 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -35,6 +35,7 @@ #include "hw/rtc/mc146818rtc.h" #include "hw/ide/pci.h" #include "hw/acpi/piix4.h" +#include "hw/usb/hcd-uhci.h" #include "migration/vmstate.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" @@ -46,6 +47,8 @@ struct PIIX4State { qemu_irq *isa; RTCState rtc; + PCIIDEState ide; + UHCIState uhci; /* Reset Control Register */ MemoryRegion rcr_mem; uint8_t rcr; @@ -205,6 +208,7 @@ static const MemoryRegionOps piix4_rcr_ops = { static void piix4_realize(PCIDevice *dev, Error **errp) { PIIX4State *s = PIIX4_PCI_DEVICE(dev); + PCIBus *pci_bus = pci_get_bus(dev); ISABus *isa_bus; qemu_irq *i8259_out_irq; @@ -243,6 +247,21 @@ static void piix4_realize(PCIDevice *dev, Error **errp) return; } s->rtc.irq = isa_get_irq(ISA_DEVICE(&s->rtc), s->rtc.isairq); + + /* IDE */ + qdev_prop_set_int32(DEVICE(&s->ide), "addr", dev->devfn + 1); + if (!qdev_realize(DEVICE(&s->ide), BUS(pci_bus), errp)) { + return; + } + pci_ide_create_devs(PCI_DEVICE(&s->ide)); + + /* USB */ + qdev_prop_set_int32(DEVICE(&s->uhci), "addr", dev->devfn + 2); + if (!qdev_realize(DEVICE(&s->uhci), BUS(pci_bus), errp)) { + return; + } + + pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PIRQS); } static void piix4_init(Object *obj) @@ -250,6 +269,8 @@ static void piix4_init(Object *obj) PIIX4State *s = PIIX4_PCI_DEVICE(obj); object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); + object_initialize_child(obj, "ide", &s->ide, "piix4-ide"); + object_initialize_child(obj, "uhci", &s->uhci, "piix4-usb-uhci"); } static void piix4_class_init(ObjectClass *klass, void *data) @@ -293,7 +314,6 @@ type_init(piix4_register_types) DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) { - PIIX4State *s; PCIDevice *pci; DeviceState *dev; int devfn = PCI_DEVFN(10, 0); @@ -301,15 +321,11 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) pci = pci_create_simple_multifunction(pci_bus, devfn, true, TYPE_PIIX4_PCI_DEVICE); dev = DEVICE(pci); - s = PIIX4_PCI_DEVICE(pci); + if (isa_bus) { *isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); } - pci = pci_create_simple(pci_bus, devfn + 1, "piix4-ide"); - pci_ide_create_devs(pci); - - pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { pci = pci_new(devfn + 3, TYPE_PIIX4_PM); qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); @@ -320,7 +336,5 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c")); } - pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PIRQS); - return dev; } From patchwork Sat Jun 11 10:32:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9BB64C433EF for ; Sat, 11 Jun 2022 11:17:54 +0000 (UTC) Received: from localhost ([::1]:38264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzz7p-0003ex-IF for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:17:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTF-0005nw-UO for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:57 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:41210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTE-0006jp-Dl for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:35:57 -0400 Received: by mail-wm1-x334.google.com with SMTP id m125-20020a1ca383000000b0039c63fe5f64so785523wme.0 for ; Sat, 11 Jun 2022 03:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NfeUOaEJG6DdO/79c/Jn/BCpB94zA5Bzp4nNGpsCT54=; b=RJPoFCIBe6OWOiehp1bmqhJFYmkckeKG2/TMVr0lPY/uEFWdBL+W0sZ2GYaVWU3TQk VTqFGIaRF3mmbSMu043K1X5NlP1t0JtDq+lojkoHiCnyLjoLQDLKJ/x1gpnOyUtDoz6c RnsPtgkCQOjCxNl5r8yUuobsW70eLs2LqAQRhe5N/q1fZvUiZg2CTQO8E5s1vH2mPRa8 /ZUVd692X4M+kgpK5toCljLqeB0HGPIpYVNZeXh1OuHWpXF+z6OWlWW2MdG+lfpXlI1h NYoR4y5o8tG/0BlKI5L1oWZHt1NrHLds0VJuqovBCX+9PUOsfZNtQ366yNNbCWMdr6ov Kgnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NfeUOaEJG6DdO/79c/Jn/BCpB94zA5Bzp4nNGpsCT54=; b=cQ+5HoaNquGTQwm7Fs5ncWjrsaSPx4dV70IbICrDolBJgBf7GNxjYAFzXqyHtz1s1l 4UGSlOEFX4zYtrHWhAXI9bYutAaiw6hUFQFnkLiLMtSnDoUVx4v3ZciTKGCTpWoqW7o8 qOnbgXhpZ+4B4jUNYytsvT5q8n7TepRT4ceviL6pQhmItVXqf4bkgi/cYAVMsXcA5grs 8qPe7C/ck1Yu5wm0LjRTD0sQEouWaFZi5/oFl4RmxXCymaUeiTgrai41QAUrhNROuu1g yxUI9z1N+5uCpqdVC4MVGXSxU6+CTn0YEsqsRK8+JyVQ7RcvreOJ0kzA6oPOm5kJWBzZ dUuA== X-Gm-Message-State: AOAM530mMutA0i2Qqc8uJRsSpiZOq38H+1GFsIGc/Ypio/4dFIjgfKQn pwaRyRTZkoxjxjNRBhT8ZYKK8FvufdI= X-Google-Smtp-Source: ABdhPJzMm95nO6gKRkl/GJK69vb/IjT8PLN/lFwV1Rdj3o0HBPpD/yu4Ug3yqu9LObGOuwl8UA8cvw== X-Received: by 2002:a1c:ed08:0:b0:39c:80b1:b0b3 with SMTP id l8-20020a1ced08000000b0039c80b1b0b3mr4187828wmh.134.1654943754273; Sat, 11 Jun 2022 03:35:54 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id bg23-20020a05600c3c9700b0039c15861001sm7085454wmb.21.2022.06.11.03.35.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 31/49] hw/isa/piix4: Factor out ISABus retrieval from piix4_create() Date: Sat, 11 Jun 2022 12:32:54 +0200 Message-Id: <20220611103312.67773-32-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Modernizes the code. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220603185045.143789-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 6 +----- hw/mips/malta.c | 3 ++- include/hw/southbridge/piix.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 058bebb5e2..96df21a610 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -312,7 +312,7 @@ static void piix4_register_types(void) type_init(piix4_register_types) -DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) +DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus) { PCIDevice *pci; DeviceState *dev; @@ -322,10 +322,6 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) TYPE_PIIX4_PCI_DEVICE); dev = DEVICE(pci); - if (isa_bus) { - *isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); - } - if (smbus) { pci = pci_new(devfn + 3, TYPE_PIIX4_PM); qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9ffdc5b8f1..e446b25ad0 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1399,7 +1399,8 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); /* Southbridge */ - dev = piix4_create(pci_bus, &isa_bus, &smbus); + dev = piix4_create(pci_bus, &smbus); + isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); /* Interrupt controller */ qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 3b97186f75..dab5c9704e 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -70,6 +70,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); -DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus); +DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus); #endif From patchwork Sat Jun 11 10:32:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C6BDC43334 for ; Sat, 11 Jun 2022 11:25:29 +0000 (UTC) Received: from localhost ([::1]:58666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzFA-0000iK-NR for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:25:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTK-0005zQ-GZ for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:02 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:38800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTI-0006k5-Ry for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:02 -0400 Received: by mail-wm1-x331.google.com with SMTP id m39-20020a05600c3b2700b0039c511ebbacso2236726wms.3 for ; Sat, 11 Jun 2022 03:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lYYHMhpJah66B43fCdeT+kLyN3px6fr6Fuks14wRcc4=; b=hsDZTRGPQlodkvyVzhGrNVKXvLJAHMDb67dCAI3hkGCywrbdQN5PDS8z/0k8NKOqAf jW9UJFoAH8Dn7eFJQmx0b5dNj/H4LEwOvHmq0Q0Kyl+p9+9GiBI8+QgvJZSA2pNV+p0H umInzdKbGiQhP/BGmtJgVTOEqt5MrJo2cvwxaDi1CL1aX7i2a2z7fhkYOyV5kJsBQZ/X 7B0sX7tBADqknBhnGDsssFMffMMS1LB1Y2Ur9b/9jnvUNtQ/eeYm1LVQOKdkn8kqZyRI T6YgNq68Z2c/bZ4na5uEl2/7Cio59S28nMzNEC/Am0Y9OIoHP5vzrvJRl9nSh/VTGQDZ YSkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lYYHMhpJah66B43fCdeT+kLyN3px6fr6Fuks14wRcc4=; b=Ip1Rb8YjEeHtgJTOltUQtPmb2rVW2uRHsBgEsN2ajrkSz0iR6/mcr4zU1MQpiwpaZo STccoeGCbqWl+NxZrIkXEAVRpPR5VVISqgrFJ2518h75bHYDOOd9FAY12i4nJlKonsW7 NeBE4GDUWSzS3YLy1nUsuWxmDHRh30rE/awD/GlaGAOmEsLBUMdXKjIUJeOS4oDyGArj zq966SHhX4BkYw+uGbcdDpK/9ByRdOauWbY7EG5hIcUyBu5/bMFUXMMQ/icsj5Xy8daM BQLTlxjarnGdmn9RBRcOARUvpDMDKy16jZwHSaOhHgXfW2EERPkQkXSNbc4HS7aKAyFj yXpA== X-Gm-Message-State: AOAM5307Rls9bwVuQtZF7/jWzF94HvTKtSOaU+BAxwjJfmnEF6XjeK86 CXRCTmi1HzzofRZZ0jvaM+X5A6tlTRM= X-Google-Smtp-Source: ABdhPJzuAf6aZSXbLMfNderHoGbgrwKOXsO953iWGslXYN/7eDpwvCZo4jQAJXWpCrECALv63ugr8A== X-Received: by 2002:a1c:7901:0:b0:39c:4252:d7f1 with SMTP id l1-20020a1c7901000000b0039c4252d7f1mr4147422wme.178.1654943759390; Sat, 11 Jun 2022 03:35:59 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m10-20020a5d56ca000000b0020c5253d8f7sm2152589wrw.67.2022.06.11.03.35.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:35:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 32/49] hw/isa/piix4: QOM'ify PIIX4 PM creation Date: Sat, 11 Jun 2022 12:32:55 +0200 Message-Id: <20220611103312.67773-33-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Just like the real hardware, create the PIIX4 ACPI controller as part of the PIIX4 southbridge. This also mirrors how the IDE and USB functions are already created. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-7-shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 24 +++++++++++++----------- hw/mips/malta.c | 5 ++++- include/hw/southbridge/piix.h | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 96df21a610..d97b245df3 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -49,6 +49,7 @@ struct PIIX4State { RTCState rtc; PCIIDEState ide; UHCIState uhci; + PIIX4PMState pm; /* Reset Control Register */ MemoryRegion rcr_mem; uint8_t rcr; @@ -261,6 +262,13 @@ static void piix4_realize(PCIDevice *dev, Error **errp) return; } + /* ACPI controller */ + qdev_prop_set_int32(DEVICE(&s->pm), "addr", dev->devfn + 3); + if (!qdev_realize(DEVICE(&s->pm), BUS(pci_bus), errp)) { + return; + } + qdev_connect_gpio_out(DEVICE(&s->pm), 0, s->isa[9]); + pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PIRQS); } @@ -271,6 +279,10 @@ static void piix4_init(Object *obj) object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); object_initialize_child(obj, "ide", &s->ide, "piix4-ide"); object_initialize_child(obj, "uhci", &s->uhci, "piix4-usb-uhci"); + + object_initialize_child(obj, "pm", &s->pm, TYPE_PIIX4_PM); + qdev_prop_set_uint32(DEVICE(&s->pm), "smb_io_base", 0x1100); + qdev_prop_set_bit(DEVICE(&s->pm), "smm-enabled", 0); } static void piix4_class_init(ObjectClass *klass, void *data) @@ -312,7 +324,7 @@ static void piix4_register_types(void) type_init(piix4_register_types) -DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus) +DeviceState *piix4_create(PCIBus *pci_bus) { PCIDevice *pci; DeviceState *dev; @@ -322,15 +334,5 @@ DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus) TYPE_PIIX4_PCI_DEVICE); dev = DEVICE(pci); - if (smbus) { - pci = pci_new(devfn + 3, TYPE_PIIX4_PM); - qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); - qdev_prop_set_bit(DEVICE(pci), "smm-enabled", 0); - pci_realize_and_unref(pci, pci_bus, &error_fatal); - qdev_connect_gpio_out(DEVICE(pci), 0, - qdev_get_gpio_in_named(dev, "isa", 9)); - *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c")); - } - return dev; } diff --git a/hw/mips/malta.c b/hw/mips/malta.c index e446b25ad0..be9f26d841 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1238,6 +1238,7 @@ void mips_malta_init(MachineState *machine) int be; MaltaState *s; DeviceState *dev; + DeviceState *pm_dev; s = MIPS_MALTA(qdev_new(TYPE_MIPS_MALTA)); sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); @@ -1399,8 +1400,10 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); /* Southbridge */ - dev = piix4_create(pci_bus, &smbus); + dev = piix4_create(pci_bus); isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); + pm_dev = DEVICE(object_resolve_path_component(OBJECT(dev), "pm")); + smbus = I2C_BUS(qdev_get_child_bus(pm_dev, "i2c")); /* Interrupt controller */ qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index dab5c9704e..2357ce0287 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -70,6 +70,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); -DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus); +DeviceState *piix4_create(PCIBus *pci_bus); #endif From patchwork Sat Jun 11 10:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4410C433EF for ; Sat, 11 Jun 2022 11:20:42 +0000 (UTC) Received: from localhost ([::1]:46808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzAX-0000vm-SX for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:20:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTb-0006Au-H1 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:26 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:44702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTO-0006kM-CU for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:18 -0400 Received: by mail-wm1-x331.google.com with SMTP id m32-20020a05600c3b2000b0039756bb41f2so764395wms.3 for ; Sat, 11 Jun 2022 03:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EKw8dkFk83kf19j0PuBQx7qP2J6aT8xObisTpd5mA4Q=; b=Wk/CsJdVWWDwweJ+HwGmCbdrY2Lm+Yrj+e65BzHPtWwPRmn58kJhCvvZlhNZALgHC3 YKrOQib9IDAnN5I4P9CPEVm321jo4N0bxFsOb0nXBBdL+93oZkV19EULnXk5C6OzRTEm QJuQ1Pyjas2d/g+UkSqEQ/vDWv5g97cY+1ZYw/3eEz+P8P/hMxQHoekMLmHoFBlWzNpt 3fK4t7WjIjVjN+F+GhC/WiMzoYAddh9y/nlN/3Fv65WiszHNmMYrWINC2YY6ua5zMccY tSX7/WDk4rk3tibj1WsHBFuResMXFxhy0yEx/o6ldtL4OlQAKOP7VJTxDtoynr1uFxYe Twbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EKw8dkFk83kf19j0PuBQx7qP2J6aT8xObisTpd5mA4Q=; b=rgr1qeWTBNEyoZQNDt5E92dwefp/VA/Kd9n8P/+fL6k9tJQoZcBv5Mngz588eKUchz 9MtslE6tCweAKCZ9ABHQ6qCiseC7Ly/Gr3NEtOxQMZ2M/U8J93hNze9vycnj8vycfeIM 93UYfVgfhOjCvWZqwLhG8QTcB+1YPaNRKpUY/sE2Ntft8u8eX65lAhheN/QN/iTsfszi sZkVAbcXdjDTyl296mHBFzln8JSjTyrm1RIN2fX8FdSJraj+2nWdQ+Z5ovX0hhsj5i56 gVIRLvGD0GEHj88XnRq+OritiSTLqLdbMYbJx8IR4JoK+cm+yKZpg+xv1ZUVFk1boHyE UYmA== X-Gm-Message-State: AOAM533NEalJ/rGQuxA/wMTUhvXxRRPriIsY8nGBxDCDZ/DBNNT8NFLd 5cVTXJ4oO7W8tWbX2Rn6yNU2GpBApcU= X-Google-Smtp-Source: ABdhPJzAEZWn6v4DYWCvPF5GoBKI//1lVXpdbOqMnbvhuFbu26luUfKJot56nY5UZKOJHV3yhjTO8A== X-Received: by 2002:a05:600c:646:b0:397:77ab:5eb7 with SMTP id p6-20020a05600c064600b0039777ab5eb7mr4283524wmm.166.1654943764479; Sat, 11 Jun 2022 03:36:04 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m5-20020a056000008500b00213d75491b0sm2134922wrx.48.2022.06.11.03.36.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 33/49] hw/isa/piix4: Inline and remove piix4_create() Date: Sat, 11 Jun 2022 12:32:56 +0200 Message-Id: <20220611103312.67773-34-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow During the previous changesets piix4_create() became a trivial wrapper around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-8-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 13 ------------- hw/mips/malta.c | 5 ++++- include/hw/southbridge/piix.h | 2 -- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index d97b245df3..15f344dbb7 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -323,16 +323,3 @@ static void piix4_register_types(void) } type_init(piix4_register_types) - -DeviceState *piix4_create(PCIBus *pci_bus) -{ - PCIDevice *pci; - DeviceState *dev; - int devfn = PCI_DEVFN(10, 0); - - pci = pci_create_simple_multifunction(pci_bus, devfn, true, - TYPE_PIIX4_PCI_DEVICE); - dev = DEVICE(pci); - - return dev; -} diff --git a/hw/mips/malta.c b/hw/mips/malta.c index be9f26d841..7a0ec513b0 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1237,6 +1237,7 @@ void mips_malta_init(MachineState *machine) int fl_idx = 0; int be; MaltaState *s; + PCIDevice *piix4; DeviceState *dev; DeviceState *pm_dev; @@ -1400,7 +1401,9 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); /* Southbridge */ - dev = piix4_create(pci_bus); + piix4 = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), true, + TYPE_PIIX4_PCI_DEVICE); + dev = DEVICE(piix4); isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); pm_dev = DEVICE(object_resolve_path_component(OBJECT(dev), "pm")); smbus = I2C_BUS(qdev_get_child_bus(pm_dev, "i2c")); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 2357ce0287..9a2dd93c2d 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -70,6 +70,4 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); -DeviceState *piix4_create(PCIBus *pci_bus); - #endif From patchwork Sat Jun 11 10:32:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878478 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 517A1CCA47A for ; Sat, 11 Jun 2022 11:26:06 +0000 (UTC) Received: from localhost ([::1]:33228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzFl-0002n1-CG for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:26:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTU-00067X-WA for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:13 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:45632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTT-0006kU-4G for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:12 -0400 Received: by mail-wm1-x32e.google.com with SMTP id x6-20020a1c7c06000000b003972dfca96cso761606wmc.4 for ; Sat, 11 Jun 2022 03:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ul1qFQ9VM3y6jWfQ7BS4BrYGnpboS+5eSvdEyMLG1+Y=; b=EvL42hEzVc9XVOPgJI9d8gDcRTdHJKxTWjvx/FpQhWaW7JQN/lL0govaIgptYuVJDI odRBBci+0gwohTbeRDiuRPS0gxOJIgj9gM3rU8r7QQdr6koU+R19629xfViU2lhTPIzP PHvT8Incpy1QaHC4rjO6O0+2irGqaeIX8lCvUiBxO4/I1DRZT0iPSx+xF+VGRQ+OAgE9 w71eVW4epYhAmkHX3ccgOAC7PSxsUo7XO+Hodh50accK5upVKGDz1CQfRTXf5PO9t5+b TRJJIGd8OBF6IzC3NIESGr8/tOoMxzc7w9zqhKUSmSzRLHEEJVPhPlUR9/fudFhvyYlm w7dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ul1qFQ9VM3y6jWfQ7BS4BrYGnpboS+5eSvdEyMLG1+Y=; b=wHTXw2r24Z6IhKuxLd+K3VvQJr7zRON5sRoEF2FJsaD12UzlnIalWkihxiPYpyeYUp xICPuF5Fu3BPgCr6uCfkzQu5WBcteVruVvx4oW5uHV9RNjV5AHhiwC//gFATec5pCtYq HnLEnBYVRiszjoiJnGz5jiUhc4H6pKQqL6EmJGMFGGP6A3Qpnz23jBb1k2ZiYOgcEVSt rSckM3qhaS69evKzMRg8tN4jAwIQfJfFOH8y7Y2xpWs6HcUsnA5gyHxnPCTUlxk6RHK8 M7D32AzVaKEgiIa7gRttUDqFLFrEWqjsiNg/a1pJUIoR/is2CdqDhMdaYWuupUYB927F OivQ== X-Gm-Message-State: AOAM531+FX5cGGXjYeLOo9Xk+bgtF0RQiwfWaJBecUZxDn5GZnrz0dLv FFGl4+VXc0hBia8aplrG5h7d+VNnGxA= X-Google-Smtp-Source: ABdhPJziMZ/u28e8+dHvuuLMBCM1LmcXshD6qA28pUYhTWfQptyAnnfL1oi0JPDePkO5UrScy0Gx5g== X-Received: by 2002:a7b:c4d4:0:b0:39c:5bb7:2210 with SMTP id g20-20020a7bc4d4000000b0039c5bb72210mr4209258wmk.99.1654943769522; Sat, 11 Jun 2022 03:36:09 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id q16-20020a5d5750000000b0020e63ab5d78sm2163247wrw.26.2022.06.11.03.36.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 34/49] hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fn Date: Sat, 11 Jun 2022 12:32:57 +0200 Message-Id: <20220611103312.67773-35-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow The pci_map_irq_fn was implemented below type_init() which made it inaccessible to QOM functions. So move it up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220603185045.143789-9-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index c92b36c4f2..d50a07b58b 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -79,6 +79,17 @@ static void piix3_set_irq(void *opaque, int pirq, int level) piix3_set_irq_level(piix3, pirq, level); } +/* + * Return the global irq number corresponding to a given device irq + * pin. We could also use the bus number to have a more precise mapping. + */ +static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx) +{ + int slot_addend; + slot_addend = PCI_SLOT(pci_dev->devfn) - 1; + return (pci_intx + slot_addend) & 3; +} + static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pin) { PIIX3State *piix3 = opaque; @@ -367,17 +378,6 @@ static void piix3_register_types(void) type_init(piix3_register_types) -/* - * Return the global irq number corresponding to a given device irq - * pin. We could also use the bus number to have a more precise mapping. - */ -static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx) -{ - int slot_addend; - slot_addend = PCI_SLOT(pci_dev->devfn) - 1; - return (pci_intx + slot_addend) & 3; -} - PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus) { PIIX3State *piix3; From patchwork Sat Jun 11 10:32:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878480 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 168BDC43334 for ; Sat, 11 Jun 2022 11:28:19 +0000 (UTC) Received: from localhost ([::1]:38658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzHu-0006er-4s for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:28:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTa-0006Ap-G6 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:26 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:38524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTY-0006lB-2h for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:17 -0400 Received: by mail-wr1-x433.google.com with SMTP id v14so1490652wra.5 for ; Sat, 11 Jun 2022 03:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+xDd2IWWipz5tS1XrqxuI9D9wP2W2TyPn8FKseiRH7o=; b=GPDYFHPr0G/BXD6utf+XpVhHaTM6/T7R71CIhuSGB4Mg7AYJ/Z63D2iapZLgbPdB0y M/OZVUc8T/hBEgSmyelU0NXTw/47ZjrfmRDf5l5ZSVtliTmYW7NyMew64l99ZvNGgnUz OQ1hlCrUczWlvN4qHoFBrGC/sdTx1VEn3x0cbcV0Gflpki4iy0Go87IaQ1ysX9Td0NF4 AfkO7jj4oJ8g60tL7/v7ZCrnc3g2/BAEd5HBFIjVbSkyqEMFgi7FDe4FnCS386lxzsGg xrktMR77t0G9ZHquE6ZW0N5pBhPbPq/CDbgbzyJa7Cj4JDtXiNgpvF7Xtc0HVqjOMEhm /69A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+xDd2IWWipz5tS1XrqxuI9D9wP2W2TyPn8FKseiRH7o=; b=m9eBmtesneMFZ5Wn1kEjazXWJNl/TRrZY8DoqWZ6l6CUBdMouMTG47DJeixqLcGc+Y APAmvs6QjZTy4PEzSHPwa0oWnyWuIe/4Fo+uzkHIcFhfzcpGeRIfoiMZJPKUK6bIPdBO AhVZYi5i97C7MawcOJPy+2QvcERMyL7UoFE20yJJs9Wq9fNsMhVgPq34Y6bYhbn1Qtl6 Jc865g+d72oA6p9bM3QxJkhhtU+E/Avg9jfj90U0Peno9ozcRKvDLNk8ffRX4Q0tfZ7Y /ZoDApwcCAbjeGZnFhYR8cg+CGw5Z19Z88VIULrUtmu6p9IW6RiaGFl2rFCAEfCoc9YT HfWQ== X-Gm-Message-State: AOAM531kDoCZZXSuCcYJ0ougNflhVFuMylTWZEeKWDIvBNVI8EoiMuwg rJqo03vlRdSfp6vW1kRBRVYjAxG+Isc= X-Google-Smtp-Source: ABdhPJzIo/i1dqOHibe85SC8mdIdzc63+JxlbObq7Cnb54hPqXNK4BAtHUM84JEScrfHXSpKU5MBgg== X-Received: by 2002:adf:a4d8:0:b0:219:ecd4:159b with SMTP id h24-20020adfa4d8000000b00219ecd4159bmr5382242wrb.431.1654943774618; Sat, 11 Jun 2022 03:36:14 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id l2-20020a5d6682000000b0020e6ce4dabdsm2145027wru.103.2022.06.11.03.36.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 35/49] hw/isa/piix3: QOM'ify PCI device creation and wiring Date: Sat, 11 Jun 2022 12:32:58 +0200 Message-Id: <20220611103312.67773-36-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow PCI interrupt wiring was performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. In order to avoid duplicate checking for xen_enabled() the realize methods are now split. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-10-shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 67 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index d50a07b58b..89064eb837 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "qemu/range.h" +#include "qapi/error.h" #include "hw/southbridge/piix.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -278,7 +279,7 @@ static const MemoryRegionOps rcr_ops = { .endianness = DEVICE_LITTLE_ENDIAN }; -static void piix3_realize(PCIDevice *dev, Error **errp) +static void pci_piix3_realize(PCIDevice *dev, Error **errp) { PIIX3State *d = PIIX3_PCI_DEVICE(dev); @@ -317,7 +318,6 @@ static void pci_piix3_class_init(ObjectClass *klass, void *data) dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix3; dc->hotpluggable = false; - k->realize = piix3_realize; k->vendor_id = PCI_VENDOR_ID_INTEL; /* 82371SB PIIX3 PCI-to-ISA bridge (Step A1) */ k->device_id = PCI_DEVICE_ID_INTEL_82371SB_0; @@ -343,11 +343,28 @@ static const TypeInfo piix3_pci_type_info = { }, }; +static void piix3_realize(PCIDevice *dev, Error **errp) +{ + ERRP_GUARD(); + PIIX3State *piix3 = PIIX3_PCI_DEVICE(dev); + PCIBus *pci_bus = pci_get_bus(dev); + + pci_piix3_realize(dev, errp); + if (*errp) { + return; + } + + pci_bus_irqs(pci_bus, piix3_set_irq, pci_slot_get_pirq, + piix3, PIIX_NUM_PIRQS); + pci_bus_set_route_irq_fn(pci_bus, piix3_route_intx_pin_to_irq); +}; + static void piix3_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->config_write = piix3_write_config; + k->realize = piix3_realize; } static const TypeInfo piix3_info = { @@ -356,11 +373,33 @@ static const TypeInfo piix3_info = { .class_init = piix3_class_init, }; +static void piix3_xen_realize(PCIDevice *dev, Error **errp) +{ + ERRP_GUARD(); + PIIX3State *piix3 = PIIX3_PCI_DEVICE(dev); + PCIBus *pci_bus = pci_get_bus(dev); + + pci_piix3_realize(dev, errp); + if (*errp) { + return; + } + + /* + * Xen supports additional interrupt routes from the PCI devices to + * the IOAPIC: the four pins of each PCI device on the bus are also + * connected to the IOAPIC directly. + * These additional routes can be discovered through ACPI. + */ + pci_bus_irqs(pci_bus, xen_piix3_set_irq, xen_pci_slot_get_pirq, + piix3, XEN_PIIX_NUM_PIRQS); +}; + static void piix3_xen_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->config_write = piix3_write_config_xen; + k->realize = piix3_xen_realize; }; static const TypeInfo piix3_xen_info = { @@ -382,27 +421,11 @@ PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus) { PIIX3State *piix3; PCIDevice *pci_dev; + const char *type = xen_enabled() ? TYPE_PIIX3_XEN_DEVICE + : TYPE_PIIX3_DEVICE; - /* - * Xen supports additional interrupt routes from the PCI devices to - * the IOAPIC: the four pins of each PCI device on the bus are also - * connected to the IOAPIC directly. - * These additional routes can be discovered through ACPI. - */ - if (xen_enabled()) { - pci_dev = pci_create_simple_multifunction(pci_bus, -1, true, - TYPE_PIIX3_XEN_DEVICE); - piix3 = PIIX3_PCI_DEVICE(pci_dev); - pci_bus_irqs(pci_bus, xen_piix3_set_irq, xen_pci_slot_get_pirq, - piix3, XEN_PIIX_NUM_PIRQS); - } else { - pci_dev = pci_create_simple_multifunction(pci_bus, -1, true, - TYPE_PIIX3_DEVICE); - piix3 = PIIX3_PCI_DEVICE(pci_dev); - pci_bus_irqs(pci_bus, piix3_set_irq, pci_slot_get_pirq, - piix3, PIIX_NUM_PIRQS); - pci_bus_set_route_irq_fn(pci_bus, piix3_route_intx_pin_to_irq); - } + pci_dev = pci_create_simple_multifunction(pci_bus, -1, true, type); + piix3 = PIIX3_PCI_DEVICE(pci_dev); *isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); return piix3; From patchwork Sat Jun 11 10:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F066C433EF for ; Sat, 11 Jun 2022 11:20:08 +0000 (UTC) Received: from localhost ([::1]:44418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzz9z-0007k7-HJ for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:20:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTj-0006D1-RH for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:28 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:41690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTh-0006ly-B0 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:27 -0400 Received: by mail-wr1-x430.google.com with SMTP id k19so1476861wrd.8 for ; Sat, 11 Jun 2022 03:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A68VoJ55WOUXt22OCWQHRJUnoqCMFbKcKuWRHTsAr+4=; b=gNPQjGwUGf29gU4LjkG124l0L3L61MQr0F6Aa7oFolUT6JpF5PEyK7DmN5K+K6xdV6 H7Pd7tKV9m/EOCfOCA/UfYABkfFoQpQC3YN/HForhjZJ4H6h6PIvaD6U/sUD4ZWuhZSK W/of1DZbgB62ONNBQo1cjlo+YBJ+v99+8T8nm5yOymOeyf0CWSk2cijN73cOIRH/oCBp PC48mPjsTppeBqNU2xpKJSKdAWHM32EgB89KvohZYHNG+hcg9ovP8hWINfmExSr6Fl8u 85vH0yzf0P1VeVCul0Qb67o6XlcYJE92Q96kbwwwWw4SejcPwL3rDWvCLbigmcvxlSio Zq/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A68VoJ55WOUXt22OCWQHRJUnoqCMFbKcKuWRHTsAr+4=; b=waqGEmbst5UUi360DXW0lJ7G8tuJdyJR01AX3X1qjNzXHnIvqs6hrmGkIVE9TYZhGK HrA3ArPFDn27Rpp3lzRIodC/x2hfYc5Lq4VTukpoaoHhYVCLKJ6vn9TDwPnbC14r/uOf mkuS/8XoAt19DXTpDJ2wx3VXJgh9JseUwJCJjOjg7ll1LLCyiUaPiz1RP21XwpVrQp88 e92mo0786C2LErLhg29uJ3+EmZ8ueeeaXNmA55PQ9fq7eb0+z1KHkQO9/liPaOlA79dR MJarH9y0wSX5pWaCTm5xjJx3ixg16wiU0VK9Pi15hUdKFXaZTxQw3uB2doYm8JAZQQU/ 4SnA== X-Gm-Message-State: AOAM531KuZYkco5okeTye0cc1w4oeNxsSOx0gAaX8OlvoOdFPmpTPkOY pXbXyCT6drM/pcqe30mqLfWUQhu2rks= X-Google-Smtp-Source: ABdhPJw7K2rxL/KQtW5/q6UszimgZCWRcXPDTL2XPDfZA9KKArvBhv0LXVR/fD8DPxu4GLdJf8cDbA== X-Received: by 2002:a5d:6daf:0:b0:218:4f53:5810 with SMTP id u15-20020a5d6daf000000b002184f535810mr23502878wrs.43.1654943779747; Sat, 11 Jun 2022 03:36:19 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id r20-20020a05600c35d400b0039c1396b495sm2035035wmq.9.2022.06.11.03.36.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 36/49] hw/isa/piix3: Factor out ISABus retrieval from piix3_create() Date: Sat, 11 Jun 2022 12:32:59 +0200 Message-Id: <20220611103312.67773-37-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Modernizes the code. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-11-shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 3 ++- hw/isa/piix3.c | 3 +-- include/hw/southbridge/piix.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7d5546600b..70c337c44b 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -207,9 +207,10 @@ static void pc_init1(MachineState *machine, pci_memory, ram_memory); pcms->bus = pci_bus; - piix3 = piix3_create(pci_bus, &isa_bus); + piix3 = piix3_create(pci_bus); piix3->pic = x86ms->gsi; piix3_devfn = piix3->dev.devfn; + isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); } else { pci_bus = NULL; i440fx_state = NULL; diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 89064eb837..d57a7fe6d6 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -417,7 +417,7 @@ static void piix3_register_types(void) type_init(piix3_register_types) -PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus) +PIIX3State *piix3_create(PCIBus *pci_bus) { PIIX3State *piix3; PCIDevice *pci_dev; @@ -426,7 +426,6 @@ PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus) pci_dev = pci_create_simple_multifunction(pci_bus, -1, true, type); piix3 = PIIX3_PCI_DEVICE(pci_dev); - *isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); return piix3; } diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 9a2dd93c2d..f805fb8683 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -68,6 +68,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, #define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" #define TYPE_PIIX4_PCI_DEVICE "piix4-isa" -PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); +PIIX3State *piix3_create(PCIBus *pci_bus); #endif From patchwork Sat Jun 11 10:33:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878483 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3FB3C433EF for ; Sat, 11 Jun 2022 11:31:22 +0000 (UTC) Received: from localhost ([::1]:47214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzKs-0004Mx-1y for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:31:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTk-0006DU-Q1 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:29 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:51128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTj-0006m9-1U for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:28 -0400 Received: by mail-wm1-x332.google.com with SMTP id e5so644128wma.0 for ; Sat, 11 Jun 2022 03:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OFhGkxlpRDZVPZOcBcovih+c/cb+eSa7SfXQerC0nSE=; b=aluCOOmWl557lOq1G5jNvnXZxTPero1MrJWT5ZolSANgIg/33TBTbVMHtHvV+pePe8 Xc3tjE5a/DW85Bg8Mm0HVEDSL0sy0BS1R6i8Bco7MTeJwXgTbJzbolFLVbZx2ZPuMuT8 mWSKJW9ntoDq1LMboxc9gIid8/QjInM7aGAZMNKAACWe44V9n1lEltbxiikSBDBtQVQ4 rs5tJqDVKBqOLHDlLg3uTPk3GWHBbexc2LiAxBpJdM0C7PCaVnvbckVWcIkTwJIfrLNd VngmRWd2WCOHlNVs3rAwX2m6EjEyDKjrEbkhaGEwPggx7RNXXsYN/dgqFW7GcTBMjR4K Az9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OFhGkxlpRDZVPZOcBcovih+c/cb+eSa7SfXQerC0nSE=; b=H387QcuYFcXlXIky953+KnO1XYH8FLjXr3X/bxXqMq/jf1rZfjMONPTg4NcuARm+vQ j6AamMHrNkHtFlxYGWEJloJdqkcaWPmbAHyp2O8tO5EC7G9H0FvMEV3TSpDu+OVzeUne W4gKdZ3Vfu80OKe+FqQ9KW9qIBUstCGWhySMNsC0RnQO/Bj/6EnE/FG122b2FkxJ20Q9 n+gVdXjLZvdLk2aJMjgxkCKJib8TUoDqLUzQmftazIRhmHc96AgXDWtQRP+PMrW1vge5 x7TDeeGRZi1jucZ+eufSUnfCUuVccGkY41VRajHoSv63Tcwv58TyInOM6PW+Ii8lyzFb fQhA== X-Gm-Message-State: AOAM532+gtFTIgr4S7VDFxblRL2OUdwZNFJdrXF4IiQnH9AWm8A0rBhu lYf71CqjsDUSMWaIzPR7eQadJSbSfC0= X-Google-Smtp-Source: ABdhPJyE237ArsyrgFF1HhDtuKTWkEMt1tLnAP9Yt0mq2SO8HQc4sWikurt5EKkHIFy7Blg/cu5SHQ== X-Received: by 2002:a05:600c:5011:b0:397:6e41:f6ec with SMTP id n17-20020a05600c501100b003976e41f6ecmr4312933wmr.190.1654943784888; Sat, 11 Jun 2022 03:36:24 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id u2-20020a056000038200b0020ff3a2a925sm2552912wrf.63.2022.06.11.03.36.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 37/49] hw/isa/piix3: Inline and remove piix3_create() Date: Sat, 11 Jun 2022 12:33:00 +0200 Message-Id: <20220611103312.67773-38-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow During the previous changesets piix3_create() became a trivial wrapper around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20220603185045.143789-12-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 6 +++++- hw/isa/piix3.c | 13 ------------- include/hw/southbridge/piix.h | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 70c337c44b..0fc2361ffe 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -197,6 +197,9 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PIIX3State *piix3; + PCIDevice *pci_dev; + const char *type = xen_enabled() ? TYPE_PIIX3_XEN_DEVICE + : TYPE_PIIX3_DEVICE; pci_bus = i440fx_init(host_type, pci_type, @@ -207,7 +210,8 @@ static void pc_init1(MachineState *machine, pci_memory, ram_memory); pcms->bus = pci_bus; - piix3 = piix3_create(pci_bus); + pci_dev = pci_create_simple_multifunction(pci_bus, -1, true, type); + piix3 = PIIX3_PCI_DEVICE(pci_dev); piix3->pic = x86ms->gsi; piix3_devfn = piix3->dev.devfn; isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index d57a7fe6d6..6388558f92 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -416,16 +416,3 @@ static void piix3_register_types(void) } type_init(piix3_register_types) - -PIIX3State *piix3_create(PCIBus *pci_bus) -{ - PIIX3State *piix3; - PCIDevice *pci_dev; - const char *type = xen_enabled() ? TYPE_PIIX3_XEN_DEVICE - : TYPE_PIIX3_DEVICE; - - pci_dev = pci_create_simple_multifunction(pci_bus, -1, true, type); - piix3 = PIIX3_PCI_DEVICE(pci_dev); - - return piix3; -} diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index f805fb8683..2693778b23 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -68,6 +68,4 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, #define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" #define TYPE_PIIX4_PCI_DEVICE "piix4-isa" -PIIX3State *piix3_create(PCIBus *pci_bus); - #endif From patchwork Sat Jun 11 10:33:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878485 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0BDDC433EF for ; Sat, 11 Jun 2022 11:33:55 +0000 (UTC) Received: from localhost ([::1]:55468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzNK-0001dy-Qz for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:33:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTp-0006Mf-7W for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:33 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:36595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTn-0006mS-IY for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:32 -0400 Received: by mail-wr1-x42b.google.com with SMTP id o8so1500251wro.3 for ; Sat, 11 Jun 2022 03:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/3Frjb+iZeP6AJlq/dppPnZOms0aAvuMgoxoQExC85M=; b=m20ruo3F2IOOtkLNtyz9Z65BKHbfypTAAB5jSV/Tk36pPgmnnft9FWrXhMKv4Ut2OF bYocOO5ZLGhdqa6ZzZ9KS1nP6Ojis5/nRCHEpoQzj7OakVVYmo6cY/33CA114C1o0aNS RD+BTPVnEdxdzYF14M0GNrAZ4TKxB5y9Bj2h71Y6WVLR1/q5sLdilBmbMr8D/Lf1XrkM XVIHwppynmaQ8DIRoPQ3AG0wJMrlnmU8W+jnWU0aEkT18GYdZdVXC4KQNiEWAQXcveKz /piPbPk27/sFArUTkdwqQQ3NBj6IIY6wGioMlXr+X1S4bM6p9Qz0WezfP85OerPcfL+g Pyuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/3Frjb+iZeP6AJlq/dppPnZOms0aAvuMgoxoQExC85M=; b=waQiuEejarP5918IoBRKJN39YUM6Zf5fEwwdPTvy/knv1SJ4Q5bBRzOR8AGQEdkdGV rhdk3o6jL89FPFgvLI+EhX8OgICR6QEwhoPXJcIKpfqaqwXfcIQ9dPwdOo/C/AU9rTBF wOOCEewSRFjTrN8nqdvk0QYLdbUbtEwS/rvrjY1/6PCUfZr7vXASP93ni0dmysj3iEfg 7lZLCXm6AQoJ3uT9xrKfFKtqnYYlHIIS4YVjwWDCrK2fT9qCBsSt/WSQtO/rMCRE2c+D mWyUAwm6EH3cqcJ4hjAvmKx8zZnzJgyYwzg5TNPgyoKvsssWz5nRgfji/QsvOfCVmsZR lkZQ== X-Gm-Message-State: AOAM530Ptq13A+MTGN62V7X/+tUYfZoQJTOI2olhC7LsCPzQBEQDz/Ed rKJG9tW5XMFeOehJJN9UF5w4zmwQDyY= X-Google-Smtp-Source: ABdhPJziEwbUPWcllCFs2ULPxl0lF+oOE3dh+XRW/+ZqmBRZYke4n1JDFnSzKL8J3aHqB/q4+K3jQQ== X-Received: by 2002:a5d:5002:0:b0:212:dab6:fce9 with SMTP id e2-20020a5d5002000000b00212dab6fce9mr47145494wrt.63.1654943790030; Sat, 11 Jun 2022 03:36:30 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id d9-20020a5d6449000000b002101ed6e70fsm2194403wrw.37.2022.06.11.03.36.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 38/49] hw/i386/microvm-dt: Force explicit failure if retrieving QOM property fails Date: Sat, 11 Jun 2022 12:33:01 +0200 Message-Id: <20220611103312.67773-39-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow New code will be added where this is best practice. So update existing code as well. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220529184006.10712-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/microvm-dt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/microvm-dt.c b/hw/i386/microvm-dt.c index 9c3c4995b4..fde74819f2 100644 --- a/hw/i386/microvm-dt.c +++ b/hw/i386/microvm-dt.c @@ -32,6 +32,7 @@ */ #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qapi/error.h" #include "sysemu/device_tree.h" #include "hw/char/serial.h" #include "hw/i386/fw_cfg.h" @@ -187,8 +188,8 @@ static void dt_add_ioapic(MicrovmMachineState *mms, SysBusDevice *dev) static void dt_add_isa_serial(MicrovmMachineState *mms, ISADevice *dev) { const char compat[] = "ns16550"; - uint32_t irq = object_property_get_int(OBJECT(dev), "irq", NULL); - hwaddr base = object_property_get_int(OBJECT(dev), "iobase", NULL); + uint32_t irq = object_property_get_int(OBJECT(dev), "irq", &error_fatal); + hwaddr base = object_property_get_int(OBJECT(dev), "iobase", &error_fatal); hwaddr size = 8; char *nodename; From patchwork Sat Jun 11 10:33:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 880E4C43334 for ; Sat, 11 Jun 2022 11:24:16 +0000 (UTC) Received: from localhost ([::1]:55356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzDz-0006rp-I1 for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:24:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTu-0006aS-H1 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:38 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTt-0006mv-1t for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:38 -0400 Received: by mail-wr1-x42a.google.com with SMTP id u8so1451452wrm.13 for ; Sat, 11 Jun 2022 03:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I09RuRBTDHhSRzTYr/o2mwFl0EFDkRli978RWl4TvaA=; b=Nq6N6vpRAVPVm8Qd1tbLvs5S2Vrng6NzxTnTm2CcpDoIz0SZD2cPpgw1o5jUrk9LJp FGW0SCWc1yVRAtflWhhsPopxNXBW0M66+x2LDXj3TXo6LWdJU7gLaF3lmk5SKVoqviWP VBkTND6orRGVjSs3x6/0XOKE7pAf7uig4tbvgFGNnsjZsIwvW4t5TRZagWY1YtQQBlpi coVzRh1Tiek5FsPwSPGfiFOwN99IkC/nKvn8Zb+Mcjo6GqEhEn8NLZoL33EjUHibLj7f L4chQUY0J/hZInFFaItIsro9uEcXY8eIXOeOaAM1ETSdBL5INkUIAHP0ueDWVL81t1V9 UjyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I09RuRBTDHhSRzTYr/o2mwFl0EFDkRli978RWl4TvaA=; b=WGVUxGIuyleviiWdF9tkyh8wlPb8y00dpSAUxPEQ3KOjifmZh2YCvufrWbVLYEfkAs Ft9nDPRZ52CVgnNlrDOO3kavoohZQaR3vEXqcpWbbzE331Q+wsxwDZZUiCJLN5CwFvoC pUfX6JW2x76Wd03WDKRaJ6/UWrm+l2O547obfTNfu2rz2WxhhJ3nEiMGXIzraIU7wdal LuwKIfREU3Na7CwjduZz6Ult9YmWB0wz3wex694zUdwSXmhCpc+1oJAQdi/LN5VAmcKf 5ZsToiGfxa/5XvraCAzucZKwpk+7mFhn+T8/z4TYxg9b8MfQc0yc2oYgbjPp2z7u1wgC rI7g== X-Gm-Message-State: AOAM532y0cOD12wmA9Losv6UlnqL7DTGbAjR0Lt+qRUr2EC1RbwYe+Sp XA9VeTlECRy84DwTOXASOe0I5pefrcw= X-Google-Smtp-Source: ABdhPJyou6QWsZdnWY1Zfkg5K1nfaFZT/jMWntl1y+vP2EODf9j5y1IbMcqV/ZHr9ATGGe1JcBKszg== X-Received: by 2002:a05:6000:156f:b0:218:4328:b4e0 with SMTP id 15-20020a056000156f00b002184328b4e0mr29200672wrz.526.1654943795230; Sat, 11 Jun 2022 03:36:35 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id f4-20020a056000128400b002184280b3cbsm2132288wrx.91.2022.06.11.03.36.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 39/49] hw/i386/microvm-dt: Determine mc146818rtc's IRQ number from QOM property Date: Sat, 11 Jun 2022 12:33:02 +0200 Message-Id: <20220611103312.67773-40-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Since commit 3b004a16540aa41f2aa6a1ceb0bf306716766914 'hw/rtc/ mc146818rtc: QOM'ify IRQ number' mc146818rtc's IRQ number is configurable. Fix microvm-dt to respect its value. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220529184006.10712-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/microvm-dt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/microvm-dt.c b/hw/i386/microvm-dt.c index fde74819f2..287818c641 100644 --- a/hw/i386/microvm-dt.c +++ b/hw/i386/microvm-dt.c @@ -209,7 +209,7 @@ static void dt_add_isa_serial(MicrovmMachineState *mms, ISADevice *dev) static void dt_add_isa_rtc(MicrovmMachineState *mms, ISADevice *dev) { const char compat[] = "motorola,mc146818"; - uint32_t irq = RTC_ISA_IRQ; + uint32_t irq = object_property_get_uint(OBJECT(dev), "irq", &error_fatal); hwaddr base = RTC_ISA_BASE; hwaddr size = 8; char *nodename; From patchwork Sat Jun 11 10:33:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878482 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C261C433EF for ; Sat, 11 Jun 2022 11:30:29 +0000 (UTC) Received: from localhost ([::1]:44550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzK0-0002Sn-Kz for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:30:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyTz-0006po-Ej for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:43 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:36107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyTx-0006nd-PU for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:43 -0400 Received: by mail-wm1-x32c.google.com with SMTP id r187-20020a1c44c4000000b0039c76434147so2247664wma.1 for ; Sat, 11 Jun 2022 03:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7rOgS1ICNRh/fyv1JCms3RmrzJ1lVycCbSy1dn78KVc=; b=BSH0pT1Mux87MV7rzuzUWfAdLXGCEDpcgNmqVCOGkIqu+caeZAT/Z0XGNDFVL9f9yD wIYVi5/rkzzPXp98QPMSaqiFcmoBvd/dn8iIbYw/+rDfyDwtolo+C2tq5JLkDrqbKn/L zrZE3G2UDjAWwf4uDegU54aWkxY8aEQ4t8gfyTsLIt5ZjJFRbQ0nfAf0pwxIdU6wy/Dk Ff69MMAf9uLxjbps9zUAaRhYj9fQSbPt1G6rQloINULc9UOAybl6nZ0diIkGgeFEddNJ TdSExgfycrJulfc3IDMuNQimpqIhOi85fkyISL7XyXtiKX0XeMuWaCaabrtxFdcouuuX fwkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7rOgS1ICNRh/fyv1JCms3RmrzJ1lVycCbSy1dn78KVc=; b=glvdqGFZuYP50pHWHrxFAiYOLdqesVNf1ZyJrdREwvz8lTaUC2Ujcl6GWQNH6mfObr du9fX/ydoHvmQNnDa0TlXkTOO9ilY9LtrIAllabs8f+T0JthT+ygUqRtHSBpMR9ws1IA cM+Bu4TjrPh2JIR/eLSR/kIkVxxZM7IwCZyNlQg05tKFa5xyVn0CipZNAQRTMgmGL6BN Ksbi0iDYKvzu2v3Zz2NEcvoVdNjD1EF1VvKi4mkkVSFPLYfL3mChidIkTBy4lLyx3dzk bnh2YWvvoeJMwvMxqf4r14zjCDqbYGmlZaagimRCJRlHC8L5Clua8wUaw+5YxfpeNa0k 7I/A== X-Gm-Message-State: AOAM531mi5Dd2HXhOK4lzSvRnMiLlOLssmdGriTGa5hhBtSqPO4ry0eU uNH9JoQk9R9HuLpZOHE4NA6oPM58p/8= X-Google-Smtp-Source: ABdhPJxQWrtZdrCdZamHsCPuvDNeSo6xS/aVyxQyNbhNU3t6pvJDI1hGNLmTHAQKT9FVf+1HgSAT7w== X-Received: by 2002:a05:600c:214c:b0:39c:43b9:9d5f with SMTP id v12-20020a05600c214c00b0039c43b99d5fmr4161506wml.56.1654943800294; Sat, 11 Jun 2022 03:36:40 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id h12-20020a05600c2cac00b003942a244f40sm6545987wmc.25.2022.06.11.03.36.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 40/49] hw/rtc/mc146818rtc: QOM'ify io_base offset Date: Sat, 11 Jun 2022 12:33:03 +0200 Message-Id: <20220611103312.67773-41-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Exposing the io_base offset as a QOM property not only allows it to be configurable but also to be displayed in HMP: Before: (qemu) info qtree ... dev: mc146818rtc, id "" gpio-out "" 1 base_year = 0 (0x0) irq = 8 (0x8) lost_tick_policy = "discard" After: dev: mc146818rtc, id "" gpio-out "" 1 base_year = 0 (0x0) iobase = 112 (0x70) irq = 8 (0x8) lost_tick_policy = "discard" Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220529184006.10712-4-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/microvm-dt.c | 2 +- hw/rtc/mc146818rtc.c | 9 ++++++--- include/hw/rtc/mc146818rtc.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/i386/microvm-dt.c b/hw/i386/microvm-dt.c index 287818c641..b3049e4f9f 100644 --- a/hw/i386/microvm-dt.c +++ b/hw/i386/microvm-dt.c @@ -210,7 +210,7 @@ static void dt_add_isa_rtc(MicrovmMachineState *mms, ISADevice *dev) { const char compat[] = "motorola,mc146818"; uint32_t irq = object_property_get_uint(OBJECT(dev), "irq", &error_fatal); - hwaddr base = RTC_ISA_BASE; + hwaddr base = object_property_get_uint(OBJECT(dev), "iobase", &error_fatal); hwaddr size = 8; char *nodename; diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ef9765bb8f..1ebb412479 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -74,6 +74,8 @@ #define RTC_CLOCK_RATE 32768 #define UIP_HOLD_LENGTH (8 * NANOSECONDS_PER_SECOND / 32768) +#define RTC_ISA_BASE 0x70 + static void rtc_set_time(RTCState *s); static void rtc_update_time(RTCState *s); static void rtc_set_cmos(RTCState *s, const struct tm *tm); @@ -941,7 +943,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) qemu_register_suspend_notifier(&s->suspend_notifier); memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2); - isa_register_ioport(isadev, &s->io, RTC_ISA_BASE); + isa_register_ioport(isadev, &s->io, s->io_base); /* register rtc 0x70 port for coalesced_pio */ memory_region_set_flush_coalesced(&s->io); @@ -950,7 +952,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) memory_region_add_subregion(&s->io, 0, &s->coalesced_io); memory_region_add_coalescing(&s->coalesced_io, 0, 1); - qdev_set_legacy_instance_id(dev, RTC_ISA_BASE, 3); + qdev_set_legacy_instance_id(dev, s->io_base, 3); object_property_add_tm(OBJECT(s), "date", rtc_get_date); @@ -983,6 +985,7 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) static Property mc146818rtc_properties[] = { DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980), + DEFINE_PROP_UINT16("iobase", RTCState, io_base, RTC_ISA_BASE), DEFINE_PROP_UINT8("irq", RTCState, isairq, RTC_ISA_IRQ), DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState, lost_tick_policy, LOST_TICK_POLICY_DISCARD), @@ -1028,7 +1031,7 @@ static void rtc_build_aml(AcpiDevAmlIf *adev, Aml *scope) * does, even though qemu only responds to the first two ports. */ crs = aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, RTC_ISA_BASE, RTC_ISA_BASE, + aml_append(crs, aml_io(AML_DECODE16, s->io_base, s->io_base, 0x01, 0x08)); aml_append(crs, aml_irq_no_flags(s->isairq)); diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 33d85753c0..1db0fcee92 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -26,6 +26,7 @@ struct RTCState { uint8_t cmos_data[128]; uint8_t cmos_index; uint8_t isairq; + uint16_t io_base; int32_t base_year; uint64_t base_rtc; uint64_t last_update; @@ -49,7 +50,6 @@ struct RTCState { }; #define RTC_ISA_IRQ 8 -#define RTC_ISA_BASE 0x70 ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq); From patchwork Sat Jun 11 10:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878473 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E52BC433EF for ; Sat, 11 Jun 2022 11:22:41 +0000 (UTC) Received: from localhost ([::1]:52850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzCS-000546-Hf for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:22:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyU7-00071M-RZ for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:57 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:56206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyU3-0006nr-1H for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:48 -0400 Received: by mail-wm1-x32c.google.com with SMTP id a10so622428wmj.5 for ; Sat, 11 Jun 2022 03:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fAiFZXHCxyENLEE19lCloGRGCJjLEAvlArgNlYu5mHA=; b=Cy0bRX+8kGpocbyp1HXoLFcrLUfwDx2QyMXVRTCmyuyNYaJm4hXd2ebYNm3iJpCbeN kt6lHbo9G1LlIPygMRJM3c40eYkI0sr06Q7K+1UjCNeEcXE4KsKXHXPlYj53h7IhpYRR oHgGYKGkBZw6rz5cvTCDPvP+aWfzqEjwnmI0uk6maBxzsm2lP+SPKJCg0cqg3XzGex66 UoCKznWAJwJRzC/5kavtpgF0oqN9+8AJI3+qG2pdfNyuanQY39KH44CG4J2FUWPopL8q M3KnXSCESJ+77EPvyLHChB1yolnNMDDkWC33153fDJO+t6Wca1YGAYYpu8O3H2KpqcVW mJzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fAiFZXHCxyENLEE19lCloGRGCJjLEAvlArgNlYu5mHA=; b=KshLIJmDfKeC8krMc7otYH6fcW1zWXezqPvzQVcFNnhgwgq94PPFhTCyPMX184ogju kmUJV/Y9ceNJmW7uPTahJ7v/2Imyzvh7fB6FuLN1W/7bcPcG3duuTvEPcY0qJY3/PBew 5vRRQL+BOeJ2PJqTtlht6w9ibrktbliNqbeJsIi2g0/aLSMFHskTPulIsFf8kyjLYGWD Afi0pU6G6K4x7TCEi93qEu+QRpKcGBS2QSjbWvpVUWu0mEutaJQSMNJGvNNWMLPSrbHd sljKV4nFrh6Au0ZDMh8a3Jbn9/lJvGG+MQfZl0jI4GFcoUnCfO+BdcZc/OC8APBjbbNu RrYg== X-Gm-Message-State: AOAM530M2XPb2Pb18ydCuzB4d1Pw6Q5DsQLNtP0sumjLWsDt+vkG0bUH nfJJ4qF45Q8ab68rxMBY/XjMLFZ5rkI= X-Google-Smtp-Source: ABdhPJw4H58fKTU6gzkHaRm+/7173jDf0yF6wJ/yp5slcsJPgVizmrXkmYgr3fS7RlDZu9TfhpV8Pw== X-Received: by 2002:a05:600c:4e0c:b0:39c:519f:9f35 with SMTP id b12-20020a05600c4e0c00b0039c519f9f35mr4110436wmq.153.1654943805352; Sat, 11 Jun 2022 03:36:45 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m16-20020a05600c3b1000b0039c673952bfsm6202512wms.6.2022.06.11.03.36.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 41/49] hw: Reuse TYPE_I8042 define Date: Sat, 11 Jun 2022 12:33:04 +0200 Message-Id: <20220611103312.67773-42-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow TYPE_I8042 is exported, so reuse it for consistency. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 4 ++-- hw/sparc64/sun4u.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1b6067ff22..af9e5edb04 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1097,7 +1097,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, return; } - i8042 = isa_create_simple(isa_bus, "i8042"); + i8042 = isa_create_simple(isa_bus, TYPE_I8042); if (!no_vmport) { isa_create_simple(isa_bus, TYPE_VMPORT); vmmouse = isa_try_new("vmmouse"); @@ -1105,7 +1105,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, vmmouse = NULL; } if (vmmouse) { - object_property_set_link(OBJECT(vmmouse), "i8042", OBJECT(i8042), + object_property_set_link(OBJECT(vmmouse), TYPE_I8042, OBJECT(i8042), &error_abort); isa_realize_and_unref(vmmouse, isa_bus, &error_fatal); } diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index d1bc77d27e..0e27715ac4 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -334,7 +334,7 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp) parallel_hds_isa_init(s->isa_bus, MAX_PARALLEL_PORTS); /* Keyboard */ - isa_create_simple(s->isa_bus, "i8042"); + isa_create_simple(s->isa_bus, TYPE_I8042); /* Floppy */ for (i = 0; i < MAX_FD; i++) { From patchwork Sat Jun 11 10:33:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC2F3C43334 for ; Sat, 11 Jun 2022 11:37:19 +0000 (UTC) Received: from localhost ([::1]:35632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzQc-0007Pb-Uw for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:37:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUB-000723-BO for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:00 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:38523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyU8-0006p6-4u for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:53 -0400 Received: by mail-wr1-x42d.google.com with SMTP id v14so1491822wra.5 for ; Sat, 11 Jun 2022 03:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rBFs/23+voIyOyZJdZK9wiVFvT/WUORppjnpNo+75eQ=; b=B6tvqKLWw08+iiKlmhC5v2fBp/VbUbnJ3PTnr4tdtzs7LfrhTSF10pzz8oSYryKE0s cCdQeM+1myRzHg5KfSvuAY8g3NtsF3hBo9IESkEGGI21Rfirdn5TaVVsJccPF06eI1CV AMnvKJOslCPtKuUW4bVdnkaqVeifcuvFTW7PNLubv1krC4n0gYsjo0uLGdiBqKn8Q61Z WrwOJiQzIHTh4RRVBu5fVeFvcNVgKH6r96Y72+OnXWe831VbAjAiiIGQ30Dt55Mzdwtd 87nSdDVB3oYYThoXDFaFWCtrEpW64hF/plb/n5/7xveFxQUhVTv1OpyxBruFDqx6vH+q jvog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rBFs/23+voIyOyZJdZK9wiVFvT/WUORppjnpNo+75eQ=; b=TqQjjaboix8+OTkAm/LVEVNyKu7Y7qkPdUKgXoBm4XG4i6CeB/IiB6eDauL70VXCe/ TwqujwmNiPG+AadCkItYnVY28f1Y8Ul7F/0VAXRYiAYCfR6YBWGwhc9QSzGqvmK7LIbg 97Ny/atggqBGl64Iqcjz8BJjEe85HgUoa1x2Byfc9FeulV/hhvfyG2qN1GOGva83htsX LsXRiFd06/mDvfnunLzCC0Mamkt0KoiPakTqWCbAdClemJqHrNykUuraeiac6NYDYfGc QuSa2RI9x+GsdtvQx2d2gY3lqrwjf2/1/v121SmctXz39Dm8fBCxN1ubfIyjTaUIpYje EXqQ== X-Gm-Message-State: AOAM5309N70itd/nPoZO/hWLrhcznENxcdj9ZLWQtL+F9ciF3NE4NGx6 mON2Asmuzvw3FS7Spul56fDEDv/VcrA= X-Google-Smtp-Source: ABdhPJyD7F7XnpJ4dc7FMLf63ohFdTPHtMXPNxpDsgwOzbRCPpWo5UPPvgGwiGcWmEWyudNozwtAzg== X-Received: by 2002:adf:f60d:0:b0:210:2cce:1922 with SMTP id t13-20020adff60d000000b002102cce1922mr46560803wrp.616.1654943810575; Sat, 11 Jun 2022 03:36:50 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id m10-20020a5d56ca000000b0020c5253d8f7sm2154884wrw.67.2022.06.11.03.36.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 42/49] hw/audio/cs4231a: Const'ify global tables Date: Sat, 11 Jun 2022 12:33:05 +0200 Message-Id: <20220611103312.67773-43-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow The tables contain spcifically crafted constants for algorithms, so make them immutable. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/cs4231a.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 0723e39430..7f17a72a9c 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -84,7 +84,7 @@ struct CSState { int transferred; int aci_counter; SWVoiceOut *voice; - int16_t *tab; + const int16_t *tab; }; #define MODE2 (1 << 6) @@ -142,13 +142,13 @@ enum { Capture_Lower_Base_Count }; -static int freqs[2][8] = { +static const int freqs[2][8] = { { 8000, 16000, 27420, 32000, -1, -1, 48000, 9000 }, { 5510, 11025, 18900, 22050, 37800, 44100, 33075, 6620 } }; /* Tables courtesy http://hazelware.luggle.com/tutorials/mulawcompression.html */ -static int16_t MuLawDecompressTable[256] = +static const int16_t MuLawDecompressTable[256] = { -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956, -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764, @@ -184,7 +184,7 @@ static int16_t MuLawDecompressTable[256] = 56, 48, 40, 32, 24, 16, 8, 0 }; -static int16_t ALawDecompressTable[256] = +static const int16_t ALawDecompressTable[256] = { -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, From patchwork Sat Jun 11 10:33:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCB95C433EF for ; Sat, 11 Jun 2022 11:33:12 +0000 (UTC) Received: from localhost ([::1]:53118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzMc-0008Sh-Vc for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:33:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUE-00072J-Pf for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:03 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:34575) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUD-0006pS-9j for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:36:58 -0400 Received: by mail-wr1-x42c.google.com with SMTP id c21so1514293wrb.1 for ; Sat, 11 Jun 2022 03:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jy+8G+yK6GF20IWR2ufr/1kZUbW/onYslHSoLcVKEqw=; b=M0hR9SdHIlOfsIss52exNtNS3ilJle5rFi8b/JEtoi0UBy3dn1fpNvHPIllugElDEt OWgudrTf3j3xPqMaseziYn/ZvYRDhCinV65fdBLdJ0Z3uesaGq75Z+P+96TVUWvmA3WZ Zec3wodzlSUauc+IISgTBpRtkRf+tsd4HceizmmBzXswtBu+kAx/c9+T+o9YsQXMieLF DiiF44TkbdE+iKnikycC/KlqlSksEX5WoJJfLk+DVaPdEIQiQ0CH3IitslM6PqnrZHAY w4IFw9cu5QlLfl4n073nCe8lW3Cy1bXot+VwZJLG9WYMVqz2585UKO/ouE86yXb+TzTG Y47w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jy+8G+yK6GF20IWR2ufr/1kZUbW/onYslHSoLcVKEqw=; b=mjSy6zOGo1TihEozaV/i2qXH6y68JkHfFzuYCU+yAHiqOomeFflCkgd1/JBoqvMonB bg3gYeFSH+fH4Gg3iltu5naAgAQd9M+mjJesZl/LdYo4lb09g0bWT260LXDJ5sewMDMY usfaMpQeJyWgnxvr7aGH6ODaYDLkwqnfqexD7/V6ftg61hHPmgBS6glv/OubLZBTmEXh uHpHzkzaWgjXbn3ekLINA3sgBd5HXUDjmTXCEH4KNOcHlnS7yqA0/snKIliaKgmoOCVM eB8VjPHpFTpXwA3asijb0/fOdQRJQhBMN2zBCYPX4qmWNTwEwYvVBmJHE1cUIZZ1ABVh dbfQ== X-Gm-Message-State: AOAM530XoW5l0XC0MKfkSF8zIhG0iO/AjbTGjoJTHej1WNXjYibuf4ys ZuxwF3/4kf69/NzMJgJqmdhIkDGjDqg= X-Google-Smtp-Source: ABdhPJz2Y5HxCroS/IcQjFZ3WVyF4TmEBa6TlmGiNYDbLhSdpjwl4Jxz8/CPDXpuMK6R+Sjvitr8WA== X-Received: by 2002:adf:f80b:0:b0:217:88ff:eb6f with SMTP id s11-20020adff80b000000b0021788ffeb6fmr33251817wrp.489.1654943815654; Sat, 11 Jun 2022 03:36:55 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id h7-20020a05600016c700b0020c7ec0fdf4sm2440540wrf.117.2022.06.11.03.36.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:36:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , "Michael S . Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 43/49] hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro Date: Sat, 11 Jun 2022 12:33:06 +0200 Message-Id: <20220611103312.67773-44-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow The macro seems to be used only internally, so remove it. Signed-off-by: Bernhard Beschow Acked-by: Michael S. Tsirkin Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-4-shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 9 +++++++++ include/hw/i386/pc.h | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index af9e5edb04..272d7227d5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -98,6 +98,15 @@ #include "trace.h" #include CONFIG_DEVICES +/* + * Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +#define PC_CPU_MODEL_IDS(v) \ + { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ + { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ + { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, + GlobalProperty pc_compat_7_0[] = {}; const size_t pc_compat_7_0_len = G_N_ELEMENTS(pc_compat_7_0); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 003a86b721..b58ac343ba 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -288,14 +288,6 @@ extern const size_t pc_compat_1_5_len; extern GlobalProperty pc_compat_1_4[]; extern const size_t pc_compat_1_4_len; -/* Helper for setting model-id for CPU models that changed model-id - * depending on QEMU versions up to QEMU 2.4. - */ -#define PC_CPU_MODEL_IDS(v) \ - { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ - { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ - { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, - #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \ From patchwork Sat Jun 11 10:33:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A81A8C43334 for ; Sat, 11 Jun 2022 11:40:28 +0000 (UTC) Received: from localhost ([::1]:41252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzTf-0002ok-KI for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:40:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUJ-00072Y-9Q for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:05 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:36595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUH-0006mS-LR for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:02 -0400 Received: by mail-wr1-x42b.google.com with SMTP id o8so1500251wro.3 for ; Sat, 11 Jun 2022 03:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O2KNO1eSWOQ3ti2siYU51lQWfPlOGu3eyr5kiTAWNd8=; b=eDZFk8rGUV/bAEmIueW8/1nk6TrLKB9NEQuBIelXCq58qYMyE2xQHXmHJnBPLPmGAU ol1ZGTv61FjZUaOXb0/yXe6SLUBjHB/pkfsvQ+LvuVNl0I89UguSAE7lqKNed9gXdYIj mzP23Y3T2lF0t+yUlvAzkaLz/R1NsKJ22tOpSIv2PT6rJdEQHDzUOeMnLZnSERcRfJ74 QTR70oivoAv1Sm1/eWX9y6skpV0gZ+zpMXfUcwb44ulzBh8SuKSsSVFq3hOIgU6OkSby bEJha2qz/YFbHOX03vDsoiPk04vamJnC80ZnW0TZ8MxvFJ4qNWAjh8UTgcl8nncFzT5t 4qPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O2KNO1eSWOQ3ti2siYU51lQWfPlOGu3eyr5kiTAWNd8=; b=KB0L30x+fn2ljLFLZXZ3zKAksnadKrQyBljv6IF9ttp6u8K1WxvWR0R1739W+KKrkm BU0gCQtfr13kFAIyrKTyHIoS/VLmzt6g0UgD6adN8rPb8uYc290Hrf2MuNFeos7yKI4Z yrV+oEFJLeM3VzgM6yyDoK84noP8Vvz6kmbwQy6Ek9Iz2MRz8eWwn9bmmifnpMUffmk3 l+CuDeqLqbSkq0WeimPjGNx6EsYJxUfLnmq53r0h9B3zn9K8V0KpAtW2qSahkBSXAR50 CGLZp6PQqEchJDqKY6yB67c6/n35zpMD9Cwg+muD5I4gJmooCedgilfadNg82pBtvvRy 4jlA== X-Gm-Message-State: AOAM531BBZnvuoUmz5qDEKMLU0PT5DrJosTxmmJ+Tdmhg+dSd6ra5sBR SBxbPlwSKqKoXGJe+din15imyzOAOU0= X-Google-Smtp-Source: ABdhPJytk5jNARQuF9bTC8ka6+zWB5Gc4vmsatroajoKFBgsXdamawkO7QwLnidxuD93hTZiD3z6+w== X-Received: by 2002:a05:6000:1446:b0:218:5a5d:6cb5 with SMTP id v6-20020a056000144600b002185a5d6cb5mr19592132wrx.629.1654943820755; Sat, 11 Jun 2022 03:37:00 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id x5-20020a5d54c5000000b002167efdd549sm2230564wrv.38.2022.06.11.03.36.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:37:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" Subject: [PULL 44/49] hw/i386/pc: Unexport functions used only internally Date: Sat, 11 Jun 2022 12:33:07 +0200 Message-Id: <20220611103312.67773-45-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 4 ++-- include/hw/i386/pc.h | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 272d7227d5..774cb2bf07 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -572,7 +572,7 @@ static const char * const fdc_container_path[] = { * Locate the FDC at IO address 0x3f0, in order to configure the CMOS registers * and ACPI objects. */ -ISADevice *pc_find_fdc0(void) +static ISADevice *pc_find_fdc0(void) { int i; Object *container; @@ -716,7 +716,7 @@ static const int ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360, 0x280, 0x380 }; static const int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 }; -void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd) +static void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd) { static int nb_ne2k = 0; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index b58ac343ba..eb3d093bca 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -167,7 +167,6 @@ void pc_basic_device_init(struct PCMachineState *pcms, ISADevice **rtc_state, bool create_fdctrl, uint32_t hpet_irqs); -void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd); void pc_cmos_init(PCMachineState *pcms, BusState *ide0, BusState *ide1, ISADevice *s); @@ -178,8 +177,6 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg); void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); -ISADevice *pc_find_fdc0(void); - /* port92.c */ #define PORT92_A20_LINE "a20" From patchwork Sat Jun 11 10:33:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44DB0C433EF for ; Sat, 11 Jun 2022 11:27:29 +0000 (UTC) Received: from localhost ([::1]:35552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzH6-0004Nd-Cw for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:27:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUP-00074A-W2 for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:10 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUO-0006pz-AL for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:09 -0400 Received: by mail-wr1-x42f.google.com with SMTP id m24so1469462wrb.10 for ; Sat, 11 Jun 2022 03:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w8vNfNLLIee2MaL+ks67DcO/J88IIdeho9H0Sq2FOVQ=; b=k9JR3N09pXjje+ggVtGLpmP3uZnOBr3P+ECZ0zN23czR0OzoFJmnc0D4LRQZQUTOsq sNE3JM91uZbHHmkB81+AHnPaSVWqmFRdE/Kp4TkwZxbf7e4WNBCWsXccFSgVp7GggUFb iK16OGDHci0xriYpwbnkCx5aby+d7xdBsBt0s/0PcgqZHo87MAEYsakDj6gM6QEfFRWU QLFaYbrp2avhLcNNr9O/I/BOp6UJsIZo8FwYEIaq+mfyXyeIPC4tLbyxisP3wsaU4yPQ PwKC8e2SRsStojvBx7kbdKaJYPtwpxFk7kXMvJmUr6YMMhWgBoipGaSc/i4e+6QAi0W3 aVQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w8vNfNLLIee2MaL+ks67DcO/J88IIdeho9H0Sq2FOVQ=; b=dV+b+8ch8h35aKlnUnLjI1GmBZpuMOvUc8LzGVsseIAb5s105ewcpz85zy09s5Lr7I oPpwG7b3ty9gmFRp/h+ezKON4S7v5ksRvxeaTDethTqWmDIMKilohx+3zUyEg8Jm74va uy3GiI2t9g1GjCrEwHZOSU7oaHLuoHerzIH3hdCz6TYds7zywH/XWHOFX5TrcnaQvJWy 2FnHNFT59eoQYGR3yPR8YipUgznAkOfPGm1gK4YcxgA4hddFf/WPLIs93JIdK4ayRVjT zvhjUhzOlel+TeKcQCaAl+I7eMN0rK+Y+h90FX8zxl4OFcP4uGN0nT+R3PuXBX8nYcXr TngA== X-Gm-Message-State: AOAM533qLQnxjFUWbR4jyq8qmBVHkhvEJCcNmhb2+5GaFZF9eulRqS7r aOqEdxNwJcmeXZFH3oWvnRsIwYU5X7o= X-Google-Smtp-Source: ABdhPJy5LhaCW1s47OpHFPRLdCNxjXwFhBzmFWiZt1JlpIbPCoqMRo86YJPhoLcf4AAlw9MNT1TD6A== X-Received: by 2002:a05:6000:1f18:b0:20f:e61b:520e with SMTP id bv24-20020a0560001f1800b0020fe61b520emr48241497wrb.214.1654943825809; Sat, 11 Jun 2022 03:37:05 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id n10-20020a056000170a00b00219fb3a275csm364003wrc.16.2022.06.11.03.37.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:37:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , "Michael S . Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 45/49] hw/i386/pc: Remove orphan declarations Date: Sat, 11 Jun 2022 12:33:08 +0200 Message-Id: <20220611103312.67773-46-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Signed-off-by: Bernhard Beschow Acked-by: Michael S. Tsirkin Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index eb3d093bca..b7735dccfc 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -171,9 +171,6 @@ void pc_cmos_init(PCMachineState *pcms, BusState *ide0, BusState *ide1, ISADevice *s); void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); -void pc_pci_device_init(PCIBus *pci_bus); - -typedef void (*cpu_set_smm_t)(int smm, void *arg); void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); From patchwork Sat Jun 11 10:33:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51E07C43334 for ; Sat, 11 Jun 2022 11:29:58 +0000 (UTC) Received: from localhost ([::1]:43914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzJU-0001xq-CD for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUU-000751-Ie for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:15 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:46620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUS-0006qh-KY for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:13 -0400 Received: by mail-wm1-x32a.google.com with SMTP id r123-20020a1c2b81000000b0039c1439c33cso761069wmr.5 for ; Sat, 11 Jun 2022 03:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qbLPFFc7MFaTFJDTC3pMiLQiCLIDD7h/iPBGWVlSuoQ=; b=Wsk4vCSWymWQqBPPa/nMK3IZ8zxDFtfSWqD8eswkcxatb27gttgxj3ZSbO4GceEKFX z0JSZ1S59mBdIaz0PEPlui7HpSqbekMPKTx1CYkFaN6GSyLtvEQQAdFH26C6DV9Vo4d8 /jhIYIAYXpsjiaAOmB9NetJKLPIJry+w/BIT15/gsfK4gEyoSUqU9l1Ss54fC+UjktXW TUIA3E7d3rno0tWHLdhwFiTcbJ7uWwApKCYFYcxknkoORdkKjsR91nfvICx+q2cjlbAb VGy7DXt/D1Y47ys+iESkm3jF2OyHB9UnDCiOZx04lLF7iSsoOHgrAv3YTENWVB7O8Hu/ LYBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qbLPFFc7MFaTFJDTC3pMiLQiCLIDD7h/iPBGWVlSuoQ=; b=0f+C+1vkBOAycOt9WYcNtx2aKE6VCfx/gx4eBkU71A4OnhOXz1Acu//yCv8tcrXwLe v4eLPFKw1vJeSpLedpzVrLa1x+nNvSjFjyoi0Ja9z54tUBz57xXpH53hc8HJ4hcctzS7 gIoUeS+k1mCOuAFMLC94Wzs+2jbLYV9WdXbRk9drAu09fQIDBOOiycxhJdusOmqi+Yvt EmnwSYE5ftT34I7PopMA547Ideoihbgt/VmZy32/JMWNZ7CQPqgIA+0VriY1u1DwLmO/ NgK1b4YXVFxrY2rbuUpAQQ5n1UAe9orbQiDGO5vswwOlUAKEhFbijGSIjCPcBwLGYPUG rZ5Q== X-Gm-Message-State: AOAM530WlU6zEL4+SLKiRI6Zba/fefyNIjz6/okNEnr+QgqP8ylz9fki WSIeBEjSdYHGdm0pUP2k3drUtvZXT0M= X-Google-Smtp-Source: ABdhPJytaDu3661zBIPya83aHaYsQvcNeMj8k6JlUMc9ZCxWdbWpF1vWa10BV91FbRwqC9oL+rPfDA== X-Received: by 2002:a05:600c:3d18:b0:39c:474c:eb with SMTP id bh24-20020a05600c3d1800b0039c474c00ebmr4178168wmb.87.1654943830948; Sat, 11 Jun 2022 03:37:10 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0039c4ba160absm15131144wmq.2.2022.06.11.03.37.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:37:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 46/49] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create() Date: Sat, 11 Jun 2022 12:33:09 +0200 Message-Id: <20220611103312.67773-47-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow etsec_create() wraps qdev API which is outdated. It is also unused, so remove it. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-8-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/net/fsl_etsec/etsec.c | 23 ----------------------- hw/net/fsl_etsec/etsec.h | 7 ------- 2 files changed, 30 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 4e6cc708de..b75d8e3dce 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -443,26 +443,3 @@ static void etsec_register_types(void) } type_init(etsec_register_types) - -DeviceState *etsec_create(hwaddr base, - MemoryRegion * mr, - NICInfo * nd, - qemu_irq tx_irq, - qemu_irq rx_irq, - qemu_irq err_irq) -{ - DeviceState *dev; - - dev = qdev_new("eTSEC"); - qdev_set_nic_properties(dev, nd); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, tx_irq); - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 1, rx_irq); - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 2, err_irq); - - memory_region_add_subregion(mr, base, - SYS_BUS_DEVICE(dev)->mmio[0].memory); - - return dev; -} diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h index fddf551544..3c625c955c 100644 --- a/hw/net/fsl_etsec/etsec.h +++ b/hw/net/fsl_etsec/etsec.h @@ -155,13 +155,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(eTSEC, ETSEC_COMMON) #define eTSEC_TRANSMIT 1 #define eTSEC_RECEIVE 2 -DeviceState *etsec_create(hwaddr base, - MemoryRegion *mr, - NICInfo *nd, - qemu_irq tx_irq, - qemu_irq rx_irq, - qemu_irq err_irq); - void etsec_update_irq(eTSEC *etsec); void etsec_walk_tx_ring(eTSEC *etsec, int ring_nbr); From patchwork Sat Jun 11 10:33:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2CCBCCA47A for ; Sat, 11 Jun 2022 11:41:47 +0000 (UTC) Received: from localhost ([::1]:45070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzUw-00059F-RD for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:41:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUY-00077K-Ua for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:19 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:54873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUX-0006qw-Fb for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:18 -0400 Received: by mail-wm1-x32a.google.com with SMTP id n185so623878wmn.4 for ; Sat, 11 Jun 2022 03:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A6EEZNkHaS1IhD9MCBtC2cYS6mSvyzNV07PVTVWi5zg=; b=P8RdqxH1VhnyAIMvsGV69fISsxlMpmKiLjqtKyMi8CFTxDTPlWQ5Ck7LP6Yg2q4MFu yGTBrhKWWqTehEYB4rLaVno3fVXx1pUA1B10yhzPJ9/fVct5lmBNXFO0DoglqviYhftu 3b76XorkCtTa+fQzPoJun2ZBdTmmTmQi3c+R0VlcQm9ql9+9lrBUw1mZFJ/SPjG/Nmkf U/jBeIn98sNrsG2WlxgeKnQyqigmULGod7jNlvuGB+LkjRVOYaX7pqMXBng/XemBxwx6 CdXW+rK0H7OpQNJPTOIPITEFKDrZaHU7zt5XWk3Cv4VBMQuhfROVj6obUIOQ1diTSLM1 r0sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A6EEZNkHaS1IhD9MCBtC2cYS6mSvyzNV07PVTVWi5zg=; b=oZtnYbtLDXKKDrb7cZ0unBEzPyPDZ2uP1SiGH3+3gVXyHeavB/TD5vmqAqpNX5yEzF /zwcV4ops2xBgGdcQSsVfjA/jHCbkIPh5KVFPdwHbpTbxOQSv7LyYx2g7YUo8VAePRli p11mI8APFjwuS8rlEucw5FORi3bp9lgChscQeZW79GXAcRV1Ojvl/NwicTUQVbTC6CHd XK8bIKEObxvnWlnlMQV1gtRN6SNaptbcOpJRBjr/fzfz3iHobC06q3RtVr4LPm5gIXgK tf3vUu7ssfEXGDS2FdC4ChFcf3bCFPdm7zKgO/SURCka9Ie1VwQ+NTtC7VCeiVDGd7dv XhBg== X-Gm-Message-State: AOAM533qr8YwfeM+V7ZPi3PpTsLP5u/07ZuCxB2xTsDW07fHu/uMHb42 d+DZ97DNgtgstxSmICfaYJPqObppxQw= X-Google-Smtp-Source: ABdhPJw/KFSrTfjcYg3hZD9vYxAdLEokEteY6li9FKGd78D/YWkxmLbHTBJCyrIPiTrHXVp5G8b65A== X-Received: by 2002:a05:600c:228d:b0:39c:63ff:5f2 with SMTP id 13-20020a05600c228d00b0039c63ff05f2mr4240388wmf.22.1654943836023; Sat, 11 Jun 2022 03:37:16 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id h16-20020a5d6890000000b0020fe61acd09sm2164824wru.12.2022.06.11.03.37.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:37:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 47/49] accel/tcg/cpu-exec: Unexport dump_drift_info() Date: Sat, 11 Jun 2022 12:33:10 +0200 Message-Id: <20220611103312.67773-48-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Commit 3a841ab53f165910224dc4bebabf1a8f1d04200c 'qapi: introduce x-query-jit QMP command' basically moved the only function using dump_drift_info() to cpu-exec.c. Therefore, dump_drift_info() doesn't need to be exported any longer. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-9-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 2 +- include/exec/cpu-all.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 635aeecc0a..7cbf9996b7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1048,7 +1048,7 @@ void tcg_exec_unrealizefn(CPUState *cpu) #ifndef CONFIG_USER_ONLY -void dump_drift_info(GString *buf) +static void dump_drift_info(GString *buf) { if (!icount_enabled()) { return; diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 5d5290deb5..9a716be80d 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -419,8 +419,6 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) } #ifdef CONFIG_TCG -/* accel/tcg/cpu-exec.c */ -void dump_drift_info(GString *buf); /* accel/tcg/translate-all.c */ void dump_exec_info(GString *buf); void dump_opcount_info(GString *buf); From patchwork Sat Jun 11 10:33:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB74AC433EF for ; Sat, 11 Jun 2022 11:44:50 +0000 (UTC) Received: from localhost ([::1]:53086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzXt-0001C5-LC for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:44:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyUf-00079R-Ng for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:27 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUd-0006rA-IW for qemu-devel@nongnu.org; Sat, 11 Jun 2022 06:37:25 -0400 Received: by mail-wr1-x42d.google.com with SMTP id u8so1452898wrm.13 for ; Sat, 11 Jun 2022 03:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fY6esjUWpYJQRunP4ZAyyQfjXBIe+rdz0gCX7PSDfA8=; b=d3nzn8aPhJHV+3EvhFZUCs/Tv2pMZcYX6m5fn7DgoSb8uairEPoM8GRHS1COHlT35E Jzd51NvM+PUkOgM/nPkUiu99ERdHEtzXFnIOrV/PORW9DT24oBFi8KaXWF9lYNoUIewH mRNh80b2S4hE//eFyHwzmxgTZUnHi4hi19n8NQNDSZakxEAIPFJoq07ttGh0KvIEUux6 ouvBDwrMuci2Kzz0sGyvBLRy2hcThFrLsZtpinNPPIGrVhKpFxI2D9PWH06rCjQXJZNN 4hcMFV6AhJON6GqKkKyCkCBprNKdHFPDB1VPKRpz3hHvAeCXpOuNHroJvPTmKAEZ54V1 Gb1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fY6esjUWpYJQRunP4ZAyyQfjXBIe+rdz0gCX7PSDfA8=; b=IC1d3jiutRpErYpeOeZm+agsjtZFxXMA82clK9UtmJFA9n2bT1m0DcFvx6tr8HJChf 40xXXXqs1rFUTrDmgooFE1KGou8fybrdPaA7w+yjcVxooEH3p5WKtiUkUydHbBXuEoOJ tc84QNrT0iJIIyjnL9Q6wIA+P6OFbe22WTQEVm0jeDnL9NQgUt+LxjuwdZmtS0Pnzuns NTHdub5ZcnPgJzKEA+n9ICsqYHmrlND/UUQYjUXYR5uPYaq0TJP/ltBhdGIgTrj/+jO3 /hwYbn+lhOy54ZaE189r5aGteQp9sBLB32Q73nQ4N4+Rq8IiWVDLHj4GRbX3IUa8PILm 8C9A== X-Gm-Message-State: AOAM530RgtRL2ZBYP/aqCkzUREsXwMTThf7QF0tz5PvLikkkR560hPVj iT7f+fnggxSNPJJwCS3+wD+HMWZ8Fzc= X-Google-Smtp-Source: ABdhPJyXfgYO2k7wWHWMYv41gfYtI6S3UM68ITOw8MkjY2lGI/sjLJrmZVlBZ5jnM7+1SRVzTo6JoA== X-Received: by 2002:a5d:59ac:0:b0:218:5b7e:1c1c with SMTP id p12-20020a5d59ac000000b002185b7e1c1cmr19910017wrr.621.1654943840999; Sat, 11 Jun 2022 03:37:20 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id h7-20020a5d6887000000b0020fdc90aeabsm2121911wru.82.2022.06.11.03.37.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:37:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 48/49] accel/tcg: Inline dump_opcount_info() and remove it Date: Sat, 11 Jun 2022 12:33:11 +0200 Message-Id: <20220611103312.67773-49-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow dump_opcount_info() is a one-line wrapper around tcg_dump_op_count() which is also exported. So use the latter directly. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-10-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 5 ----- include/exec/cpu-all.h | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 7cbf9996b7..a565a3f8ec 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1091,7 +1091,7 @@ HumanReadableText *qmp_x_query_opcount(Error **errp) return NULL; } - dump_opcount_info(buf); + tcg_dump_op_count(buf); return human_readable_text_from_str(buf); } diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 291034cb09..8fd23a9d05 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2124,11 +2124,6 @@ void dump_exec_info(GString *buf) tcg_dump_info(buf); } -void dump_opcount_info(GString *buf) -{ - tcg_dump_op_count(buf); -} - #else /* CONFIG_USER_ONLY */ void cpu_interrupt(CPUState *cpu, int mask) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 9a716be80d..f5bda2c3ca 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -421,7 +421,6 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) #ifdef CONFIG_TCG /* accel/tcg/translate-all.c */ void dump_exec_info(GString *buf); -void dump_opcount_info(GString *buf); #endif /* CONFIG_TCG */ #endif /* !CONFIG_USER_ONLY */ From patchwork Sat Jun 11 10:33:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12878477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC743C43334 for ; Sat, 11 Jun 2022 11:26:04 +0000 (UTC) Received: from localhost ([::1]:33042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzFj-0002d6-M9 for qemu-devel@archiver.kernel.org; Sat, 11 Jun 2022 07:26:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzyV2-0007Es-8c; Sat, 11 Jun 2022 06:37:48 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:36110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzyUl-0006rT-Et; Sat, 11 Jun 2022 06:37:32 -0400 Received: by mail-wm1-x32d.google.com with SMTP id r187-20020a1c44c4000000b0039c76434147so2248314wma.1; Sat, 11 Jun 2022 03:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LSRhU0WHNkI3RpqcgumxLgAlGt42w+Z0sNOGRHj1XUo=; b=DKj1bP5X5Wra55aPOSACmNLnCf/m1dSSMyBt1i6gKjLfhM/X5O6CWBLXglLyNz9WH8 dJRN3Vs5jiKaMlodyWs2eZ3KHrrXN7XO/jiQAJy3SRPd8xBh8ZBN+50sU2LWGf+LsBxT tybrBIKqH5ivyUEJreeqgsIwBQUDRIEY7W/fup3BksTlUUjHi30bEm6eDXJgZCDb7Oct VS+Z/7e/JBXupxppTuDfD7GosASFwgKxKdQEDKa+knfu/MYJ5ePVOn/wgn5OFlDTAq0D KGIQTAzHQdMXTqhnYtPgT0TgHiK4asDtJQnPt43ndaIgKWF52XaaewoDoxrLPVlP41R6 2LSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LSRhU0WHNkI3RpqcgumxLgAlGt42w+Z0sNOGRHj1XUo=; b=2dEUMUU+QX9OLBdMkTK33oHbDo5XEj69kt4yKqSSm7YKf27imWxKwncB/8hNKb/VBl 3nXp2qLOltso1isqomqwVuMNlTrjnRyMOJiKnQw3PqUw4gg4YH8wOh2LPThCxSEHfa82 W1sbTTdX6U1IfE+v1t3gqxyRYwy3pf3767C4yVYdRW5XTTZWJHoN4WEqHq7jOQ/xflWL VRAo13lj5K/tIqPWIdHczAWv80LY/Xd+azEW02U0Eq4seDCggmmT3VHEYlZbnWzko1c0 Ph0ozBFvKI8D/b35qD7aOEqQwFn7HVHTVEUtstb+ZidOzJoEL3hFZZOcjJDrpLqitpKf ftSQ== X-Gm-Message-State: AOAM531/DTbJwvPiPEKv4K7gIiRQV0BjDhEbKlwjSoOsIucxr3/EMMNw dYaUL8daZ3TXCBFXCFMMI4+PG8NacbY= X-Google-Smtp-Source: ABdhPJzJ0SkbL6Kr8/nREy9ZzFdRh88H6gR6lur+Djxwvcs6Hq0qhuEznlv5rMYhdFxrXJEprxoRvA== X-Received: by 2002:a1c:4c0d:0:b0:39c:5233:1873 with SMTP id z13-20020a1c4c0d000000b0039c52331873mr4277207wmf.28.1654943846134; Sat, 11 Jun 2022 03:37:26 -0700 (PDT) Received: from localhost.localdomain (124.net-94.228.4.isbl.embou.net. [94.228.4.124]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b0039c5fb1f592sm2260172wmq.14.2022.06.11.03.37.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 11 Jun 2022 03:37:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Aurelien Jarno , Stefan Pejic , Aleksandar Rikalo , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Bernhard Beschow , qemu-stable@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PULL 49/49] docs/devel: Fix link to developer mailing lists Date: Sat, 11 Jun 2022 12:33:12 +0200 Message-Id: <20220611103312.67773-50-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> References: <20220611103312.67773-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bernhard Beschow Ammends commit 9f73de8df0335c9387f4ee39e207a65a1615676f 'docs: rSTify the "SubmitAPatch" wiki'. Cc: qemu-stable@nongnu.org Signed-off-by: Bernhard Beschow Acked-by: Mark Cave-Ayland Message-Id: <20220520180109.8224-11-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- docs/devel/submitting-a-patch.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/devel/submitting-a-patch.rst b/docs/devel/submitting-a-patch.rst index d3876ec1b7..09a8d12c2c 100644 --- a/docs/devel/submitting-a-patch.rst +++ b/docs/devel/submitting-a-patch.rst @@ -18,9 +18,9 @@ one-shot fix, the bare minimum we ask is that: `__ policy.) ``git commit -s`` or ``git format-patch -s`` will add one. - All contributions to QEMU must be **sent as patches** to the - qemu-devel `mailing list `__. Patch contributions - should not be posted on the bug tracker, posted on forums, or - externally hosted and linked to. (We have other mailing lists too, + qemu-devel `mailing list `__. + Patch contributions should not be posted on the bug tracker, posted on + forums, or externally hosted and linked to. (We have other mailing lists too, but all patches must go to qemu-devel, possibly with a Cc: to another list.) ``git send-email`` (`step-by-step setup guide `__ and `hints and