From patchwork Wed Feb 21 21:16:01 2024 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: 774510 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp458987wrw; Wed, 21 Feb 2024 13:17:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUL5gLQpj/jxEO1u+Bx0KJwdLi1/l7wP1h+EQx2ht5HOBZInC8qp7NA4tughQ0AAoNrNsUisPRz/pTWgCniyxW9 X-Google-Smtp-Source: AGHT+IHfxcOjBYBwCPgDMnx97OINXg8j+Gxt7XGfetv4iPyFDPrqTwSGZ33ekk/RGDn3MnQum9Tb X-Received: by 2002:a05:6808:1928:b0:3c1:35de:8440 with SMTP id bf40-20020a056808192800b003c135de8440mr22779448oib.47.1708550255890; Wed, 21 Feb 2024 13:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550255; cv=none; d=google.com; s=arc-20160816; b=JySmj0fFwJ7zJZPnJk/Vhav25ekJtCAtoMhJLaRKfJ3ocLfEBbf4hWaQ+MGki0Pr/o tINjC3LM4tVOJOTLJQJS7POL2Ubcc7BrkGs9GW8qIok9bZ0Uh9Tr7JpDRPESQyq+cuBM tMNIZD74CvUYdURYf0EgyvgT6NdnL3jlJacxVzgNF/CKaT7pUNW8polW1po8sQnWHmC5 tVyvp8q09VaSyNjOmnozmWAyyr810Uih7/SpKdTpiGsgCJ1JnxKK3Swy0IYDvdsHVAA3 5hIEr2z0bGpG+Yh2DORs6iYO17G/3gcceRxRSEC55xK1Fc6gIxG+DWtUTC977R3xHSpw cE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z/W4KhZI17pYbgZl7WFC76po73LZjqrV640NPiHP0AU=; fh=FmsLcdt/LUQpgS6NV6HcHKbEVcRfHqlCHqgKBqY1uBE=; b=RujRasTozgdftaLri4clnpQEbSVys/Ju0k3jH9X+7Z2JTXOyzaZ1LJ4q/KCWJohRZw w0bPm0bvLASbJvojj6/no5ffNom2wORXlT/C2lisVXPBIkVCom7nj8twcv5gDwlZxl4A 5CvbsbhvtwyxPL629IwNAHOxHDoBUQHWvdbNXdUpmO241NUXn56YRldFrlgdXUn/WZY8 rPq2sBClb2bBBqCTm+JLSNcj+UNVX1uo2Xblo/2k3P+nOmhizhVHG25g9FBtksnFdIzG pBMfwYWP4A4gK9w1JRgbwHm9300m1s87Dj7PfPD6RXT+g1uyFoRYi5D7Bix+4sC4dpF5 4Skw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ef3iS58P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c8-20020a056214224800b0068f2a156fb3si12528997qvc.290.2024.02.21.13.17.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:17:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ef3iS58P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctxX-0002OG-8n; Wed, 21 Feb 2024 16:16:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctxH-00024Q-Sg for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:16:43 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctxF-0000lF-C8 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:16:39 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4127190ad83so14251985e9.0 for ; Wed, 21 Feb 2024 13:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550195; x=1709154995; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z/W4KhZI17pYbgZl7WFC76po73LZjqrV640NPiHP0AU=; b=Ef3iS58PtEyhd3b9O1hyyK16GzW6rWGKTN/tSxAAR4+4dgcXED+ZjXkk0D6qRPKSZD 6O6u+6wHsCmlTClXtfyBO2rweaBc7I+3a1HTy6IL58L3S7KKhxUTGmCOIPtsLwbsqmI0 +iCjGm9g/hZdqyzLZ6fMTDCOw4eaTOorU+hKp0bgFebQ1hCoR1aKeo1GHkaBnHRU5y4y R6NEiROxHfm0imU04+gIxBtBUKAOABxip+c6sMwpG+mRqBAHQ6KMPwkXbQkui4fax/Gm pjbEqMjO4rbLTO03aPBvTRbTY1ZRllaichNHF2XEZfr+zU2l6wPwiTx/KKYdc6a4MdUi gNSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550195; x=1709154995; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z/W4KhZI17pYbgZl7WFC76po73LZjqrV640NPiHP0AU=; b=D4Her62nW7taTk9r/FMt3ShqOCyxujWyi1vVZVd+7WfTH3jJZ4AUdRgwnylxL5sCPi 9+uISIPNikkHNhXJkbRbd05cW4SS6BTQdLLcLaTqAEer8pKpD8RCwA+3pwCVnbmRpOAN 2eFgGFnlzwR5NY6pzo+2IxQY9jEJvqB7Gke/7OQVW4n721gk1u5YDHfkE1wpAqO0e0NH EDtMq1P04JhKd9yrVSIZ1j7wueC3Qj4oqr2WeaTeJZ2/fPIiApWwQ0Dsn9YiunJo7fd3 ETgLSMmfOdmGwyu8b3jLskLIAM+158OdTyfEk52LFBxvBdAJCcw1XQA8WBwEkw5J1T8h NTKA== X-Gm-Message-State: AOJu0YxzXmnI81SlDrttQP4CAfzvSz7EXuSBmd2zt0HKneYbJoI001oH kwVzc7rqzWpK9h0CE3CwUaZMxy0txXOM/FGbWEyW0q8CUYP6FFDLgDnsMh7/AWWCESmthSVpoS8 SBzI= X-Received: by 2002:a05:600c:45d3:b0:410:2d72:63b3 with SMTP id s19-20020a05600c45d300b004102d7263b3mr14072844wmo.23.1708550195659; Wed, 21 Feb 2024 13:16:35 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id m20-20020a05600c281400b0041214ff06cesm19052761wmb.42.2024.02.21.13.16.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:16:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Yanan Wang , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 01/25] hw/input/pckbd: Open-code i8042_setup_a20_line() wrapper Date: Wed, 21 Feb 2024 22:16:01 +0100 Message-ID: <20240221211626.48190-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Since the named GPIO lines are a "public" interface to the device, we can directly call qdev_connect_gpio_out_named(), making it consistent with how the other A20 input source (port92) is wired. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Message-Id: <20211218130437.1516929-6-f4bug@amsat.org> --- include/hw/input/i8042.h | 1 - hw/i386/pc.c | 3 ++- hw/input/pckbd.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index 9fb3f8d787..e90f008b66 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -89,7 +89,6 @@ struct MMIOKBDState { void i8042_isa_mouse_fake_event(ISAKBDState *isa); -void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); static inline bool i8042_present(void) { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 28194014f8..9cbc59665f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1195,7 +1195,8 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, port92 = isa_create_simple(isa_bus, TYPE_PORT92); a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2); - i8042_setup_a20_line(i8042, a20_line[0]); + qdev_connect_gpio_out_named(DEVICE(i8042), + I8042_A20_LINE, 0, a20_line[0]); qdev_connect_gpio_out_named(DEVICE(port92), PORT92_A20_LINE, 0, a20_line[1]); g_free(a20_line); diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 90a4d9eb40..74f10b640f 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -777,11 +777,6 @@ void i8042_isa_mouse_fake_event(ISAKBDState *isa) ps2_mouse_fake_event(&s->ps2mouse); } -void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out) -{ - qdev_connect_gpio_out_named(DEVICE(dev), I8042_A20_LINE, 0, a20_out); -} - static const VMStateDescription vmstate_kbd_isa = { .name = "pckbd", .version_id = 3, From patchwork Wed Feb 21 21:16:02 2024 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: 774518 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459613wrw; Wed, 21 Feb 2024 13:19:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU29iz1D8TIxIfXT9C0M+Cd7tyxIFh77XJGQAA689E0yuYWoejk33yBIOUoyRecIocli8IgzoYu29YXhgJnfYo6 X-Google-Smtp-Source: AGHT+IEUj5ec1V0AYHz1cG33k70weYZEZS5owaSqtrN73AzMZLvP7WIUn+3nVhMKSchgJBfNqL1u X-Received: by 2002:ac8:59c6:0:b0:42e:24c4:ca0c with SMTP id f6-20020ac859c6000000b0042e24c4ca0cmr8066617qtf.60.1708550359924; Wed, 21 Feb 2024 13:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550359; cv=none; d=google.com; s=arc-20160816; b=O0AKu6NXkb54XP73TXONZVb99zsMXq6NTkenkO/egSyBKkhL9Lejy91EDtOTgoKbkL Ks7kQAkX3tcMOmNBg1xr4G1A2YHLJZ/4Aswgeg3quM4q/3/OztdIKZpOMkXxRC34kfK4 Q1FRMBJTaMjYIICBygdUq/beBeJwWhXXo2ZnMbWc+ZQJG/le5DiW1YaFaJPCVqv1gQ/g v69qOifsUlGI4CjZEHGAHYF0/K9u3F46P3mKbtBcy/KSso3lW3L0a6vnM/CX6eYcTiCO 66wv32M1aQYyT075e/ECZg5aeg6XbfOokePbNLpJXETYFPEC0mM04U2cxURMnw78w9xC k5+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=krMCnSm7PN59WBp42omeBRDoSFldcCIH3sGDX1JOTwc=; fh=NlbHjPHTM0NETPCnAyZXzfU4vwje2f5YofplVfqt1rY=; b=KC8LOZsJun/5XD2sOcs33r2WWizejkJd8btWynpGrpaSGG4muMFKVjvmhunHbECWAR xVyg3CmSWkoMdguSfBjMVpHGf7XhDOPIfns5bejmd2ZTAMnGd/L9T1vpcvSoTtnlWMnF ITPj07q7U8TR1IVJtZ0FAwOe3DKSNUHXgX9PL9NNy2VErwfP0ErmcMlOADHbCZFg893d NjUSm7MT/Yt4AT8sVcUCUwJ3HwYHKZlAwErHpnsRG40Fu7wUH3rtDBvxCOrC8/A1bZTg RG8rKXaRvm1bSEdy25Rw0OECrzMqWXaEOStM5do5pslAEkMQE6gS+M/aYm3+4iACC7Cz uOCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jKfhZQRb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s1-20020a05622a018100b0042c7297f3d4si11222026qtw.650.2024.02.21.13.19.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:19:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jKfhZQRb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctxw-0002tn-Fd; Wed, 21 Feb 2024 16:17:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctxU-0002JV-9X for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:16:53 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctxM-0000mi-Lv for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:16:51 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33ce8cbf465so3658823f8f.3 for ; Wed, 21 Feb 2024 13:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550202; x=1709155002; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=krMCnSm7PN59WBp42omeBRDoSFldcCIH3sGDX1JOTwc=; b=jKfhZQRbt1eKbTCvF9Je8+ri8dt6VB+D+IRj6Cu2tlUepxVWMweW3sE05LdIuZyqmF hpeHylPBYwllg71C0ze4o5r5T/Tq+dK6tDZg5yQTVLIIxmHtVvI1x4X6d3pDazLC3oYT g5sBdBRJf4OsYxu7QtP5Ybgf8d3k3IXLneL2Psup+KKJFibLI9ewVk5gMgAehZ91sfRw nS7vRy5CtUfHuoBT9g0Ca5Y4Em1mcaEPIWdeEOozTIWq/Hg41znfaP0H1bM5lUCTeD5g A56/36hxPf+902Vrhc22+qgV/ZOdNtmP2xgmEmSu9lRiX+tj7wqrO7uE3ECqem5vicJy 5N4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550202; x=1709155002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=krMCnSm7PN59WBp42omeBRDoSFldcCIH3sGDX1JOTwc=; b=R9A+/bvLOSgm58RTnyp+Hin0OKsMclXgmYHulwFSprfsTtC5OxxfB8P7peQFIz87SW 0sK7KxIVFb0u/b6ZYKcVAEoIYSBIKXYeQaEVnBsurf5PLeH7vidgtyIJ9blGqNHz0tx/ nJwjVPWrGLx30ITrugH+o3+5TAlJgo7x+zFn7CkkEEG3mlmigP7KwNyNgVytwNsjJkqo TnG2v1rJo1OOqadpE+xvYgINSFV4q31QnR4kczCS+cWQkjpTMDNdzkm0+mHelWdGNyPK QPpozTgQnzh4zf0LOdC5suhnYOGibLzDtSTc5sMLr0h/K77+Kj14Sxmq2tUWGjUh/ixi SBhw== X-Gm-Message-State: AOJu0Yz802VBcgnItScxw1FaRXixu/WwXrWCMfeeoxtSYuXLDo6VvOiv +hkjS6B/dgOMF/flExuhqNsqVSqrlA+x2lnXvKjqC2H8GVKvrsCZU7Kb5OsASOXPiGg0i9pxme8 JHNw= X-Received: by 2002:a5d:648e:0:b0:33d:3bc2:7acc with SMTP id o14-20020a5d648e000000b0033d3bc27accmr9430955wri.11.1708550202692; Wed, 21 Feb 2024 13:16:42 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id ba20-20020a0560001c1400b0033d640c8942sm7735227wrb.10.2024.02.21.13.16.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:16:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum , Aleksandar Rikalo , Gerd Hoffmann , kvm@vger.kernel.org Subject: [PULL 02/25] hw/sysbus: Inline and remove sysbus_add_io() Date: Wed, 21 Feb 2024 22:16:02 +0100 Message-ID: <20240221211626.48190-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sysbus_add_io(...) is a simple wrapper to memory_region_add_subregion(get_system_io(), ...). It is used in 3 places; inline it directly. Rationale: we want to move to an explicit I/O bus, rather that an implicit one. Besides in heterogeneous setup we can have more than one I/O bus. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-Id: <20240216150441.45681-1-philmd@linaro.org> --- include/hw/sysbus.h | 2 -- hw/core/sysbus.c | 6 ------ hw/i386/kvmvapic.c | 2 +- hw/mips/mipssim.c | 2 +- hw/nvram/fw_cfg.c | 5 +++-- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 3564b7b6a2..14dbc22d0c 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -83,8 +83,6 @@ void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr); void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, int priority); void sysbus_mmio_unmap(SysBusDevice *dev, int n); -void sysbus_add_io(SysBusDevice *dev, hwaddr addr, - MemoryRegion *mem); MemoryRegion *sysbus_address_space(SysBusDevice *dev); bool sysbus_realize(SysBusDevice *dev, Error **errp); diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 35f902b582..9f1d5b2d6d 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -298,12 +298,6 @@ static char *sysbus_get_fw_dev_path(DeviceState *dev) return g_strdup(qdev_fw_name(dev)); } -void sysbus_add_io(SysBusDevice *dev, hwaddr addr, - MemoryRegion *mem) -{ - memory_region_add_subregion(get_system_io(), addr, mem); -} - MemoryRegion *sysbus_address_space(SysBusDevice *dev) { return get_system_memory(); diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index f2b0aff479..3be64fba3b 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -727,7 +727,7 @@ static void vapic_realize(DeviceState *dev, Error **errp) VAPICROMState *s = VAPIC(dev); memory_region_init_io(&s->io, OBJECT(s), &vapic_ops, s, "kvmvapic", 2); - sysbus_add_io(sbd, VAPIC_IO_PORT, &s->io); + memory_region_add_subregion(get_system_io(), VAPIC_IO_PORT, &s->io); sysbus_init_ioports(sbd, VAPIC_IO_PORT, 2); option_rom[nb_option_roms].name = "kvmvapic.bin"; diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index a12427b6c8..57c8c33e2b 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -226,7 +226,7 @@ mips_mipssim_init(MachineState *machine) qdev_prop_set_uint8(dev, "endianness", DEVICE_LITTLE_ENDIAN); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, env->irq[4]); - sysbus_add_io(SYS_BUS_DEVICE(dev), 0x3f8, + memory_region_add_subregion(get_system_io(), 0x3f8, sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); } diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index e85493d513..6d6b17462d 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1142,6 +1142,7 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, SysBusDevice *sbd; FWCfgIoState *ios; FWCfgState *s; + MemoryRegion *iomem = get_system_io(); bool dma_requested = dma_iobase && dma_as; dev = qdev_new(TYPE_FW_CFG_IO); @@ -1155,7 +1156,7 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, sbd = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(sbd, &error_fatal); ios = FW_CFG_IO(dev); - sysbus_add_io(sbd, iobase, &ios->comb_iomem); + memory_region_add_subregion(iomem, iobase, &ios->comb_iomem); s = FW_CFG(dev); @@ -1163,7 +1164,7 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, /* 64 bits for the address field */ s->dma_as = dma_as; s->dma_addr = 0; - sysbus_add_io(sbd, dma_iobase, &s->dma_iomem); + memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem); } return s; From patchwork Wed Feb 21 21:16:03 2024 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: 774513 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459292wrw; Wed, 21 Feb 2024 13:18:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWE3KWrpTo07SOmy6bxezAwJ/qvzw+cryA+JqQAheaMrh2vcslPX9+ddls8Ax/NjvZO1CzsH/oxA8dJlLMszxYM X-Google-Smtp-Source: AGHT+IEwj8Rb7rAdKBD8jsQ2FT5aSWgmco+V5DumzLhn9v05P9COdMNVTjXzcofTd+z+i4s/ye8o X-Received: by 2002:a81:a001:0:b0:608:918:76e0 with SMTP id x1-20020a81a001000000b00608091876e0mr14048926ywg.11.1708550308113; Wed, 21 Feb 2024 13:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550308; cv=none; d=google.com; s=arc-20160816; b=WAr1hrWy7VtOb0CaUwFzNTK2WzTf0XzT0oT+ChXCJnBfb8ctfuQa04Bv9urR3tq0jp sQHtQV+cf8U9gVDVi9PS6oHieLnJaeV60gScgSwzIM4mKhX9k/fup/0IQo3QlKf0tMoF ISDOd9NQDxLZmhx0k/MIjqAzeVtGKYhLkBrPsA5AsDL7RZ1ppFJWcN3PEmwJDddKnmsQ nHV6ZtG3lvFIsszVl6eF2d3abWNopH1XwI5wTaP1ong6gXFvVaDsyGSP06a6De4dR1Ip TNjIsFhE3ui1STu8+lhOvb+QJR0efKR82wA4lbwsiLrffFlr+y+B70gF4mhjQeDoW9NS ue3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4TRvCQivHf+BGM6I7nL2pwFghFnMYw5aVlLSb0J/9JI=; fh=Tm1JBeIpbRgXIQbzR7Pxs7dfN0JWk+aR4tRoAkqiPTU=; b=fA2P12Y5/TKdxgj1leaVYZ4HeoN5GzjFqU9t07ORR6urG29ofw/DsxhnknMMflSLhs B6XV2L7/N5QEPlBHbQJyIkoJPFWrHWsXvHUeKNijbW/x5oTn46pqdMxb/ZqqnCBioe26 XeA47iCWvkgw5rGB7HpY3aL/qmD0PyaWjUqBAsQQ9LTZeLYXxQbQnPHHGpGTrFkE6AUr LKHGFWusYbJcEooKtikL903gY2l+xv8EIHkc6CAhzzodPLDViAVlB6BkYtU3EqKzw22K lS6Ogjjqf4+32j9Eebkbq0JYD9Ydt40KLdLxCtPCML8B3UKl+DEWtlAat9c0h1+jgAZ/ uZ4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qsM2Tz+l; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t5-20020a05622a180500b0042c0dc588f2si11600531qtc.702.2024.02.21.13.18.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:18:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qsM2Tz+l; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctxr-0002io-0e; Wed, 21 Feb 2024 16:17:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctxU-0002Jd-AZ for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:16:53 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctxS-0000nt-2Q for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:16:51 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33d754746c3so904255f8f.1 for ; Wed, 21 Feb 2024 13:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550208; x=1709155008; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4TRvCQivHf+BGM6I7nL2pwFghFnMYw5aVlLSb0J/9JI=; b=qsM2Tz+ldd3LESpb8XP0unrIoiDe02oSiS82cEthbN3bIOm2BDEdguOyOG5NGF/Uoj ewL2t/sU8008nHPzSPb951RnpGsGqR/HCQ+1dIXsDn3NLat/0X9XCphhUkj5mcM3VIqe CBvkllWdlxVcNufvPBAfjOtenFYy81ESfie9jTSIX5u9k3aV3/MU+eKof5PhyNlBtmC8 DDqwqTBC4/6bLSsdHURy50y/Df1HfepHYPtgjpOr04chg3hfF2QS2Jn7A2RQLVwe3obs NYAaIa/gnx/p2astKirRsbREcmmmlv9A4e3PhTSefmDDqzu93JrObr22V8MP0Wg8RAAZ NZ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550208; x=1709155008; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4TRvCQivHf+BGM6I7nL2pwFghFnMYw5aVlLSb0J/9JI=; b=KLLv/IBvWKFAa6NMO1sT7AXLZOdDqc+RxlMPgYdwe31awNC/FYT5nkGIRBBYJndwL9 52NbGeFHa1qUMFHLL5vIFMMjPP07kSB95XiQmbeQz4Crw3PUk2h1JjvtM16EPqOMLvkb Ak5Fykp44KlAZie4rQWIxhM2XyswxcHkH27jaatyCOJCVBI9zLajtb2MbTHlq+iVtV8D WuNokUMXWvRsF9RJdFoJCMqStHOuRlZ6EEgB2PmQuqxCXTuoppHZicRQmSZEnJdhcspv iApGu7UqF26KMDuctabfFF/2jsFNJQzFiXRGwvnKCzGZ0sZwgzqj8IZ26ce+KbeMN3d2 nKQg== X-Gm-Message-State: AOJu0YzNJTdrIvFa33M+msRD3q304EXrLZfhh0INNbE3rqqnHxmaCzVy nLImWJ+L+CcOntQRs1/OCNRMOpg8vRYXeTysfxYpgFPXJfb+7Qs6JDQd7JrdhGdJVApYM2y/+b3 M9ZM= X-Received: by 2002:a5d:64c8:0:b0:33d:545b:a74 with SMTP id f8-20020a5d64c8000000b0033d545b0a74mr10313634wri.33.1708550208078; Wed, 21 Feb 2024 13:16:48 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id ba20-20020a0560001c1400b0033d640c8942sm7735486wrb.10.2024.02.21.13.16.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:16:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , BALATON Zoltan , Thomas Huth Subject: [PULL 03/25] hw/ppc/ppc4xx_pci: Remove unused "hw/ppc/ppc.h" header Date: Wed, 21 Feb 2024 22:16:03 +0100 Message-ID: <20240221211626.48190-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan Reviewed-by: Thomas Huth Message-Id: <20240215105017.57748-2-philmd@linaro.org> --- hw/ppc/ppc440_pcix.c | 1 - hw/ppc/ppc4xx_pci.c | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index df4ee374d0..d84418cb7b 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -25,7 +25,6 @@ #include "qemu/module.h" #include "qemu/units.h" #include "hw/irq.h" -#include "hw/ppc/ppc.h" #include "hw/ppc/ppc4xx.h" #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 0a07aab5d1..e4101398c9 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "hw/irq.h" -#include "hw/ppc/ppc.h" #include "hw/ppc/ppc4xx.h" #include "migration/vmstate.h" #include "qemu/module.h" From patchwork Wed Feb 21 21:16:04 2024 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: 774523 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp460792wrw; Wed, 21 Feb 2024 13:22:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJ4vdwCU8P3wlxF1CX1+6l6oW3LwVEpfrwIuL4e6vcl4h2XtY8yQcLm+tCoxfyyoyFeUVJutUcSi2oQvCHyJKo X-Google-Smtp-Source: AGHT+IHd+ZvkrNEkD8xuE+U7Gz1Mi80+CEKnz3Eh1NJJTnnabkLpALj6Pafddg2Ajs40QJ3/AvKN X-Received: by 2002:a05:6808:f11:b0:3c1:4b06:7ac2 with SMTP id m17-20020a0568080f1100b003c14b067ac2mr15019998oiw.12.1708550546916; Wed, 21 Feb 2024 13:22:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550546; cv=none; d=google.com; s=arc-20160816; b=IKy+oj0aXv88Kv99uJSIZnIdw1w+HCh3qt8k9IMT3LePZ7BxvPPHY3ZLkKKhX2Dpw/ YSC08bF39p8KdjmHfojODFsWu58rqSNdSraTQ2XWhe3txt2LbmFMEAgAy0xZa5BVNbai c/MXEM0DBUi3xrViH87FsLNV21S89RMpwl1ssWSXQBkbp+CWV5BwB2HRL3rscRpo0Vm6 fukiu3p0FRhuwMY/T3RFN9vdZOdN6rthpmwvFa4LAqwg2Hs2ewyYEkSvt69DKvFVo1O6 ljv/MfvYSuZe6q0UeSVCRHB2QIuG2sAt75Ty4m3+/rvvnVySISmf+1uyMM0hhmoIiFsP wivQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GU7gAHkVNY1ZnCm5tOTnwrsOZMxJGgzLpPFYNVYgH0g=; fh=Tm1JBeIpbRgXIQbzR7Pxs7dfN0JWk+aR4tRoAkqiPTU=; b=jgnq8id7PWe9PnwcWMQA+2KpmNwgG71kFzHiJmx1Y5gzhYMPtKfdcyIHhb+s4RvMNC nR/sjENlY472s4p/+RLL0G/3xoVyipRtyO7eoxU5DzgPh3pHMgI9iui8DydZhWCthSnO K4n5lfnIBxvz/TGIJhuLhsxw+Ae+YXfxXrq4CLE7QyR9gfad6oIYrzKNIq47Ae+9dO0E NhklvSorFC9F9KuAryBUVKmCvMRzHfd2q7IUEdnMd4hUA9DeI6yhmA4XrLYATYRmFMyK dNxGBh54Mk1ByaGWhPr36N8nMy4zrkCiXji7FKvmnqwztP0c+lRg2it8f5GSMAPj51oD JNcw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="s2bYLsq/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jf12-20020a0562142a4c00b0068f731f88c7si7240114qvb.312.2024.02.21.13.22.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:22:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="s2bYLsq/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctxz-0002ux-Ih; Wed, 21 Feb 2024 16:17:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctxh-0002eN-R1 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:06 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctxY-0000pn-6x for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:05 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33d7b04f7e9so788454f8f.1 for ; Wed, 21 Feb 2024 13:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550214; x=1709155014; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GU7gAHkVNY1ZnCm5tOTnwrsOZMxJGgzLpPFYNVYgH0g=; b=s2bYLsq/SnTwAs0PbA68nT8WROylbqGw12WHNeXeDvXHA5Ipw1TC4u39WSBKOre/Rf eL7t+tno5MU1NBQ6K1NrGh10L8Cs2/AsuVRcJ25iyuSN9+tE8rTcs+0vNBXJeQyH4ecU /kjCakh/NDBAFgKXodOwwwRg7eBCjdI1U38dARbstT0KySPDwU7SssOFJC59CDytSsfN zAkKKtHufOD/sPxKffC8Iz4uYsqOMHbeuCPj0bikcvdfP6dHus5K7G9iJBowgZ/QCCXw meAMy0HULcxg9VQcLG6jvyOCSz9qg4IE5iQVa+bEh3rh/Zs6LNn2f5n7v9Tj+9LgYpic Mo8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550214; x=1709155014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GU7gAHkVNY1ZnCm5tOTnwrsOZMxJGgzLpPFYNVYgH0g=; b=S33sEnL1ZJPiv0VlrvyEwiGU2qWKcwNviPVrrEGvg7y914Chv+PsjiVzpOVgqZHa9X gNtU2TUIhk7lBy0YrQB8U3fMSsXwqMsgWNSWdJnfzvI/hyI5JXFEdG57T8mwWZVsPi/J BZ3cxs+d5ntUuKPmifkVt+RhKPTXpjoW30hNH/pr6parFAWKlNQG2zxfb8ImeaqGs5cQ ocbXoEUuJXsxGigGXUsAhLIv2m7kOcfxiz56Pa8m+lz6w1cRT9ahKRbbtyCpc789erIT z/mdKD/2FFmRt3xSogPQemxGhj3RN31slZCBZ+gSXzzFKTcrMbSemIU3GLj8ldywVIHq sugA== X-Gm-Message-State: AOJu0YxNlZfMlraRUgOG+Z+vjSwraaZCt2qOMliUVXKNveByK2rjaXf4 PS3zu8Q4CwnI9TOtDAyarqXW4xiaDowTRj8bFzeWhmiLehYCI/i7rBgminOrew6MbmgkSsuD69+ j6bo= X-Received: by 2002:a5d:47ac:0:b0:33d:38cf:aa76 with SMTP id 12-20020a5d47ac000000b0033d38cfaa76mr10702068wrb.46.1708550213945; Wed, 21 Feb 2024 13:16:53 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id df5-20020a5d5b85000000b0033d87557283sm997351wrb.0.2024.02.21.13.16.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:16:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , BALATON Zoltan , Thomas Huth Subject: [PULL 04/25] hw/ppc/ppc4xx_pci: Extract PCI host definitions to hw/pci-host/ppc4xx.h Date: Wed, 21 Feb 2024 22:16:04 +0100 Message-ID: <20240221211626.48190-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: BALATON Zoltan Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240215105017.57748-3-philmd@linaro.org> --- MAINTAINERS | 1 + include/hw/pci-host/ppc4xx.h | 17 +++++++++++++++++ include/hw/ppc/ppc4xx.h | 5 ----- hw/ppc/ppc440_bamboo.c | 1 + hw/ppc/ppc440_pcix.c | 2 +- hw/ppc/ppc440_uc.c | 1 + hw/ppc/ppc4xx_pci.c | 2 +- hw/ppc/sam460ex.c | 1 + 8 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 include/hw/pci-host/ppc4xx.h diff --git a/MAINTAINERS b/MAINTAINERS index 7d61fb9319..9b6ce9a934 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2070,6 +2070,7 @@ F: hw/ppc/ppc4xx*.c F: hw/ppc/ppc440_uc.c F: hw/ppc/ppc440.h F: hw/i2c/ppc4xx_i2c.c +F: include/hw/pci-host/ppc4xx.h F: include/hw/ppc/ppc4xx.h F: include/hw/i2c/ppc4xx_i2c.h F: hw/intc/ppc-uic.c diff --git a/include/hw/pci-host/ppc4xx.h b/include/hw/pci-host/ppc4xx.h new file mode 100644 index 0000000000..32396417fc --- /dev/null +++ b/include/hw/pci-host/ppc4xx.h @@ -0,0 +1,17 @@ +/* + * QEMU PowerPC 4xx PCI-host definitions + * + * Copyright (c) 2018-2023 BALATON Zoltan + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_PCIHOST_PPC4XX_H +#define HW_PCIHOST_PPC4XX_H + +#define TYPE_PPC4xx_HOST_BRIDGE "ppc4xx-host-bridge" +#define TYPE_PPC4xx_PCI_HOST "ppc4xx-pci-host" +#define TYPE_PPC440_PCIX_HOST "ppc440-pcix-host" +#define TYPE_PPC460EX_PCIE_HOST "ppc460ex-pcie-host" + +#endif diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h index ea7740239b..1bd9b8821b 100644 --- a/include/hw/ppc/ppc4xx.h +++ b/include/hw/ppc/ppc4xx.h @@ -29,11 +29,6 @@ #include "exec/memory.h" #include "hw/sysbus.h" -#define TYPE_PPC4xx_HOST_BRIDGE "ppc4xx-host-bridge" -#define TYPE_PPC4xx_PCI_HOST "ppc4xx-pci-host" -#define TYPE_PPC440_PCIX_HOST "ppc440-pcix-host" -#define TYPE_PPC460EX_PCIE_HOST "ppc460ex-pcie-host" - /* * Generic DCR device */ diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index c75c3083e6..e18f57efce 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -24,6 +24,7 @@ #include "elf.h" #include "hw/char/serial.h" #include "hw/ppc/ppc.h" +#include "hw/pci-host/ppc4xx.h" #include "sysemu/sysemu.h" #include "sysemu/reset.h" #include "hw/sysbus.h" diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index d84418cb7b..1926ae2a27 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -25,7 +25,7 @@ #include "qemu/module.h" #include "qemu/units.h" #include "hw/irq.h" -#include "hw/ppc/ppc4xx.h" +#include "hw/pci-host/ppc4xx.h" #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "trace.h" diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 7d6ca70387..1312aa2080 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -14,6 +14,7 @@ #include "qemu/log.h" #include "hw/irq.h" #include "hw/ppc/ppc4xx.h" +#include "hw/pci-host/ppc4xx.h" #include "hw/qdev-properties.h" #include "hw/pci/pci.h" #include "sysemu/reset.h" diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index e4101398c9..b6c6c8993c 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "hw/irq.h" -#include "hw/ppc/ppc4xx.h" +#include "hw/pci-host/ppc4xx.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/reset.h" diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 1e615b8d35..a28498f39c 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -25,6 +25,7 @@ #include "elf.h" #include "exec/memory.h" #include "ppc440.h" +#include "hw/pci-host/ppc4xx.h" #include "hw/block/flash.h" #include "sysemu/sysemu.h" #include "sysemu/reset.h" From patchwork Wed Feb 21 21:16:05 2024 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: 774527 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461042wrw; Wed, 21 Feb 2024 13:23:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXk8vmrDWFTIvpLqh64SUhK/kbAEFcgSnWV6PWExBqgsdZlJ3WyAv5DVF8B8/mUKxibbeJG75/1LEYtH8rjUISD X-Google-Smtp-Source: AGHT+IFUGoPlWdJ9+M+qyF7kuQj3HflyCB60s16MVdZJSIwSZ5TogsUioBVlbyghoiLD/890PpNp X-Received: by 2002:a05:6808:3993:b0:3c1:3e92:4d21 with SMTP id gq19-20020a056808399300b003c13e924d21mr21041772oib.23.1708550596333; Wed, 21 Feb 2024 13:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550596; cv=none; d=google.com; s=arc-20160816; b=AJFECUhKJaqI5iLE10PP3dQ9T/QpXtEvr0rOQdgfh1RdLJ1AHJsGitW4wtx7+/7i0T ddArYAMGDTkEe0fT7t/pR04Q5Cd3qp2UaEBqXAc6XyzlIH8NNLEA+kIUpCquTvr0qcyd 0HoQECdsKDLn6PHcXzqZnj2t67Udmh6tulgSixQ5w860l7lTZvjpr7dawi+4cK7FhVDI CQv0DHDtHwM/rAZCZiGcKnB3kCHUVANs8pNORt9qDYs+H0WkGHcnGYatIBRGRKDtSduh 0ufPBoV5j+3AlBumC5jI02lVekcD2/5cUDZatxaGz2EOagFYfLamQwb2ir3N2WcGoW6s bvYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Rri7DRJiOpDcuu3Ysur7tkTebJnDy+J9NH64dvVvHsc=; fh=mj1wQZ3bCyc7JCc8OC9xV+kNymToV2ebAdjioKsqLOU=; b=w1gdHNLFAdK2HyTcb/aux/Angfb01LisOvQOJ5pJotRLRS51G7jTI10gZ4uX+Y+J2G aUz81VCUq3MFxgoQJgVZMWMZHLlO97nXssaPjkYdqHWSx3p2EqMuzjodup4lrb61yhWt PwO12BYt4v4UGgqIM5sBcQLVX19HjwG7FWivgBphBldOeav5MeOhR5ojnTMDHXJkrT9h xIr1Zn4FieXE3No7l1xOs/XGFK/E4PmbmpnbGz2uF9PkDuDNE0WLR2y89BAxN2iD6X0z jH8u6jGh+OIDMsHcJXypSO17KMNS1bMB2P0JMvWERRTwFM3/5IRLYLP0ECA/lx6xzhT0 3SEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yKuCK9IZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j17-20020ac85511000000b0042c3325e600si10799851qtq.745.2024.02.21.13.23.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:23:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yKuCK9IZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctxv-0002tR-NX; Wed, 21 Feb 2024 16:17:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctxg-0002ct-Bk for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:04 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctxd-0000sg-ME for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:03 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4126f486429so17014975e9.0 for ; Wed, 21 Feb 2024 13:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550220; x=1709155020; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rri7DRJiOpDcuu3Ysur7tkTebJnDy+J9NH64dvVvHsc=; b=yKuCK9IZMXL7RWbQNfHHu6bio1XXVij196jfanWQDD+Jq5c+ye+bFj/6L5wPPtdf8M ABf6Jnj+ndrPaoDDobrVBBKXHgpQhDLXVf4SR2bWDOQmXhbliW4qzoKtpemndlKK6OC2 k3Eqm5isHtkrjORy9epKN5lLWJbzBsa3+E94frBaFl4qVe+TwW3DWHi0/oo19HTKF1VI wm7GSTN1HLZUhi2SiwoQZIJk65sshlhrbB1ks/0/DkgP/rZ8U4pBLEWGy7SLvC+kH+jD vDYZ25rfvdfFSON5kD85/bgHt8dSR33dPazkCMFWoVc5oZ4v9oSZS1uR6i3FYUu0D6Ab UEGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550220; x=1709155020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rri7DRJiOpDcuu3Ysur7tkTebJnDy+J9NH64dvVvHsc=; b=PfiE2Y2BDVrIG9XsbUpdvKcwU6M29VJZFeG0JEV2R1zI8NS6BGqWXGr//sy28xozlu tmRd2ZDbJy/dvXC8ZpJZ0V/5QSLccZn7UiYFKbZSqpduVcRYFkbAd+8NEe1mINyuf9+f 70gFQPeyoLky/arq0acACf2t3dq4GQ/ahC0CdkmMZ0qzfENbmXa8VtOpsxughQSEWN14 XczjOs1LpA2gnpazvxq1m65jgqRav1umwAWsxNFKCM6irOoReyhKt+p1BBA2CVyrZUWD 3iwIOI8W6JtYACGl9mdIpnMRBp7ExtObEwdJkZ7xyBC5p/LRSs6i5bRYMUGM7iAZFRTg +sxQ== X-Gm-Message-State: AOJu0YwqIaiE2avN06UjqREJhZSRKTFNQ1zvqg9iyNbfmLyyuXhrKAXt l+Yb0+5oNSVItbRP0LUE80919sxdgHyUkRz7QDFs3zAPkNtpt9CzJRfXRlwW06IWLjZAQhe7RyD v+hw= X-Received: by 2002:a05:600c:4455:b0:412:7045:64c9 with SMTP id v21-20020a05600c445500b00412704564c9mr3946267wmn.8.1708550219867; Wed, 21 Feb 2024 13:16:59 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bt27-20020a056000081b00b0033d1b653e4csm18877936wrb.54.2024.02.21.13.16.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:16:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Paolo Bonzini , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= Subject: [PULL 05/25] hw/ppc/ppc4xx_pci: Move ppc4xx_pci.c to hw/pci-host/ Date: Wed, 21 Feb 2024 22:16:05 +0100 Message-ID: <20240221211626.48190-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org ppc4xx_pci.c is moved from the target specific ppc_ss[] meson source set to pci_ss[] which is common to all targets: the object is built once. Declare PPC4XX_PCI selector in pci-host/Kconfig. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20240215105017.57748-4-philmd@linaro.org> --- MAINTAINERS | 1 + hw/{ppc => pci-host}/ppc4xx_pci.c | 0 hw/pci-host/ppce500.c | 2 +- hw/pci-host/Kconfig | 4 ++++ hw/pci-host/meson.build | 1 + hw/pci-host/trace-events | 4 ++++ hw/ppc/Kconfig | 2 +- hw/ppc/meson.build | 1 - hw/ppc/trace-events | 4 ---- 9 files changed, 12 insertions(+), 7 deletions(-) rename hw/{ppc => pci-host}/ppc4xx_pci.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 9b6ce9a934..8d9ccd5073 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1423,6 +1423,7 @@ Bamboo L: qemu-ppc@nongnu.org S: Orphan F: hw/ppc/ppc440_bamboo.c +F: hw/pci-host/ppc4xx_pci.c F: tests/avocado/ppc_bamboo.py e500 diff --git a/hw/ppc/ppc4xx_pci.c b/hw/pci-host/ppc4xx_pci.c similarity index 100% rename from hw/ppc/ppc4xx_pci.c rename to hw/pci-host/ppc4xx_pci.c diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index fa0d67b342..95b983b2b3 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -5,7 +5,7 @@ * * Author: Yu Liu, * - * This file is derived from hw/ppc4xx_pci.c, + * This file is derived from ppc4xx_pci.c, * the copyright for that material belongs to the original owners. * * This is free software; you can redistribute it and/or modify diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig index f046d76a68..0a221e719e 100644 --- a/hw/pci-host/Kconfig +++ b/hw/pci-host/Kconfig @@ -6,6 +6,10 @@ config XEN_IGD_PASSTHROUGH default y depends on XEN && PCI_I440FX +config PPC4XX_PCI + bool + select PCI + config RAVEN_PCI bool select PCI diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build index 36d5ab756f..eb6dc71c88 100644 --- a/hw/pci-host/meson.build +++ b/hw/pci-host/meson.build @@ -14,6 +14,7 @@ pci_ss.add(when: 'CONFIG_REMOTE_PCIHOST', if_true: files('remote.c')) pci_ss.add(when: 'CONFIG_SH_PCI', if_true: files('sh_pci.c')) # PPC devices +pci_ss.add(when: 'CONFIG_PPC4XX_PCI', if_true: files('ppc4xx_pci.c')) pci_ss.add(when: 'CONFIG_RAVEN_PCI', if_true: files('raven.c')) pci_ss.add(when: 'CONFIG_GRACKLE_PCI', if_true: files('grackle.c')) # NewWorld PowerMac diff --git a/hw/pci-host/trace-events b/hw/pci-host/trace-events index b2f47e6335..90a37ebff0 100644 --- a/hw/pci-host/trace-events +++ b/hw/pci-host/trace-events @@ -37,6 +37,10 @@ unin_data_read(uint64_t addr, unsigned len, uint64_t val) "read addr 0x%"PRIx64 unin_write(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64 unin_read(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64 +# ppc4xx_pci.c +ppc4xx_pci_map_irq(int32_t devfn, int irq_num, int slot) "devfn 0x%x irq %d -> %d" +ppc4xx_pci_set_irq(int irq_num) "PCI irq %d" + # pnv_phb4.c pnv_phb4_xive_notify(uint64_t notif_port, uint64_t data) "notif=@0x%"PRIx64" data=0x%"PRIx64 pnv_phb4_xive_notify_ic(uint64_t addr, uint64_t data) "addr=@0x%"PRIx64" data=0x%"PRIx64 diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 44263a58c4..82e847d22c 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -53,7 +53,7 @@ config PPC440 config PPC4XX bool select BITBANG_I2C - select PCI + select PPC4XX_PCI select PPC_UIC config SAM460EX diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index eba3406e7f..d0efc0aba5 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -63,7 +63,6 @@ ppc_ss.add(when: 'CONFIG_PPC440', if_true: files( 'ppc440_pcix.c', 'ppc440_uc.c')) ppc_ss.add(when: 'CONFIG_PPC4XX', if_true: files( 'ppc4xx_devs.c', - 'ppc4xx_pci.c', 'ppc4xx_sdram.c')) ppc_ss.add(when: 'CONFIG_SAM460EX', if_true: files('sam460ex.c')) # PReP diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events index f670e8906c..b59fbf340f 100644 --- a/hw/ppc/trace-events +++ b/hw/ppc/trace-events @@ -146,10 +146,6 @@ rs6000mc_size_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" rs6000mc_size_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" rs6000mc_parity_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" -# ppc4xx_pci.c -ppc4xx_pci_map_irq(int32_t devfn, int irq_num, int slot) "devfn 0x%x irq %d -> %d" -ppc4xx_pci_set_irq(int irq_num) "PCI irq %d" - # ppc440_pcix.c ppc440_pcix_map_irq(int32_t devfn, int irq_num, int slot) "devfn 0x%x irq %d -> %d" ppc440_pcix_set_irq(int irq_num) "PCI irq %d" From patchwork Wed Feb 21 21:16:06 2024 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: 774514 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459394wrw; Wed, 21 Feb 2024 13:18:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVXRyWSndeCqm8indFdGAUMxSdNg+fR5cFKj8zwENkAib1ehnSQLxeV5r3HSUCSm8qzmZZed8zrlHOxJhM4MfRi X-Google-Smtp-Source: AGHT+IFj2Pw6WkyZ2PHTFroFKe6nQN5pZajVET1Ung7YZYlt0LW3lMtoU/+cMC515YUhHZi9xl6s X-Received: by 2002:a67:be06:0:b0:470:3a99:f3c with SMTP id x6-20020a67be06000000b004703a990f3cmr10562904vsq.23.1708550322387; Wed, 21 Feb 2024 13:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550322; cv=none; d=google.com; s=arc-20160816; b=kchc899wIqyjrx0JbLuZQezy0j6QO43F9rY59Iescs5qmyzY1X81SDbPcolnoTsjcQ ttGgbsVJgpDIS9p0ZQtUf/wvJj9M2cI6+7kOyKK3LyEuTSMf9SJF/LP7DqRj/dRPBRam iO/zbMiOB0GRZcKiEhal5TsrtKa7LXgGcn9kc5BU3L/L76TuJzq3MW95UZ5c5jcnfgKZ 42nD8gjEmMh3UM9N3iZ3re0RgeG18j3dTQoQaqeA7Wv9s4cuANfbPQaeHsQLzFXmEGSt FglB0BQJW9dJC4Hk6xSk3S19+a8MjGVQMBAq4M5IfX+ay3rTWfhfO/t6XYV7XRsVHTLR gtvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p7UW6IclJd8hCDh0KBzCCTcSNX/nbCbUmPbqAU8gk48=; fh=mj1wQZ3bCyc7JCc8OC9xV+kNymToV2ebAdjioKsqLOU=; b=HqHyPEav7v/NbSEkXeaPEyKnU9aUylgHCn4zmcSR7t4pWqWVWr8FJ7EKXotTvSwH0g YGgfT89NHauhx7ERJhYnjIZwxzUHDdE7JWXUbsaRZvHy80QYn6rOMN8EtXjfCEwxMEXW KIFDBw0klF0cD0cpPoziC9/i8wD9ZNXjE9El2Qm6faHlH6OlgxPQuTpUUtpan0PGlZNu hyt27LMrkjOda5DmOLYR6Kq8+Ww3uzOcI5bqn6O8yuhgujZDbwMSQVY7S+IImMW/dn6k NzJ9K6vVmfzsJEWQIDyTRE93K8gM6+yX+lsygPQF76AArmfghAPDi4yr5J4wo9xbUSkV TduQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iO5+laCe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h2-20020ac87142000000b0042deb612e75si11158360qtp.420.2024.02.21.13.18.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iO5+laCe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyQ-0003Yj-OU; Wed, 21 Feb 2024 16:17:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyH-0003Q8-5Y for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:45 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyB-0000x9-6R for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:40 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33d0a7f2424so4269890f8f.0 for ; Wed, 21 Feb 2024 13:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550253; x=1709155053; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p7UW6IclJd8hCDh0KBzCCTcSNX/nbCbUmPbqAU8gk48=; b=iO5+laCe/BzjgnN4mTi+mKmUfRreG0qD+giLineW/3qeNEDkdgSmiJgDCczwSmvOMH 3hnoMCxZ2Kkgp9iD2iupgGUgDciJTsJulXRA/PQ+aaujBAQdG612Gyw8yRov7NDhVmUx Kc5KXr9o2piiTgnKCKre1hV1JNado4l6HieF2MCPpODEIKJde4RRAeyGDa23nFKhKiP8 27r/m8V2cZYh1K7+RwIbQI1cLIjfIT0NNvdwP/egPcPrnA/48U1MaU0MJKX08malOWpu 7WUw/PVgp9sDtIHKgRvMlvYB/Wk3RlQzVsr0+0Xf6ttWvklABq2VAXe8K0pot0Wowsz7 t2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550253; x=1709155053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p7UW6IclJd8hCDh0KBzCCTcSNX/nbCbUmPbqAU8gk48=; b=Q0zY6MsvE1S8T0YpFFnQ7ohzYMPCsi+MuLYvw6Y3kQvEARvMA2sRq+/wZTk9s5JDsA qONoxtOSGCAMaSOLwmJFOQ3mcOK/7Bmvp6CZJ9SPsEVhmnb9EagAt+im9eYXdUpY7KPi oui6JpZjVKS2tcEN22yPHlpcx9T7WkbcZQJKzYtfeSwbLScMWdNUq71IPmnCAn89G/yf /W0t9vaQEQDFgsQx4obzDY9T5l4OLdhbo8G7xWUmMQeSqEZ6x3W1yprXZnTFwJ9hCyTZ IjjrLbVkp2CQQ10eAfxDg9rMyHuF6iWdnrPQy0Ri46gGoUW6QozD8cxs5qvmfKpGbHKn yShw== X-Gm-Message-State: AOJu0YwgcyPWomDRKec1h9aMYkEabK+GkBH3xnOvzYI6F2dloO7X2S4r 7JvBUbRWrijPrGCdwWYxaeT6C2Vb9x/aqexPjcTZUSoFG3fHTaclQ/yn3m+06qBrWtPcSMuNNEd iQDk= X-Received: by 2002:a05:6000:1f89:b0:33d:4bc3:e786 with SMTP id bw9-20020a0560001f8900b0033d4bc3e786mr9252589wrb.23.1708550253362; Wed, 21 Feb 2024 13:17:33 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bs20-20020a056000071400b0033d449f5f65sm12675816wrb.4.2024.02.21.13.17.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:17:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Paolo Bonzini , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= Subject: [PULL 06/25] hw/ppc/ppc440_pcix: Move ppc440_pcix.c to hw/pci-host/ Date: Wed, 21 Feb 2024 22:16:06 +0100 Message-ID: <20240221211626.48190-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org ppc440_pcix.c is moved from the target specific ppc_ss[] meson source set to pci_ss[] which is common to all targets: the object is built once. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240215105017.57748-5-philmd@linaro.org> --- MAINTAINERS | 2 +- hw/{ppc => pci-host}/ppc440_pcix.c | 0 hw/pci-host/Kconfig | 4 ++++ hw/pci-host/meson.build | 1 + hw/pci-host/trace-events | 8 ++++++++ hw/ppc/Kconfig | 1 + hw/ppc/meson.build | 2 +- hw/ppc/trace-events | 8 -------- 8 files changed, 16 insertions(+), 10 deletions(-) rename hw/{ppc => pci-host}/ppc440_pcix.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 8d9ccd5073..5535df4487 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1556,7 +1556,7 @@ L: qemu-ppc@nongnu.org S: Maintained F: hw/ppc/sam460ex.c F: hw/ppc/ppc440_uc.c -F: hw/ppc/ppc440_pcix.c +F: hw/pci-host/ppc440_pcix.c F: hw/display/sm501* F: hw/ide/sii3112.c F: hw/rtc/m41t80.c diff --git a/hw/ppc/ppc440_pcix.c b/hw/pci-host/ppc440_pcix.c similarity index 100% rename from hw/ppc/ppc440_pcix.c rename to hw/pci-host/ppc440_pcix.c diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig index 0a221e719e..c91880b237 100644 --- a/hw/pci-host/Kconfig +++ b/hw/pci-host/Kconfig @@ -10,6 +10,10 @@ config PPC4XX_PCI bool select PCI +config PPC440_PCIX + bool + select PCI + config RAVEN_PCI bool select PCI diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build index eb6dc71c88..3001e93a43 100644 --- a/hw/pci-host/meson.build +++ b/hw/pci-host/meson.build @@ -15,6 +15,7 @@ pci_ss.add(when: 'CONFIG_SH_PCI', if_true: files('sh_pci.c')) # PPC devices pci_ss.add(when: 'CONFIG_PPC4XX_PCI', if_true: files('ppc4xx_pci.c')) +pci_ss.add(when: 'CONFIG_PPC440_PCIX', if_true: files('ppc440_pcix.c')) pci_ss.add(when: 'CONFIG_RAVEN_PCI', if_true: files('raven.c')) pci_ss.add(when: 'CONFIG_GRACKLE_PCI', if_true: files('grackle.c')) # NewWorld PowerMac diff --git a/hw/pci-host/trace-events b/hw/pci-host/trace-events index 90a37ebff0..0a816b9aa1 100644 --- a/hw/pci-host/trace-events +++ b/hw/pci-host/trace-events @@ -41,6 +41,14 @@ unin_read(uint64_t addr, uint64_t value) "addr=0x%" PRIx64 " val=0x%"PRIx64 ppc4xx_pci_map_irq(int32_t devfn, int irq_num, int slot) "devfn 0x%x irq %d -> %d" ppc4xx_pci_set_irq(int irq_num) "PCI irq %d" +# ppc440_pcix.c +ppc440_pcix_map_irq(int32_t devfn, int irq_num, int slot) "devfn 0x%x irq %d -> %d" +ppc440_pcix_set_irq(int irq_num) "PCI irq %d" +ppc440_pcix_update_pim(int idx, uint64_t size, uint64_t la) "Added window %d of size=0x%" PRIx64 " to CPU=0x%" PRIx64 +ppc440_pcix_update_pom(int idx, uint32_t size, uint64_t la, uint64_t pcia) "Added window %d of size=0x%x from CPU=0x%" PRIx64 " to PCI=0x%" PRIx64 +ppc440_pcix_reg_read(uint64_t addr, uint32_t val) "addr 0x%" PRIx64 " = 0x%" PRIx32 +ppc440_pcix_reg_write(uint64_t addr, uint32_t val, uint32_t size) "addr 0x%" PRIx64 " = 0x%" PRIx32 " size 0x%" PRIx32 + # pnv_phb4.c pnv_phb4_xive_notify(uint64_t notif_port, uint64_t data) "notif=@0x%"PRIx64" data=0x%"PRIx64 pnv_phb4_xive_notify_ic(uint64_t addr, uint64_t data) "addr=@0x%"PRIx64" data=0x%"PRIx64 diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 82e847d22c..99d571fa20 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -46,6 +46,7 @@ config PPC440 imply TEST_DEVICES imply E1000_PCI select PCI_EXPRESS + select PPC440_PCIX select PPC4XX select SERIAL select FDT_PPC diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index d0efc0aba5..da14fccce5 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -60,7 +60,7 @@ ppc_ss.add(when: 'CONFIG_PPC405', if_true: files( 'ppc405_uc.c')) ppc_ss.add(when: 'CONFIG_PPC440', if_true: files( 'ppc440_bamboo.c', - 'ppc440_pcix.c', 'ppc440_uc.c')) + 'ppc440_uc.c')) ppc_ss.add(when: 'CONFIG_PPC4XX', if_true: files( 'ppc4xx_devs.c', 'ppc4xx_sdram.c')) diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events index b59fbf340f..157ea756e9 100644 --- a/hw/ppc/trace-events +++ b/hw/ppc/trace-events @@ -146,14 +146,6 @@ rs6000mc_size_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" rs6000mc_size_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" rs6000mc_parity_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" -# ppc440_pcix.c -ppc440_pcix_map_irq(int32_t devfn, int irq_num, int slot) "devfn 0x%x irq %d -> %d" -ppc440_pcix_set_irq(int irq_num) "PCI irq %d" -ppc440_pcix_update_pim(int idx, uint64_t size, uint64_t la) "Added window %d of size=0x%" PRIx64 " to CPU=0x%" PRIx64 -ppc440_pcix_update_pom(int idx, uint32_t size, uint64_t la, uint64_t pcia) "Added window %d of size=0x%x from CPU=0x%" PRIx64 " to PCI=0x%" PRIx64 -ppc440_pcix_reg_read(uint64_t addr, uint32_t val) "addr 0x%" PRIx64 " = 0x%" PRIx32 -ppc440_pcix_reg_write(uint64_t addr, uint32_t val, uint32_t size) "addr 0x%" PRIx64 " = 0x%" PRIx32 " size 0x%" PRIx32 - # ppc405_boards.c opba_readb(uint64_t addr, uint32_t val) "addr 0x%" PRIx64 " = 0x%" PRIx32 opba_writeb(uint64_t addr, uint64_t val) "addr 0x%" PRIx64 " = 0x%" PRIx64 From patchwork Wed Feb 21 21:16:07 2024 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: 774515 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459493wrw; Wed, 21 Feb 2024 13:19:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXjFEfAL2U8O/JQKRUMsZvrPiX8sYKKAi/nEfbSv0YIou3hPwJjSk5wSKT5h+4ATnzHTug+ooR5n+pqmOWXNank X-Google-Smtp-Source: AGHT+IGL3IyFW3DxTU+GAsYnTu0153+cqQbzWyz0IPYPjpLTO3il70CKcAZQHj/c1SZYMsV5Z3KM X-Received: by 2002:a05:620a:199b:b0:787:99da:91c4 with SMTP id bm27-20020a05620a199b00b0078799da91c4mr168586qkb.71.1708550341079; Wed, 21 Feb 2024 13:19:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550341; cv=none; d=google.com; s=arc-20160816; b=a7t6mMwN/twBfQcGGUaBEsdHDk3nXQX8/uLOm2VTPF0DFVRPPEwhWE1qwkTtDiPIs3 KyXbIOW4iNCzG8UUuypJ/7ENuyUSG+Hw6JE+2uc6L53c80vomKd6KAVpYBpooC6t32Fg 9MehlIIpUFXe6/DMf4HiyKNSUdH/THKRmQmDt1coLQbQup3QkWHkduPTbItPdCQ9wzhM peGoRznRga/qKyNjh0jIL88fCz0Z/RmbgfP8lMJdiXdFCS8K3C6cUMZ81XoeRguugbqK SnTM4GKnxUeSsj57Lm7PYOVKzWE4bbHUkal913BFqP1bHRi8WFtZJwFOAKWHPWznc2rb Dhjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BjLOWnOowHsDr6B+HTK3K7dnAqdoyTXUuN5gUgDOyxc=; fh=c99CppiWip1+hf6EyIYyWPuGGJQCaULkrjwhxd/3dq0=; b=Mq0AYPFOOL4sGTICE8UdWDz0iMw7rHMWoa78KCrqb47NqMgnqHQwrg9ULpwzFzWboR KpKlQRBljFvp03HiMgFujDG/CzdyDf7vl84gncBo2co9EpJ4GtxHX2P+X39AaOknYUvD AKas9XztzxkM8S7/EvWEmZWT2kcVL7DMmR9rrEb5RMTC2a3DlkrLAzDwMmAh6muCM48E /uMyXNyS5gXcanQcwIA2omOlhHeka2ubh1sdEh+pMEYCOFhOtbY1+9TxRG7Whh/WXAkI HKr4+SXkQo6+zrgmXNx4l+x7/kZxQfKhSB3tugb4Z6+5fP5v3H8BDWwDr9wnPEevlu4i HSug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i6GbSvhL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j7-20020a05620a0a4700b00787305a1315si11473832qka.309.2024.02.21.13.19.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:19:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i6GbSvhL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyW-00049c-H5; Wed, 21 Feb 2024 16:17:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyL-0003Ut-Ji for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:46 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyG-0000y4-Of for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:45 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-33aeb088324so3908689f8f.2 for ; Wed, 21 Feb 2024 13:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550259; x=1709155059; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BjLOWnOowHsDr6B+HTK3K7dnAqdoyTXUuN5gUgDOyxc=; b=i6GbSvhLMscjmR20xCNa2UCblE+gWX7go3qvdspTDC8hYccvzP7MmajJxlxHDc6s3k e53wPWUdk3tDP+2J+ooalVBfYqj30RPEtWUl3AQq7eByiCVheJZHIpG/gxB0nKmobrkq SR1BMmrbWqTgWztpYOdQvSkULA8pv0GHvaVRC2UDnyD8KUEX/9RmV9yrG1idCa5mp3kx qyenmg6uj6pdQoua/PQ08s1LS1yQmO2Qhd3pMHBFr0zxTpqcO93djw/Dzq/fPtTNZlL9 1e+4XWPsTGZuM3O47sEliT83Gb6KMT6sUUF2UtHP9osm0tNp6Iyp6+gLD9OKmvGjcyiR /AdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550259; x=1709155059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BjLOWnOowHsDr6B+HTK3K7dnAqdoyTXUuN5gUgDOyxc=; b=bTOMKGQpiWmb9V2zTzDviZTU54F92BSrgSaz6oDZeukUd/SQoa75GzA5SlhaEuytJ8 Nr5aCj1wzOzQXm/JtJws8zpu5ICRskRpqsXAfXAkMRDbXvgxhJBCLEkn0ovbBjiI1LjB fxdPU9EuwcVAjM+XZul2riY5qnNsOWaG/Sii03oclMaptFYfyuTnm9iE2v13xQftwiZ1 NFKVPWbMAD3TvQjlcdBn+KFY4NoBImd5XdpnMbC9VL0v14iiUWof+GH4kkl1p6VbHF3q Xs2irPBsD+cFDx+qHM3ZfLRDU3328fACOojx99yTCogBRnTFA5LJxCu7rmkNIGJq+qvc BQjQ== X-Gm-Message-State: AOJu0Yz+vIseQdUAjYSqhQqfHEvVkx/Bge2Sg7MRDr1Fd4DGNH+0XV6t zzHq2Uz9/4T4Hf/b/U8ABHXicVlVM2XQ5YuWuCinT4DZvapE7vT0D9/p9BSDCboaFTHP0OkZBXB ury0= X-Received: by 2002:a5d:6dae:0:b0:33d:3cf6:a2ca with SMTP id u14-20020a5d6dae000000b0033d3cf6a2camr8716854wrs.30.1708550258936; Wed, 21 Feb 2024 13:17:38 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id 14-20020a056000154e00b0033d10bd6612sm18477037wry.81.2024.02.21.13.17.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:17:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Joe Komlodi , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Corey Minyard Subject: [PULL 07/25] hw/i2c/smbus_slave: Add object path on error prints Date: Wed, 21 Feb 2024 22:16:07 +0100 Message-ID: <20240221211626.48190-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Joe Komlodi The current logging doesn't tell us which specific smbus device is an error state. Signed-off-by: Joe Komlodi Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240202204847.2062798-3-komlodi@google.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/smbus_slave.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/i2c/smbus_slave.c b/hw/i2c/smbus_slave.c index 1300c9ec72..9f9afc25a4 100644 --- a/hw/i2c/smbus_slave.c +++ b/hw/i2c/smbus_slave.c @@ -25,11 +25,15 @@ #define DPRINTF(fmt, ...) \ do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while (0) #define BADF(fmt, ...) \ -do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) +do { g_autofree char *qom_path = object_get_canonical_path(OBJECT(dev)); \ + fprintf(stderr, "%s: smbus: error: " fmt , qom_path, ## __VA_ARGS__); \ + exit(1); } while (0) #else #define DPRINTF(fmt, ...) do {} while(0) #define BADF(fmt, ...) \ -do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0) +do { g_autofree char *qom_path = object_get_canonical_path(OBJECT(dev)); \ + fprintf(stderr, "%s: smbus: error: " fmt , qom_path, ## __VA_ARGS__); \ + } while (0) #endif enum { From patchwork Wed Feb 21 21:16:08 2024 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: 774528 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461294wrw; Wed, 21 Feb 2024 13:24:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXiGpy1mWUE9LT9jR9wCvRA2BO4lYn+a+AAa0z2Hi9Bkmr6vmbViSi+/5FZ5/bybcKRjFdMhg9g+hiqde8d87sO X-Google-Smtp-Source: AGHT+IHU5o3WT9AcnU4o0WC/hBXAdeWoKaXj4MXmEHqeLeTk6nCDlKaxPA6AxUHII02jTvaj7/DJ X-Received: by 2002:a25:b20f:0:b0:dc7:45df:a04c with SMTP id i15-20020a25b20f000000b00dc745dfa04cmr480173ybj.43.1708550641452; Wed, 21 Feb 2024 13:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550641; cv=none; d=google.com; s=arc-20160816; b=iES07PFNrxlhstxfvlTjgMfhRJDwI4JkDObtjSygq01PfyVz1jNn8G3CUf2NpMhAPw T+B70OGg0DAiss6TrMjWbHBKCREbSpK0b4pG8ehCQOS9K2xjNem0nyzpQ4ZS+knJ7qfZ mr7ObtvkFxWvLtfM3Knmz3Zz45aFCHOet84e9TUa2MGA2XAA17BDX/uKTD6zT2ri7ZsX J+OYmL+i1Hf3np96qve/KnFK2OXKx9i1GPliruyGCLURocfDCHZ5X542evr3NkalQtLP /EHSvRwM7zzv3gK837aFRW6A7c/9RNQBwd/x6jWXmr2JytDbOSLY1/lO4/d3RO5FW5W6 TAew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TS/v5N8VdhzRmhkYhnKkjLky4Kvoae1G5ndSJvSbSPI=; fh=TBkf8G+Ez4Eaw6VUUzH52/Tgi6ZRMzC+7d8Wa9UKRjk=; b=coeVvv+p679qMzNTLco0VXnu3PghOiCD/UWuD2cXv+ZLEvfFqPNSt1ZjJq2m0sfzU5 MSJBY2gSwvKLXG83AZAiubojKfNMql0MjPaZeBD+OTk5Ol7JiZUR4pmxRm3BcCBMfwUo oqNonMPLIpi/AKa9IsJDhE1x2nsH2NI2APiVtTw3SvUtgjoqt+2+3XCV/Au5jleTDy47 p1YU7FbehsBULwN/BP4TdlAFBjjxQlREiyxm9Va3o+WvAGVKseEBbAiM5h2OsNihdEad U2eJBZgkG0/0ODPotApm5sYOKl/6pn7OKu44QiFzDv+oUo2le/f8FPgvQ+d+oytgGPUE bDHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qe8mzHBk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id pe19-20020a05620a851300b007877e1802b0si3626967qkn.722.2024.02.21.13.24.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:24:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qe8mzHBk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyY-0004X0-Fw; Wed, 21 Feb 2024 16:17:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyP-0003WG-Q3 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:50 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyN-0000z5-BJ for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:49 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33d26da3e15so126531f8f.1 for ; Wed, 21 Feb 2024 13:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550264; x=1709155064; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TS/v5N8VdhzRmhkYhnKkjLky4Kvoae1G5ndSJvSbSPI=; b=qe8mzHBkyj6O/Omp2SsxsOjnG1sBVQRdEBzjCBFGHCIm29qXDuHR0hCpUd68Ki/Cbp nMxIMdYLvRjNvECbzOBEjd0oUiRii244jH720dTlMLxYQuhU8MoTTyCWeYY7YH3cQ5Ii lLR00QW83OHR1u+uHQVxkI7KkNHZyTmNnN8a/ZkCAdehFOeJ64GUc6fglig71E/uVqnH AQXNnB8qVRVtDCbnNmTu/0vTKkbydtHr3s9j2xXIuaSYKtqXOHD7owsXVr89rtOlfD0D 3vSYjkwBzqZgW952fwZS5hkLUwKyK1fR+w9odJ7zFzZJ+7BUyn4c89aD/7mQmdBh9iPB rFmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550264; x=1709155064; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TS/v5N8VdhzRmhkYhnKkjLky4Kvoae1G5ndSJvSbSPI=; b=pJhSjmK9Y65kikdURIGUlZ+MNX+UQ5fmyhwGhCPEDXZvGNGwN/I8NmiDErOOntx7O5 YGMRfLTBSRPBg0PFE+95EIwh74ycbuiKDLLrF6kgj8em8LiFFZiTpJkwAUFtnUBAUHFQ Yta7bFxLI4kZDxRcqQk4Duu9KAOrkoMgQwGRNIs/gv/idzLXyTzsLOjNgtltHDbwFuHL 3V7HfA4JUFq/F0lyEM9K9DuTkE+vfwJrhO8ILafAH8CT+Ej0NMfT0SFIYiyzcYpJPZ4c OV6pAmkCzN0utLidSDXh7mPueMpAjPV49vwd0DfTDXMBYfwoBCX3jsSPFxFSg6Yoh2ia DF5g== X-Gm-Message-State: AOJu0Yx7vV24sDM078AOvMoLlK37jJw+4Q7O4e8TCMPBrH6mdRYr4onx 3043TtkkMyhB54DQsvHFHl8K8v5j7f8axJPXUB2jHPRBHs2P9vTt3IpXO5b0Y7tRiv3xnv5APJv D5Bo= X-Received: by 2002:a5d:4fce:0:b0:33d:27c3:9f47 with SMTP id h14-20020a5d4fce000000b0033d27c39f47mr480220wrw.35.1708550264622; Wed, 21 Feb 2024 13:17:44 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id q17-20020a05600c46d100b0041249ea88b9sm18846364wmo.16.2024.02.21.13.17.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:17:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 08/25] hw/i386/pc_piix: Share pc_cmos_init() invocation between pc and isapc machines Date: Wed, 21 Feb 2024 22:16:08 +0100 Message-ID: <20240221211626.48190-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Both invocations are the same and either one is always executed. Avoid this redundancy. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 999b7b806c..9064511507 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -341,11 +341,8 @@ static void pc_init1(MachineState *machine, pc_nic_init(pcmc, isa_bus, pci_bus); - if (pcmc->pci_enabled) { - pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); - } #ifdef CONFIG_IDE_ISA - else { + if (!pcmc->pci_enabled) { DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int i; @@ -363,10 +360,11 @@ static void pc_init1(MachineState *machine, busname[4] = '0' + i; idebus[i] = qdev_get_child_bus(DEVICE(dev), busname); } - pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); } #endif + pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); + if (piix4_pm) { smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); From patchwork Wed Feb 21 21:16:09 2024 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: 774521 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp460481wrw; Wed, 21 Feb 2024 13:21:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXlfcSw3URntsilhZkHhhjuSWtQDoEqrAaYHmES3tzEeDMYYqnJGWMnxepHsDR/ji44wqMzEgE6eN0pvA51O7Ly X-Google-Smtp-Source: AGHT+IEkOjEDtSiIesGVPraOfNDlnghE1YrtitdJ2kroG0ilMIR5npld+LlnOjPdTLgqrJ6IvyVN X-Received: by 2002:a0c:f310:0:b0:68f:2eac:5e1e with SMTP id j16-20020a0cf310000000b0068f2eac5e1emr3994993qvl.38.1708550496370; Wed, 21 Feb 2024 13:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550496; cv=none; d=google.com; s=arc-20160816; b=p6IEBvKWJelv1/BORmGCyp4bGlxlUCsWgM8jpcyvmAAaoNdwn4Yn5Iu6zQq65kz13z J9SpqP3ea7UeQ1QoHHwBwRUyRzeKUhB+R5jcpQyF/cEjflhnYyDY/z0p3BKkJ41m6SNw lDuvNZq5UInh2W3Ty2DnoXWcG52w5uiZcy5KeMnX386NrjeC8DzrUZA812CDLovsxPHl a7nNxstKI2bVWilGQQXc0zwo9deqWL2YmbCi4Llwkeny3iarMI0PFN4lP1kEpbkLZDh5 BkPyWp/X/gFGA+pgwqQwspmSy0gLd7XpW1A4mKWp/cbBhvfFq8br4A0JnJvShTNM+VJg vVug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3gLsl7BBn0DZO5gyuGErugwjfhowG19+Smg3Lb3vokg=; fh=ziNDwD7INcC1M9J1tYg22SezsWtooJOl5kogI1P87lo=; b=P7CX4K0Dtj4Sn/uLO46ZAGMRuPcppubG8yabouzen3SNx1z3S4bcvKcZCKKirtiNIU slTV2nNgl7og4h6nrqPYsUGzija4Sw5mPmYbeR54cONu/9JqqqL8REyECprT0+yrW/FL n8rGv8unfLELWn4AYOIGH4YHzo6D25K74N6LwgBJdJVxj5yhr4hiP2fmTGD37G3oKnrU 7WI4s+M4W+7/YXvdrKMzJFYfS1XOgAQ6Dh1dMbsdMvh8gutyf6Pb1Pjga4Q074qQw9BS spGmktRnf35iEWiuShSYXoPBcTpiPtSW053asQZArl8cmU2cVZdG3fUu/ZbJ9Eg2AbiO cTzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TClTjH7Z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j1-20020a05621419c100b0068d039dbe5esi11948910qvc.492.2024.02.21.13.21.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:21:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TClTjH7Z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyd-0004vB-5S; Wed, 21 Feb 2024 16:18:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyZ-0004g0-MB for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:59 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyS-00010W-F6 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:17:59 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-41270d0b919so15994525e9.1 for ; Wed, 21 Feb 2024 13:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550270; x=1709155070; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3gLsl7BBn0DZO5gyuGErugwjfhowG19+Smg3Lb3vokg=; b=TClTjH7ZuuBhe/WiafLP2jCKPn0aWHcprJZwk2PIGA/ChzLNVNAERvtGZ/5tVbOFnu nDTBywWk1Bk7kM12w7dG2rLxe3G33/UfFN98/onneTG1Frqd292x6mBCQmHY7PS651e7 F6g8iSeC7hOyqcmdld3UMXb0WayASWB69VtOEAZo3eEmBGNIWUjWriaD4V64IGJyJeb3 47Yt1D7RWr1N+6mLRjxANj0qJQDb7hj115FeeDacb2dLTOdwVQB38j1kLazwd+QzbTCz hUQ61wxJZiisRHoV2tE/NR2O8awvzEW4A23dQ2uuoLgOQbj0LAWDscKRvCeHBulAqgFw 9CgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550270; x=1709155070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3gLsl7BBn0DZO5gyuGErugwjfhowG19+Smg3Lb3vokg=; b=OzYm3hRxA7agyxS1XRgxOsxJ/AQRu5nH/8k+HXpY/7SQ0h+8L2ivx6HsNMm1OFBQEl pn0Esy02PFOD3Wovp2AQll/UoPLoqibCTjNON2bWf3YjnevGsaBSeNwxdKj4+5C1k4RT cQ3BS9j+YDJ1nxeFqHs6WowUC2f/mXfYba4ONHV6L/LOSE8NkON+PEQhpZLqKot5UTsg FVRge9sVp6Tkey+T2wnpEJropq0snTaFIgPiGT3KLPjCMs327Y97KOXvh3fwrzPvJ6Lp jnu7uSRsEK+AvQvO9Dah6j5vBgtBGNR2n5EPWuNdBEywHl9MJ0dgQPdIjoXCrJ50329H 8iXg== X-Gm-Message-State: AOJu0Yz1IkKCU3FP8EYvNuFFMzGqF2UJXjj6LSgmvL2lgI6t4Hpr3Qa8 f4iVBlLr3TPgB2yY+xZJqUUjIrvS2J1uMVTcoBPRZwlSm9Gpu9USmCP2fWjfi9IIn3WADvuZU7x Q/gI= X-Received: by 2002:a05:6000:1561:b0:33d:804f:5ea3 with SMTP id 1-20020a056000156100b0033d804f5ea3mr1934709wrz.69.1708550270472; Wed, 21 Feb 2024 13:17:50 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id n1-20020a5d51c1000000b0033b1c321070sm17958745wrv.31.2024.02.21.13.17.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:17:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Peter Maydell , Richard Henderson , "Michael S . Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost Subject: [PULL 09/25] hw/i386/pc: Store pointers to IDE buses in PCMachineState Date: Wed, 21 Feb 2024 22:16:09 +0100 Message-ID: <20240221211626.48190-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell Add the two IDE bus BusState pointers to the set we keep in PCMachineState. This allows us to avoid passing them to pc_cmos_init(), and also will allow a refactoring of how we call pc_cmos_init_late(). Signed-off-by: Peter Maydell Acked-by: Richard Henderson Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé [PMD: Do not zero-init pcms->idebus[] again] Message-ID: <20240220160622.114437-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 4 +++- hw/i386/pc.c | 5 ++--- hw/i386/pc_piix.c | 12 ++++-------- hw/i386/pc_q35.c | 9 +++------ 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 02a0deedd3..cf2fa60868 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -17,6 +17,8 @@ #define HPET_INTCAP "hpet-intcap" +#define MAX_IDE_BUS 2 + /** * PCMachineState: * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling @@ -37,6 +39,7 @@ typedef struct PCMachineState { PFlashCFI01 *flash[2]; ISADevice *pcspk; DeviceState *iommu; + BusState *idebus[MAX_IDE_BUS]; /* Configuration options: */ uint64_t max_ram_below_4g; @@ -182,7 +185,6 @@ void pc_basic_device_init(struct PCMachineState *pcms, bool create_fdctrl, uint32_t hpet_irqs); void pc_cmos_init(PCMachineState *pcms, - BusState *ide0, BusState *ide1, ISADevice *s); void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 9cbc59665f..3e9ca6295f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -574,7 +574,6 @@ static void pc_cmos_init_late(void *opaque) } void pc_cmos_init(PCMachineState *pcms, - BusState *idebus0, BusState *idebus1, ISADevice *rtc) { int val; @@ -634,8 +633,8 @@ void pc_cmos_init(PCMachineState *pcms, /* hard drives and FDC */ arg.rtc_state = s; - arg.idebus[0] = idebus0; - arg.idebus[1] = idebus1; + arg.idebus[0] = pcms->idebus[0]; + arg.idebus[1] = pcms->idebus[1]; qemu_register_reset(pc_cmos_init_late, &arg); } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9064511507..bea096f569 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -68,7 +68,6 @@ #include "kvm/kvm-cpu.h" #include "target/i386/cpu.h" -#define MAX_IDE_BUS 2 #define XEN_IOAPIC_NUM_PIRQS 128ULL #ifdef CONFIG_IDE_ISA @@ -114,7 +113,6 @@ static void pc_init1(MachineState *machine, Object *piix4_pm = NULL; qemu_irq smi_irq; GSIState *gsi_state; - BusState *idebus[MAX_IDE_BUS]; ISADevice *rtc_state; MemoryRegion *ram_memory; MemoryRegion *pci_memory = NULL; @@ -299,8 +297,8 @@ static void pc_init1(MachineState *machine, piix4_pm = object_resolve_path_component(OBJECT(pci_dev), "pm"); dev = DEVICE(object_resolve_path_component(OBJECT(pci_dev), "ide")); pci_ide_create_devs(PCI_DEVICE(dev)); - idebus[0] = qdev_get_child_bus(dev, "ide.0"); - idebus[1] = qdev_get_child_bus(dev, "ide.1"); + pcms->idebus[0] = qdev_get_child_bus(dev, "ide.0"); + pcms->idebus[1] = qdev_get_child_bus(dev, "ide.1"); } else { isa_bus = isa_bus_new(NULL, system_memory, system_io, &error_abort); @@ -312,8 +310,6 @@ static void pc_init1(MachineState *machine, i8257_dma_init(OBJECT(machine), isa_bus, 0); pcms->hpet_enabled = false; - idebus[0] = NULL; - idebus[1] = NULL; } if (x86ms->pic == ON_OFF_AUTO_ON || x86ms->pic == ON_OFF_AUTO_AUTO) { @@ -358,12 +354,12 @@ static void pc_init1(MachineState *machine, * second one. */ busname[4] = '0' + i; - idebus[i] = qdev_get_child_bus(DEVICE(dev), busname); + pcms->idebus[i] = qdev_get_child_bus(DEVICE(dev), busname); } } #endif - pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); + pc_cmos_init(pcms, rtc_state); if (piix4_pm) { smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index d346fa3b1d..0e9bd27a6e 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -126,7 +126,6 @@ static void pc_q35_init(MachineState *machine) PCIBus *host_bus; PCIDevice *lpc; DeviceState *lpc_dev; - BusState *idebus[MAX_SATA_PORTS]; ISADevice *rtc_state; MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); @@ -300,13 +299,11 @@ static void pc_q35_init(MachineState *machine) ICH9_SATA1_FUNC), "ich9-ahci"); ich9 = ICH9_AHCI(pdev); - idebus[0] = qdev_get_child_bus(DEVICE(pdev), "ide.0"); - idebus[1] = qdev_get_child_bus(DEVICE(pdev), "ide.1"); + pcms->idebus[0] = qdev_get_child_bus(DEVICE(pdev), "ide.0"); + pcms->idebus[1] = qdev_get_child_bus(DEVICE(pdev), "ide.1"); g_assert(MAX_SATA_PORTS == ich9->ahci.ports); ide_drive_get(hd, ich9->ahci.ports); ahci_ide_create_devs(&ich9->ahci, hd); - } else { - idebus[0] = idebus[1] = NULL; } if (machine_usb(machine)) { @@ -327,7 +324,7 @@ static void pc_q35_init(MachineState *machine) smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } - pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); + pc_cmos_init(pcms, rtc_state); /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, host_bus); From patchwork Wed Feb 21 21:16:10 2024 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: 774512 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459195wrw; Wed, 21 Feb 2024 13:18:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWechMzxIRXlVvhft1UWTlodFfBNe30pMNfbAKkMNRfShamdPYzl6HqhCKWsUVqsUdnRNS9cbR2/EJ5QyxEmyzv X-Google-Smtp-Source: AGHT+IEu6N/upro0Z3ZYDhOBAt/0C7XFqnSJUdYzwjvcetMaaBpNpVpFJttdF6Qc2hz3RD2MjY4a X-Received: by 2002:a05:6808:1a25:b0:3c1:5d21:25e with SMTP id bk37-20020a0568081a2500b003c15d21025emr10105713oib.1.1708550294612; Wed, 21 Feb 2024 13:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550294; cv=none; d=google.com; s=arc-20160816; b=xBXpqFE/fd+gc6yjqYC48TNJP0ASvuMTd+vgY87/MN3mqkYwcNbSo121u4sS3umhW7 BBwOd33Zp1T/wXfDrcc5BM1iEoyKMKrlvb3mDjw/VXr4X5+Z/4zK3+EGYNsrYfFaOUc4 PUxiwf/7zQ5a9QG7kaZgNiWFVrgtncTlEiD24HwUQlc0iUQRT3ClXOT8AvhBMSVdR84V lmNo2WLCUk8UnMoy2uQ4PhycIsYI8cVhgWtpqLXUMT1JsE0BFUyFCKLLdbETUhLPTiDC 1IWsub62T9FjLpbbxO3h2ckJNHfoPo41A6j1U3o1amUug0cwI4z6hmVM5NaRClydIAZi 11lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=27hOzulyzznR+8+N4cQ8+ljTXaEP/WvWvivYVWJzeRw=; fh=fOS9T8nZxGxNTWJFjTtcwB9FTA7dJSlPWQ2iU6/sqUU=; b=G05bJFb1rOSSTN3KweOqvKIzhseSEIpHbNfv8AVh5ZhZYwQAQv2BlS8NUV5tBJL9ll 3VlyytSfRodqCUHniUclxpBTQVruj7vebFl42fQjiHkbj/iVPj7Wx/px8z9PJ2FrGFoW Mbi1Wbq5woKf1XQDNs6m1cza9gz0vrCHECmQe6zDTOb5Izh3awFvrMxgiZUUTOuWXXY4 byhewF0jNkZYQ1MtB+XL3a1fNS1lSsHiwUSKKNXKGNz+k+9n9Bjkp5gd83U5ahQhtFob aeV5GVNcC8bQbLMOg2qjeANPHPhr9G8Pqs3YCo4BTgwNtTC8ZDPqeF2fI5kgKCexJf0B OhHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kex/o3hY"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q4-20020a056214194400b0068f973111ddsi4147582qvk.572.2024.02.21.13.18.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:18:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kex/o3hY"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyh-0005KS-Ue; Wed, 21 Feb 2024 16:18:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyb-0004rF-Bb for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:01 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyZ-00012x-6U for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:00 -0500 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-512cc3ea7a5so2518049e87.3 for ; Wed, 21 Feb 2024 13:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550277; x=1709155077; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=27hOzulyzznR+8+N4cQ8+ljTXaEP/WvWvivYVWJzeRw=; b=kex/o3hY7dTIqeyR0VHiV5Uq41H7oL+U6aqLO8K0kz1ICVxCGYdI+4PVIjKj5BHR/z k+bhIgU+Kxe5nIzWzFSN/v3bBZ9NOXGyGxdjKKK9xa1B7lcxzFQWVvmGExuAc4nMzmab E8oZy2giWmhTM5RayoRBAzx6u9j0UHQIUJScGLzfmeocBRpsPz3al5EJyp9wYe0WKT0r pazQZX8MVkjqHDu8gZJ7rxobnMKa5nwlX+jFOKL6Wk4/yCZTGvbGCcRDLSDwu+n6NXl7 zfgiAVWu7VQdglxQUReAK/VKGJ0qhG3bivrHbRJ6AzoBGaLdjQ8iM2b9r8cTt4LEWFmY u2UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550277; x=1709155077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=27hOzulyzznR+8+N4cQ8+ljTXaEP/WvWvivYVWJzeRw=; b=X4Qt/OUTnjpqwFl7nrkFABFiSBvHvbg/1AJ8vArvt/Uqj+Gb5yGyPAQgrugZmdR51h qa5GDzjrTFFkVxzmWxKAKDroUMTNSPnL5PvecO8t65j6DOCabRJBcE5QZaNc8LO+rlS8 oOVPPVIsSi2qg6OQ4+sJt98C/ihSr3Qrz2DVGPTUZNdxZAhQFrmXZh0oHf97z9QEBeHI 8dorgkSAoo14AywdMkOdFRpIppsMJ7egKWDkt2RJKPG2CgolbR6Tb1+POMadJGWw4N8X ZwUjwCMLYooDHij+vm9EXFqRVhMXoVftHf95W5UvZ1tR/rPxtU1xwfk9FaHfweHfRs+9 ZBvA== X-Gm-Message-State: AOJu0Yz8SM5NS9U8bTYl/VfdNV5r4k91hiSKhnYaoQB9bej80Nw0+bMZ jHxxBPZq9wxjTD36OKpQKDBszI8f7kiqpkGrIPlvcFN0Fc/25IDeyqXHcqz4LisWxHNJVJ9gwPL fgVc= X-Received: by 2002:a2e:878a:0:b0:2d2:3594:49f6 with SMTP id n10-20020a2e878a000000b002d2359449f6mr7329948lji.14.1708550277021; Wed, 21 Feb 2024 13:17:57 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bs20-20020a056000071400b0033d449f5f65sm12676547wrb.4.2024.02.21.13.17.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:17:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Peter Maydell , Richard Henderson , "Michael S . Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 10/25] hw/i386/pc: Do pc_cmos_init_late() from pc_machine_done() Date: Wed, 21 Feb 2024 22:16:10 +0100 Message-ID: <20240221211626.48190-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell In the i386 PC machine, we want to run the pc_cmos_init_late() function only once the IDE and floppy drive devices have been set up. We currently do this using qemu_register_reset(), and then have the function call qemu_unregister_reset() on itself, so it runs exactly once. This was an expedient way to do it back in 2010 when we first added this (in commit c0897e0cb94e8), but now we have a more obvious point to do "machine initialization that has to happen after generic device init": the machine-init-done hook. Do the pc_cmos_init_late() work from our existing PC machine init done hook function, so we can drop the use of qemu_register_reset() and qemu_unregister_reset(). Because the pointers to the devices we need (the IDE buses and the RTC) are now all in the machine state, we don't need the pc_cmos_init_late_arg struct and can just pass the PCMachineState pointer. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240220160622.114437-3-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3e9ca6295f..1733dffc00 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -465,11 +465,6 @@ static void pc_cmos_init_floppy(MC146818RtcState *rtc_state, ISADevice *floppy) mc146818rtc_set_cmos_data(rtc_state, REG_EQUIPMENT_BYTE, val); } -typedef struct pc_cmos_init_late_arg { - MC146818RtcState *rtc_state; - BusState *idebus[2]; -} pc_cmos_init_late_arg; - typedef struct check_fdc_state { ISADevice *floppy; bool multiple; @@ -530,23 +525,25 @@ static ISADevice *pc_find_fdc0(void) return state.floppy; } -static void pc_cmos_init_late(void *opaque) +static void pc_cmos_init_late(PCMachineState *pcms) { - pc_cmos_init_late_arg *arg = opaque; - MC146818RtcState *s = arg->rtc_state; + X86MachineState *x86ms = X86_MACHINE(pcms); + MC146818RtcState *s = MC146818_RTC(x86ms->rtc); int16_t cylinders; int8_t heads, sectors; int val; int i, trans; val = 0; - if (arg->idebus[0] && ide_get_geometry(arg->idebus[0], 0, - &cylinders, &heads, §ors) >= 0) { + if (pcms->idebus[0] && + ide_get_geometry(pcms->idebus[0], 0, + &cylinders, &heads, §ors) >= 0) { cmos_init_hd(s, 0x19, 0x1b, cylinders, heads, sectors); val |= 0xf0; } - if (arg->idebus[0] && ide_get_geometry(arg->idebus[0], 1, - &cylinders, &heads, §ors) >= 0) { + if (pcms->idebus[0] && + ide_get_geometry(pcms->idebus[0], 1, + &cylinders, &heads, §ors) >= 0) { cmos_init_hd(s, 0x1a, 0x24, cylinders, heads, sectors); val |= 0x0f; } @@ -558,10 +555,11 @@ static void pc_cmos_init_late(void *opaque) geometry. It is always such that: 1 <= sects <= 63, 1 <= heads <= 16, 1 <= cylinders <= 16383. The BIOS geometry can be different if a translation is done. */ - if (arg->idebus[i / 2] && - ide_get_geometry(arg->idebus[i / 2], i % 2, + BusState *idebus = pcms->idebus[i / 2]; + if (idebus && + ide_get_geometry(idebus, i % 2, &cylinders, &heads, §ors) >= 0) { - trans = ide_get_bios_chs_trans(arg->idebus[i / 2], i % 2) - 1; + trans = ide_get_bios_chs_trans(idebus, i % 2) - 1; assert((trans & ~3) == 0); val |= trans << (i * 2); } @@ -569,15 +567,12 @@ static void pc_cmos_init_late(void *opaque) mc146818rtc_set_cmos_data(s, 0x39, val); pc_cmos_init_floppy(s, pc_find_fdc0()); - - qemu_unregister_reset(pc_cmos_init_late, opaque); } void pc_cmos_init(PCMachineState *pcms, ISADevice *rtc) { int val; - static pc_cmos_init_late_arg arg; X86MachineState *x86ms = X86_MACHINE(pcms); MC146818RtcState *s = MC146818_RTC(rtc); @@ -631,11 +626,7 @@ void pc_cmos_init(PCMachineState *pcms, val |= 0x04; /* PS/2 mouse installed */ mc146818rtc_set_cmos_data(s, REG_EQUIPMENT_BYTE, val); - /* hard drives and FDC */ - arg.rtc_state = s; - arg.idebus[0] = pcms->idebus[0]; - arg.idebus[1] = pcms->idebus[1]; - qemu_register_reset(pc_cmos_init_late, &arg); + /* hard drives and FDC are handled by pc_cmos_init_late() */ } static void handle_a20_line_change(void *opaque, int irq, int level) @@ -703,6 +694,8 @@ void pc_machine_done(Notifier *notifier, void *data) /* update FW_CFG_NB_CPUS to account for -device added CPUs */ fw_cfg_modify_i16(x86ms->fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); } + + pc_cmos_init_late(pcms); } void pc_guest_info_init(PCMachineState *pcms) From patchwork Wed Feb 21 21:16:11 2024 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: 774517 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459540wrw; Wed, 21 Feb 2024 13:19:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW3bFTvzLd1MGLbSfhFAfxiLSoeYOmrPpuh5USYfVElYxGTKM9yhXA5arx9c1u89ZF7SOoM6vcszX64XK925X/0 X-Google-Smtp-Source: AGHT+IEYUIJiIAp6yAnklMB/13M5LJIwEO8UebrcGprMi6Tz5G78/L6WnyBQfqlCbbTDo7cEnIMy X-Received: by 2002:ac8:5a56:0:b0:42d:adce:fcdb with SMTP id o22-20020ac85a56000000b0042dadcefcdbmr24446714qta.58.1708550350114; Wed, 21 Feb 2024 13:19:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550350; cv=none; d=google.com; s=arc-20160816; b=k/CiGGEl7nl0xxKubXWYJhfv1Rv4dQBMSqOqO0W8fJwoa+S5dJc5rHVw7UGHUTwqaY 1R3OdWCuhDEChSgLxWTkwuIwtWZFU1sHnIRz9s8VVCSa3u2YWxswLLI3AQg/oShorDsU TFy8IvY/KirCfwux3NJAo7DJtNSM7Y+uonJAdMaJ1k1LjxS/UICc1EVJlVBX2L0C4kOk SGRPKlPYg7T0QdrgzOJTd8C3PZIhcbBwbNFa+CNWzXAXJHEdwdggWN1ZCfnGWpgK3apH T8VrZI/XonVkeClhHBaA889RuEq5+HC4zRgWtrnGGm51ucrn2xbBJ7fSGQlajrc+Uo6l 3OkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B1hBOWCBa8Kc+AFXTCFEtySegdqlIvAldt191B4hj40=; fh=oiq67qnM8BqA32ksqeHh/BJ2xCOd1MIE3GFJJBbt894=; b=eY7Lt4t1GyeZ6N/AWuTDDlL/+R4VVq/H3J2rKSaQXFCmcvyKzEfr11c3xcmoQhlxUz MU03WSwbJvpQlzywloHoOm+l9BZKWa561qMWGnXlCRhq+xO4RWdtBC6pctK2d36ntgXL 3WphHwv45FRn8gR9OyG2PUPP13C6TywNTn7yb83E0gUqsspxwkwjYoQTJ7g8XT7nT537 Oi5TEOsO2H+Kblx/gN/MP3NLNRhvoDGYSItzJHDIiWe+7jf9KX1IRJ4Wnxah/Um3oQgA xGdylBW6wad+mSSvcMNz9NrB93rOrH7q4ReCJ1qnxXpKJksgUz09OdsGEzeAKivuEx36 A4/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bxlRPqzI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t20-20020ac85314000000b0042da72aa198si11409887qtn.207.2024.02.21.13.19.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:19:10 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bxlRPqzI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctym-0005zz-Jh; Wed, 21 Feb 2024 16:18:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyi-0005Tt-1p for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:08 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyf-000145-6g for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:07 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2d09cf00214so80603461fa.0 for ; Wed, 21 Feb 2024 13:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550283; x=1709155083; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B1hBOWCBa8Kc+AFXTCFEtySegdqlIvAldt191B4hj40=; b=bxlRPqzIWBooO6TMuH4aztPfAbHTT1axJyOtQibOOq8zFfeY2ppC9KmFb41u2P8Skl cpxXphpQlh7QKvdlFyxhat7g+/6Ayxr2JYGpKqAirG+2yHXRuyE2+6ZvH8PTjqzW5SVL 58RcIJX8QeExsFrpp/+Z2oU6o5rGyx+T56X5nwgWcntoMZybbD9vvyljH8xIQN8wqwiE WDyY0qoqXSr6K+oJLkaaqOG4fST0y9dupmergl2sjpvrAnvcAMtl+n25u5A0YVIZZoVs u1Rm3jouQ1qjubnfnPlw8wgUY8joBDwqBzMqnOn9Amy53OH/bq4vYIlcnIX1hCz0H6Ka BY6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550283; x=1709155083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B1hBOWCBa8Kc+AFXTCFEtySegdqlIvAldt191B4hj40=; b=SYrPi21cGCpi3qfucxu9gxcb0OEyzkPvFoXhTBYMrWoaqBFVVDUyfH+xfSmK4/8K8x dJN0r+ucpumKVr285cJliMsL4rwdeIw5TWN9gxBa+RniagEaVHV0eG8c+muFx3o/RkeW zuZ66bG4V9J1DMjzvyuGU2YxThqE9wtI8ub9Liq0Zw7oA90fiaikbHfj76VtRyRPp6On aOgA4QZ65z+1kZ14qDlwj/KmKVFJe6fTT11jA4QdK7HS7UaCrvIJQAAzoGrnpXl6w6sP FhBdA3E9/KybEKkgEmXhcu94OAYCec7v0W4t9Hr9nBRdCDIA47Rk5azuGnSSkqCaLCHk wBtg== X-Gm-Message-State: AOJu0YwE1d8w26vWNqZY5NmVGgqGnM8VwVTuMKusCUV+bj6f7ek340Js 5OhnA8dVIhCz+6kv56GU7oD9xigOrv7N3wwJ9fy/OgrU/Sm3qBi9HkbMKc9y3r5MZFgDVhv+UeS jTCM= X-Received: by 2002:a05:651c:1543:b0:2d2:47e0:4427 with SMTP id y3-20020a05651c154300b002d247e04427mr4972111ljp.41.1708550283044; Wed, 21 Feb 2024 13:18:03 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id t11-20020a05600c198b00b0041270c2b95esm5969210wmq.29.2024.02.21.13.18.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 11/25] hw/i386/x86: Turn apic_xrupt_override into class attribute Date: Wed, 21 Feb 2024 22:16:11 +0100 Message-ID: <20240221211626.48190-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow The attribute isn't user-changeable and only true for pc-based machines. Turn it into a class attribute which allows for inlining pc_guest_info_init() into pc_machine_initfn(). Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-4-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/x86.h | 3 ++- hw/i386/acpi-common.c | 3 ++- hw/i386/pc.c | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index da19ae1546..8e306db7bb 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -34,6 +34,8 @@ struct X86MachineClass { bool save_tsc_khz; /* use DMA capable linuxboot option rom */ bool fwcfg_dma_enabled; + /* CPU and apic information: */ + bool apic_xrupt_override; }; struct X86MachineState { @@ -57,7 +59,6 @@ struct X86MachineState { uint64_t above_4g_mem_start; /* CPU and apic information: */ - bool apic_xrupt_override; unsigned pci_irq_mask; unsigned apic_id_limit; uint16_t boot_cpus; diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 43dc23f7e0..cea4b3d71c 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -100,6 +100,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *linker, int i; bool x2apic_mode = false; MachineClass *mc = MACHINE_GET_CLASS(x86ms); + X86MachineClass *x86mc = X86_MACHINE_GET_CLASS(x86ms); const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(x86ms)); AcpiTable table = { .sig = "APIC", .rev = 3, .oem_id = oem_id, .oem_table_id = oem_table_id }; @@ -122,7 +123,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *linker, IO_APIC_SECONDARY_ADDRESS, IO_APIC_SECONDARY_IRQBASE); } - if (x86ms->apic_xrupt_override) { + if (x86mc->apic_xrupt_override) { build_xrupt_override(table_data, 0, 2, 0 /* Flags: Conforms to the specifications of the bus */); } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1733dffc00..d7183780bd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -700,9 +700,6 @@ void pc_machine_done(Notifier *notifier, void *data) void pc_guest_info_init(PCMachineState *pcms) { - X86MachineState *x86ms = X86_MACHINE(pcms); - - x86ms->apic_xrupt_override = true; pcms->machine_done.notify = pc_machine_done; qemu_add_machine_init_done_notifier(&pcms->machine_done); } @@ -1795,6 +1792,7 @@ static bool pc_hotplug_allowed(MachineState *ms, DeviceState *dev, Error **errp) static void pc_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); + X86MachineClass *x86mc = X86_MACHINE_CLASS(oc); PCMachineClass *pcmc = PC_MACHINE_CLASS(oc); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); @@ -1814,6 +1812,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->pvh_enabled = true; pcmc->kvmclock_create_always = true; pcmc->resizable_acpi_blob = true; + x86mc->apic_xrupt_override = true; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = pc_get_hotplug_handler; mc->hotplug_allowed = pc_hotplug_allowed; From patchwork Wed Feb 21 21:16:12 2024 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: 774529 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461820wrw; Wed, 21 Feb 2024 13:25:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUQwzYoU78uDKsvYpR7AyOzL++KmdSpxWa372+64RKltkSK++Vsp+T9pHbKWwg8QT4HIXUH9LPXd5pJVwyuZVUc X-Google-Smtp-Source: AGHT+IG2Qn+p3tcaJT+S3lYPPH0JYrNZf0PSF70OQzfF7R8XNm5LKvh8cjNpl/MAH0zCcxNm7GSs X-Received: by 2002:a05:620a:3956:b0:787:2bc5:b455 with SMTP id qs22-20020a05620a395600b007872bc5b455mr23835745qkn.6.1708550739697; Wed, 21 Feb 2024 13:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550739; cv=none; d=google.com; s=arc-20160816; b=zBbfhqtUXPIVeE752QfOajnTM1GkS8FxlcaZ0qefMfxNefgKIVcu9q4UClmoGtrxHA OGBWAsEp70RoaUW6lGIg0OpgXkMVx4LNp7uQ3ksvmnXxq3GiXjtHi+L5BSYseYenh3M0 3a5UjGsLC5DSG3pDEVlI4NeuTmSNj7+ayCpD/jpE3rAnA0TeQFUUKgsbg5dh244/Gxw1 yQIQXv0bCbBvVTKf7Wt19+iUdKg+aytXyDhnpxzp58/gRs21q3TF+X/gbBFlxZSMHXdW nHeXqkBdjKSDdAe5mIchFqtflTghIcYvKFnmVGJSTElr3Xs8QLyceO5hbHcC9AWA2WAm 5nsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XwtVJOAzHCvEh5zeHnf1CnqeZsBBSTY3uRRfR/7NLW8=; fh=oiq67qnM8BqA32ksqeHh/BJ2xCOd1MIE3GFJJBbt894=; b=vtCmdOhIC2jaIVQfUJ8sb8VHYaRnyUU3jjqNJbtAxmzBBcGrP55cg+DMLVXTvolW14 j9ndY+XULxxCePZUVdMiWNcw6SJVcCva5ivQeM+6JMsgjk/7J5ovn6DdC2T6BFgXSQpa 6kJtABGigSs0Ha3i0+CqMhaukSMPZj74yTF1KQ7xL2mOfLWXlN7/X/cOQY82yUalRPvb k0X3VNNIjMsk3JATk1ugwPoWUiEEtuNfIrsRuPEIlwuUznbEMaZGiVfqRHevgtkWX+H+ IulZupR7whC34JaJa3vKP1E/zKoXYHYiDv2pWpunpxrNCgibZa8EtA/BV/r3wTpG8QZG UaWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k7M65HuW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a17-20020a05620a067100b007858e39cb76si10985969qkh.589.2024.02.21.13.25.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:25:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k7M65HuW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyu-0006rj-9a; Wed, 21 Feb 2024 16:18:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyq-0006Vq-M7 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:16 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyk-00014z-Lz for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:16 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33d4c0b198aso730701f8f.2 for ; Wed, 21 Feb 2024 13:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550288; x=1709155088; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XwtVJOAzHCvEh5zeHnf1CnqeZsBBSTY3uRRfR/7NLW8=; b=k7M65HuWfT9rTjKKBypVlcMJ9HLsgS5D4kI4RIA7ar37Rs83OXjglwFLBFGuckfrKT K0/GaQDUZYikOb1xMR4I9JRT6ZazJhmpQof7qF3xXHVkkq2f017wWkbqFsDqUtgwSxmB pq8LeEBq8igyzdleE9sWRFUN5/oD2dVtVrK4U6yGW8V/9snw8eWiRIPPm3LfxylJSyw1 9FYGnZXFtrrcQKMnMTTVtNBlUgXdyCLX1cE8KMKdO2e//d2Z1gPpzKcmDg8qfP8A6hk0 Fk6ILIXzWPD++VqBRvqRYbpEVMgHKIfInFk7DpaYdsc5lUZiZ1X08/JIuGURkCGtUsfU vS3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550288; x=1709155088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XwtVJOAzHCvEh5zeHnf1CnqeZsBBSTY3uRRfR/7NLW8=; b=uqdU77mfkmMv13Pnc55YwQDxk9wxSEMZgmpjWfFsi/oJvEr7Z1lN6j98BnRdAJ5Ilx ATYghbpukvZySwj3HUPQVu9vxG93dAqnNqW2znecdGEMd96BjytSA/t1zX0eIFtZCY5V RbuPY61l12rtIQgbjK+5k1kEGupxEgfptlVya1Gm19k5+j2JdnEeqnHJaRCI/STikw/I 0OZZ7vC0a8/Jj41MmMbjbBnxVDAufdsWkr0BxXd0pRoSbFHX95dItQD9D0pHVOXuM1wR 2D7bHOIFL6JsOx6/v6pu3X2rS/2Ob1NdfKKTw9XG8U6E2Pek8qPLlwh90ri2/QGVGe5n vSHA== X-Gm-Message-State: AOJu0YyHMB+7K5UVScP3fjFVB/pmHOdZWqOU+nmwiapvqRjXNYVJboHJ CMmfrArhpO7fc+FGQS9coRV3XpXOeccqpa5P9e7H0ygK6LFOJs5DkLPdQov/pBSeE9OUSC1ygai JYzU= X-Received: by 2002:a05:6000:184a:b0:33d:6b89:fbbb with SMTP id c10-20020a056000184a00b0033d6b89fbbbmr4816826wri.47.1708550288697; Wed, 21 Feb 2024 13:18:08 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bx14-20020a5d5b0e000000b0033d6bd4eab9sm6920318wrb.1.2024.02.21.13.18.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 12/25] hw/i386/pc: Merge pc_guest_info_init() into pc_machine_initfn() Date: Wed, 21 Feb 2024 22:16:12 +0100 Message-ID: <20240221211626.48190-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Resolves redundant code in the piix and q35 machines. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 9 +++------ hw/i386/pc_piix.c | 2 -- hw/i386/pc_q35.c | 2 -- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index cf2fa60868..39cdb9b933 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -154,8 +154,6 @@ extern int fd_bootchk; void pc_acpi_smi_interrupt(void *opaque, int irq, int level); -void pc_guest_info_init(PCMachineState *pcms); - #define PCI_HOST_PROP_RAM_MEM "ram-mem" #define PCI_HOST_PROP_PCI_MEM "pci-mem" #define PCI_HOST_PROP_SYSTEM_MEM "system-mem" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d7183780bd..694de8e130 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -698,12 +698,6 @@ void pc_machine_done(Notifier *notifier, void *data) pc_cmos_init_late(pcms); } -void pc_guest_info_init(PCMachineState *pcms) -{ - pcms->machine_done.notify = pc_machine_done; - qemu_add_machine_init_done_notifier(&pcms->machine_done); -} - /* setup pci memory address space mapping into system address space */ void pc_pci_as_mapping_init(MemoryRegion *system_memory, MemoryRegion *pci_address_space) @@ -1744,6 +1738,9 @@ static void pc_machine_initfn(Object *obj) object_property_add_alias(OBJECT(pcms), "pcspk-audiodev", OBJECT(pcms->pcspk), "audiodev"); cxl_machine_init(obj, &pcms->cxl_devices_state); + + pcms->machine_done.notify = pc_machine_done; + qemu_add_machine_init_done_notifier(&pcms->machine_done); } static void pc_machine_reset(MachineState *machine, ShutdownCause reason) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index bea096f569..eeca725504 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -225,8 +225,6 @@ static void pc_init1(MachineState *machine, &error_abort); } - pc_guest_info_init(pcms); - if (pcmc->smbios_defaults) { MachineClass *mc = MACHINE_GET_CLASS(machine); /* These values are guest ABI, do not change */ diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 0e9bd27a6e..8053d8cccb 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -188,8 +188,6 @@ static void pc_q35_init(MachineState *machine) kvmclock_create(pcmc->kvmclock_create_always); } - pc_guest_info_init(pcms); - if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ smbios_set_defaults("QEMU", mc->desc, From patchwork Wed Feb 21 21:16:13 2024 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: 774516 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459500wrw; Wed, 21 Feb 2024 13:19:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVmkzl3fvOoshAUSN8jWN1zLRkCJA6rKTPwna3V+0WzA3wTExmfq50YwUBGI70D1Yli6K0j7Ae+O3mjngxph7D2 X-Google-Smtp-Source: AGHT+IFitfzvLSGh3dXrD6n5fVIkqVPhjCsKzfEeC0lZ2WK7ZirceGCghejQO1z8s/oBQRLEfjnO X-Received: by 2002:a05:622a:1747:b0:42c:6e72:f6d2 with SMTP id l7-20020a05622a174700b0042c6e72f6d2mr1040549qtk.10.1708550341609; Wed, 21 Feb 2024 13:19:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550341; cv=none; d=google.com; s=arc-20160816; b=AbzZ+cL9JwY9COaFCry9eB3ZoXndk7wqGCAhGsKCPSNNSKz5WqUhW/Awt4U5uNqUge kuBtrLgjC9Azxt5rblzX2Kce6SdXpa1gv3g5gNRBkDNbvMgjOXJTr1mBoU2mIIkuzNKo FkQohx4cyUlVlQUjzbXIINANY2uiEmh5k63ZqLa1Ty4pkutj6m1GxAZ/K6N3/mRlWzpH TpEj5m8KljHOXLLcRHYGH1PiulLW+RfGTlEJDDsFtRJLgBvapGf0131Jys9pmRw4Mok3 q2UQBoFsxcMBcVaRz2Bqv4wFRNFKrEaoGY9Sw9aMSFx7pA4vo3m6qAgei92RgbsHW41s cvuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2NDbYpJ4EdF7CcKKuGkJjZq3a85KtwD7y7arPJ8C56o=; fh=oiq67qnM8BqA32ksqeHh/BJ2xCOd1MIE3GFJJBbt894=; b=tCDDI/OWtcIUjy9SwoN4T1v4uTammaQgCbsyzKAB1TBpgTjt8F2jA0po67hy5EwV3J oImI2UTSw3/3ZBQZEyh/+lg8V0xSXmfhHgQH3bUgGGFTcgQv3Opt5kaQAhZVctZPs8xk r0O0uFRS9RMainq/owywkP395+ICh2/0BhW2PYDMH9N+thHt5GdZUJqUSQ+8ZHj8G96C BaV4+bNkjqI/TZ+IY1ywf+6829MKwP3SArl2Nnm7Jq3apTLRDmWmel4LY8IWzyQ5zLjb jXVNfddk9NFPeRrct5lX8ECpLl5v2ntmXoF7GaErI+Yy6idfd9g3Rsgk75ygsTtXdf06 jfzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fcy48vvJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i17-20020ac84891000000b0042e124eafe6si7014552qtq.146.2024.02.21.13.19.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:19:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fcy48vvJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyw-00073U-6p; Wed, 21 Feb 2024 16:18:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctys-0006gI-F1 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:18 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyq-00015l-2g for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:17 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-33d8d208b6cso595f8f.2 for ; Wed, 21 Feb 2024 13:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550294; x=1709155094; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2NDbYpJ4EdF7CcKKuGkJjZq3a85KtwD7y7arPJ8C56o=; b=Fcy48vvJC/x4A5u1WeCitCOwaTN71l2VQcECTFTZ22Rr+V93KuX88rQ3CWmOWOUh05 B1bp2SHHSrLPDI9XhGKbKafEP0Cavhva9vRUs6WJ4W7JE5+GnVi1dbUbq7zzkc3z/5M5 PP/SnK586LUNmAXtw8nJTutPoABAKP4VVHrpz5wc1r0mnCObZvNvQgYuB1UzDHU8DVRh 1Opl6xAAdxnu30FESgKlcwWOequgKOLUy2wCXeQ/aCfRkV52VgtBwRc/Mt/uCQiwW7FF Tf6nR72AwY4ElxKRQV5uN6I7LcuBFS+1J9UUdre+p6gvz5P6SyZ7Fo4/55i96S6YnQoi 6Sng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550294; x=1709155094; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2NDbYpJ4EdF7CcKKuGkJjZq3a85KtwD7y7arPJ8C56o=; b=iAjRFRoxO1JOtX91HNBoCIfH5Xko/LZYyzDn81Jk8A1IRSY7sUCmIjuA8GGekmEBiD xFVX1aSGp31nqiQtmkPgNP/+zZFbQY8iyqNfo9mfIP+ZLl66tR2taU7lz53nBcKKz8zH i3VY14yGBF2HlG8yegcLbe5eZDpG4uZLbyhQK6LWHp1gD45Q5GEe7LOC/+xMMX28VUw7 CvE8zPVwydCZpThQQOOzMGsa0c1MIiRsh1ioEI8p3EikVpFsEs0WGJJGy2DpNg5J97nN vWEp2PcOxpurqvUa/BVq/xtE+79ua1YJ3/lQOAyzxkXdKz704LBEDcAvwOwObN+K1B2l JVGw== X-Gm-Message-State: AOJu0YzSNh8xslXpdA6fGEOqn1GSbIihUO+T8hAOkuSVdwA9HE+d9K26 fEfekHgEqUYTaP/1sYJoatuBJmwEBBuVqwCr5j/g9FWdc6zV3iZKqmxfvtUoZYJZyBm7OHN03Kf 7WBs= X-Received: by 2002:adf:d1ef:0:b0:33d:2198:f2fc with SMTP id g15-20020adfd1ef000000b0033d2198f2fcmr15766982wrd.2.1708550294459; Wed, 21 Feb 2024 13:18:14 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id e6-20020adffd06000000b0033cf60e268fsm17873029wrr.116.2024.02.21.13.18.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 13/25] hw/i386/pc: Defer smbios_set_defaults() to machine_done Date: Wed, 21 Feb 2024 22:16:13 +0100 Message-ID: <20240221211626.48190-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Handling most of smbios data generation in the machine_done notifier is similar to how the ARM virt machine handles it which also calls smbios_set_defaults() there. The result is that all pc machines are freed from explicitly worrying about smbios setup. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/fw_cfg.h | 3 ++- include/hw/i386/pc.h | 1 - hw/i386/fw_cfg.c | 12 +++++++++++- hw/i386/pc.c | 2 +- hw/i386/pc_piix.c | 10 ---------- hw/i386/pc_q35.c | 9 --------- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/hw/i386/fw_cfg.h b/hw/i386/fw_cfg.h index 86ca7c1c0c..1e1de6b4a3 100644 --- a/hw/i386/fw_cfg.h +++ b/hw/i386/fw_cfg.h @@ -10,6 +10,7 @@ #define HW_I386_FW_CFG_H #include "hw/boards.h" +#include "hw/i386/pc.h" #include "hw/nvram/fw_cfg.h" #define FW_CFG_IO_BASE 0x510 @@ -22,7 +23,7 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, uint16_t boot_cpus, uint16_t apic_id_limit); -void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg); +void fw_cfg_build_smbios(PCMachineState *ms, FWCfgState *fw_cfg); void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg); void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 39cdb9b933..0a8a96600c 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -12,7 +12,6 @@ #include "hw/hotplug.h" #include "qom/object.h" #include "hw/i386/sgx-epc.h" -#include "hw/firmware/smbios.h" #include "hw/cxl/cxl.h" #define HPET_INTCAP "hpet-intcap" diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 7362daa45a..98a478c276 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -48,15 +48,25 @@ const char *fw_cfg_arch_key_name(uint16_t key) return NULL; } -void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg) +void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg) { #ifdef CONFIG_SMBIOS uint8_t *smbios_tables, *smbios_anchor; size_t smbios_tables_len, smbios_anchor_len; struct smbios_phys_mem_area *mem_array; unsigned i, array_count; + MachineState *ms = MACHINE(pcms); + PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); + MachineClass *mc = MACHINE_GET_CLASS(pcms); X86CPU *cpu = X86_CPU(ms->possible_cpus->cpus[0].cpu); + if (pcmc->smbios_defaults) { + /* These values are guest ABI, do not change */ + smbios_set_defaults("QEMU", mc->desc, mc->name, + pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, + pcms->smbios_entry_point_type); + } + /* tell smbios about cpuid version and features */ smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 694de8e130..e526498164 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -689,7 +689,7 @@ void pc_machine_done(Notifier *notifier, void *data) acpi_setup(); if (x86ms->fw_cfg) { - fw_cfg_build_smbios(MACHINE(pcms), x86ms->fw_cfg); + fw_cfg_build_smbios(pcms, x86ms->fw_cfg); fw_cfg_build_feature_control(MACHINE(pcms), x86ms->fw_cfg); /* update FW_CFG_NB_CPUS to account for -device added CPUs */ fw_cfg_modify_i16(x86ms->fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index eeca725504..34203927e1 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -36,7 +36,6 @@ #include "hw/rtc/mc146818rtc.h" #include "hw/southbridge/piix.h" #include "hw/display/ramfb.h" -#include "hw/firmware/smbios.h" #include "hw/pci/pci.h" #include "hw/pci/pci_ids.h" #include "hw/usb.h" @@ -225,15 +224,6 @@ static void pc_init1(MachineState *machine, &error_abort); } - if (pcmc->smbios_defaults) { - MachineClass *mc = MACHINE_GET_CLASS(machine); - /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", mc->desc, - mc->name, pcmc->smbios_legacy_mode, - pcmc->smbios_uuid_encoded, - pcms->smbios_entry_point_type); - } - /* allocate ram and load rom/bios */ if (!xen_enabled()) { pc_memory_init(pcms, system_memory, rom_memory, hole64_size); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 8053d8cccb..ab7750c346 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -45,7 +45,6 @@ #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" #include "hw/display/ramfb.h" -#include "hw/firmware/smbios.h" #include "hw/ide/pci.h" #include "hw/ide/ahci-pci.h" #include "hw/intc/ioapic.h" @@ -188,14 +187,6 @@ static void pc_q35_init(MachineState *machine) kvmclock_create(pcmc->kvmclock_create_always); } - if (pcmc->smbios_defaults) { - /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", mc->desc, - mc->name, pcmc->smbios_legacy_mode, - pcmc->smbios_uuid_encoded, - pcms->smbios_entry_point_type); - } - /* create pci host bus */ phb = OBJECT(qdev_new(TYPE_Q35_HOST_DEVICE)); From patchwork Wed Feb 21 21:16:14 2024 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: 774519 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp459759wrw; Wed, 21 Feb 2024 13:19:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaf0RNKa5mM7wZYHHGUN5088bqoj/XZwOHmftCnv3dAATPP8CAJwE9cPt+H5m5OeGTBwVM5V7IyawYC9toId5n X-Google-Smtp-Source: AGHT+IFYyUo0Dg3l484/oDUme9iO0Wu/F9r7SRsfaVba94KmZGyHUnK/oBISKyd1AGnznauDQnit X-Received: by 2002:a05:622a:1310:b0:42e:42eb:3e41 with SMTP id v16-20020a05622a131000b0042e42eb3e41mr1593548qtk.46.1708550382961; Wed, 21 Feb 2024 13:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550382; cv=none; d=google.com; s=arc-20160816; b=F33+mIPLbjYyVjbOj/cqNiGtAVNvzfZKTRjT0hiB3Quzhm04ZVDYt3nCPX+Fovg5Iy Rs774AIJ7WghjlOlrarkfRVdaJI01MwFQLCirPeuah7ZzW7f08k4QAP5Dq4ppDxazJiv lPrUo9AFVjUwRFZ+GaF1Fbj1tPkGkVIs1wRStWvJlZTZdZmtZDN9QRdGTp1xXTySGL1m 5ZuITHPLGhjL6V2t6qXCJP6tKOrilVFjWqyhIw6mcS1ibm5FHJLh0pPfBv5YcixzQPhG MDFTzWVaoD07HsUpFqSX90JIM/c0VRyRvzpVyLyFsiLiaF+Xhp7JhuBhlHQJFS5tuwgp DI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AbWaENVXrPEDOnkXsgR9cEbYG3NY0XwtRW+JhFfX4HQ=; fh=oiq67qnM8BqA32ksqeHh/BJ2xCOd1MIE3GFJJBbt894=; b=RVWwDvSQaF9LKzU2vse0LJaIPyyaWobyHmi4Pf4WEQJBcphQ+e0YiIzStUg4KSTsiG r/sQLHbrdzbtolEteFd2DTxrBD0F4Y7cIf23vNsDL5MEpuvvp3eRsa5woLD0BClZguGN lvYIKbfi0Ft7RB+eCvIjY83Mcp/zT/2yxbhze7kKZSVydrBroWrhbMX/b2AqZXQFfbHR J/OpN1EnCSiYC0XDmmbDknB71tjaYVNtGgmInUo2eCl0MbSeIp0vKj2xTOp2q7e6WVfm 1KeT6eSEZHPpHx3AVrCwnh+rRQm+r04WuCo9EKh0WhQW22LUJ02+u0BKjrmPg4K/jYYR 02wA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h68HLyeh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e9-20020ac85dc9000000b0042c0effa9bfsi12540975qtx.295.2024.02.21.13.19.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:19:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h68HLyeh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctz3-0007nD-Nv; Wed, 21 Feb 2024 16:18:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctyy-0007GL-M3 for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:24 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyw-00017z-0c for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:24 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4126f48411dso1366555e9.0 for ; Wed, 21 Feb 2024 13:18:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550300; x=1709155100; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AbWaENVXrPEDOnkXsgR9cEbYG3NY0XwtRW+JhFfX4HQ=; b=h68HLyehp/sb1F348DsrxBHvI+gwHeXPYbxRRPQyGc2Cp7tibkHTL95Yslhije+exx vp85F7ZfldhmcK4J9ZKRvJR6sQnCpRWM19O5rXiciGDZ/y7zctc51nywtAt8wJb2ZKCA Z2/rK9ZhNJ2w5lMvpw7sXBMTuAXsanmMM4rHQd6bMVsT6P7EdFaVJ8tNSVh0zJlZCeS+ tPm7B1l5v+85Tdj68hh73BoVz8TXpudVzwrZbi010556OY8N/pTY6DC4X7UAkY1TvEh7 H/4nw3GY43QN6YJzWcxBYLKRBh14/5UtYymgQUl6fmFP7ITjPujldOwYDoulInw5ogW1 ZWiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550300; x=1709155100; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AbWaENVXrPEDOnkXsgR9cEbYG3NY0XwtRW+JhFfX4HQ=; b=eAJsnIGYyf1jx9VBIZGq0IaKMcgoMH+lVQ87i4FIxidbitzjYTgg29MRboH8PNDoLd M+70iKFlNUD1c2rp9zH04GsnBme9A2ghcASYaKXs5K2iKbrzOn8r2lWnsaIr99710KJU CSMJKf/qSGSpU53cUa526r61uTXndFVa9QMvkvvCIfWjI+16h55ERq9Zju3sanAbHHcg cQNRwumy1PUDLZJUHlFANEDvmzJkzGBbHA3pilhtG5m2UnEfT+eVD9SjUnqrodcyX+XR FYCmE45+AMeOe84iLH66Nqx7l9Sl01U2eUe6nn1bFVhqT/CEIzizT0D9TOonswcor2r6 5ucA== X-Gm-Message-State: AOJu0YwjzQIrBPVLayJnXmSocaRaHLqKL6ql7BfH9PQOOdEJo371rsLH LI9c80WCFCzly5cuWzBJ74vtvVs9IOz9aH5bR5mzJBZIMM26e+680kZinP7XtVXZBzp04OwjnpT 5Wus= X-Received: by 2002:a05:600c:6029:b0:412:6e83:b89d with SMTP id az41-20020a05600c602900b004126e83b89dmr603451wmb.8.1708550300263; Wed, 21 Feb 2024 13:18:20 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id m2-20020a5d6a02000000b0033d071c0477sm17903145wru.59.2024.02.21.13.18.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 14/25] hw/i386/pc: Confine system flash handling to pc_sysfw Date: Wed, 21 Feb 2024 22:16:14 +0100 Message-ID: <20240221211626.48190-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Rather than distributing PC system flash handling across three files, let's confine it to one. Now, pc_system_firmware_init() creates, configures and cleans up the system flash which makes the code easier to understand. It also avoids the extra call to pc_system_flash_cleanup_unused() in the Xen case. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-7-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 - hw/i386/pc_sysfw.c | 6 ++++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 0a8a96600c..e8f4af5d5c 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -193,8 +193,6 @@ void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); #define TYPE_PORT92 "port92" /* pc_sysfw.c */ -void pc_system_flash_create(PCMachineState *pcms); -void pc_system_flash_cleanup_unused(PCMachineState *pcms); void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, int *data_len); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e526498164..1ee41a5e56 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1733,7 +1733,6 @@ static void pc_machine_initfn(Object *obj) #endif pcms->default_bus_bypass_iommu = false; - pc_system_flash_create(pcms); pcms->pcspk = isa_new(TYPE_PC_SPEAKER); object_property_add_alias(OBJECT(pcms), "pcspk-audiodev", OBJECT(pcms->pcspk), "audiodev"); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 34203927e1..ec7c07b362 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -231,7 +231,6 @@ static void pc_init1(MachineState *machine, assert(machine->ram_size == x86ms->below_4g_mem_size + x86ms->above_4g_mem_size); - pc_system_flash_cleanup_unused(pcms); if (machine->kernel_filename != NULL) { /* For xen HVM direct kernel boot, load linux here */ xen_load_linux(pcms); diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index c8d9e71b88..b4c3833352 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -91,7 +91,7 @@ static PFlashCFI01 *pc_pflash_create(PCMachineState *pcms, return PFLASH_CFI01(dev); } -void pc_system_flash_create(PCMachineState *pcms) +static void pc_system_flash_create(PCMachineState *pcms) { PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); @@ -103,7 +103,7 @@ void pc_system_flash_create(PCMachineState *pcms) } } -void pc_system_flash_cleanup_unused(PCMachineState *pcms) +static void pc_system_flash_cleanup_unused(PCMachineState *pcms) { char *prop_name; int i; @@ -212,6 +212,8 @@ void pc_system_firmware_init(PCMachineState *pcms, return; } + pc_system_flash_create(pcms); + /* Map legacy -drive if=pflash to machine properties */ for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { pflash_cfi01_legacy_drive(pcms->flash[i], From patchwork Wed Feb 21 21:16:15 2024 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: 774526 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461036wrw; Wed, 21 Feb 2024 13:23:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXAcn4ZHGJVP9Yrz/6ZJjwQJpLpuuW551FebNuGPyTRpdUeIrt4A0EkChFVOzMI0mvQ4aspNJLthujXjcC4qRX0 X-Google-Smtp-Source: AGHT+IENb1Zne1hFFDB+xV+bjWpd+o3KP02FqoCdDURZkeju145sniE0gsBRT6c5rygD+k1gGrZw X-Received: by 2002:a0c:f2cd:0:b0:68f:fd7:fddf with SMTP id c13-20020a0cf2cd000000b0068f0fd7fddfmr15352953qvm.50.1708550595671; Wed, 21 Feb 2024 13:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550595; cv=none; d=google.com; s=arc-20160816; b=LwJYLoyPwOkNA6U6Dy5Cyai0KCGCOSzMFkJDgGtLOcwBFA9TqR1/MFQIC45CJYoMkn IC7y51bDzxgEDRGmvYVjiSQTaTj3bB0X7BBv0HIekIb0tq/l5GrELid1SafizEFePWyD uIopDa8aA4MINUtuJ0CIfWJszWI1oSNx3OMt3XM7+cNN/LEZb8TaAGEklVOGWSFXjcEz ldLhnNrr2yz/UMhWBi5utUFB4q+cbxSs2t0pRzWRQsGXzBRrp1tw6ynmaGdLAtlvy9uX 6OuJaBRbfrCH/IAFrv9zBWvxvXuEVEXapHwR2PWOdnqVEEGEUhWhOGhzRr+bjVqiqgxM 9xfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=el8jSU/WeUKeTdfPo2BhG3KsHF8nK1ocI6Kjqh4/a/E=; fh=oiq67qnM8BqA32ksqeHh/BJ2xCOd1MIE3GFJJBbt894=; b=PE0G5Y7gH67PsiHTPoKJVaxMMLm8R1mW3E14Tm7EIi+3qNM6PiAOSo+Fu8VRZGRV30 7GymrY2V4oikQyxkgPScTWabJ3Iy4vBWbNe2Wx1SQeVcH9nt6Gixm6Tbp9ihEMXHy1ss xazJyWwpEMkM5n3JPV8mR+5KzrCxNh2YGRW77Hk9xrsXC1cfdCDvWuGxiMvTpf381Bpi MaG+BVvJ9vXd8NxlCTnQvWc9vhb47tTFJPE9ReUj5dZJmbodClUo25uHHZroRBxB8dI2 U1UJ78sN7itGxk9BWbVAG78hwqx6/W9pSo4pzYU0FZ+yfmhN+6pPOzS2Np6o54cQTNfO BkXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ThuE/8q9"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id kd28-20020a056214401c00b0068cbae9b4f7si11593017qvb.201.2024.02.21.13.23.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:23:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ThuE/8q9"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctz6-0007tD-J1; Wed, 21 Feb 2024 16:18:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctz4-0007oV-NC for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:30 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctz2-00019d-6I for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:30 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41275971886so8637945e9.3 for ; Wed, 21 Feb 2024 13:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550306; x=1709155106; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=el8jSU/WeUKeTdfPo2BhG3KsHF8nK1ocI6Kjqh4/a/E=; b=ThuE/8q9DfSfcpFLvOukCe4ulkoRZK3mM1OqWxQrdxnhqFcPx29NhOcdkYUO5oYdBE xc9dX4ZidNbyghsr+Q8BswaK2+P7Xa2RNxnY05wJSFGQP9hfPBTKrZDfYiy7WbuKqZyG LXO00XquRWqSYHkz90vPvbXuthFMdAXmzax72zhwRK3SegzPUVm/46bt17ilDkcn62wA Tl0T9EGZAm+Qw/jLxezKzMhjl2xh+Skc2nPwlQADriB2CCtlL5avdHonkQq7M0niQeH9 jlWghRNxGwZTsTej5w9vhWaCVUmSaw8L4/+fTRYeF4MNppnCu0z3lf3SFZXTi9KvKjCe VWJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550306; x=1709155106; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=el8jSU/WeUKeTdfPo2BhG3KsHF8nK1ocI6Kjqh4/a/E=; b=NB8zG9Z4Zdd7nqqC+xbfp6Kr+4jiThS50jAqQcauEgjZLKVQo8JJRJjKX2MuNc4VXi wbj5vrRdNiPEkEdx4szRfi8iCxr1GodrgC/ei0BYQl098r9p3VBogoXQVJNet4iNIERx IjB2mG6nf7lEwAfmOzSAPlCKeXFpnEgtwRwkheFphAfYuvg1HPgE/sZWRnLWOTlBDUSh 1y8wfZx458RR586U4dS2MlNwQoG0tId25z6tpu2Qeg/23MwCyQ3FtLnDj0rcFcRCR95w 1CdpjxJX3bkLvv3Aq+UT30zNbfvhueDgJ6I07AMs4cnNRFOWVZV/Tep7xVtB7q2+ny/n AvcA== X-Gm-Message-State: AOJu0YzAZPVqskN4x2kQGATMT49aH9x+7NISZmFalJbZRfi0TP4nl8o1 4HzxwT5FyC2JgTBen0J1h/By1/9zXhxMcEjxD1YXcB62YGEt5NzVaKf5MywydYMMHTGYRogRdNn /1pw= X-Received: by 2002:a05:600c:a01a:b0:412:78da:8abe with SMTP id jg26-20020a05600ca01a00b0041278da8abemr1487738wmb.30.1708550306443; Wed, 21 Feb 2024 13:18:26 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id n3-20020a05600c4f8300b00410395dc7d1sm3817423wmq.7.2024.02.21.13.18.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 15/25] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove it Date: Wed, 21 Feb 2024 22:16:15 +0100 Message-ID: <20240221211626.48190-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow pc_system_flash_create() checked for pcmc->pci_enabled which is redundant since its caller already checked it. The method can be turned into just two lines, so inline and remove it. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-8-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_sysfw.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index b4c3833352..2dcaa116ad 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -91,18 +91,6 @@ static PFlashCFI01 *pc_pflash_create(PCMachineState *pcms, return PFLASH_CFI01(dev); } -static void pc_system_flash_create(PCMachineState *pcms) -{ - PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); - - if (pcmc->pci_enabled) { - pcms->flash[0] = pc_pflash_create(pcms, "system.flash0", - "pflash0"); - pcms->flash[1] = pc_pflash_create(pcms, "system.flash1", - "pflash1"); - } -} - static void pc_system_flash_cleanup_unused(PCMachineState *pcms) { char *prop_name; @@ -212,7 +200,8 @@ void pc_system_firmware_init(PCMachineState *pcms, return; } - pc_system_flash_create(pcms); + pcms->flash[0] = pc_pflash_create(pcms, "system.flash0", "pflash0"); + pcms->flash[1] = pc_pflash_create(pcms, "system.flash1", "pflash1"); /* Map legacy -drive if=pflash to machine properties */ for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { From patchwork Wed Feb 21 21:16:16 2024 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: 774525 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461017wrw; Wed, 21 Feb 2024 13:23:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVVkOJQPUYDHRIKMV+PVMAxdn8bzkTSeCTfiZNqSP4Nw6vms9922Pu/IIYjhjQKlrFAhFyc2cyXKXo2DgxlTMBn X-Google-Smtp-Source: AGHT+IERrkJatcA5XsjYc95+0BAQnwhQywEyCjanrYo5HzAfpgmn1WqsE6CbNVhJJ/qeNwLAz6by X-Received: by 2002:a81:9945:0:b0:607:d9fb:5144 with SMTP id q66-20020a819945000000b00607d9fb5144mr17503005ywg.13.1708550591477; Wed, 21 Feb 2024 13:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550591; cv=none; d=google.com; s=arc-20160816; b=qhQm80Ohm9CXzm2Y9Wup6/MQQ4wJIMup44328ZTTzCC61RdYoJWwT8Nq3905PZAEru 37e5/rjyoCUg5WFOlVOoTG1gZhvs7fuPvv5RfvfIze46mFcNTaGdF+hjcjWmyl5Y5yT2 wAA48DM9dTti0tCId0MJI4czcCg/3QY7Ev8r4dIV9TqR4qQt01hMtROTK9SDUOyDPDbt zRGt4X345veO5GYMe+sdBmqABGzmHqjWyKYnXNeiPB/DyqMJhyL4fajRnLRvjFlDWdQn 1VSPpKt5XtDwaOWA3+ooylaGsLRzqYvVyFFWogQuAcJIbtvJIsZ+1mSSBTtI9p/v4CW3 JUlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a97LH+/zHlwhK38ayT8uR+FI5InpUgImRxlOHohl8Qc=; fh=TBkf8G+Ez4Eaw6VUUzH52/Tgi6ZRMzC+7d8Wa9UKRjk=; b=QAGW+IJHi9PVwAdA2grOo62wsC5g5TFbhZ6smC6KuFj4HRBNRABxlnrseQaNSopsSU mTAXkbjVVIcyNnHgRkZkZyfyGYYJFfKneioL4LgJhk6qU/B24F7x6tC0JoExR/maH4dB xNhCjztz1PWmb4jbu3mE/AAO+5sKRyhQlDzkzT5HbyNLkBuQBd3Y1GndzwUYEnC7VQaR wuYRBoxRs9jO63kQc2ZIMrJG36hUlSxe3dvir/PO7a3RpF/vftj4xF2AUOZaEnkCMsoc 8xVbfKPJhBmE1948XbIeDTZVnounF1Zso4BqlTaBw+CaBiaF6pTbCKgghMW0t2Wn6Pfk VEiQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pg5yT5Cy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l12-20020ac848cc000000b0042c56f2bc74si11327617qtr.94.2024.02.21.13.23.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pg5yT5Cy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzG-0000H9-AZ; Wed, 21 Feb 2024 16:18:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzB-0008O1-9e for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:37 -0500 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctz8-0001BB-Cy for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:37 -0500 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2d1094b549cso102518811fa.3 for ; Wed, 21 Feb 2024 13:18:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550312; x=1709155112; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a97LH+/zHlwhK38ayT8uR+FI5InpUgImRxlOHohl8Qc=; b=Pg5yT5Cye0H1JIo91afFQqfD3as4YMI0YbA+r3u1A178bjxhJewLqvI+4uoZrwyyKa sWs1qGpiu1YGPj/yr/+XmSk+togHsVAxYoW2/8r4clI4Ch/TBn9a3c2942hav7aGm5dK 3bfPfwBTBcyQDt5iB5T7Cf/eymJ5J2dqdlZ6GzUKjyzJPN5igA95Ns8EDRim4MzB3d3b 2d0vQuVaWVYBmSbkdHs14n15Gmc0xN27aTZwvrtcJBgQq36gFNjf7AiYN5dG0BkDD9SI 4kXerLNUBzh3McRSmcdviGPLFWu18BS/CsKNqT5vEDWpOqUm0Nvuca6+hM5eknpaNxmf ogFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550312; x=1709155112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a97LH+/zHlwhK38ayT8uR+FI5InpUgImRxlOHohl8Qc=; b=puyeyiV0RgcijRTgUIi8V4Xarnro7d03tMgJCpF5TM6VbCbMm3XeeHwLmw/LSarvab 4CHjmNisonj3sbQoKd1qb18omyrfhbcluWJolv83bih8wWj/IFIbajSfQB7FO466+Ibd ExrWhYefT8nqoyf0EHS/BKlQFAAzU5e6sSS1tGmdN/+Zmo2AnKsHm2CxKhEMgZ+WQ3m6 ibqiKBToZTYvb1M6XVFhFmsl6WNYWSKdFbT+4GMoP3xoGFL2+SPvzPiVSs+h5u1p0Yup BZwP5kA160tYKwhlDJXmmln0QuHRsXmCRTKhXZ8eWugcm16Vka1kwMasvcTvlopEACxH ubEw== X-Gm-Message-State: AOJu0YyZrpuihh1gcOZCQtRipwYATGm+c/eY61D8cUqTfPH4h/kQTsM6 0cTTtBW7RiDXyxli+uQolFz0z9H6lHYjOvkB9n5NZunsj/WqPVuNlBehPC0HnUQFpNas3rFZ7Sc aM14= X-Received: by 2002:a05:651c:206:b0:2d2:4def:a7bd with SMTP id y6-20020a05651c020600b002d24defa7bdmr3459148ljn.24.1708550312324; Wed, 21 Feb 2024 13:18:32 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bw2-20020a0560001f8200b003392206c808sm12383532wrb.105.2024.02.21.13.18.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 16/25] hw/i386/pc_q35: Populate interrupt handlers before realizing LPC PCI function Date: Wed, 21 Feb 2024 22:16:16 +0100 Message-ID: <20240221211626.48190-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=philmd@linaro.org; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow The interrupt handlers need to be populated before the device is realized since internal devices such as the RTC are wired during realize(). If the interrupt handlers aren't populated, devices such as the RTC will be wired with a NULL interrupt handler, i.e. MC146818RtcState::irq is NULL. Fixes: fc11ca08bc29 "hw/i386/q35: Realize LPC PCI function before accessing it" Cc: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20240217104644.19755-1-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index ab7750c346..53fb3db26d 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -228,10 +228,10 @@ static void pc_q35_init(MachineState *machine) lpc_dev = DEVICE(lpc); qdev_prop_set_bit(lpc_dev, "smm-enabled", x86_machine_is_smm_enabled(x86ms)); - pci_realize_and_unref(lpc, host_bus, &error_fatal); for (i = 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } + pci_realize_and_unref(lpc, host_bus, &error_fatal); rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc")); From patchwork Wed Feb 21 21:16:17 2024 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: 774532 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp462230wrw; Wed, 21 Feb 2024 13:26:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEyzNh4bFJh46eKq/MDYHS1ZKPZNFwj9jl/+Lt0nbJYYjWyqehusXZe+s8CE9w2FdX1bn7yyr486QSRRqQyXEo X-Google-Smtp-Source: AGHT+IG2dUg+ILAYa6Lv4WUIhiI2KvL3m78qWC1MJfsnh2QGlx8jYaVAVPJCfojpwgNcEqncWEQC X-Received: by 2002:a0c:e314:0:b0:68f:19a7:dd91 with SMTP id s20-20020a0ce314000000b0068f19a7dd91mr21248437qvl.2.1708550811481; Wed, 21 Feb 2024 13:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550811; cv=none; d=google.com; s=arc-20160816; b=ptkBMcCh6lFIblhST8nDFgJ2jlLpVIHJfgOojN/WbdE8KE8Rbse1Hb4LgfavgqAVKN 8aa3YfIDzZojbb3a2uMmXZAc0adx/YsKdWrfo8QTJC1kFb4aK5X7LdfQDPi2bLMRQfU/ +QRuiFKrSdPkK/uTotKVdl1e/ZFIbcuDnHwikolujWG3q6BYDFdsemXttAM5BccOcfJi u3ng2KJsvX6ymRhE10Id8cAOO1a2C+7XjF5DWHYLugvaZsnMHACSWgc4GERRdfOYw4nk IZ5aNxs4rTeVVIy0ddKVTs5BxnRM3w8Vdgcu03PqhTzXTSyfuG2ap4XPJvOCgpjzlSec dmZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BV4BUYH/p7RXmaoiTzArsDf4sWF/v6E5dOHqrTpk5Lc=; fh=o1GZbbQ62ngg4dlaZxb53qVVhksovwgU8pY3p3NX8Es=; b=Mdi2pYg2bbnr+y+5v3z5Okp7Eh57ylU6FkGwYjKvJ9TkKVZkkNUTg6l5QGqTihOMCD j5pNTZKnvcmZLg5kHEs5dtqqV5ZOiwAaDLuXdRZoBG4b+H5Igz3NnsoI2JK0FNp7Rz8r N6CRU1sWGgua/w0wAcZUQL6b2vOBuhSQcbvFtGUg13ydihVcLXN/aFFasI08Sb8SLfdA pzLGJ1xYU8CO+A5RUWapziU+Zk3m6UziEqBneGdrFf+NnK9dqh5vnliBbfqTnnOAtsZT Y8Wya2xqwHftzxeXZ7uDyN+GSDRrgGw/++5Fee5fAai1Ppd0X2hQTf0fao1s56zZG0Kx GWDg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DzMyjL/5"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j12-20020a05621419cc00b0068f9ce3fbeesi3227090qvc.362.2024.02.21.13.26.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:26:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DzMyjL/5"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzK-0000iA-7M; Wed, 21 Feb 2024 16:18:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzG-0000MZ-Oy for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:42 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzF-0001C9-2H for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:42 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41275855dc4so8168445e9.0 for ; Wed, 21 Feb 2024 13:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550318; x=1709155118; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BV4BUYH/p7RXmaoiTzArsDf4sWF/v6E5dOHqrTpk5Lc=; b=DzMyjL/50C8/xkdUgx6OqzMnHuTdlHHoL/oIIgattKBfNrAQ7ClF6Vz7PnUo9ytoEe eRQF5QjIzYzP5oZL0rR9k87zBBe0YxNs11sDY+6VjApXXHPK6ZEiVpKtKFt4CETVq+k9 xgPV7MmMxv4M/DNs5btHLEL3+oxLGIG9scM1G4ZDjjLEn4ON5/OhgbNihnQRSSzfq3Tz xkjyEvSf/h/me/tbERSi5Akc2xTyCpfS9+/2vkOf1wjjUeOvMwk3sCWmKL0FB1iylfCU aW+cmVmZ+F+WfZI2JdWXRRrIdeiawuBJYfKN+jkfCr3++RmvsUhQzxix1hEbvUR1Ijki VXfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550318; x=1709155118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BV4BUYH/p7RXmaoiTzArsDf4sWF/v6E5dOHqrTpk5Lc=; b=GrIIwkRYjs+q1wOP7eWYFJFgJAwkUXheNoKdKcYnPh5TWF3vM+4kZtLXyQTwZpbDBW oGGdrVUHnBNZXiUrx317D7UpDJ12QyDiqTujyMHBk01WEoxxM4k6yqr/1/6NrihapkmM bf/iHWnnsuLpi3LlItwtUV6D94uc5TqaEQD56DlUykq/bjF4A7qOoE4o8ba4U2LQtyZX kmfFRMZGoioo8jzDFfS9hAkPjwa7fFx7NJWYeqQ/9eZvSMg/JIoQOvzT3sr74ZM1WSIB n//0RwkGx7+Tu10uB5f2n9NnqowVb1vYBQNIGv6qR0vSpxBoxKnVPmkztG/zW5EgwqzH ++qg== X-Gm-Message-State: AOJu0Yy1XyjYdC+kHlatOljyAQ9ARjWYGwYL5NbvaJJIRNje2UQBKBh8 hQEJFrR+zokKERVnRw3DirBNtIFo2XeFVL8JbQbNQq3kihsJsLqLj64u24hTvgkPcXjot+ggv1W +9js= X-Received: by 2002:a05:600c:4fd5:b0:411:b834:9c79 with SMTP id o21-20020a05600c4fd500b00411b8349c79mr14858240wmq.13.1708550317938; Wed, 21 Feb 2024 13:18:37 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id m5-20020a05600c4f4500b004127dd1f713sm436127wmq.27.2024.02.21.13.18.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 17/25] hw/isa/meson.build: Sort alphabetically Date: Wed, 21 Feb 2024 22:16:17 +0100 Message-ID: <20240221211626.48190-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Fixes: fbd758008f0f "hw/isa: extract FDC37M81X to a separate file" Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240218131701.91132-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/meson.build b/hw/isa/meson.build index f650b39507..3219282217 100644 --- a/hw/isa/meson.build +++ b/hw/isa/meson.build @@ -1,10 +1,10 @@ system_ss.add(when: 'CONFIG_APM', if_true: files('apm.c')) +system_ss.add(when: 'CONFIG_FDC37M81X', if_true: files('fdc37m81x-superio.c')) system_ss.add(when: 'CONFIG_I82378', if_true: files('i82378.c')) system_ss.add(when: 'CONFIG_ISA_BUS', if_true: files('isa-bus.c')) system_ss.add(when: 'CONFIG_ISA_SUPERIO', if_true: files('isa-superio.c')) system_ss.add(when: 'CONFIG_PC87312', if_true: files('pc87312.c')) system_ss.add(when: 'CONFIG_PIIX', if_true: files('piix.c')) -system_ss.add(when: 'CONFIG_FDC37M81X', if_true: files('fdc37m81x-superio.c')) system_ss.add(when: 'CONFIG_SMC37C669', if_true: files('smc37c669-superio.c')) system_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686.c')) From patchwork Wed Feb 21 21:16:18 2024 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: 774533 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp462233wrw; Wed, 21 Feb 2024 13:26:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWyhG73IzcjW++5yrPzl+kkyWl1cZ4QFlltMRQFcyKjEvbywWrI1AjAC00dNhoirYrHDkh8fEjEAFxAVYKvDi9n X-Google-Smtp-Source: AGHT+IF2xF28jJEll4rEcUqhGQTYaPB3X/eh9Fn0+Cz8o+x0wwYYJ0Ijdd4mqnTvixKUge13Rfmt X-Received: by 2002:a05:620a:1225:b0:787:2897:db82 with SMTP id v5-20020a05620a122500b007872897db82mr19420231qkj.74.1708550811786; Wed, 21 Feb 2024 13:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550811; cv=none; d=google.com; s=arc-20160816; b=mQT2sCySZVcp6Ix+1yeMp9hspeVqoMWc5qBbnA2k90yi/xoOpqGyHJ1ywua0ZPXIl1 BWKYymylW2lDB3eL4l+1jVlIohayfr6eQhh0+5TKYeX5sDqmkLMCHq+BvNEQNFlGGM/3 NBJoXagk8g0iPASDcwakyNXxhnKvcIdAE/D7AvNJogi4yAHVqvedt5C9ee2R/9AxCXdJ w2hNXPml17GXtDsY3JXg8NG+TbpEekw7X7fy/5U4OipVC09rRpmAq0bnbMICr9mDQ+uY DPKgN4VWuTF9JaRoCC3HXhPj+njpaqvvNLE+JmREDkfSsK9namclY2ycu0wZnwMzAI/R Rb+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vfxMxGGGcVex8fdynjVIKbNEXslFjUR/0YwN6ul07SQ=; fh=o9ubtuYrudZSzwlqCtLLkyChA0aIwKGGleHPII5m6vc=; b=IVSZY4sc1jz3ih70DuQ/DgJDgmOxPAnmwLDSCl9hPuleDhf2kLFbqyjutzDIH26pyT AMm7UsSuDC+M9zv5r7N3JN3iPzPKNFFXV7tEY1n/NFrrCzdgbXGrHrwlYFZj0Htb+uGx ij5aDLjJaBpqY8n5TJOV72Cywn2IxrifhCri74LrtVX2oZvyY3uIiIHZ+Zjv76kff3Vs AmW7Od6JY2Uh/ZzCJdCSU/ZXE6fvePjEqCsLbmSfySD5ya62AQ50bGj5ADvlT/LeWfKe Mes9kP934vDuJ6SZONltvdYNCk9yp3K0kdduqgapBgU6y3/5/Rqx6qz5gM10ua3gToYX W+QA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WcwmGaNb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i20-20020a05620a0a1400b007877550e3b5si5146879qka.290.2024.02.21.13.26.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:26:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WcwmGaNb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzd-0002WI-Dk; Wed, 21 Feb 2024 16:19:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzO-0001P3-5o for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:55 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzJ-0001Dv-If for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:49 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3394ca0c874so3915184f8f.2 for ; Wed, 21 Feb 2024 13:18:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550323; x=1709155123; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vfxMxGGGcVex8fdynjVIKbNEXslFjUR/0YwN6ul07SQ=; b=WcwmGaNbrsJ+LjDufUCLGA347RjWRYf5kVuIQIHlU9nBhVgdG8tKcjOwQFzAxm+AA+ jnkRui0VVIU10WuPVODy5PwtE7GhgHr7P79gDj5ode2YIBYVv4tT55la6AbXT8O1JWQP 7Id385EoHEQ1l6NtI3SJESSRozI/D3LR6qrvBf00fB36VRC+kENHSjRxPj5Pqvxsx7QO WyE+JwLOLsGRYxVZIF6W/m5N7q/HbVBqCrmMdmw0rfDvnESBVnkpt+3zrUbo9/Xxe35F qqpdxLP0hfGoTALERZRvwvwrqtMrDsxt467SyUp9sU3gGd8WzafgsP78sV8WXBC3CxsJ 1H6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550323; x=1709155123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vfxMxGGGcVex8fdynjVIKbNEXslFjUR/0YwN6ul07SQ=; b=RPin9tTV4lvq74d3iS+buBffD25YUkznhlmAAUTWa84Qmquu/jMQBJ6C9+ir08FSbq L2vY5qLEim30PixM1qI3f9pijZx6Ksrw+6l2xLCFVltqrS4mZAjT0ak+WJVHp3w6tl2J fNiV7DL2aGuhBQNwQLcrbfSIcDj5sIJzcNM7xy8m5/eojMsoapw4cfqSPjFo1mjE16tf vFpQE910fGr1IKIE/7nMDUboggfvhRUnZx+In8lhALohfCliTaVHiLyfCGTJ4BE+S4Ff JU1qQ22X42tI6m4STmnxNAEUfMuuixk9/x9cVbBFnMJVZUaxGoWYiiH3aoGcWidmhhL0 fF/g== X-Gm-Message-State: AOJu0YxR1LGysWNWEYnGLrHVypogBZQpPXDcHH5/Lrl4j0eukzSzxcOp SRbFsjDTpPw7PXihKTPDTaBz2xXJpvT7r78Q5gFekN3DoDJudlvZ2VHiypWGMLQdV2/APqmhpTf V7QA= X-Received: by 2002:a05:6000:118a:b0:33d:66be:6da4 with SMTP id g10-20020a056000118a00b0033d66be6da4mr4380687wrx.29.1708550323494; Wed, 21 Feb 2024 13:18:43 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id x4-20020adff644000000b0033b792ed609sm18116174wrp.91.2024.02.21.13.18.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Paolo Bonzini , John Snow Subject: [PULL 18/25] hw/ide: Add the possibility to disable the CompactFlash device in the build Date: Wed, 21 Feb 2024 22:16:18 +0100 Message-ID: <20240221211626.48190-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth For distros like downstream RHEL, it would be helpful to allow to disable the CompactFlash device. For making this possible, we need a separate Kconfig switch for this device, and the code should reside in a separate file. Let's also introduce a new header ide-dev.h which can be used to collect definitions related to IDE devices. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Message-ID: <20240220085505.30255-2-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ide/ide-dev.h | 41 ++++++++++++++++++++++++++++ hw/ide/cf.c | 58 ++++++++++++++++++++++++++++++++++++++++ hw/ide/qdev.c | 51 ++--------------------------------- hw/ide/Kconfig | 4 +++ hw/ide/meson.build | 1 + 5 files changed, 106 insertions(+), 49 deletions(-) create mode 100644 include/hw/ide/ide-dev.h create mode 100644 hw/ide/cf.c diff --git a/include/hw/ide/ide-dev.h b/include/hw/ide/ide-dev.h new file mode 100644 index 0000000000..7e9663cda9 --- /dev/null +++ b/include/hw/ide/ide-dev.h @@ -0,0 +1,41 @@ +/* + * ide device definitions + * + * Copyright (c) 2009 Gerd Hoffmann + * + * This code is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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 . + */ + +#ifndef IDE_DEV_H +#define IDE_DEV_H + +#include "hw/qdev-properties.h" +#include "hw/block/block.h" +#include "hw/ide/internal.h" + +typedef struct IDEDrive { + IDEDevice dev; +} IDEDrive; + +#define DEFINE_IDE_DEV_PROPERTIES() \ + DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \ + DEFINE_BLOCK_ERROR_PROPERTIES(IDEDrive, dev.conf), \ + DEFINE_PROP_STRING("ver", IDEDrive, dev.version), \ + DEFINE_PROP_UINT64("wwn", IDEDrive, dev.wwn, 0), \ + DEFINE_PROP_STRING("serial", IDEDrive, dev.serial),\ + DEFINE_PROP_STRING("model", IDEDrive, dev.model) + +void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp); + +#endif diff --git a/hw/ide/cf.c b/hw/ide/cf.c new file mode 100644 index 0000000000..2a425cb0f2 --- /dev/null +++ b/hw/ide/cf.c @@ -0,0 +1,58 @@ +/* + * ide CompactFlash support + * + * This code is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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 . + */ + +#include "qemu/osdep.h" +#include "hw/ide/ide-dev.h" +#include "qapi/qapi-types-block.h" + +static void ide_cf_realize(IDEDevice *dev, Error **errp) +{ + ide_dev_initfn(dev, IDE_CFATA, errp); +} + +static Property ide_cf_properties[] = { + DEFINE_IDE_DEV_PROPERTIES(), + DEFINE_BLOCK_CHS_PROPERTIES(IDEDrive, dev.conf), + DEFINE_PROP_BIOS_CHS_TRANS("bios-chs-trans", + IDEDrive, dev.chs_trans, BIOS_ATA_TRANSLATION_AUTO), + DEFINE_PROP_END_OF_LIST(), +}; + +static void ide_cf_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + IDEDeviceClass *k = IDE_DEVICE_CLASS(klass); + + k->realize = ide_cf_realize; + dc->fw_name = "drive"; + dc->desc = "virtual CompactFlash card"; + device_class_set_props(dc, ide_cf_properties); +} + +static const TypeInfo ide_cf_info = { + .name = "ide-cf", + .parent = TYPE_IDE_DEVICE, + .instance_size = sizeof(IDEDrive), + .class_init = ide_cf_class_init, +}; + +static void ide_cf_register_type(void) +{ + type_register_static(&ide_cf_info); +} + +type_init(ide_cf_register_type) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 1b3b4da01d..4189313d30 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -24,12 +24,9 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/module.h" -#include "hw/ide/internal.h" -#include "hw/qdev-properties.h" -#include "hw/qdev-properties-system.h" +#include "hw/ide/ide-dev.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" -#include "hw/block/block.h" #include "sysemu/sysemu.h" #include "sysemu/runstate.h" #include "qapi/visitor.h" @@ -158,11 +155,7 @@ int ide_get_bios_chs_trans(BusState *bus, int unit) /* --------------------------------- */ -typedef struct IDEDrive { - IDEDevice dev; -} IDEDrive; - -static void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp) +void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp) { IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); IDEState *s = bus->ifs + dev->unit; @@ -283,19 +276,6 @@ static void ide_cd_realize(IDEDevice *dev, Error **errp) ide_dev_initfn(dev, IDE_CD, errp); } -static void ide_cf_realize(IDEDevice *dev, Error **errp) -{ - ide_dev_initfn(dev, IDE_CFATA, errp); -} - -#define DEFINE_IDE_DEV_PROPERTIES() \ - DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \ - DEFINE_BLOCK_ERROR_PROPERTIES(IDEDrive, dev.conf), \ - DEFINE_PROP_STRING("ver", IDEDrive, dev.version), \ - DEFINE_PROP_UINT64("wwn", IDEDrive, dev.wwn, 0), \ - DEFINE_PROP_STRING("serial", IDEDrive, dev.serial),\ - DEFINE_PROP_STRING("model", IDEDrive, dev.model) - static Property ide_hd_properties[] = { DEFINE_IDE_DEV_PROPERTIES(), DEFINE_BLOCK_CHS_PROPERTIES(IDEDrive, dev.conf), @@ -346,32 +326,6 @@ static const TypeInfo ide_cd_info = { .class_init = ide_cd_class_init, }; -static Property ide_cf_properties[] = { - DEFINE_IDE_DEV_PROPERTIES(), - DEFINE_BLOCK_CHS_PROPERTIES(IDEDrive, dev.conf), - DEFINE_PROP_BIOS_CHS_TRANS("bios-chs-trans", - IDEDrive, dev.chs_trans, BIOS_ATA_TRANSLATION_AUTO), - DEFINE_PROP_END_OF_LIST(), -}; - -static void ide_cf_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - IDEDeviceClass *k = IDE_DEVICE_CLASS(klass); - - k->realize = ide_cf_realize; - dc->fw_name = "drive"; - dc->desc = "virtual CompactFlash card"; - device_class_set_props(dc, ide_cf_properties); -} - -static const TypeInfo ide_cf_info = { - .name = "ide-cf", - .parent = TYPE_IDE_DEVICE, - .instance_size = sizeof(IDEDrive), - .class_init = ide_cf_class_init, -}; - static void ide_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k = DEVICE_CLASS(klass); @@ -396,7 +350,6 @@ static void ide_register_types(void) type_register_static(&ide_bus_info); type_register_static(&ide_hd_info); type_register_static(&ide_cd_info); - type_register_static(&ide_cf_info); type_register_static(&ide_device_type_info); } diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig index dd85fa3619..b93d6743d5 100644 --- a/hw/ide/Kconfig +++ b/hw/ide/Kconfig @@ -57,3 +57,7 @@ config IDE_SII3112 bool select IDE_PCI select IDE_QDEV + +config IDE_CF + bool + default y if IDE_QDEV diff --git a/hw/ide/meson.build b/hw/ide/meson.build index e050eef942..d2e5b45c9e 100644 --- a/hw/ide/meson.build +++ b/hw/ide/meson.build @@ -1,6 +1,7 @@ system_ss.add(when: 'CONFIG_AHCI', if_true: files('ahci.c')) system_ss.add(when: 'CONFIG_AHCI_ICH9', if_true: files('ich.c')) system_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('ahci-allwinner.c')) +system_ss.add(when: 'CONFIG_IDE_CF', if_true: files('cf.c')) system_ss.add(when: 'CONFIG_IDE_CMD646', if_true: files('cmd646.c')) system_ss.add(when: 'CONFIG_IDE_CORE', if_true: files('core.c', 'atapi.c')) system_ss.add(when: 'CONFIG_IDE_ISA', if_true: files('isa.c', 'ioport.c')) From patchwork Wed Feb 21 21:16:19 2024 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: 774524 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp460793wrw; Wed, 21 Feb 2024 13:22:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXKJKoPBrUR6SjiwaJjCEoGbk8I4ICvwLvMJQtcy4fr0KknHAz9/nYr6RnpzVDK2fnWWRzHPmGrehQcScyK0SvF X-Google-Smtp-Source: AGHT+IFz6oSUHtYNjOC2kxRRQ6HFK6F73Ki4c7q9U+t6htCKfZmwEz4OhomEJkkf5TBO94doSfkZ X-Received: by 2002:a05:6122:45a2:b0:4cd:1430:7834 with SMTP id de34-20020a05612245a200b004cd14307834mr11459215vkb.7.1708550546906; Wed, 21 Feb 2024 13:22:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550546; cv=none; d=google.com; s=arc-20160816; b=pdsPPowzObeGNugP+Uu5M3h5AiWvIrWdvHEn+l8hgaK5GEcanSsSuWyhP2r+4fmmgT fmhBcGlggvg1dqwCybFWNZbwtcio03IjFsALYONbUCyT9w9FqI6F99DvbuG/bYF8vAPK 8LeaKFgXhaSdti91UogvlA3tSz043r/AEKiztQB43dYBqUp5GgV0JbKuvPUlgN2wsKCq liPtsd0B1JMNoOW4KVFZx88bip5EyfCA0Hme5pv4Uf5aQZLE1G8460eMb/+v9htp93pp SwItO4wa6+yzkLvdc5Nd8T7Ybm7tzGxSME6Nq3Wno3VTUaLZhEiVn5hxY0KB9+K3pJf3 ihSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8/bWYrGiGEWbiVuhkyiTI2lY8MFAALvypRNrUgC8WXQ=; fh=H7sks7HDBvRmAqttFv3tBcgYm/TSOOJpPVxr8Ia2q8E=; b=Lgjx0dObAxyiZ9KH2qEq9w6y2omCBq7QfGFY2C+AjtqOaAFIRKiEsGPvEbIxTJ7Sfa r3H4zRFjJYNI3j9U2v42BkiFf66eGiAQEZmWKpZwEMGqbUHGAH+zZJALPCGLZ0Lxop9d dF0+zwHrpwT7EQlSwVylfX1u+CiFAyq7OIJZdkgJnvfUgC7RAdVxo9SVSpRu0erZweND JbpapB0/ts1X+jHLhHuE+Kuaz3uyRSPnmeIydUZT6OWli1fmL2tqcSTBxuLh92Z0qCBA TbWfrHlVtqO8U9vYT/DAMegWxf3ydHgmJZ2crlLZd6Y/H8CAdvzzu5F71/T9hTWbNiR/ Ovng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6GoplIu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jf11-20020a0562142a4b00b0068f8d411539si4646658qvb.464.2024.02.21.13.22.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:22:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6GoplIu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzi-0003GV-Ns; Wed, 21 Feb 2024 16:19:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzS-0001Yc-GK for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:55 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzP-0001G3-Ce for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:54 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-41278553016so7281805e9.2 for ; Wed, 21 Feb 2024 13:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550329; x=1709155129; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8/bWYrGiGEWbiVuhkyiTI2lY8MFAALvypRNrUgC8WXQ=; b=M6GoplIu/4g4e/IxtZiQHiQW2XL8OauYwCApC45ZYurAvJAWNZ4bPBy1ojnnolz6Qe /0PWFkwb9/4pFkOEJf5jyOJh6tVFt32XW0foHG1GtzlVJ2l43QxoelRpntYnzK5R15oC WGcm4jFh2yoJwaReRJgdXg/7wPX5h5aSihI9SFyNAsi2s/bBedV9roG0Q7BJQKpYXVf0 CvB+5JLeNnyx0EFeO8BiDFWyDuL49VNSD3aFEH1UaRPZm8hPeKg3rZv+ODGma3svG8cW UMa06RedVY4wfs8jwbPCkrSs5S0WzgjR6m/dt7bqSNdvWuYIsdDRL8bsV4JoiRVr9Y3t aGSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550329; x=1709155129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8/bWYrGiGEWbiVuhkyiTI2lY8MFAALvypRNrUgC8WXQ=; b=u5/WQWepTQzGntiDTfaA9iWaQt6p2x+EhogLUT+xtZg8OlHR+BM+5YvtXwkSDfO5fD MrQks/oMtm1DatbW/F+Q/GoGTToazReS2c6a2LWxNenLVDcHbVzx5i6VV1SrDjnO0Ik0 Cxl14CXYlL0AADi/YJRHx10RWMQSV0w0IvOypCwrf4MTppK1oJW5HfPg6d2oZTTx3V/a jflRv8PTy3Rp0tfEwj733X5nY4++RDO062MVVlJgiM3fBvIWe5/JFk0+E32Ec5wsrW7J fDGCBxCsvxIw1J1WT0AGUoLrYkbOEjoIkHSPg1ve9p/uyb2v6DmgeRTzeIk+x3Wrsb9a ngjg== X-Gm-Message-State: AOJu0YycgTLJQeF/Ou7SJa+TX2s1bLib/g05wUiJjt6hdrHFL9EhUgyu 90jh5hBnRleuBPO80RTKdj5K8VtsmppTymDmtEFF0stacrQFFV8JuALSxFUjPDLOotiNSyzbVhi mQpA= X-Received: by 2002:a05:600c:35d2:b0:410:8ab6:8c72 with SMTP id r18-20020a05600c35d200b004108ab68c72mr13531087wmq.31.1708550329348; Wed, 21 Feb 2024 13:18:49 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id d2-20020adfef82000000b0033b75b39aebsm18035057wro.11.2024.02.21.13.18.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Paolo Bonzini , Peter Maydell , John Snow Subject: [PULL 19/25] hw/ide: Split qdev.c into ide-bus.c and ide-dev.c Date: Wed, 21 Feb 2024 22:16:19 +0100 Message-ID: <20240221211626.48190-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth qdev.c is a mixture between IDE bus specific functions and IDE device functions. Let's split it up to make it more obvious which part is related to bus handling and which part is related to device handling. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Message-ID: <20240220085505.30255-3-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ide-bus.c | 111 +++++++++++++++++++++++++++++++++++ hw/ide/{qdev.c => ide-dev.c} | 87 +-------------------------- hw/arm/Kconfig | 2 + hw/ide/Kconfig | 30 ++++++---- hw/ide/meson.build | 3 +- 5 files changed, 134 insertions(+), 99 deletions(-) create mode 100644 hw/ide/ide-bus.c rename hw/ide/{qdev.c => ide-dev.c} (78%) diff --git a/hw/ide/ide-bus.c b/hw/ide/ide-bus.c new file mode 100644 index 0000000000..57fe67b29c --- /dev/null +++ b/hw/ide/ide-bus.c @@ -0,0 +1,111 @@ +/* + * ide bus support for qdev. + * + * Copyright (c) 2009 Gerd Hoffmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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 . + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qemu/error-report.h" +#include "qemu/module.h" +#include "hw/ide/internal.h" +#include "sysemu/block-backend.h" +#include "sysemu/blockdev.h" +#include "sysemu/runstate.h" + +static char *idebus_get_fw_dev_path(DeviceState *dev); +static void idebus_unrealize(BusState *qdev); + +static void ide_bus_class_init(ObjectClass *klass, void *data) +{ + BusClass *k = BUS_CLASS(klass); + + k->get_fw_dev_path = idebus_get_fw_dev_path; + k->unrealize = idebus_unrealize; +} + +static void idebus_unrealize(BusState *bus) +{ + IDEBus *ibus = IDE_BUS(bus); + + if (ibus->vmstate) { + qemu_del_vm_change_state_handler(ibus->vmstate); + } +} + +static const TypeInfo ide_bus_info = { + .name = TYPE_IDE_BUS, + .parent = TYPE_BUS, + .instance_size = sizeof(IDEBus), + .class_init = ide_bus_class_init, +}; + +void ide_bus_init(IDEBus *idebus, size_t idebus_size, DeviceState *dev, + int bus_id, int max_units) +{ + qbus_init(idebus, idebus_size, TYPE_IDE_BUS, dev, NULL); + idebus->bus_id = bus_id; + idebus->max_units = max_units; +} + +static char *idebus_get_fw_dev_path(DeviceState *dev) +{ + char path[30]; + + snprintf(path, sizeof(path), "%s@%x", qdev_fw_name(dev), + ((IDEBus *)dev->parent_bus)->bus_id); + + return g_strdup(path); +} + +IDEDevice *ide_bus_create_drive(IDEBus *bus, int unit, DriveInfo *drive) +{ + DeviceState *dev; + + dev = qdev_new(drive->media_cd ? "ide-cd" : "ide-hd"); + qdev_prop_set_uint32(dev, "unit", unit); + qdev_prop_set_drive_err(dev, "drive", blk_by_legacy_dinfo(drive), + &error_fatal); + qdev_realize_and_unref(dev, &bus->qbus, &error_fatal); + return DO_UPCAST(IDEDevice, qdev, dev); +} + +int ide_get_geometry(BusState *bus, int unit, + int16_t *cyls, int8_t *heads, int8_t *secs) +{ + IDEState *s = &DO_UPCAST(IDEBus, qbus, bus)->ifs[unit]; + + if (s->drive_kind != IDE_HD || !s->blk) { + return -1; + } + + *cyls = s->cylinders; + *heads = s->heads; + *secs = s->sectors; + return 0; +} + +int ide_get_bios_chs_trans(BusState *bus, int unit) +{ + return DO_UPCAST(IDEBus, qbus, bus)->ifs[unit].chs_trans; +} + +static void ide_bus_register_type(void) +{ + type_register_static(&ide_bus_info); +} + +type_init(ide_bus_register_type) diff --git a/hw/ide/qdev.c b/hw/ide/ide-dev.c similarity index 78% rename from hw/ide/qdev.c rename to hw/ide/ide-dev.c index 4189313d30..15d088fd06 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/ide-dev.c @@ -1,5 +1,5 @@ /* - * ide bus support for qdev. + * IDE device functions * * Copyright (c) 2009 Gerd Hoffmann * @@ -18,71 +18,21 @@ */ #include "qemu/osdep.h" -#include "sysemu/dma.h" #include "qapi/error.h" #include "qapi/qapi-types-block.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" #include "qemu/module.h" #include "hw/ide/ide-dev.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "sysemu/sysemu.h" -#include "sysemu/runstate.h" #include "qapi/visitor.h" -/* --------------------------------- */ - -static char *idebus_get_fw_dev_path(DeviceState *dev); -static void idebus_unrealize(BusState *qdev); - static Property ide_props[] = { DEFINE_PROP_UINT32("unit", IDEDevice, unit, -1), DEFINE_PROP_END_OF_LIST(), }; -static void ide_bus_class_init(ObjectClass *klass, void *data) -{ - BusClass *k = BUS_CLASS(klass); - - k->get_fw_dev_path = idebus_get_fw_dev_path; - k->unrealize = idebus_unrealize; -} - -static void idebus_unrealize(BusState *bus) -{ - IDEBus *ibus = IDE_BUS(bus); - - if (ibus->vmstate) { - qemu_del_vm_change_state_handler(ibus->vmstate); - } -} - -static const TypeInfo ide_bus_info = { - .name = TYPE_IDE_BUS, - .parent = TYPE_BUS, - .instance_size = sizeof(IDEBus), - .class_init = ide_bus_class_init, -}; - -void ide_bus_init(IDEBus *idebus, size_t idebus_size, DeviceState *dev, - int bus_id, int max_units) -{ - qbus_init(idebus, idebus_size, TYPE_IDE_BUS, dev, NULL); - idebus->bus_id = bus_id; - idebus->max_units = max_units; -} - -static char *idebus_get_fw_dev_path(DeviceState *dev) -{ - char path[30]; - - snprintf(path, sizeof(path), "%s@%x", qdev_fw_name(dev), - ((IDEBus*)dev->parent_bus)->bus_id); - - return g_strdup(path); -} - static void ide_qdev_realize(DeviceState *qdev, Error **errp) { IDEDevice *dev = IDE_DEVICE(qdev); @@ -121,40 +71,6 @@ static void ide_qdev_realize(DeviceState *qdev, Error **errp) dc->realize(dev, errp); } -IDEDevice *ide_bus_create_drive(IDEBus *bus, int unit, DriveInfo *drive) -{ - DeviceState *dev; - - dev = qdev_new(drive->media_cd ? "ide-cd" : "ide-hd"); - qdev_prop_set_uint32(dev, "unit", unit); - qdev_prop_set_drive_err(dev, "drive", blk_by_legacy_dinfo(drive), - &error_fatal); - qdev_realize_and_unref(dev, &bus->qbus, &error_fatal); - return DO_UPCAST(IDEDevice, qdev, dev); -} - -int ide_get_geometry(BusState *bus, int unit, - int16_t *cyls, int8_t *heads, int8_t *secs) -{ - IDEState *s = &DO_UPCAST(IDEBus, qbus, bus)->ifs[unit]; - - if (s->drive_kind != IDE_HD || !s->blk) { - return -1; - } - - *cyls = s->cylinders; - *heads = s->heads; - *secs = s->sectors; - return 0; -} - -int ide_get_bios_chs_trans(BusState *bus, int unit) -{ - return DO_UPCAST(IDEBus, qbus, bus)->ifs[unit].chs_trans; -} - -/* --------------------------------- */ - void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp) { IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); @@ -347,7 +263,6 @@ static const TypeInfo ide_device_type_info = { static void ide_register_types(void) { - type_register_static(&ide_bus_info); type_register_static(&ide_hd_info); type_register_static(&ide_cd_info); type_register_static(&ide_device_type_info); diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 29abe1da29..b372b819a4 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -275,6 +275,8 @@ config SBSA_REF select USB_XHCI_SYSBUS select WDT_SBSA select BOCHS_DISPLAY + select IDE_BUS + select IDE_DEV config SABRELITE bool diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig index b93d6743d5..6dfc5a2129 100644 --- a/hw/ide/Kconfig +++ b/hw/ide/Kconfig @@ -1,51 +1,58 @@ config IDE_CORE bool -config IDE_QDEV +config IDE_BUS bool select IDE_CORE +config IDE_DEV + bool + depends on IDE_BUS + config IDE_PCI bool depends on PCI - select IDE_QDEV + select IDE_BUS + select IDE_DEV config IDE_ISA bool depends on ISA_BUS - select IDE_QDEV + select IDE_BUS + select IDE_DEV config IDE_PIIX bool select IDE_PCI - select IDE_QDEV config IDE_CMD646 bool select IDE_PCI - select IDE_QDEV config IDE_MACIO bool - select IDE_QDEV + select IDE_BUS + select IDE_DEV config IDE_MMIO bool - select IDE_QDEV + select IDE_BUS + select IDE_DEV config IDE_VIA bool select IDE_PCI - select IDE_QDEV config MICRODRIVE bool - select IDE_QDEV + select IDE_BUS + select IDE_DEV depends on PCMCIA config AHCI bool - select IDE_QDEV + select IDE_BUS + select IDE_DEV config AHCI_ICH9 bool @@ -56,8 +63,7 @@ config AHCI_ICH9 config IDE_SII3112 bool select IDE_PCI - select IDE_QDEV config IDE_CF bool - default y if IDE_QDEV + default y if IDE_BUS diff --git a/hw/ide/meson.build b/hw/ide/meson.build index d2e5b45c9e..d09705cac0 100644 --- a/hw/ide/meson.build +++ b/hw/ide/meson.build @@ -1,15 +1,16 @@ system_ss.add(when: 'CONFIG_AHCI', if_true: files('ahci.c')) system_ss.add(when: 'CONFIG_AHCI_ICH9', if_true: files('ich.c')) system_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('ahci-allwinner.c')) +system_ss.add(when: 'CONFIG_IDE_BUS', if_true: files('ide-bus.c')) system_ss.add(when: 'CONFIG_IDE_CF', if_true: files('cf.c')) system_ss.add(when: 'CONFIG_IDE_CMD646', if_true: files('cmd646.c')) system_ss.add(when: 'CONFIG_IDE_CORE', if_true: files('core.c', 'atapi.c')) +system_ss.add(when: 'CONFIG_IDE_DEV', if_true: files('ide-dev.c')) system_ss.add(when: 'CONFIG_IDE_ISA', if_true: files('isa.c', 'ioport.c')) system_ss.add(when: 'CONFIG_IDE_MACIO', if_true: files('macio.c')) system_ss.add(when: 'CONFIG_IDE_MMIO', if_true: files('mmio.c')) system_ss.add(when: 'CONFIG_IDE_PCI', if_true: files('pci.c')) system_ss.add(when: 'CONFIG_IDE_PIIX', if_true: files('piix.c', 'ioport.c')) -system_ss.add(when: 'CONFIG_IDE_QDEV', if_true: files('qdev.c')) system_ss.add(when: 'CONFIG_IDE_SII3112', if_true: files('sii3112.c')) system_ss.add(when: 'CONFIG_IDE_VIA', if_true: files('via.c')) system_ss.add(when: 'CONFIG_MICRODRIVE', if_true: files('microdrive.c')) From patchwork Wed Feb 21 21:16:20 2024 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: 774531 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461974wrw; Wed, 21 Feb 2024 13:26:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1curkzP6biPPnGlIHqH5kKm47RSksf+FPIIUhinrsHT1ptq2GSO8Y0XGcvBKeV5NykKgPit1fOZBiYlv/8t9t X-Google-Smtp-Source: AGHT+IGlUIzewhkloT4dxTOweK3GML0IQoe6dGNKeq99zw0O7hoPWXynH0cogK6IqCxnfOf+KbYy X-Received: by 2002:ad4:5765:0:b0:68f:2a5e:4fa5 with SMTP id r5-20020ad45765000000b0068f2a5e4fa5mr28384081qvx.11.1708550766703; Wed, 21 Feb 2024 13:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550766; cv=none; d=google.com; s=arc-20160816; b=K4qWNQvPl/ZrDN6Knex16WWFakFZq4tSs9In48KoMbvODht97GOIbQjJ7tK3jw/yD0 31AuBuaROJsTDDYNYOFodH+Jzz2qz6molvknFccDGyXCRDhvv455rYQkz8EcOj0ruVwd ZuOEDSu0eFrbxyDlrgHqwnR5Flda26IjTxtHjZEAaOwT298Fofy9v0ChJ9BGjOEcmlcN WVdA76mo7mCLSwx9FGWtIPNHV3VZJvoqa5aTOdkHYLvrg4DQ7FJCGkQz0/HPydccgapE UWMUCNdnhCxcpoZAFe0CXPgMwhB/sJR9EgdcryQ2fkRItmaFr9VgXm1wZGx7+i9wvhfJ w8fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; fh=5cA6FzatP5fS6W/Tt18xlG6cH7utM3ZrQCPKoe4O9n0=; b=C5lhzQLVTMNEp7EXyGlCwW3DE3x/TWU8FF5vLjIaLBU1v0/8U46s5sqKDLWcXf1Q0O ZQvXVt6kMXuFwpxorS24NKGT+OtDyU8AQoCXmFNoI5mJI7YEKkGAR71RJ+jy1Fgl9oB6 oaBxQXW5/Rac6TmShfxNFCTcSWdwZ2YmaIoq8fTD/yUBiSiA/1lngCnsV+RRXaW7uPau BO9ZiUAFoftkjfFb3l786XLPPedhASnNWlSZYscSE5qtsDk6enaYxs3DPXg8oIZy9XRE /9doRxdj/EIKu9M121GpFis2ytdU8YWmfeWswtzoQ/ePkQTuuhxxWfAON9L+Tvxamky9 hZmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGEBAiIs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gi8-20020a056214248800b0068cce1999cbsi12203081qvb.420.2024.02.21.13.26.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:26:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGEBAiIs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzl-0003eq-9i; Wed, 21 Feb 2024 16:19:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzX-0001yR-WB for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:00 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzV-0001H1-4s for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:59 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4127706e48cso7725705e9.1 for ; Wed, 21 Feb 2024 13:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550335; x=1709155135; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; b=RGEBAiIsuiz5p+2U+o/EKQahdwdWlOmALej/ZeqRHMqk5+MnSIFdKcvPxU7+6xWAEO FJwgxNqjZlfF1A398qoYJJlPz9ppb4aj9vi2ODHmWxLo+OpPnLTt45bokIcKENP1h2n1 JEX7SgfY0lHEhLvtrZH9oxBzf3xqShU65/ftyhSEOJbASsalkDhZjdVrS1FDzj5dBF2o TiqDz1Tk+Ev1XyN0dcXrPyfYy36Hfr8tqEaTpTKh9d2cdHYcSWzIvyWbFuOU3f2Oqqwi lXlcI8EUV7J3ZtzcFNzyhzzfKUj3qIi5BEDYn4z1YMgslw8gmMChLqwxC9sFSkkrMmCy iokw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550335; x=1709155135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; b=xOXCJ2UcJF0A4V0eRV/CLxVuAaRn15lRuQjyoGP2cxkWZemVYQRQDW6uEjYytrxZXl MDbJM+UMkxshZBXMdidKiMOgMrKm2hvxXeB+U9xjAsSI3bfeBwVkuzTrf2df3vi+eSnJ B4zNK8QSkUYwgR2lnUm+vDdHeYF8CHeAu3cGOHuFNSkEzyFfjpnjIPT/Itp+Qs/9msZg bh3iHaZiYHBNKP3JO11zM1lsDEJ72TPAmlxJnA0YbEp6ENEwHQGNRaNRF93FJ4Okph0t m+fi6xr646QcyxRhkEv8Ok5U+piJQ4Ln1rDvOy9DNNMEMufnzY1TBavwoZNBUfgHftmf gjzg== X-Gm-Message-State: AOJu0YyTUMYUSgCdppWuer5iZhN3fQ/xbtwb3Bdsntrgxoqd51Yz8SBf CJlHGEZb5IYk5syKsFfG8ToZYqS12x2dyBZUfBUAEMsCOb306bSc02GZaeJcGm9j3DjLMgGVbkx UbP0= X-Received: by 2002:a05:600c:46ce:b0:40e:f693:94f6 with SMTP id q14-20020a05600c46ce00b0040ef69394f6mr14433886wmo.35.1708550335180; Wed, 21 Feb 2024 13:18:55 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id f9-20020a05600c44c900b00411e3cc0e0asm18723489wmo.44.2024.02.21.13.18.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , John Snow Subject: [PULL 20/25] hw/ide: Move IDE DMA related definitions to a separate header ide-dma.h Date: Wed, 21 Feb 2024 22:16:20 +0100 Message-ID: <20240221211626.48190-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth These definitions are required outside of the hw/ide/ code, too, so lets's move them from internal.h to a new header called ide-dma.h. Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240220085505.30255-4-thuth@redhat.com> [PMD: Use IDEDMAOps typedef in struct IDEDMA] Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ide/ide-dma.h | 37 +++++++++++++++++++++++++++++++++++++ include/hw/ide/internal.h | 29 +---------------------------- 2 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 include/hw/ide/ide-dma.h diff --git a/include/hw/ide/ide-dma.h b/include/hw/ide/ide-dma.h new file mode 100644 index 0000000000..d0b19ac9c5 --- /dev/null +++ b/include/hw/ide/ide-dma.h @@ -0,0 +1,37 @@ +#ifndef HW_IDE_DMA_H +#define HW_IDE_DMA_H + +#include "block/aio.h" +#include "qemu/iov.h" + +typedef struct IDEState IDEState; +typedef struct IDEDMAOps IDEDMAOps; +typedef struct IDEDMA IDEDMA; + +typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc *); +typedef void DMAVoidFunc(const IDEDMA *); +typedef int DMAIntFunc(const IDEDMA *, bool); +typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len); +typedef void DMAu32Func(const IDEDMA *, uint32_t); +typedef void DMAStopFunc(const IDEDMA *, bool); + +struct IDEDMAOps { + DMAStartFunc *start_dma; + DMAVoidFunc *pio_transfer; + DMAInt32Func *prepare_buf; + DMAu32Func *commit_buf; + DMAIntFunc *rw_buf; + DMAVoidFunc *restart; + DMAVoidFunc *restart_dma; + DMAStopFunc *set_inactive; + DMAVoidFunc *cmd_done; + DMAVoidFunc *reset; +}; + +struct IDEDMA { + const IDEDMAOps *ops; + QEMUIOVector qiov; + BlockAIOCB *aiocb; +}; + +#endif diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 3bdcc75597..a3a6702eec 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -11,6 +11,7 @@ #include "sysemu/dma.h" #include "hw/block/block.h" #include "exec/ioport.h" +#include "hw/ide/ide-dma.h" /* debug IDE devices */ #define USE_DMA_CDROM @@ -18,8 +19,6 @@ typedef struct IDEDevice IDEDevice; typedef struct IDEState IDEState; -typedef struct IDEDMA IDEDMA; -typedef struct IDEDMAOps IDEDMAOps; #define TYPE_IDE_BUS "IDE" OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) @@ -332,13 +331,6 @@ typedef enum { IDE_HD, IDE_CD, IDE_CFATA } IDEDriveKind; typedef void EndTransferFunc(IDEState *); -typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc *); -typedef void DMAVoidFunc(const IDEDMA *); -typedef int DMAIntFunc(const IDEDMA *, bool); -typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len); -typedef void DMAu32Func(const IDEDMA *, uint32_t); -typedef void DMAStopFunc(const IDEDMA *, bool); - struct unreported_events { bool eject_request; bool new_media; @@ -460,25 +452,6 @@ struct IDEState { int ncq_queues; }; -struct IDEDMAOps { - DMAStartFunc *start_dma; - DMAVoidFunc *pio_transfer; - DMAInt32Func *prepare_buf; - DMAu32Func *commit_buf; - DMAIntFunc *rw_buf; - DMAVoidFunc *restart; - DMAVoidFunc *restart_dma; - DMAStopFunc *set_inactive; - DMAVoidFunc *cmd_done; - DMAVoidFunc *reset; -}; - -struct IDEDMA { - const struct IDEDMAOps *ops; - QEMUIOVector qiov; - BlockAIOCB *aiocb; -}; - struct IDEBus { BusState qbus; IDEDevice *master; From patchwork Wed Feb 21 21:16:21 2024 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: 774522 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp460626wrw; Wed, 21 Feb 2024 13:22:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX++ihy+2M4HtPQZYUNVDA/IsmBZbiWi2+nBIoHBQxKI5Cl4pwfC8jMLfhs0lmR2LDpME7+Dr6ClaVy0uSvzg3O X-Google-Smtp-Source: AGHT+IEvZPZKzzocMbjFyjabZb9vQ9zKG5SZqrOw+mGPHW7cNPoDTlhT/6PUUMBkuH15kM0inZIN X-Received: by 2002:a5b:781:0:b0:dcc:2caa:578b with SMTP id b1-20020a5b0781000000b00dcc2caa578bmr577231ybq.40.1708550520891; Wed, 21 Feb 2024 13:22:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550520; cv=none; d=google.com; s=arc-20160816; b=LJ+WKX6yuAFg/dRCM6iNhLUmsq6B52ui61UnztAe1c4AYDe+d2SWtqgJN2fPoSHwJO ddLcMtsKPZCrt57h2MR8LxTNZ0j2GwWpdP61rmoSrcPsf/rznmqn5yeAFGxb9UgSs4J0 W/F80/wdODH3ON9FdpS0St7xUbmhUfFUrivCI38ZNCiV+Se++Oq9Cj8ajiflfjlqNafl SbZBmg20GslaVZi8LEaKoUdJTuM1O2OgIAPGhNRAUcjyiP7Gkdn7POk2S9m8XInS9K+B fXajQVyPDDZDibnomOS2NqMShL2tr8nhU0M8CJOlJ/iuTUe86uYZKRi7SJA0xJbZzQrX pclw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xFzn/uz4uT8liK1wRCr+n2ERXfHQX8sWgAYNC3jQl+0=; fh=5cA6FzatP5fS6W/Tt18xlG6cH7utM3ZrQCPKoe4O9n0=; b=xQ0RdppoWDK6AqIcvW3kGiHGi5Cqw9JdBcFD8JhCya3Z+f9AqFjGp+WwMFYixe/Sqv 6DlbTL9pUZfdpSiU4vN/EcMVXf/qTE3JFbyG8owK7GWZa3+U6ym8GQuHmfCk/mCX6bF7 AWCz/YHpj82EkAkDlEcwSt4WnnLVPiHs57Czz+uXb/1AMuCl5AVI6Tj4Fl6SuND4cdSi mhvLSg+EMey3LgfhFS5V7dZv8lTS559KM3edJ9U5/40WFXeAbsAwPOrJLLZAD5szpwMA or77G0AfIR1TWey7xED9O+d+fIONwuHFFf5EJLSl6yVbi7NvLiP5Zisy3XvHje7NfiHz Eu4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2dttVdB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id vr4-20020a05620a55a400b00785d6a7b7e9si11691806qkn.40.2024.02.21.13.22.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:22:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2dttVdB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzw-0004D4-LU; Wed, 21 Feb 2024 16:19:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzf-0002lS-6K for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:07 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctza-0001Jj-TX for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:06 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-412698ac6f9so1289045e9.0 for ; Wed, 21 Feb 2024 13:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550341; x=1709155141; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xFzn/uz4uT8liK1wRCr+n2ERXfHQX8sWgAYNC3jQl+0=; b=n2dttVdBCvZ3XNufC5L9oz2YztjKdNL8T24gkYt5DLdIBJqg1UTz9fuNtn4hLFfk9n +PvxjYaCDXoPAZdo9FaYdC8EJkoPROnWXhWqL4+eXYPFN7RdbMghWtoFwUwhJl/Yv9G2 Da/EG1l8RiNLd8flO2JsQTg8bry2tNi3b+Ng6RNzHiedbThRnSDcUXzeNUhNIW4gSUqB YhlgpTwKPt2rLqyfDobEETEAsW4uJcHnoV6xkNOktyedThsqIlUQokOk1bWQ5eCUroJt RwBow/tZiLpWx4Tog8GmRqP0UA7lltQGCIZCq9r6ZCQUbqnuaRb9tsb2ed2xBLfUVbNt g2+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550341; x=1709155141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xFzn/uz4uT8liK1wRCr+n2ERXfHQX8sWgAYNC3jQl+0=; b=ojIlMfdyHPXQVcGQqlgHWgtaiUGTnqbKJIYvmhvfgt9e5PtfJdZDpeEsM8UyWSpCk9 3NhV0cHoeys5JSU7eGOnLCCAUiajCZ7i/9V5XOerxxaY2S9pb/ltlABsZ6HUoMMt593G rq1GmjwrBGLq8yjlkMWYHuk6MBxpovlZjuyT6391HzUVQkKnMF1ccd4gPcUsRhVSVKTO s0DbJ/EK837w3N10Nib18fHNgkRyZ48j6ep9DCHhzX/Bk490pez2JKsWg9NHHaCthabk 12cGqG6Lpsaj//6zFHmdbjbjBSwfYBdYJ+3Gxn94C/jotUhKXM6jaYrbxUTKK68+B2rA TONw== X-Gm-Message-State: AOJu0YwK/Bv0qnL0eCqYGoOAlTNvYsvgazVUMbJW/v7OAYU5uwn6RJtq vk9K4lwG/imc92nrtYvZn1zIIMh+fwWyuE6q5hheB6mGYlsSXwVam4PAXrtIoGcC7LzL/0CKSst uuP0= X-Received: by 2002:a5d:4d8e:0:b0:33d:2012:6d64 with SMTP id b14-20020a5d4d8e000000b0033d20126d64mr609702wru.4.1708550340703; Wed, 21 Feb 2024 13:19:00 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id r2-20020a05600c35c200b004123b049f86sm19731963wmq.37.2024.02.21.13.18.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:19:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , John Snow Subject: [PULL 21/25] hw/ide: Move IDE device related definitions to ide-dev.h Date: Wed, 21 Feb 2024 22:16:21 +0100 Message-ID: <20240221211626.48190-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth Untangle internal.h by moving public IDE device related definitions to ide-dev.h. Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240220085505.30255-5-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ide/ide-dev.h | 143 +++++++++++++++++++++++++++++++++++++- include/hw/ide/internal.h | 143 +------------------------------------- hw/ide/ide-dev.c | 1 + 3 files changed, 144 insertions(+), 143 deletions(-) diff --git a/include/hw/ide/ide-dev.h b/include/hw/ide/ide-dev.h index 7e9663cda9..1f62e58ebc 100644 --- a/include/hw/ide/ide-dev.h +++ b/include/hw/ide/ide-dev.h @@ -20,9 +20,150 @@ #ifndef IDE_DEV_H #define IDE_DEV_H +#include "sysemu/dma.h" #include "hw/qdev-properties.h" #include "hw/block/block.h" -#include "hw/ide/internal.h" + +typedef struct IDEDevice IDEDevice; +typedef struct IDEState IDEState; +typedef struct IDEBus IDEBus; + +typedef void EndTransferFunc(IDEState *); + +#define MAX_IDE_DEVS 2 + +#define TYPE_IDE_DEVICE "ide-device" +OBJECT_DECLARE_TYPE(IDEDevice, IDEDeviceClass, IDE_DEVICE) + +typedef enum { IDE_HD, IDE_CD, IDE_CFATA } IDEDriveKind; + +struct unreported_events { + bool eject_request; + bool new_media; +}; + +enum ide_dma_cmd { + IDE_DMA_READ = 0, + IDE_DMA_WRITE, + IDE_DMA_TRIM, + IDE_DMA_ATAPI, + IDE_DMA__COUNT +}; + +/* NOTE: IDEState represents in fact one drive */ +struct IDEState { + IDEBus *bus; + uint8_t unit; + /* ide config */ + IDEDriveKind drive_kind; + int drive_heads, drive_sectors; + int cylinders, heads, sectors, chs_trans; + int64_t nb_sectors; + int mult_sectors; + int identify_set; + uint8_t identify_data[512]; + int drive_serial; + char drive_serial_str[21]; + char drive_model_str[41]; + uint64_t wwn; + /* ide regs */ + uint8_t feature; + uint8_t error; + uint32_t nsector; + uint8_t sector; + uint8_t lcyl; + uint8_t hcyl; + /* other part of tf for lba48 support */ + uint8_t hob_feature; + uint8_t hob_nsector; + uint8_t hob_sector; + uint8_t hob_lcyl; + uint8_t hob_hcyl; + + uint8_t select; + uint8_t status; + + bool io8; + bool reset_reverts; + + /* set for lba48 access */ + uint8_t lba48; + BlockBackend *blk; + char version[9]; + /* ATAPI specific */ + struct unreported_events events; + uint8_t sense_key; + uint8_t asc; + bool tray_open; + bool tray_locked; + uint8_t cdrom_changed; + int packet_transfer_size; + int elementary_transfer_size; + int32_t io_buffer_index; + int lba; + int cd_sector_size; + int atapi_dma; /* true if dma is requested for the packet cmd */ + BlockAcctCookie acct; + BlockAIOCB *pio_aiocb; + QEMUIOVector qiov; + QLIST_HEAD(, IDEBufferedRequest) buffered_requests; + /* ATA DMA state */ + uint64_t io_buffer_offset; + int32_t io_buffer_size; + QEMUSGList sg; + /* PIO transfer handling */ + int req_nb_sectors; /* number of sectors per interrupt */ + EndTransferFunc *end_transfer_func; + uint8_t *data_ptr; + uint8_t *data_end; + uint8_t *io_buffer; + /* PIO save/restore */ + int32_t io_buffer_total_len; + int32_t cur_io_buffer_offset; + int32_t cur_io_buffer_len; + uint8_t end_transfer_fn_idx; + QEMUTimer *sector_write_timer; /* only used for win2k install hack */ + uint32_t irq_count; /* counts IRQs when using win2k install hack */ + /* CF-ATA extended error */ + uint8_t ext_error; + /* CF-ATA metadata storage */ + uint32_t mdata_size; + uint8_t *mdata_storage; + int media_changed; + enum ide_dma_cmd dma_cmd; + /* SMART */ + uint8_t smart_enabled; + uint8_t smart_autosave; + int smart_errors; + uint8_t smart_selftest_count; + uint8_t *smart_selftest_data; + /* AHCI */ + int ncq_queues; +}; + +struct IDEDeviceClass { + DeviceClass parent_class; + void (*realize)(IDEDevice *dev, Error **errp); +}; + +struct IDEDevice { + DeviceState qdev; + uint32_t unit; + BlockConf conf; + int chs_trans; + char *version; + char *serial; + char *model; + uint64_t wwn; + /* + * 0x0000 - rotation rate not reported + * 0x0001 - non-rotating medium (SSD) + * 0x0002-0x0400 - reserved + * 0x0401-0xffe - rotations per minute + * 0xffff - reserved + */ + uint16_t rotation_rate; +}; typedef struct IDEDrive { IDEDevice dev; diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index a3a6702eec..1aab89b27b 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -8,23 +8,17 @@ */ #include "hw/ide.h" -#include "sysemu/dma.h" -#include "hw/block/block.h" #include "exec/ioport.h" #include "hw/ide/ide-dma.h" +#include "hw/ide/ide-dev.h" /* debug IDE devices */ #define USE_DMA_CDROM #include "qom/object.h" -typedef struct IDEDevice IDEDevice; -typedef struct IDEState IDEState; - #define TYPE_IDE_BUS "IDE" OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) -#define MAX_IDE_DEVS 2 - /* Device/Head ("select") Register */ #define ATA_DEV_SELECT 0x10 /* ATA1,3: Defined as '1'. @@ -327,23 +321,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) #define SMART_DISABLE 0xd9 #define SMART_STATUS 0xda -typedef enum { IDE_HD, IDE_CD, IDE_CFATA } IDEDriveKind; - -typedef void EndTransferFunc(IDEState *); - -struct unreported_events { - bool eject_request; - bool new_media; -}; - -enum ide_dma_cmd { - IDE_DMA_READ = 0, - IDE_DMA_WRITE, - IDE_DMA_TRIM, - IDE_DMA_ATAPI, - IDE_DMA__COUNT -}; - extern const char *IDE_DMA_CMD_lookup[IDE_DMA__COUNT]; extern const MemoryRegionPortio ide_portio_list[]; @@ -361,97 +338,6 @@ typedef struct IDEBufferedRequest { bool orphaned; } IDEBufferedRequest; -/* NOTE: IDEState represents in fact one drive */ -struct IDEState { - IDEBus *bus; - uint8_t unit; - /* ide config */ - IDEDriveKind drive_kind; - int drive_heads, drive_sectors; - int cylinders, heads, sectors, chs_trans; - int64_t nb_sectors; - int mult_sectors; - int identify_set; - uint8_t identify_data[512]; - int drive_serial; - char drive_serial_str[21]; - char drive_model_str[41]; - uint64_t wwn; - /* ide regs */ - uint8_t feature; - uint8_t error; - uint32_t nsector; - uint8_t sector; - uint8_t lcyl; - uint8_t hcyl; - /* other part of tf for lba48 support */ - uint8_t hob_feature; - uint8_t hob_nsector; - uint8_t hob_sector; - uint8_t hob_lcyl; - uint8_t hob_hcyl; - - uint8_t select; - uint8_t status; - - bool io8; - bool reset_reverts; - - /* set for lba48 access */ - uint8_t lba48; - BlockBackend *blk; - char version[9]; - /* ATAPI specific */ - struct unreported_events events; - uint8_t sense_key; - uint8_t asc; - bool tray_open; - bool tray_locked; - uint8_t cdrom_changed; - int packet_transfer_size; - int elementary_transfer_size; - int32_t io_buffer_index; - int lba; - int cd_sector_size; - int atapi_dma; /* true if dma is requested for the packet cmd */ - BlockAcctCookie acct; - BlockAIOCB *pio_aiocb; - QEMUIOVector qiov; - QLIST_HEAD(, IDEBufferedRequest) buffered_requests; - /* ATA DMA state */ - uint64_t io_buffer_offset; - int32_t io_buffer_size; - QEMUSGList sg; - /* PIO transfer handling */ - int req_nb_sectors; /* number of sectors per interrupt */ - EndTransferFunc *end_transfer_func; - uint8_t *data_ptr; - uint8_t *data_end; - uint8_t *io_buffer; - /* PIO save/restore */ - int32_t io_buffer_total_len; - int32_t cur_io_buffer_offset; - int32_t cur_io_buffer_len; - uint8_t end_transfer_fn_idx; - QEMUTimer *sector_write_timer; /* only used for win2k install hack */ - uint32_t irq_count; /* counts IRQs when using win2k install hack */ - /* CF-ATA extended error */ - uint8_t ext_error; - /* CF-ATA metadata storage */ - uint32_t mdata_size; - uint8_t *mdata_storage; - int media_changed; - enum ide_dma_cmd dma_cmd; - /* SMART */ - uint8_t smart_enabled; - uint8_t smart_autosave; - int smart_errors; - uint8_t smart_selftest_count; - uint8_t *smart_selftest_data; - /* AHCI */ - int ncq_queues; -}; - struct IDEBus { BusState qbus; IDEDevice *master; @@ -475,33 +361,6 @@ struct IDEBus { VMChangeStateEntry *vmstate; }; -#define TYPE_IDE_DEVICE "ide-device" -OBJECT_DECLARE_TYPE(IDEDevice, IDEDeviceClass, IDE_DEVICE) - -struct IDEDeviceClass { - DeviceClass parent_class; - void (*realize)(IDEDevice *dev, Error **errp); -}; - -struct IDEDevice { - DeviceState qdev; - uint32_t unit; - BlockConf conf; - int chs_trans; - char *version; - char *serial; - char *model; - uint64_t wwn; - /* - * 0x0000 - rotation rate not reported - * 0x0001 - non-rotating medium (SSD) - * 0x0002-0x0400 - reserved - * 0x0401-0xffe - rotations per minute - * 0xffff - reserved - */ - uint16_t rotation_rate; -}; - /* These are used for the error_status field of IDEBus */ #define IDE_RETRY_MASK 0xf8 #define IDE_RETRY_DMA 0x08 diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 15d088fd06..c8e2033469 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -23,6 +23,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "hw/ide/ide-dev.h" +#include "hw/ide/internal.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "sysemu/sysemu.h" From patchwork Wed Feb 21 21:16:22 2024 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: 774530 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461837wrw; Wed, 21 Feb 2024 13:25:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWZjErKaSFaoD8n6JMNTBtHfaxExXahxCy2u6M6pcvmnCH9NnLnM3eucFcmd/57tVk74o+10YlE2C60ScI8O1bZ X-Google-Smtp-Source: AGHT+IENMGbK38/Quh8Z1/SHUizbA0yf+UtOiJvItZ00PSO3Qx9HQeeNiLzzG+WDHCU7W73Vti4y X-Received: by 2002:a05:6214:268d:b0:68f:8f35:771a with SMTP id gm13-20020a056214268d00b0068f8f35771amr7739634qvb.53.1708550744260; Wed, 21 Feb 2024 13:25:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550744; cv=none; d=google.com; s=arc-20160816; b=I4Q1cOzFsUv5GsOqeBkXfSZQkIc6tYinjy3MC0etBuWHkZ25tufdQ62q5s79o2A+Gn PBw3jHKQ28jLXbpjs+PV1C0ua2Zij/2jNjJawX+lcApGkX46gtsGZezjxDuJOO0kiHY+ yT8nt5Cp2QKwaU57sLZlZKMnsDZeREXavgtTx7UTmKg8Z9t5wGS8NQpnzFHPzW1poQxa /DRrh+1nrKxwAxkxnGm+cfZChDzqx4e8oQ1xRQv0XLUjOJ73LZONpdtWD3b5MdVQrc9+ HOzelopF3WFvvj4xOWqh9XoDdIaIIw4HXek6TZAPr9RylTvyI2d/YmzKrEGojF06ErWQ HnZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NpDez5BJ9vbQ7QvGPKHbANOGqK0wCG2QqegQsAENy/M=; fh=5cA6FzatP5fS6W/Tt18xlG6cH7utM3ZrQCPKoe4O9n0=; b=e8ev5MTp09cOrehZhtQpeOA51Sm8vYrcTQabx4pSo47/5ik4JpsFr4Zoss3ylumM40 SX649PqOja/bbjE76f96fTIXFFPToC5NHIzXFypdXp38Gm2dk1a96QI4fnUevRN0hHKx uj1xzAAl9t4VrSvwQi+tzgLlrBpVgmZz4y42ZK8b0lvLtbDgCt60IF4KLIC6NdLyezjW jwvdGHpEmqpCWwGmHzm5+mFmXYt8ysP+1T4nDFe7O7vhAqgfAYDBqGb3quZa3mv6s9N1 g3MeFzCuyEpolPSW+do74nNYb+sirp+IjU8tOOHCjE2lwldwFgI1NZO6GZ0bPDD6Iubl 6cNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JhhImJ34; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id iy5-20020a0562140f6500b0068f69d2142csi9252145qvb.186.2024.02.21.13.25.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:25:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JhhImJ34; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcu0T-0005wO-6p; Wed, 21 Feb 2024 16:19:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzv-0004ZX-NK for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:26 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzh-0001Kl-2s for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:23 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33d26da3e15so127025f8f.1 for ; Wed, 21 Feb 2024 13:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550346; x=1709155146; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NpDez5BJ9vbQ7QvGPKHbANOGqK0wCG2QqegQsAENy/M=; b=JhhImJ34pZsm+yXJkMhkg39DZC5rn7ZSVufvqv6DoCpYcp9it9GKYW2BTJFrYdNsOH NUwwWGq32qv2M6b9duDLUkgyAtaTeZwl+yvqpwDVoVt/yNaeWGbYUI0Sqzz13ZdUOJyb led7Y+1HusAtJypdCDRENxmTSGm17DnxOuT7lTGUfmRvdJUi//2nHQ3gcX1K1O1MgBqw Vtp/k2uzM+I0w/AxEn9yurNwmURSbqXfivWB8QzePn6n0Z+nQ0mXMl11Ozj8/BW46wr/ OWuaLvaeXx6Or+aGF9OIIQcCq7viHcz6PWoyTNmh2/eJ6AOIoPDwW8gRAA+GYdhuz7jl 3D6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550346; x=1709155146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NpDez5BJ9vbQ7QvGPKHbANOGqK0wCG2QqegQsAENy/M=; b=jT/2aYTJdDVCCK2fJ2knc007ka53yrgSLrj+QWBlc+MW5UG0Zbl30IreGvapbKsKH4 kNvKRwOWi84QD2Mc4rWMtxvxgrllQqKlWiEShP11/bGFIt+pzeypvlaHCs1UmRB9tKUQ hP/5WzvMhSZyYOSJjVhtg/wFGt5gkd1r77LeJkcOWW6CVu5fc8vapUYihNbTtkyjoyqA 3N05B6apw0/qkhdWYuDUJQXcegmuWvE6fCVw8Sm/eqOtPRGuEfGTD+vrpGX4NL2XrRxr KlQQzCJp3qMYrPZ1Cn7e7NA7ZDjPql0ijOGneEW0KinLE3JH2eyr0KIgllTQVr1j+zq5 KIkA== X-Gm-Message-State: AOJu0Yw8XS5tSY+eag9TeBu+1e3JC5r8j0eL9CMqoN65dQT7UKuUM78N ktFNw/+xuekmi30HnmflUnFeNS0rDQTwwI0Ywzgc9QzEDYN1Wc8RNBq/QvhnQRUS0Ve66JPIsQe e7rs= X-Received: by 2002:adf:f78c:0:b0:33d:3490:6e05 with SMTP id q12-20020adff78c000000b0033d34906e05mr639495wrp.27.1708550346251; Wed, 21 Feb 2024 13:19:06 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id e4-20020adfe384000000b0033cfa00e497sm17842766wrm.64.2024.02.21.13.19.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:19:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , John Snow Subject: [PULL 22/25] hw/ide: Move IDE bus related definitions to a new header ide-bus.h Date: Wed, 21 Feb 2024 22:16:22 +0100 Message-ID: <20240221211626.48190-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth Let's consolidate the public IDE bus related functions in a separate header. Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240220085505.30255-6-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ide/ide-bus.h | 42 +++++++++++++++++++++++++++++++++++++++ include/hw/ide/internal.h | 40 +------------------------------------ 2 files changed, 43 insertions(+), 39 deletions(-) create mode 100644 include/hw/ide/ide-bus.h diff --git a/include/hw/ide/ide-bus.h b/include/hw/ide/ide-bus.h new file mode 100644 index 0000000000..4841a7dcd6 --- /dev/null +++ b/include/hw/ide/ide-bus.h @@ -0,0 +1,42 @@ +#ifndef HW_IDE_BUS_H +#define HW_IDE_BUS_H + +#include "exec/ioport.h" +#include "hw/ide/ide-dev.h" +#include "hw/ide/ide-dma.h" + +struct IDEBus { + BusState qbus; + IDEDevice *master; + IDEDevice *slave; + IDEState ifs[2]; + QEMUBH *bh; + + int bus_id; + int max_units; + IDEDMA *dma; + uint8_t unit; + uint8_t cmd; + qemu_irq irq; /* bus output */ + + int error_status; + uint8_t retry_unit; + int64_t retry_sector_num; + uint32_t retry_nsector; + PortioList portio_list; + PortioList portio2_list; + VMChangeStateEntry *vmstate; +}; + +#define TYPE_IDE_BUS "IDE" +OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) + +void ide_bus_init(IDEBus *idebus, size_t idebus_size, DeviceState *dev, + int bus_id, int max_units); +IDEDevice *ide_bus_create_drive(IDEBus *bus, int unit, DriveInfo *drive); + +int ide_get_geometry(BusState *bus, int unit, + int16_t *cyls, int8_t *heads, int8_t *secs); +int ide_get_bios_chs_trans(BusState *bus, int unit); + +#endif diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 1aab89b27b..d3ec16a945 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -8,16 +8,10 @@ */ #include "hw/ide.h" -#include "exec/ioport.h" -#include "hw/ide/ide-dma.h" -#include "hw/ide/ide-dev.h" +#include "hw/ide/ide-bus.h" /* debug IDE devices */ #define USE_DMA_CDROM -#include "qom/object.h" - -#define TYPE_IDE_BUS "IDE" -OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) /* Device/Head ("select") Register */ #define ATA_DEV_SELECT 0x10 @@ -338,29 +332,6 @@ typedef struct IDEBufferedRequest { bool orphaned; } IDEBufferedRequest; -struct IDEBus { - BusState qbus; - IDEDevice *master; - IDEDevice *slave; - IDEState ifs[2]; - QEMUBH *bh; - - int bus_id; - int max_units; - IDEDMA *dma; - uint8_t unit; - uint8_t cmd; - qemu_irq irq; /* bus output */ - - int error_status; - uint8_t retry_unit; - int64_t retry_sector_num; - uint32_t retry_nsector; - PortioList portio_list; - PortioList portio2_list; - VMChangeStateEntry *vmstate; -}; - /* These are used for the error_status field of IDEBus */ #define IDE_RETRY_MASK 0xf8 #define IDE_RETRY_DMA 0x08 @@ -477,15 +448,6 @@ void ide_cancel_dma_sync(IDEState *s); void ide_atapi_cmd(IDEState *s); void ide_atapi_cmd_reply_end(IDEState *s); -/* hw/ide/qdev.c */ -void ide_bus_init(IDEBus *idebus, size_t idebus_size, DeviceState *dev, - int bus_id, int max_units); -IDEDevice *ide_bus_create_drive(IDEBus *bus, int unit, DriveInfo *drive); - -int ide_get_geometry(BusState *bus, int unit, - int16_t *cyls, int8_t *heads, int8_t *secs); -int ide_get_bios_chs_trans(BusState *bus, int unit); - int ide_handle_rw_error(IDEState *s, int error, int op); #endif /* HW_IDE_INTERNAL_H */ From patchwork Wed Feb 21 21:16:23 2024 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: 774520 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp460450wrw; Wed, 21 Feb 2024 13:21:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpxL5WTnrDisIX3DBQvCVzRihwcSstqCpCiUvi5iyzirtBfj3pHwiVsvwlFuCfaiiI3y0fYfLA1OM0Daysyle6 X-Google-Smtp-Source: AGHT+IH7dtE/S9Jev+2gB8WJgE+wHtkxU6qZJnGOAJImpPvK9JNGSx+srx3wlkCqU51HICg3y9I8 X-Received: by 2002:a05:6808:2388:b0:3c0:4129:9467 with SMTP id bp8-20020a056808238800b003c041299467mr24457801oib.0.1708550490253; Wed, 21 Feb 2024 13:21:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550490; cv=none; d=google.com; s=arc-20160816; b=hwETh1nJxSTJX21R3+uUzPEN8j6Izp50IPJjn6N71HuTOzQFOiKlXMZnEqIC+5GHSd LTRy1ipi2PONrXWFoMuPsWob5UMzy0WK0gIwAhi4ZxV3eZ+Ejm46iiMpfvGk74Sxz+PB 9s2DdgRErdOJ/jtcRcfbW98ahg1qXAFFqh7SlCZBuRGky2bvzqvHq1c37AxFjzhDSwys DuJd54Ooxsh9rPSo3AkfDlTqyXMqnml0t0oreTZBNtpKYMWNcouR51ZMNz1fL0sErZQN eANeq+qAojRvDIyxDtlOSjbE+GzxvGzeygWfcaSdy6q8MuEI3XTNNBFayxpNvaz8TvNf zn+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w/0nxiYdmkxhHFcoyS3JZWxjubFyxLiPoIZ7GwIxEsQ=; fh=pFT2F0T6nJrV/heHTjP7d7LJQ1K3VhIRtJG/CsMnjrI=; b=xUPWxVPpedIFFO1y4pz5uhyPJcVvEN8UIdI6uHb7BrqW2INESL29ofVxS90NZJxOnh ep1UHGr67s1EtfWiNXgB72pypiHe5C795X9Jx4oT1WDcx1XPeGWFTpo1NHZICVDxK2oN F6wJF4gOf4yIm6Y3iXmV00sZaXr3C3jC1bNILjhVFxgvcgxMucTCasGHUkxkaRxJdd4w 4I1A4ripWIENsXHJpZnXr0kYLSo88oSUDJ+niT7yOsnnYRTRSKsuT/HaHcSgaz8dek8J JRCPxHgFUp8rcQu1m0FuC4oGzUHEx2TGuJAay90wwqp+USHoPHcXObcYzzh2rtvhMM7c 1TNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gsel+bvN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u9-20020a0562141c0900b0068f9cca90d6si3311920qvc.353.2024.02.21.13.21.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:21:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gsel+bvN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcu0Q-0005Sm-33; Wed, 21 Feb 2024 16:19:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzp-0004M7-VP for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:20 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzm-0001MF-Ud for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:17 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4127a0d8ae1so3995335e9.2 for ; Wed, 21 Feb 2024 13:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550352; x=1709155152; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w/0nxiYdmkxhHFcoyS3JZWxjubFyxLiPoIZ7GwIxEsQ=; b=Gsel+bvNel7e5S+Im07IoAfEHdZcNSfwCNeXu2AQlCGD1vnkntdGhimisb02DgI/zO BIKD//3A3mZusoKRyNhAFs3eu5k4vxOzpAYz1ELUr6xAWlQSSN47H/K/UZCugHJ1ZWrL UodzjUQvprVTE4N9iSusTiGdY2SweNZFVBph/DB8Vq1Ld/ufDlA7gsKFF4M+eGQCEgig nkfczsDwYVM2z4DP0hnVBI8TWnokIM/+BXhQmAauDec/9kaBujGljtiw285VAsEwhhbV rzmQZoHj1jwGpvopXa3mVp6Udq6nflwr/WNtZzqah1oPCEbmGQxiIJafoRilHybkjNh/ +Ruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550352; x=1709155152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w/0nxiYdmkxhHFcoyS3JZWxjubFyxLiPoIZ7GwIxEsQ=; b=BzL/nJWz5ZJxmV/f8bk8XzV/qICwTgEWjzzD8D0D8qFnSipWQUE6qzOgeItc+vb7ez khEKdrG0qjBx86K1LkMgUGwGTBfx53GsEFFZ+PZkwUxPNxYXUnzEPne4j3fNSuPDmgT1 w0WWuv5wNG8O5S45vKtrHH46k38mFy7HDFlg+EN9oy9hLRkYWbZynsmLeIn4iQaL4S7U AzaXQf6nlRlIFquxvQ/OC3/D4Hl24H4lE5xkbN6NVLxEaMV7U03t60XLf4dUQteWgmFA uKLtGTtcH8QrC8DlIiQrRg0EoY2ZUb01wBiGv4Ad6/4K7228Zs36RkiZlcvknxy6hB7c IYxQ== X-Gm-Message-State: AOJu0YwiZBrpTa65cyAmJefxtGY/99mxkZWlfh0dT82PKdT88dTgPK/U YOvDiBX4+uSpEo12zSywa8LZL0iEdVe6Mx0fcSS74ZbE58VMWH4iku3PPhMQc2QsljHt4CG2ym/ DOFM= X-Received: by 2002:a05:6000:1542:b0:33d:28a9:2fd8 with SMTP id 2-20020a056000154200b0033d28a92fd8mr13726735wry.39.1708550351870; Wed, 21 Feb 2024 13:19:11 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bk26-20020a0560001d9a00b0033d568f8310sm10168971wrb.89.2024.02.21.13.19.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:19:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , John Snow Subject: [PULL 23/25] hw/ide: Remove the include/hw/ide.h legacy file Date: Wed, 21 Feb 2024 22:16:23 +0100 Message-ID: <20240221211626.48190-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth There was only one prototype left in this legacy file. Move it to ide-dev.h to finally get rid of it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Message-ID: <20240220085505.30255-7-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 - include/hw/ide.h | 9 --------- include/hw/ide/ide-dev.h | 2 ++ include/hw/ide/internal.h | 3 +-- 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 include/hw/ide.h diff --git a/MAINTAINERS b/MAINTAINERS index 5535df4487..9dd98a923f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1937,7 +1937,6 @@ IDE M: John Snow L: qemu-block@nongnu.org S: Odd Fixes -F: include/hw/ide.h F: include/hw/ide/ F: hw/ide/ F: hw/block/block.c diff --git a/include/hw/ide.h b/include/hw/ide.h deleted file mode 100644 index db963bdb77..0000000000 --- a/include/hw/ide.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HW_IDE_H -#define HW_IDE_H - -#include "exec/memory.h" - -/* ide/core.c */ -void ide_drive_get(DriveInfo **hd, int max_bus); - -#endif /* HW_IDE_H */ diff --git a/include/hw/ide/ide-dev.h b/include/hw/ide/ide-dev.h index 1f62e58ebc..708cc0fda3 100644 --- a/include/hw/ide/ide-dev.h +++ b/include/hw/ide/ide-dev.h @@ -179,4 +179,6 @@ typedef struct IDEDrive { void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp); +void ide_drive_get(DriveInfo **hd, int max_bus); + #endif diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index d3ec16a945..20dde37f45 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -4,10 +4,9 @@ /* * QEMU IDE Emulation -- internal header file * only files in hw/ide/ are supposed to include this file. - * non-internal declarations are in hw/ide.h + * non-internal declarations are in hw/include/ide-*.h */ -#include "hw/ide.h" #include "hw/ide/ide-bus.h" /* debug IDE devices */ From patchwork Wed Feb 21 21:16:24 2024 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: 774535 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp464181wrw; Wed, 21 Feb 2024 13:32:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWOT5dDqyMyUBz/2C+AhSHVBw2Um7uVgRifXw0W+0V3dykeSi+sc0W3Ot8SqoZE4yzv8EmRK8nrIUUpnNIcy9rx X-Google-Smtp-Source: AGHT+IFLjR17KiP0cqbh4iRlFrB5hmZ7tTqhEy78ek8izvgQLi/1tTuBFh+9dj/GREBQlLNQ8fFJ X-Received: by 2002:a05:620a:1a24:b0:787:2e2b:a78f with SMTP id bk36-20020a05620a1a2400b007872e2ba78fmr1151985qkb.33.1708551127826; Wed, 21 Feb 2024 13:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708551127; cv=none; d=google.com; s=arc-20160816; b=qfjCq2pUo+Nf1dntKOtlilybkN0uTfFejkMVmFKD+4m2XW8oa4mvogoRFyvCtrSucd WvVpuXQPrItzNANeThRaR6udeEAmLBlkv0Rb3MizqAqDJOhf7SiZG9ooSHxZTwlpwlmK XWONZ1crTG/PjLMBQc8Ox345+sNr5ylIWB0AIxX+cEqvTtizh6wBbF52c3wmH3/Mwqi6 JCOw3yAhZIFs3F/oqetNmZrWEJ3FOnN0yz3D8PHP3dUOOmSvPBXM2b7myjc/59fWV0Jd DijfCypkCGanHlieGS5ox0cRCIphIYuR7HD6ztyuvXBGnk9rHup0y9RBUYk2S9Wh7hHk 2JLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bSyJnKQkd93ud2FmPgc+3hwMsxOVnxzVCD11CZAAcfk=; fh=+X8R+e3mbgU3IshgdSHlFTALwQAZEUfmYK2Jo0JZy3M=; b=a22bNhaFi7GrbvJwwBgSG2DlGvNbMMIhKAxvYvv+9sIxsTUBYRH8tTL3O7zQZX1Jxs Rt+/Q2bxt6k0CGDJQoKRC13g/KxTwRQPpBJekcmhf8G+h5j0uDyvn5CqjwyktjU3i9Se Havp7xqTXOXD8vrh01+kEoX144glT4PblT32KTnmTaDPepBJhCKHpLL7a9O5E8LSCWKz 55UBfxXEBUDZR4dLdMO3v8OB9OKqpbAoFOvdcCVwWYiSqyzo0hbtA4DGzcj1sTNUBZEq Ew1ifeoDhtdHVhlLRw3cwci2QqXI4n0K2L8y+MVsVQ+y2eIVjQveubRfEA7X8t4x0G0F jVng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dHP54ZK/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p6-20020a05622a13c600b0042db3db25afsi12610179qtk.773.2024.02.21.13.32.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:32:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dHP54ZK/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcu0V-0006B5-Ek; Wed, 21 Feb 2024 16:19:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctzx-0004a3-4R for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:26 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzt-0001NV-Fl for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:23 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33d44d78e5fso2020285f8f.1 for ; Wed, 21 Feb 2024 13:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550359; x=1709155159; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bSyJnKQkd93ud2FmPgc+3hwMsxOVnxzVCD11CZAAcfk=; b=dHP54ZK/SlQkPy6n53VV6BW/1UlH9FWQ60TCS3VMtPP+u/C8oTFzu0a9U/yOQi9s2W p79JQeFoWa2fD2A38Bvzxvc+fQASyrF0hOJs1ZbODUFoOpCoZiLWXyktXhPSaR0Vpqq7 vu3P3K0ipKmR/oS1faGh/ReXUVlv5LZeZ/jjVzENn986KKME0zOA3tR6fORxMi7E0uNb L5FFE2YCTLFOWspEZW70Fe8in7tfBv6vCY+m+Nh4bvk6EMg6NMoMg5L6CQfLfviuVJh6 VA8OqKhtxGlj5VR156Ec67IWaxU5NbXfFMkacvkCgHi0JtJ85RznwHQmeHz/U0rvKc4O 9MgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550359; x=1709155159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bSyJnKQkd93ud2FmPgc+3hwMsxOVnxzVCD11CZAAcfk=; b=udku5VdIeK0GTtinn2bPa4pWOT4TZDLhywt1p1kLBSglqDak5X5+1WhTeZUvbW8FY6 ZMHsqj0j6/H6yTjJi/dRURJzyQTaNDkr0x1P0t8jsfzUF8Ic9BaU6Z3CXphSxoA0lbFa CD2S32CoU9eaDWDcwY/jHTIoQMI3eI7vjhfyg72QryfCAYC8zQLos/CIqQ9DGTghR8hM FeK+SuUlWMCbRDj9ujw1IiC6aADCfl4Y7Kn5wOHvx+IuhCQBWK+zYQy36jEjWECqbJ5d aicF95ypX2JqvWfkiQ0odXhI8m+JkDYljVbu1hPMpgbqKfnFLqxg8gbEOtX4GD6zlpqe Kwdg== X-Gm-Message-State: AOJu0Ywa83cE76qpNpRKtfTIHJRLGCD/9HLuppI0j/FWlFS4N9/X+AZb r9DpjSD0UAfBpHK8VMRQy+lQziDiYdeYBEMfMoDdaHO0yol3zTe7LdOqff/So3Wx00R1nPi65Jd 3fac= X-Received: by 2002:adf:fc90:0:b0:33d:3566:b5d1 with SMTP id g16-20020adffc90000000b0033d3566b5d1mr9489249wrr.57.1708550358803; Wed, 21 Feb 2024 13:19:18 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id p6-20020adfe606000000b0033cdbe335bcsm18113801wrm.71.2024.02.21.13.19.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:19:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , John Snow , BALATON Zoltan Subject: [PULL 24/25] hw/ide: Stop exposing internal.h to non-IDE files Date: Wed, 21 Feb 2024 22:16:24 +0100 Message-ID: <20240221211626.48190-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth include/hw/ide/internal.h is currently included by include/hw/ide/pci.h and thus exposed to a lot of files that are not part of the IDE subsystem. Stop including internal.h there and use the appropriate new headers ide-bus.h and ide-dma.h instead. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Message-ID: <20240220085505.30255-8-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ide/pci.h | 2 +- hw/i386/pc.c | 2 +- hw/ide/cmd646.c | 1 + hw/ide/pci.c | 1 + hw/ide/piix.c | 1 + hw/ide/sii3112.c | 1 + hw/ide/via.c | 1 + 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index a814a0a7c3..ef03764caa 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -1,7 +1,7 @@ #ifndef HW_IDE_PCI_H #define HW_IDE_PCI_H -#include "hw/ide/internal.h" +#include "hw/ide/ide-bus.h" #include "hw/pci/pci_device.h" #include "qom/object.h" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1ee41a5e56..f8eb684a49 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -31,7 +31,7 @@ #include "hw/i386/fw_cfg.h" #include "hw/i386/vmport.h" #include "sysemu/cpus.h" -#include "hw/ide/internal.h" +#include "hw/ide/ide-bus.h" #include "hw/timer/hpet.h" #include "hw/loader.h" #include "hw/rtc/mc146818rtc.h" diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index c0bcfa4414..23d213ff01 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -33,6 +33,7 @@ #include "sysemu/reset.h" #include "hw/ide/pci.h" +#include "hw/ide/internal.h" #include "trace.h" /* CMD646 specific */ diff --git a/hw/ide/pci.c b/hw/ide/pci.c index ca85d8474c..73efeec7f4 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -30,6 +30,7 @@ #include "sysemu/dma.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "hw/ide/internal.h" #include "hw/ide/pci.h" #include "trace.h" diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 4e5e12935f..1773a068c3 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -30,6 +30,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/pci/pci.h" +#include "hw/ide/internal.h" #include "hw/ide/piix.h" #include "hw/ide/pci.h" #include "trace.h" diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 63dc4a0494..321b9e46a1 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -13,6 +13,7 @@ */ #include "qemu/osdep.h" +#include "hw/ide/internal.h" #include "hw/ide/pci.h" #include "qemu/module.h" #include "trace.h" diff --git a/hw/ide/via.c b/hw/ide/via.c index 3f3c484253..cf151e70ec 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -25,6 +25,7 @@ */ #include "qemu/osdep.h" +#include "hw/ide/internal.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "qemu/module.h" From patchwork Wed Feb 21 21:16:25 2024 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: 774534 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp463945wrw; Wed, 21 Feb 2024 13:31:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXy/sbdkm/WhQZktdtwl4QhDWh1hzLum2ao1RZzVbht20f7Qsn/Z3IajlpUdQPnxYJADkwRfmKB1TFJyNzBki2C X-Google-Smtp-Source: AGHT+IF+YGqzaeUcb5jeQ9g9JDU/StD9N+J+m0MMRsuQiY0rdPchP3qSeMxetZ1mRPedfQHh62K7 X-Received: by 2002:a05:6830:2707:b0:6e4:4218:22ac with SMTP id j7-20020a056830270700b006e4421822acmr14631050otu.26.1708551093614; Wed, 21 Feb 2024 13:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708551093; cv=none; d=google.com; s=arc-20160816; b=JxTtoFl40HgWdstG+uWoxsWYFh21avVd2dT4oYLROsM0iPDkijFHn8Oh/41W/GLiXC 3Jhtn0S6HmT0ppMdC4EIz9U/Rqv36rmDmn4pD/rVKk5eVOsfQWbJA/UEgBYYAvt+iVjc Mai6OWha/FNsvV/n4Jg3NTpuDH8zQT4yubxueVpm0uG82nJS01OGZfW8kPMQQEe6USUN vdDoH5BRYEtIiqxSLI4LbMDHkYSjtIpx0XxlbBZ6i5226HDBozc5ciHZS2eMcHGVLz3+ C7b/MoO7KjjjOXAIm98TkvBdPsGJkZvpX6n0T6nXvgufRcX/cUcStp0kby1vClN5sBye hFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NM3OaF5xVJiH79yUFzhlf4BJ4fqxcxDiXY4cqoH9BzE=; fh=9w3KqSgzMaROh11QbcP6yxiFqeRkPaMHH6jm8VkaSlE=; b=ZF3zHejwTmp8mm/gz999xpFcJDZ98Ge+lZuCAewIxhbDfLfWXLxVQRMvQ4hLl5xSBE H3Y9GDvupAqcfzakqHVX91sIij8tzdM4PyGte99k5NcO9EwbG2cjeRkauDw9ReGDSs2k +9WeZssAO0k4x1tU0S0JwW6RkVXhHqfD2wtCCKd4E9TMbP4keYvKB6J6S21bfo//JCxv +rIvJ/V+z/SehwssQUYZDlYrDT8f+Ebw/iFFte6DuaCRuU1GVC9QQx8F71hHMHd7EH+U wDlh0E5jDQuEbSiY9cnJRjg1a5AAI774d1duEIZSY0BPmEidVemMbUFJTO7eC7gZzerf 8wgw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AdpoUhzf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z2-20020ac87f82000000b0042dc7e37411si12983710qtj.55.2024.02.21.13.31.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AdpoUhzf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcu0r-0006jw-8b; Wed, 21 Feb 2024 16:20:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcu02-0004ek-KG for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:32 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzz-0001OW-Er for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:29 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41276a43dc3so7479145e9.0 for ; Wed, 21 Feb 2024 13:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550364; x=1709155164; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NM3OaF5xVJiH79yUFzhlf4BJ4fqxcxDiXY4cqoH9BzE=; b=AdpoUhzfMXTC3rmgCYRewXCSVh3cBZKFmYxrAJ1KAbJu9a+BjkahyKyx/Ka+DoK7i+ iWNk90ehBr8pseI39qjax8zZ6Tqg3pGKFo1tK8kDvdkAbfvlXnnvwg+SFwY9qrz1AsFw d9jGeIj9fbNsitQo4JEG3h40lk4FOlEYhzgBBF920oDEX7BQ66uV0t6FmD7XF75nr1Yq KMuqc28P8rxazbeo+SiljigLsMWv1ysw8lg/KWm8Le/ZzWAd6mUqYGnFbbtoOqGgRdDd dYAPKVMz6+zUfXlHRTaY4tUfq2uaN0Urcg0l1ZHdleGg0HfXOU1Xj9Q1LHQPzECw0MLR v9hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550364; x=1709155164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NM3OaF5xVJiH79yUFzhlf4BJ4fqxcxDiXY4cqoH9BzE=; b=cN0lHutNGfcoFP2/sAkSlk+8MFvM3pLOU1kguVzp+NW5oK5VkW5gfAe5FgHcb+rXoh N0MqF7TSQH9IAsTcgbZeW6hWvAALlIwO2ORI2MB50NOfslx7NC4mgAfyAV183SM9af1v UzzyIcP3YCiUBrUswjA3ELYv/pTSkwrCJu2NjeHOjujHQF6BpR3iQVSE8cDD9Ut+c7dS AhyW5X/3m+p0MrKrcVK5+osNNc9SAPQX6w+lzcB4vq9DaxRLxAueTBjIujbg0kh3RaAP ZQUKrH4A8HoF2hLjfnHSCPnHAXDcjHgwt7gkFikr5T366nlu63++0m470rbxFkl1HzTo PnfA== X-Gm-Message-State: AOJu0Yw+e+6+WJs2kkFr9FxUkROsR6PFqb6QX7ZP/mG0LVVoMl8wepYl hbjaQ5XnBqS833GY3vBY6x7mH8aQpv+cnO9l2iV6i/stdLpdhcdZk6cWu/SnbxAYCYB73C64UGq PrwU= X-Received: by 2002:a05:600c:5250:b0:412:63e8:b2f3 with SMTP id fc16-20020a05600c525000b0041263e8b2f3mr9088273wmb.4.1708550364663; Wed, 21 Feb 2024 13:19:24 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id l20-20020a05600c1d1400b0041256ab5becsm16906430wms.26.2024.02.21.13.19.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:19:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Cl?= =?utf-8?q?=C3=A9ment_Chigot?= , Frederic Konrad , Mark Cave-Ayland , Artyom Tarasenko Subject: [PULL 25/25] hw/sparc/leon3: Fix wrong usage of DO_UPCAST macro Date: Wed, 21 Feb 2024 22:16:25 +0100 Message-ID: <20240221211626.48190-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth leon3.c currently fails to compile with some compilers when the -Wvla option has been enabled: ../hw/sparc/leon3.c: In function ‘leon3_cpu_reset’: ../hw/sparc/leon3.c:153:5: error: ISO C90 forbids variable length array ‘offset_must_be_zero’ [-Werror=vla] 153 | ResetData *s = (ResetData *)DO_UPCAST(ResetData, info[id], info); | ^~~~~~~~~ cc1: all warnings being treated as errors Looking at this code, the DO_UPCAST macro is indeed used in a wrong way here: DO_UPCAST is supposed to check that the second parameter is the first entry of the struct that the first parameter indicates, but since we use and index into the info[] array, this of course cannot work. The intention here was likely rather to use the container_of() macro instead, so switch the code accordingly. Fixes: d65aba8286 ("hw/sparc/leon3: implement multiprocessor") Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240221180751.190489-1-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 4873b59b6c..6aaa04cb19 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -150,7 +150,7 @@ static void leon3_cpu_reset(void *opaque) { struct CPUResetData *info = (struct CPUResetData *) opaque; int id = info->id; - ResetData *s = (ResetData *)DO_UPCAST(ResetData, info[id], info); + ResetData *s = container_of(info, ResetData, info[id]); CPUState *cpu = CPU(s->info[id].cpu); CPUSPARCState *env = cpu_env(cpu);