From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282411; cv=none; d=zohomail.com; s=zohoarc; b=mQZ6O4oIx1t22AMZyOhTP4vmqIdTstNwnqCzkwAIVD3kii2C1of36MS+2fsfaXPoL9+FzwYiz1bhOON7Q/PVIlqTxXvSjrgWBDIgnJURtpo35yhYfAO8q013X9YFwzT8aWJQXRBz/FTHEiKzjKjyXJQdPxyOnhy9zlTZyY7raF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282411; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WRQy+p9QHBhbhdctUoVX94Tio3w4hP8sJtMALXRbrgI=; b=ZrNYFhQdD8TjTxb3ggP5UbvHrSdL2QGB6dHfazlI0t7RyWHsG8MDQget3190Li9YViLdyGdbCXVWVc8b7vSjI2ohMnTheyzQKz0wRC74QgKfoX/X3v2dduoqcJ8yDByWB/D3ya28RRDAUbvd7I5r1Xb7Z1bw6NzM+gx7m8HVfvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282411406360.95971539115567; Fri, 3 Jun 2022 11:53:31 -0700 (PDT) Received: from localhost ([::1]:49186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCQM-0001Tn-E7 for importer@patchew.org; Fri, 03 Jun 2022 14:53:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCO5-00077K-DH for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:10 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:44841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO0-00047r-Al for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:06 -0400 Received: by mail-ej1-x62b.google.com with SMTP id kq6so4597400ejb.11 for ; Fri, 03 Jun 2022 11:51:03 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WRQy+p9QHBhbhdctUoVX94Tio3w4hP8sJtMALXRbrgI=; b=I+KWJK5wdnGCNQatXmeewgCvNV3aI++/RCNIUlAB7p9Hx1k9AOqSPUJPRRz6R6Jmib 231VQRo86xC9Lpj1rbnu/sOexMfqcB3dU5cEO5P9/9lvXyT45Eq1wxohixxsrcq45jWa qivF8O0gTf1eLMwnNKzWdoyyOPAcfgSXmsq5XNhK8Vr/LlBmTTAt5wNfcmT/43id88bd BvB3FMRvuEb5uOAKSNry/KkhTq3m5WCATOk9JaXQ+xBa1dMsM1H1hom+83W/7PHvbmZs DSZBmydGZ3AcVrMrJPRSSnwi5Hn13TC0eoHPE01btkMOqNUor6rU8jumy4rao/z9aHpi 4ElA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WRQy+p9QHBhbhdctUoVX94Tio3w4hP8sJtMALXRbrgI=; b=LgMrm6D9OZCC7aGX6cNDOwqMYYdzHGqLvQMGih6B+PbBCW+n4YA7ohSVE2xc8yp8tG olKx6JiPLFb21J1cFZ5cA5TscQtxHVofT6JYpJ/ww0YX23+qaDN2+oYC7vKtibLI0+r6 pOuw5OlNECLTMATeaXpnOV5hYmSMqD3zbGHU4rge/BXgw5kwSYOReNiqT2T7niNX/6o+ 5yjZLKDK7/qkecYjiiJKt5mLbwjawdkkBHx/XokxEg2rLNPBsPwOVx2gt8VZu6Ow6xnx 7KSTSBM7YR/4qnCqw1MObLXm6lo1SGqKzdkMOKT5OuhCVKILV1rJiLebOk1xE4kCdkkc +jCA== X-Gm-Message-State: AOAM5333x5zAe71nRr6fgojJGEQFgcSyO+8Nr/aenAlakW5rv/WoLziQ CcgohYitU/TW74cy1KPiBMjtYjlSq9iRig== X-Google-Smtp-Source: ABdhPJwWSK0mloEc7bHzrGOo/wz3YA1l10SFJRCPBC5y+2vHvXSH6y3kAagX+FpyzCZG5PQvXV+PZQ== X-Received: by 2002:a17:906:99c1:b0:6fe:b01d:134 with SMTP id s1-20020a17090699c100b006feb01d0134mr9821740ejn.598.1654282262709; Fri, 03 Jun 2022 11:51:02 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Mark Cave-Ayland Subject: [PATCH v4 01/11] hw/southbridge/piix: Aggregate all PIIX southbridge type names Date: Fri, 3 Jun 2022 20:50:35 +0200 Message-Id: <20220603185045.143789-2-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282412003100001 TYPE_PIIX3_PCI_DEVICE resides there as already, so add the remaining ones, too. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix3.c | 3 --- include/hw/isa/isa.h | 2 -- include/hw/southbridge/piix.h | 4 ++++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index dab901c9ad..d96ce2b788 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -35,9 +35,6 @@ =20 #define XEN_PIIX_NUM_PIRQS 128ULL =20 -#define TYPE_PIIX3_DEVICE "PIIX3" -#define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" - static void piix3_set_irq_pic(PIIX3State *piix3, int pic_irq) { qemu_set_irq(piix3->pic[pic_irq], diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 034d706ba1..e9fa2f5cea 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -144,6 +144,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d) return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); } =20 -#define TYPE_PIIX4_PCI_DEVICE "piix4-isa" - #endif diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 976b4da582..3b97186f75 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -64,6 +64,10 @@ typedef struct PIIXState PIIX3State; DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, TYPE_PIIX3_PCI_DEVICE) =20 +#define TYPE_PIIX3_DEVICE "PIIX3" +#define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" +#define TYPE_PIIX4_PCI_DEVICE "piix4-isa" + PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); =20 DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbu= s); --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282583; cv=none; d=zohomail.com; s=zohoarc; b=lBaSJ2G8mQPHLuMoeOs9mvVYAfii9C92jokHXy28Kmo/xRgxCas8a/RiyZVKny+R2qm24D7/bq1y7waOU6/eEaDFfFIejRj1W5+c8DclbKRReQYPyHB/6Zlrrq+dtehG549mU87VN7vPD4PAtNCuscPExLeUXGKuGs4vDGrQ04c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282583; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zsrYs9v+j1ezvORFnoGAQqRmm4nxMzuK/3Qj8II5VG4=; b=N59x2yeKbWUH9tS0e+qzxHz3+F/9xeBpBWIWx951u8Xb5qodPvdHDNZ3W0coqhJcgCSSjBd2DTxDTD7LcipNxL7TmdG7P6je+6GXKHng2nXIdCY9agrCH5Vlm1DCI0THdVPdddWxGpyny+tkjSF7HTNopoa9y5yrDe5QoPj3AT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282583281316.0763295728093; Fri, 3 Jun 2022 11:56:23 -0700 (PDT) Received: from localhost ([::1]:57784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCT8-0007Bt-8l for importer@patchew.org; Fri, 03 Jun 2022 14:56:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCO5-00077M-Ea for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:10 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:40620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO1-00048B-F7 for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:06 -0400 Received: by mail-ej1-x636.google.com with SMTP id fu3so16122361ejc.7 for ; Fri, 03 Jun 2022 11:51:04 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zsrYs9v+j1ezvORFnoGAQqRmm4nxMzuK/3Qj8II5VG4=; b=f03RNSjLDYDV1Xcd8f96z1+MNrrs82v5G1g1ZXYM9gBJsZAKgXrTdi/G6vIgqAhdJU yVCTKnNhLm6Tg/EzH+lQ04RUKs5IP46b7qy4/XMgIprA3qHtJGlG0Ks+s6EqIqEOFPD6 wY8TyIJz4o2K6RsFdgk1yVUhTrM4CQPtBAnYtDHkLMr8sVJ5Yd34r6m6qlS2jQethcNU tJ3vPQZTkkmQxy5PadfOrzF7cA/nFSZFNMKIe/wC/dn4YKflweLk13F4sBDvw4R3gYD2 urAWCJ7QwTy6JUlCK6u+kEUvjorQGYcOb9pZBmPWZo1DHAVEzQ08KyZEdTqPdUalSz2b 60oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zsrYs9v+j1ezvORFnoGAQqRmm4nxMzuK/3Qj8II5VG4=; b=MRPO6HnwJtjMeX64gDazDX2eyZJUY5RJ3Sg5H93q8BgGSHArF0iWPT0tzFjGAnPhEB 0GyNGNlDVW0JD5/4VN4usQuIEELGBxqkqY3YTJgAcVQuV9GB2kTNklqs0U7+y0Rbl4Wb dPJkz34oo60duSnc1eSaMFp6mMxP5dMJVlIofYBNRFSSIIDphxPpE3Y1rcLqu6Scvl7n gjEM9K1LZtqZkaKeJWyrKBtwTZRdZOcYSNHN5LeZPLRRETx/VVv22m/81RxGx6JSk0sP N0DiZs6A4mZvj46xjaBQHA7tUY0jXyJYoKj/mJxm4kRJxE6VLz3MyopjeeJuWbwgSoDX jzNA== X-Gm-Message-State: AOAM532PRkXTyLj09WUVsLskqbmaV4ohsUlM5F9LyjstTu4IHkRrdeIZ CYDr98DiWFHTR9g3VesYRLSMazLKdJ2JSg== X-Google-Smtp-Source: ABdhPJxacIlHswXk79YvmaZi/5wEqK6+EQ9ZNgtS4j4dJfc2wtJSQWPB/mmmSrMlbWFzy2kTZY15+g== X-Received: by 2002:a17:907:2d2a:b0:710:76a1:4d89 with SMTP id gs42-20020a1709072d2a00b0071076a14d89mr300271ejc.307.1654282263816; Fri, 03 Jun 2022 11:51:03 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Peter Maydell Subject: [PATCH v4 02/11] hw/isa/piix4: Use object_initialize_child() for embedded struct Date: Fri, 3 Jun 2022 20:50:36 +0200 Message-Id: <20220603185045.143789-3-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282584315100001 Reported-by: Peter Maydell Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland --- hw/isa/piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 9a6d981037..1d04fb6a55 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -224,7 +224,7 @@ static void piix4_init(Object *obj) { PIIX4State *s =3D PIIX4_PCI_DEVICE(obj); =20 - object_initialize(&s->rtc, sizeof(s->rtc), TYPE_MC146818_RTC); + object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); } =20 static void piix4_class_init(ObjectClass *klass, void *data) --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282406; cv=none; d=zohomail.com; s=zohoarc; b=h/KWo4AELbVQZ3NgnAjxpCOH2ExDC6oQHZTQFpfBi5cxBrASdVuCX3euUAqzsYMyEpP9aYl9QUif/MEGVsloe6AqZhhDWSKiitJnUkozliZBc+88JIgrv+7Sr3wQFUeEIFHvh1AIjABybg3Ytd0KdQaxNudof1cUnkLeo2NniU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282406; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w+VBxhxh0gSBVm9fr937VMDDWJs7ypGS7SXewGU/qvQ=; b=iFjidcJb+50z32zwKSC2bD7dWQWtvLZM4SC+kcjyuP2gbK68AIqGIphgodnoB+F1cc9bZArWiptFDGVbkl8jgpwLYzdCLcBFrTzJyvEsASQm1kz/W5BqLMv7VUiANawohUSMf2v7gmGh5s2oHzehE4I4kj8YZemJwlbq2axJSXg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282406566633.2845094808364; Fri, 3 Jun 2022 11:53:26 -0700 (PDT) Received: from localhost ([::1]:49142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCQG-0001S5-Bi for importer@patchew.org; Fri, 03 Jun 2022 14:53:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCO7-00078J-NI for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:11 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:34357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO5-00048p-2F for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:11 -0400 Received: by mail-ej1-x633.google.com with SMTP id q21so17644467ejm.1 for ; Fri, 03 Jun 2022 11:51:06 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w+VBxhxh0gSBVm9fr937VMDDWJs7ypGS7SXewGU/qvQ=; b=nMBcEmvzYazMSmOM+6PchFb6GHzW4PR+GwBeOLg/ec4KyuXvazUlVwesC3IL+dsqKA FuqRDJcxyqZ5geAFCGVy9HEuakns9XjnT3edMdNedW9fx4h4AZnk8Nwo3RBbqRgnO8rp gnjKnEkfv32jeuYQkKE1kQn7bbMDIrG+NXH36bf0foC2PJJsBfI+jQ0iPwnxGG3HJW8t j9K8+EMFUhayUlWUDR6gQ/fjj/KT+qroWUvLmTQfKqTsbXTcHQFNaSkZpFW6DfspS4zK VwvpiJVwFz/RDwsOMkkhYDlEjilfiSx8HV+1mAgy6WwOG08as/QC+6PlXwZjZMI1SZDu ThPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w+VBxhxh0gSBVm9fr937VMDDWJs7ypGS7SXewGU/qvQ=; b=xYiKjhCtuo3edKRzs3xaXUs9J7VPqinSIFzW2GcZqxAZx6qUlhzsJA/y0l0QMsDFhD MQvBgoIoMgnyx93FSqG4qJjqAztRazMn3znMqEHvz9uvff54DeOxW0C0o6PVLuux+p9U owL9DXAJ7tEtMB9TjtMVoYkCoqYjD+0dMF5KourySjZ7Ic0h8OrNeiaWqKdbQmDnuYv2 CZSn4y32E7zoWNQyjpBVZv7MyhHk0Akd3d8n4G4OXwQDwd9unfZwK6DHSDByo8+t8dEs c4Pj7+kbf1EKnrOr+ZSXjYDQlqd54z3n8LGpZS/PdONXVuQkE1VLeVxy8wL9sbyQYO91 RPpg== X-Gm-Message-State: AOAM531l2emVqkzdJJCdpopQA4I2XWuZ8pK0pLX4i0Q6e9lJA88ReGfv HPln1IYe0B3KDwMAP5BYSw2E0+TWcw5wIA== X-Google-Smtp-Source: ABdhPJysHlDfP9FYhPKp2znJhlxn4OFCjLsNlBQznkSoblZy7z8Rb3GhGGY9fNEQnDO8jyJRSDDMhg== X-Received: by 2002:a17:907:868c:b0:6fe:fd7a:e0d7 with SMTP id qa12-20020a170907868c00b006fefd7ae0d7mr9880899ejc.90.1654282265505; Fri, 03 Jun 2022 11:51:05 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Mark Cave-Ayland Subject: [PATCH v4 03/11] hw/isa/piix4: Move pci_map_irq_fn' near pci_set_irq_fn Date: Fri, 3 Jun 2022 20:50:37 +0200 Message-Id: <20220603185045.143789-4-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=shentey@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282408273100001 The pci_map_irq_fn was implemented below type_init() which made it inaccessible to QOM functions. So move it up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix4.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 1d04fb6a55..18aa24424f 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -74,6 +74,31 @@ static void piix4_set_irq(void *opaque, int irq_num, int= level) } } =20 +static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) +{ + int slot; + + slot =3D PCI_SLOT(pci_dev->devfn); + + switch (slot) { + /* PIIX4 USB */ + case 10: + return 3; + /* AMD 79C973 Ethernet */ + case 11: + return 1; + /* Crystal 4281 Sound */ + case 12: + return 2; + /* PCI slot 1 to 4 */ + case 18 ... 21: + return ((slot - 18) + irq_num) & 0x03; + /* Unknown device, don't do any translation */ + default: + return irq_num; + } +} + static void piix4_isa_reset(DeviceState *dev) { PIIX4State *d =3D PIIX4_PCI_DEVICE(dev); @@ -266,31 +291,6 @@ static void piix4_register_types(void) =20 type_init(piix4_register_types) =20 -static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) -{ - int slot; - - slot =3D PCI_SLOT(pci_dev->devfn); - - switch (slot) { - /* PIIX4 USB */ - case 10: - return 3; - /* AMD 79C973 Ethernet */ - case 11: - return 1; - /* Crystal 4281 Sound */ - case 12: - return 2; - /* PCI slot 1 to 4 */ - case 18 ... 21: - return ((slot - 18) + irq_num) & 0x03; - /* Unknown device, don't do any translation */ - default: - return irq_num; - } -} - DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbu= s) { PIIX4State *s; --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282764; cv=none; d=zohomail.com; s=zohoarc; b=fcJhpQzwIKKmphLoW5wVe+QQUzlqB8l3jXvCPwSlbzPcgWm419ZHnds6X4ZuQQDvV/Fst1KswjCSyDnoLvGA5CMM+1QUcl7LLzDD6WUzxo4RcP3WeaLOCj4Ih9DzTyfGuVbsCFkxmtnqqjFrehNndl6aCTagIpqcPaGdq7m4zJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282764; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=INWHJdCEzGhmN69hiuG+Qj1A8L6gKWutj0DTiMvIB5Q=; b=aP16CxqSak7ZXFog6Dd+YMeZ/wE4sl6QINgKHN6hw0CWw+CVo5/2ylEda9xVATks3AvOB6pq4SZDswn0BB0L7E5JJskLsyU81ef09SwBC4VI8Hb7Jjn/IqvVJBEWSb6IZZqpBGjUhJZPJMzFAbcctj90x/tWZM1Z8Fk47eXFKBE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282764355285.15352623340095; Fri, 3 Jun 2022 11:59:24 -0700 (PDT) Received: from localhost ([::1]:36348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCW3-0003QP-6f for importer@patchew.org; Fri, 03 Jun 2022 14:59:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCO6-00077V-PF for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:10 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:42814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO5-00048x-27 for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:10 -0400 Received: by mail-ed1-x532.google.com with SMTP id n28so11299717edb.9 for ; Fri, 03 Jun 2022 11:51:07 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=INWHJdCEzGhmN69hiuG+Qj1A8L6gKWutj0DTiMvIB5Q=; b=duuMEbFnpsbxxmA2fiQRqu5AKm5dOhMCahzcDIuBAT9j2mnRZPKAhIL1Fi4GXjHRdx aYJ3hN0PRV0MtFF/9sbmlG0SWRCrjO78G6EAxPD4TgulAb7BbJPZQhvkbWUmh3LBF14O 6Q1EPBv9koimVXv59qlmVM1z3a+uGhPHPaZtg39KOXxv6Mk1GD9YqKkG9KG1kzKrKen8 p+9V6PfBI1smChTpRlyoC3bm5OsVy9tuLC1RdoqOaKfrPlgucdhM4aq6lRHf0wI8qWVX VpOr1+n7GiJTeuq1FXlgIGQoar6pUPMH0W1OMHN9w+V0Ui3//dqmmljvP7GcDiyhcwTs xYTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=INWHJdCEzGhmN69hiuG+Qj1A8L6gKWutj0DTiMvIB5Q=; b=JoqXQuyOoAqez69LYgYZFEsA6IykXM7JMa8JzjA7x2ctFx5mwjLNtqAuGR1H+IXMiB OF+dkjCJN0nYi93RlGrOz3ACZosiDXB9NpHBQV+P6Ax5qah8tUiHzjTaYgNWxho+QvZQ SmHNk2MG0Ujck0hAP6b4g8eSAuP+w11xtBy9RBs0CEiJR30UIRo+K/uohWfhjUoHGMNo zUZJPO+RFKgIR3b6dAsSYZfRYZ/20Fm3WIVAEY5bqwu4kXtGDt36UEOf5w/5e802m+Fy 70jqYYkEDiDO/8zngAApvSGTHtH2e9m6nuUvslXYTEVf06ZRBQroVfnstHbLEmrRybnR akOw== X-Gm-Message-State: AOAM530C9lEwwUrLH0QVtu9wG66qnzjJKMFzxFtG+AbAD6N90aI80oVZ SNr7kd56I1EBxSveDE8Rt3Ed1wwJH5GJvA== X-Google-Smtp-Source: ABdhPJw4tmGLk/1Xp/iEPARnj0s7Ac1Ahx37R88Inrr/3pn8QNJajorqtBOfTk0bUbYmxCQ+DQJHIw== X-Received: by 2002:a05:6402:516e:b0:42d:c48b:b724 with SMTP id d14-20020a056402516e00b0042dc48bb724mr12406610ede.93.1654282266632; Fri, 03 Jun 2022 11:51:06 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow Subject: [PATCH v4 04/11] hw/isa/piix4: QOM'ify PCI device creation and wiring Date: Fri, 3 Jun 2022 20:50:38 +0200 Message-Id: <20220603185045.143789-5-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=shentey@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282765808100001 PCI interrupt wiring and device creation were performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland --- hw/isa/piix4.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 18aa24424f..058bebb5e2 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -35,6 +35,7 @@ #include "hw/rtc/mc146818rtc.h" #include "hw/ide/pci.h" #include "hw/acpi/piix4.h" +#include "hw/usb/hcd-uhci.h" #include "migration/vmstate.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" @@ -46,6 +47,8 @@ struct PIIX4State { qemu_irq *isa; =20 RTCState rtc; + PCIIDEState ide; + UHCIState uhci; /* Reset Control Register */ MemoryRegion rcr_mem; uint8_t rcr; @@ -205,6 +208,7 @@ static const MemoryRegionOps piix4_rcr_ops =3D { static void piix4_realize(PCIDevice *dev, Error **errp) { PIIX4State *s =3D PIIX4_PCI_DEVICE(dev); + PCIBus *pci_bus =3D pci_get_bus(dev); ISABus *isa_bus; qemu_irq *i8259_out_irq; =20 @@ -243,6 +247,21 @@ static void piix4_realize(PCIDevice *dev, Error **errp) return; } s->rtc.irq =3D isa_get_irq(ISA_DEVICE(&s->rtc), s->rtc.isairq); + + /* IDE */ + qdev_prop_set_int32(DEVICE(&s->ide), "addr", dev->devfn + 1); + if (!qdev_realize(DEVICE(&s->ide), BUS(pci_bus), errp)) { + return; + } + pci_ide_create_devs(PCI_DEVICE(&s->ide)); + + /* USB */ + qdev_prop_set_int32(DEVICE(&s->uhci), "addr", dev->devfn + 2); + if (!qdev_realize(DEVICE(&s->uhci), BUS(pci_bus), errp)) { + return; + } + + pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PI= RQS); } =20 static void piix4_init(Object *obj) @@ -250,6 +269,8 @@ static void piix4_init(Object *obj) PIIX4State *s =3D PIIX4_PCI_DEVICE(obj); =20 object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); + object_initialize_child(obj, "ide", &s->ide, "piix4-ide"); + object_initialize_child(obj, "uhci", &s->uhci, "piix4-usb-uhci"); } =20 static void piix4_class_init(ObjectClass *klass, void *data) @@ -293,7 +314,6 @@ type_init(piix4_register_types) =20 DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbu= s) { - PIIX4State *s; PCIDevice *pci; DeviceState *dev; int devfn =3D PCI_DEVFN(10, 0); @@ -301,15 +321,11 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **i= sa_bus, I2CBus **smbus) pci =3D pci_create_simple_multifunction(pci_bus, devfn, true, TYPE_PIIX4_PCI_DEVICE); dev =3D DEVICE(pci); - s =3D PIIX4_PCI_DEVICE(pci); + if (isa_bus) { *isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); } =20 - pci =3D pci_create_simple(pci_bus, devfn + 1, "piix4-ide"); - pci_ide_create_devs(pci); - - pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { pci =3D pci_new(devfn + 3, TYPE_PIIX4_PM); qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); @@ -320,7 +336,5 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa= _bus, I2CBus **smbus) *smbus =3D I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c")); } =20 - pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PI= RQS); - return dev; } --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282415; cv=none; d=zohomail.com; s=zohoarc; b=Jt9S4raAzLgulaN2SyszS1AeAgThY26pR40P2CJMcrmbuTGmaSaF18t3eMHTVaTlXU1SmQkDJOAQtfpp467fCexpL+mAMpgG84EoiLO3GqZDhbg3fZj8z0S5Bxj5QTOVDg6CEMH6cYw0FMn5punj6fsrT4XDBmHA336aGe3+POA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282415; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hiYBO+N7jIAM2+stGie02AILzVrsGsOeOjsOm9ex25w=; b=nTQmahVv5ZhczvO3qGvcb0laOADaCRRwtR49wH+vqrIVxMDSJxl+64qw2/ZjV8MYw6IQ5D9O8tQHpmNhaSYL1FoWrTzo/rWXryk0tn67cD4yJ+G6Had2PyC3SMs+7nNOmH2HIQw6dHrKnU9AVPPHyeYfTxJsCeLkrUcWACUwp/g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282415605955.9586315903388; Fri, 3 Jun 2022 11:53:35 -0700 (PDT) Received: from localhost ([::1]:49176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCQQ-0001TX-7C for importer@patchew.org; Fri, 03 Jun 2022 14:53:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCO7-00078d-Tu for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:12 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:46785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO5-000493-4q for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:11 -0400 Received: by mail-ej1-x629.google.com with SMTP id v1so6921289ejg.13 for ; Fri, 03 Jun 2022 11:51:08 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hiYBO+N7jIAM2+stGie02AILzVrsGsOeOjsOm9ex25w=; b=qcSFa+CjdyGMu4BtneDS1h2fU58B07eDFJ8rHYvMuk2JngrnshtBe1WcDw2WQSLR82 rhsis1SnnBUYeAghSPQcj/yQPBUdqWQH7oW7hPr25mDctykVfEGVjXSh98m3Plh2qjqK pOtpxVD6xmIEXKrBTQAdmzJ7phVw7VI7JoHLo/+pv+tgyF36dtWjqRAfjtDDFqlBAiiJ jDUTgpnYNeKlOqib1qv9j1sei6SNYM7Up+U6MVOrABFwzFT+tBYp523xK6clC/BwuuUI 7H+xYsMRPRNluKKKVdhFAD5cRLiiVE6s6m0g/GlBh6Ja5SFHvcfQUwdwsIOXBb2c8WY3 nE4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hiYBO+N7jIAM2+stGie02AILzVrsGsOeOjsOm9ex25w=; b=PxbUlXIFklixBImtkM1OevK2l27zF2ogsubZZd32o6SShjD1miTOLImdFphX7EebRR B7vJftXJ6wqg0DWpzViMsOI6YcK0hfExGwiGh55thuHrJsyo0XggXmKISrufQ1X6qZ0D 3n4+iy0tTGlrFwhECd6QxktJA6SFd/DsK0oqM/11creRed39KAD10KP1mXD6zp3s/ZZp 7wb9Au0XSXuSCt8ACfTQOE8akQuYDVcIPjN/IbJ1GTmjfslu0UheyRcEmrQKrrPqpaGw NokgnuoU5WCQMnZ4J4kFUkQGT6ir44Wh/BDdSAWwKVOEGOxQ6uKGT8rGe8o3r6XsE8Ov kDxw== X-Gm-Message-State: AOAM532IwYry8EXn1WPflrY7uTkGOHvGEsTXFK8/K6AKSr3OImStasfT PtU38Mn44SKoBRnaP6wv9er+YT7ukM2daw== X-Google-Smtp-Source: ABdhPJxwqmGSFJq0Ksy9kB/6+H3mzMyjmReuUgs3RU/fOaN3pMJTr3y7s0KimZMCALYxoMKWdQ1K6w== X-Received: by 2002:a17:907:3c81:b0:6e6:cf3e:6e14 with SMTP id gl1-20020a1709073c8100b006e6cf3e6e14mr10038017ejc.181.1654282267662; Fri, 03 Jun 2022 11:51:07 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Mark Cave-Ayland Subject: [PATCH v4 05/11] hw/isa/piix4: Factor out ISABus retrieval from piix4_create() Date: Fri, 3 Jun 2022 20:50:39 +0200 Message-Id: <20220603185045.143789-6-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282418130100001 Modernizes the code. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix4.c | 6 +----- hw/mips/malta.c | 3 ++- include/hw/southbridge/piix.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 058bebb5e2..96df21a610 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -312,7 +312,7 @@ static void piix4_register_types(void) =20 type_init(piix4_register_types) =20 -DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbu= s) +DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus) { PCIDevice *pci; DeviceState *dev; @@ -322,10 +322,6 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **is= a_bus, I2CBus **smbus) TYPE_PIIX4_PCI_DEVICE); dev =3D DEVICE(pci); =20 - if (isa_bus) { - *isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); - } - if (smbus) { pci =3D pci_new(devfn + 3, TYPE_PIIX4_PM); qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9ffdc5b8f1..e446b25ad0 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1399,7 +1399,8 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); =20 /* Southbridge */ - dev =3D piix4_create(pci_bus, &isa_bus, &smbus); + dev =3D piix4_create(pci_bus, &smbus); + isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); =20 /* Interrupt controller */ qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 3b97186f75..dab5c9704e 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -70,6 +70,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, =20 PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); =20 -DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbu= s); +DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus); =20 #endif --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282582; cv=none; d=zohomail.com; s=zohoarc; b=F6S80y8ZDhLFcEyZzi8OcRCnsvYdN3JjCqZfgEaxYcjwTDwXXZFHniEkGBBMokVI0CPg8JEDADfglmkiQcAwHLiVo90zctPF9AHYh8mbtqWNPORZboJ/Gj0mYGZbUzvyXQm6mxVad6TiuXN4pG2YCEIkE2gs/lvv3lcrBaGgghU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282582; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x+b0Zu1GpfMHDnb2ysjGbnPDUKZFXcnMEMYykhWD4rs=; b=MbRMAjQtDIm8rFJU3Lmt55xK96odHFJNE8PjY963mC2eIoAMr2HojngU06yzmyb2omeGv3jixXTdLZNjMown/vQQP7DnAnfcfibcvykGsi8nVi2R4WvFg2/gROo8zjHDYby9gfGT/YSxjRnnCssSlIstWnnSqXdEiDWI1KNcr5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282582705374.35512237917976; Fri, 3 Jun 2022 11:56:22 -0700 (PDT) Received: from localhost ([::1]:57770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCT7-0007BT-Gp for importer@patchew.org; Fri, 03 Jun 2022 14:56:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCO8-00078n-IO for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:12 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:40795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO6-00049m-6i for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:12 -0400 Received: by mail-ed1-x530.google.com with SMTP id w27so11283363edl.7 for ; Fri, 03 Jun 2022 11:51:09 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x+b0Zu1GpfMHDnb2ysjGbnPDUKZFXcnMEMYykhWD4rs=; b=Ei93CIWqMJLoRBjXg5cXJZTCH7jUkaOANSpvzFw/7ySPTy1vFiTApeRjfpmK8HZ3XH TVW1By4KZERnZ5G7AVCW569s+p/VSVrP435QZzMA93nijzc8jviItX4ZRdZdHDOttQzM EVbaiLiG0DNXN746UQyUXQH6SpphiHmiQ0+aPDPUTSf4Kr0T2Kja4Pop66WxiDFRxt4j 1w2OMJQMGdhaM1/ktW6FB1MBkVvFvb8cbdkNhkaD4P+Cgiv+jWRKQzDPFMRHdsog+p2B 86anmce/J4t3Yh9DtpwQ1DQN3LeeDePPaqDFL/HuIPffQmGjKiAT0A+ROpychgri8QgL 5eFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x+b0Zu1GpfMHDnb2ysjGbnPDUKZFXcnMEMYykhWD4rs=; b=3CPoBVVKo7qIzdzWn3THmFp3Q43yE1RQCMw0Ak0FINf40Gx5/qgMOs93jieX+qmq/2 qZkEQ5eBBZB2+ImJoueI3AZvND0QfUGVfNH9W7LozyHV0dGpSXj9BIrHTbzOGtTaR8pF AOdx9UgmJt+nJloJrjluL+GmLnsvrcL1BwUxoer5h7QvvTWjfvKZeCzTNtgCjeBMsnDz jwM448w74EP3ZRxI+X4Rcp/Rd142bDzv8UE4kduqMnJ8RhePW/S11rgFmW4ElS5Gmixj 3UMFWXHiDAx/DSGKF0k/LQuSkIujEsPvR2NpEC3amx3RbDaoZndWmUcuIIxprvKD84UA pQBA== X-Gm-Message-State: AOAM533aTS54lT2k+yed1c2Qry6WpuPoVbNUR3bL0nV45p1TnoRINkzo NUkOPXNoMbk799QOZhvi9URKuaCdG2FBaQ== X-Google-Smtp-Source: ABdhPJwzis9RPDPNTemaStprXTug8QsHp2LQ9HX0JH9DCbJzco7bXmkVV13BvX5os9FGDlkKLzkmgQ== X-Received: by 2002:a05:6402:254e:b0:42b:4633:e53e with SMTP id l14-20020a056402254e00b0042b4633e53emr12485663edb.314.1654282268634; Fri, 03 Jun 2022 11:51:08 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow Subject: [PATCH v4 06/11] hw/isa/piix4: QOM'ify PIIX4 PM creation Date: Fri, 3 Jun 2022 20:50:40 +0200 Message-Id: <20220603185045.143789-7-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282584316100003 Content-Type: text/plain; charset="utf-8" Just like the real hardware, create the PIIX4 ACPI controller as part of the PIIX4 southbridge. This also mirrors how the IDE and USB functions are already created. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland --- hw/isa/piix4.c | 24 +++++++++++++----------- hw/mips/malta.c | 5 ++++- include/hw/southbridge/piix.h | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 96df21a610..d97b245df3 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -49,6 +49,7 @@ struct PIIX4State { RTCState rtc; PCIIDEState ide; UHCIState uhci; + PIIX4PMState pm; /* Reset Control Register */ MemoryRegion rcr_mem; uint8_t rcr; @@ -261,6 +262,13 @@ static void piix4_realize(PCIDevice *dev, Error **errp) return; } =20 + /* ACPI controller */ + qdev_prop_set_int32(DEVICE(&s->pm), "addr", dev->devfn + 3); + if (!qdev_realize(DEVICE(&s->pm), BUS(pci_bus), errp)) { + return; + } + qdev_connect_gpio_out(DEVICE(&s->pm), 0, s->isa[9]); + pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PI= RQS); } =20 @@ -271,6 +279,10 @@ static void piix4_init(Object *obj) object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); object_initialize_child(obj, "ide", &s->ide, "piix4-ide"); object_initialize_child(obj, "uhci", &s->uhci, "piix4-usb-uhci"); + + object_initialize_child(obj, "pm", &s->pm, TYPE_PIIX4_PM); + qdev_prop_set_uint32(DEVICE(&s->pm), "smb_io_base", 0x1100); + qdev_prop_set_bit(DEVICE(&s->pm), "smm-enabled", 0); } =20 static void piix4_class_init(ObjectClass *klass, void *data) @@ -312,7 +324,7 @@ static void piix4_register_types(void) =20 type_init(piix4_register_types) =20 -DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus) +DeviceState *piix4_create(PCIBus *pci_bus) { PCIDevice *pci; DeviceState *dev; @@ -322,15 +334,5 @@ DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **sm= bus) TYPE_PIIX4_PCI_DEVICE); dev =3D DEVICE(pci); =20 - if (smbus) { - pci =3D pci_new(devfn + 3, TYPE_PIIX4_PM); - qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); - qdev_prop_set_bit(DEVICE(pci), "smm-enabled", 0); - pci_realize_and_unref(pci, pci_bus, &error_fatal); - qdev_connect_gpio_out(DEVICE(pci), 0, - qdev_get_gpio_in_named(dev, "isa", 9)); - *smbus =3D I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c")); - } - return dev; } diff --git a/hw/mips/malta.c b/hw/mips/malta.c index e446b25ad0..be9f26d841 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1238,6 +1238,7 @@ void mips_malta_init(MachineState *machine) int be; MaltaState *s; DeviceState *dev; + DeviceState *pm_dev; =20 s =3D MIPS_MALTA(qdev_new(TYPE_MIPS_MALTA)); sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); @@ -1399,8 +1400,10 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); =20 /* Southbridge */ - dev =3D piix4_create(pci_bus, &smbus); + dev =3D piix4_create(pci_bus); isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); + pm_dev =3D DEVICE(object_resolve_path_component(OBJECT(dev), "pm")); + smbus =3D I2C_BUS(qdev_get_child_bus(pm_dev, "i2c")); =20 /* Interrupt controller */ qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index dab5c9704e..2357ce0287 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -70,6 +70,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, =20 PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); =20 -DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus); +DeviceState *piix4_create(PCIBus *pci_bus); =20 #endif --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282970; cv=none; d=zohomail.com; s=zohoarc; b=U/O9//MRuF5GQzgm8hlM4uw2hSSkQfGgs8aCZ280MlRO748KWZR6kESsTA880BFFiyguUG33PMIdLMLy/6WIvk3Z+NbuDP1WkuLtl4h1PEtSYll1tfjgWER3aC2jifuDUQfwffsY95v4QDpOrb0ygi+yPvPpQVPPysxR7p9Fwus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282970; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zrOO35qYt2V3te37RfBRgK7i5bd7cvuNNbZAPeTba8M=; b=Vx3HUJMMeZJn/c87nn4zzZxSXs8pmfzp3MRwN+n33VYplcp0A74atKi1b7pecADbuAIIVBZ/hH3tfWDK/dzmhOXTplBP/aXUtEdTix9fEdSo8nyqY9mMFB3NUyE1Heboz5S1D7mAtX6mzaelpabo7yfqoBrxbnKWIXtzc2SbvE0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282969945132.9932565892907; Fri, 3 Jun 2022 12:02:49 -0700 (PDT) Received: from localhost ([::1]:40794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCZM-0006XR-9F for importer@patchew.org; Fri, 03 Jun 2022 15:02:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCOA-0007Cz-Ug for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:15 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:40794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO8-0004AZ-AE for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:13 -0400 Received: by mail-ed1-x52e.google.com with SMTP id w27so11283474edl.7 for ; Fri, 03 Jun 2022 11:51:11 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zrOO35qYt2V3te37RfBRgK7i5bd7cvuNNbZAPeTba8M=; b=KfwlXeRL9BT7wL0pQQZdEg/bEwgMJtTKlmfsJrCFRRJCh+UC+ZYSvYEMqFfYoECV79 2+5UrjtqfLNUyr5MUWD+tUphg4/UHjI5Y8CNAyO4ji5xEnooJoQIzdxtQGxCpudGjep+ wLFXQ3lQzgIgiIFA6yqaj6yrp2GUoF9/PohRjfR22tQ1jyAm+wvUkNZBbFJNYtsCBFsa a2Xsyf1y0G33PjXU8JvMGqECZiNoVliGeqJeUSQSLtLMiYRzuH9fJ8qohfRUm7niQpio 0C+7P97+NktqkXT9LktPpLt99/jZZZA+HDJ0xdSEICccMcYsYybmsSDvG1e7E2IpDGmS jdjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zrOO35qYt2V3te37RfBRgK7i5bd7cvuNNbZAPeTba8M=; b=k0/erGvKpA9dsWHN6PUBYQY/sN94A6w2LeJHBcImN+BLdi91/uFfT/jTYeHNAQ6uLW xCi5/d1NYu2ZpX6s1wyjGTLGCHKKlttR7HsCYKc3UJo+w8XzwkZf0ClV+KvIskampRZb Q69NRrWF2LkQa60/wPCTDTG8v59+zjbq6vdlv//8SDu35thZhhwbxKElldn9SHBeYXyV bqtDlvRSUqyRBd79evyXodjCKl7y7egl3eX74PGhm7XhAgL8ehl4eQ49EdNhOn7KkyCs HktBBzMTNd9ZLH6A4Gfx9C/do8ectjH+cHxskaiU5mKftzQ7zkBtWaWVgKyADBqLfg5n cC5Q== X-Gm-Message-State: AOAM532yyeAg+Ky4Myo8lONHQAxjuRCAv40LGbI4WYfQ5d/u3CQM2004 imQPkybKVhxmrSIkbQybZydFLFt0DNBT7A== X-Google-Smtp-Source: ABdhPJzHcpwiExyprP2Ts2kcgGQkpbWERlG3k68jzUIq3Qbw4/RI1KrNNEZITVwQaD1zqiIOUbnXfg== X-Received: by 2002:a05:6402:11ca:b0:42b:d282:4932 with SMTP id j10-20020a05640211ca00b0042bd2824932mr12449383edw.421.1654282270527; Fri, 03 Jun 2022 11:51:10 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow Subject: [PATCH v4 07/11] hw/isa/piix4: Inline and remove piix4_create() Date: Fri, 3 Jun 2022 20:50:41 +0200 Message-Id: <20220603185045.143789-8-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=shentey@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282970989100001 During the previous changesets piix4_create() became a trivial wrapper around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland --- hw/isa/piix4.c | 13 ------------- hw/mips/malta.c | 5 ++++- include/hw/southbridge/piix.h | 2 -- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index d97b245df3..15f344dbb7 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -323,16 +323,3 @@ static void piix4_register_types(void) } =20 type_init(piix4_register_types) - -DeviceState *piix4_create(PCIBus *pci_bus) -{ - PCIDevice *pci; - DeviceState *dev; - int devfn =3D PCI_DEVFN(10, 0); - - pci =3D pci_create_simple_multifunction(pci_bus, devfn, true, - TYPE_PIIX4_PCI_DEVICE); - dev =3D DEVICE(pci); - - return dev; -} diff --git a/hw/mips/malta.c b/hw/mips/malta.c index be9f26d841..7a0ec513b0 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1237,6 +1237,7 @@ void mips_malta_init(MachineState *machine) int fl_idx =3D 0; int be; MaltaState *s; + PCIDevice *piix4; DeviceState *dev; DeviceState *pm_dev; =20 @@ -1400,7 +1401,9 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); =20 /* Southbridge */ - dev =3D piix4_create(pci_bus); + piix4 =3D pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), t= rue, + TYPE_PIIX4_PCI_DEVICE); + dev =3D DEVICE(piix4); isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); pm_dev =3D DEVICE(object_resolve_path_component(OBJECT(dev), "pm")); smbus =3D I2C_BUS(qdev_get_child_bus(pm_dev, "i2c")); diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 2357ce0287..9a2dd93c2d 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -70,6 +70,4 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, =20 PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); =20 -DeviceState *piix4_create(PCIBus *pci_bus); - #endif --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282582; cv=none; d=zohomail.com; s=zohoarc; b=SKx5YPHZtD60Dx7W0XEqbpCbp944UYsyMP2k+rPWPbG0gzyaqDgxw/OQPKduzGV2XAl5TSWHTkKPnCQc4hGR6asueB7SZ2/a5GeTDfLs9nYYLds2GBAtB6qzkXbrf74jPen7hQoGLKbHOXtu8fjnPrEIZ/M7pjqiWhTJlCPw8dw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282582; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z2E0qTaPT0rwn/y0lNnZ/aNt1ZAGrawia4pom9sqpdw=; b=UhFfTrlJ7qs/9wMvJT1jW5d4tZrOoaJv4yu//PlV11yOYJOkyxQW5HcoUhL7Xaon90Om7aDScsr93YyLoDYEgvDIbbD4KRHw55d7I8vUYDkyCQy2WL/tdePp1nla/2fG1kQJba1h5+tGOzm9kF1c4sh2lgN+lbJsnaton1H0zxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282582965881.9116506157475; Fri, 3 Jun 2022 11:56:22 -0700 (PDT) Received: from localhost ([::1]:57814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCT7-0007DH-UH for importer@patchew.org; Fri, 03 Jun 2022 14:56:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCOB-0007DF-0W for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:16 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:37773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCO9-0004BC-Dj for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:14 -0400 Received: by mail-ej1-x62f.google.com with SMTP id gl15so3736507ejb.4 for ; Fri, 03 Jun 2022 11:51:12 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z2E0qTaPT0rwn/y0lNnZ/aNt1ZAGrawia4pom9sqpdw=; b=WNAaVTapejdu7NDn2BAGoV9512worsjW+Oa5ASgUHmOEh2IGXHvnQWkSSJ/Zu+PMt8 TuwVIHOvSkXYCU/nXjXFqzW8SGPcHPnFuOnQbbNQkkxrtOsJeXdLZsqIrSKNNNIlnUmc MVkwkBIFoXy5B6AMsxSy0pLd9ZmxFYcGqSGMq7CTUm9fCJ5r2qxOjHEHLrW6+etTPsSL NCzJ/5gYMWwmcZvE3Fc7uxJ5lDPN56QugGb/aJCuIcUE9ZFKkFJNf1JlA2AwzqzVmTL3 q0sOEsBWgZkqkLkSgrqsbrbp0eKs6v4+xWCPozkFrbB5yzlh8Ox1WqK6SxfwkVAc1nPM U27w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z2E0qTaPT0rwn/y0lNnZ/aNt1ZAGrawia4pom9sqpdw=; b=sX9SicD88KuDGYnXffgfIF+HpEAYdZxt3oIwEcI22ch/jXH1nYKzcsennRFxLOJ5U/ lKic6fW641JoOZQNsOWfSfwXj3vo9Km+BjfwSL2Kh6VY3qZqfosKZBW8Zj3vDHbTRZJJ /HdAoz8FQmkGMZ8gfUG3qZraH2hjMRnWshfJ6hmXQPPEDDhypRdCQncbYvZgU2lnnlJ0 ZHRgFaVQmz0R25AlCQ5d5adU6dGPs2kIkFP9ausSCgKn+MgaSUMGTfWnqiAXmmQz5Bwe scAvYao9ds3T6VVvDxIWIRhHSDWij/mhMxrhTI/HFoI/Yv/RsQe195Y80eTX51q+Tepv Cdyw== X-Gm-Message-State: AOAM533JAtpCgB+qgxJkOyst+sdqiunIEb3P3A1OBYtvzqKIyMHiANZD URt1yUDAyY+tfBbmBWr0QcvTFST4RyXDBg== X-Google-Smtp-Source: ABdhPJyri6RdwNn92N0sCtiTa1ATygvi+4UANLSAGGzVRQIDocxQEe8dfBYpxHXRe9V46gqWDx+LOg== X-Received: by 2002:a17:907:7642:b0:706:fd3a:61f0 with SMTP id kj2-20020a170907764200b00706fd3a61f0mr9785725ejc.503.1654282271729; Fri, 03 Jun 2022 11:51:11 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Mark Cave-Ayland Subject: [PATCH v4 08/11] hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fn Date: Fri, 3 Jun 2022 20:50:42 +0200 Message-Id: <20220603185045.143789-9-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282584315100002 The pci_map_irq_fn was implemented below type_init() which made it inaccessible to QOM functions. So move it up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix3.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index d96ce2b788..c7a9014c3f 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -78,6 +78,17 @@ static void piix3_set_irq(void *opaque, int pirq, int le= vel) piix3_set_irq_level(piix3, pirq, level); } =20 +/* + * Return the global irq number corresponding to a given device irq + * pin. We could also use the bus number to have a more precise mapping. + */ +static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx) +{ + int slot_addend; + slot_addend =3D PCI_SLOT(pci_dev->devfn) - 1; + return (pci_intx + slot_addend) & 3; +} + static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pin) { PIIX3State *piix3 =3D opaque; @@ -350,17 +361,6 @@ static void piix3_register_types(void) =20 type_init(piix3_register_types) =20 -/* - * Return the global irq number corresponding to a given device irq - * pin. We could also use the bus number to have a more precise mapping. - */ -static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx) -{ - int slot_addend; - slot_addend =3D PCI_SLOT(pci_dev->devfn) - 1; - return (pci_intx + slot_addend) & 3; -} - PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus) { PIIX3State *piix3; --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282765; cv=none; d=zohomail.com; s=zohoarc; b=k4SnmthrEA/VgrmZzOtea7UUgCJAB9ACYbuo9EjTnq4EJ9+K8XYqG9DjeC7rMIN/Y9fgzPhbumcUIAm4HpSK5fXkY9NjS02WOWL/u9mE/P+IKgd+kdjQsI4bbYjWTJM1PKazp6/GNYqXGbmCP/eSjPrcfdi9w3XY1ch+9sRR9Co= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282765; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IxlhUXhWWLGkh4tQNKHeVva8WuCFxq7n16eNJytTjtI=; b=atHSZuCkQxdjCi4c+vc1Squ6RUddYHKDhom88QRlXgWws1FeWtysUldXHPkZdvBIBqONWJkCF7ZfXYCrIb+m9wwbIRkJjaXf9ILu/7XPWe6lQE82QoXZjJ48gRTnymQiQeouW7MHdV+zzEN2SXcWiQja7umR2tAkgWlA6ldLiqY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282765143364.82476244801205; Fri, 3 Jun 2022 11:59:25 -0700 (PDT) Received: from localhost ([::1]:36330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCW3-0003Q1-Iy for importer@patchew.org; Fri, 03 Jun 2022 14:59:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCOC-0007Dx-9I for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:16 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:37776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCOA-0004Bu-Ml for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:16 -0400 Received: by mail-ej1-x632.google.com with SMTP id gl15so3736608ejb.4 for ; Fri, 03 Jun 2022 11:51:14 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IxlhUXhWWLGkh4tQNKHeVva8WuCFxq7n16eNJytTjtI=; b=AAegG21Trd/rndetxiIlYtW7EGuzL2OUeiwu5ArvPmOKDsEscLwX4Gcj0bOuOqWHMS 8TJfKNl2NP8um+zkirmR09qLkdaaTxVKwqFJwnmEwM6uaRiCRy3vEsqXpgaDZ7CDfp9l Hl1BwgqrOoLCrqzkYKq806qIfhRjLoUJdjnPJ2k+l50HVi+W17Fl6Y5wJTOrTbRj84Zi lG8odoDAeBQvPcPuh0DOd5UDt3sPbNk2aHWj5g8rjFjUfqJsKs1tyCRIbPxkm+zlFNkp Mdoe9tgqPIxP5SZ85PhpkeczMbLIcSO4MClvo/Ic9usu71akkBiCRLhmY8bbTLVHod4W SHCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IxlhUXhWWLGkh4tQNKHeVva8WuCFxq7n16eNJytTjtI=; b=bjlRXKbew/LZJvg3bXzyQJiRJLo3FxZdqaWVar7KcLTKBAu+NZioCgHPhR7DTvDOKR 5ieAKlTusJqCG5y+EmHgBCq7hW4xfx3ZbvfaIu6/UWEhvslZgcdAkzmFEjRgk5NSznX7 kJtW5e5MrjabQxDd14bxvwL5ulyyiX2gm0EiC/iFRGt5FO9K1mlCy9B+G4oeASwe20Lc uLtFn7MymqGanCJgkSrE4scZ74QuaWfDGy6k8aUpF+0EZLwqPFbgZJ/yYHq54lEKwHY1 VupcvYbIIzfnAM10A+baG/p/pT1CcS2C/QGCA58hRekT25+btZDj/stNEDF/IuSK3IbI E3fg== X-Gm-Message-State: AOAM532oU7L32tzgaeVVkDJpXYtYUmNcO/vU4HEjtx8833y4Jdvmbxcq hPTIj2YkXCfui7W6BgaYQjJSmfxqLqnveg== X-Google-Smtp-Source: ABdhPJyOkrRwp8QCGD3s8IF4O3QQRHmgQ0EFLmAPWXf8Gk0WlFOHnqT8AQMDpzSR8LMbppV8gDMFRw== X-Received: by 2002:a17:906:c155:b0:708:21b1:dcf6 with SMTP id dp21-20020a170906c15500b0070821b1dcf6mr10003170ejc.661.1654282273135; Fri, 03 Jun 2022 11:51:13 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow Subject: [PATCH v4 09/11] hw/isa/piix3: QOM'ify PCI device creation and wiring Date: Fri, 3 Jun 2022 20:50:43 +0200 Message-Id: <20220603185045.143789-10-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282765823100002 Content-Type: text/plain; charset="utf-8" PCI interrupt wiring was performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. In order to avoid duplicate checking for xen_enabled() the realize methods are now split. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland --- hw/isa/piix3.c | 67 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index c7a9014c3f..de532cc692 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/range.h" +#include "qapi/error.h" #include "hw/southbridge/piix.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -277,7 +278,7 @@ static const MemoryRegionOps rcr_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN }; =20 -static void piix3_realize(PCIDevice *dev, Error **errp) +static void pci_piix3_realize(PCIDevice *dev, Error **errp) { PIIX3State *d =3D PIIX3_PCI_DEVICE(dev); =20 @@ -302,7 +303,6 @@ static void pci_piix3_class_init(ObjectClass *klass, vo= id *data) dc->desc =3D "ISA bridge"; dc->vmsd =3D &vmstate_piix3; dc->hotpluggable =3D false; - k->realize =3D piix3_realize; k->vendor_id =3D PCI_VENDOR_ID_INTEL; /* 82371SB PIIX3 PCI-to-ISA bridge (Step A1) */ k->device_id =3D PCI_DEVICE_ID_INTEL_82371SB_0; @@ -326,11 +326,28 @@ static const TypeInfo piix3_pci_type_info =3D { }, }; =20 +static void piix3_realize(PCIDevice *dev, Error **errp) +{ + ERRP_GUARD(); + PIIX3State *piix3 =3D PIIX3_PCI_DEVICE(dev); + PCIBus *pci_bus =3D pci_get_bus(dev); + + pci_piix3_realize(dev, errp); + if (*errp) { + return; + } + + pci_bus_irqs(pci_bus, piix3_set_irq, pci_slot_get_pirq, + piix3, PIIX_NUM_PIRQS); + pci_bus_set_route_irq_fn(pci_bus, piix3_route_intx_pin_to_irq); +}; + static void piix3_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 k->config_write =3D piix3_write_config; + k->realize =3D piix3_realize; } =20 static const TypeInfo piix3_info =3D { @@ -339,11 +356,33 @@ static const TypeInfo piix3_info =3D { .class_init =3D piix3_class_init, }; =20 +static void piix3_xen_realize(PCIDevice *dev, Error **errp) +{ + ERRP_GUARD(); + PIIX3State *piix3 =3D PIIX3_PCI_DEVICE(dev); + PCIBus *pci_bus =3D pci_get_bus(dev); + + pci_piix3_realize(dev, errp); + if (*errp) { + return; + } + + /* + * Xen supports additional interrupt routes from the PCI devices to + * the IOAPIC: the four pins of each PCI device on the bus are also + * connected to the IOAPIC directly. + * These additional routes can be discovered through ACPI. + */ + pci_bus_irqs(pci_bus, xen_piix3_set_irq, xen_pci_slot_get_pirq, + piix3, XEN_PIIX_NUM_PIRQS); +}; + static void piix3_xen_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 k->config_write =3D piix3_write_config_xen; + k->realize =3D piix3_xen_realize; }; =20 static const TypeInfo piix3_xen_info =3D { @@ -365,27 +404,11 @@ PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **is= a_bus) { PIIX3State *piix3; PCIDevice *pci_dev; + const char *type =3D xen_enabled() ? TYPE_PIIX3_XEN_DEVICE + : TYPE_PIIX3_DEVICE; =20 - /* - * Xen supports additional interrupt routes from the PCI devices to - * the IOAPIC: the four pins of each PCI device on the bus are also - * connected to the IOAPIC directly. - * These additional routes can be discovered through ACPI. - */ - if (xen_enabled()) { - pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, - TYPE_PIIX3_XEN_DEVICE); - piix3 =3D PIIX3_PCI_DEVICE(pci_dev); - pci_bus_irqs(pci_bus, xen_piix3_set_irq, xen_pci_slot_get_pirq, - piix3, XEN_PIIX_NUM_PIRQS); - } else { - pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, - TYPE_PIIX3_DEVICE); - piix3 =3D PIIX3_PCI_DEVICE(pci_dev); - pci_bus_irqs(pci_bus, piix3_set_irq, pci_slot_get_pirq, - piix3, PIIX_NUM_PIRQS); - pci_bus_set_route_irq_fn(pci_bus, piix3_route_intx_pin_to_irq); - } + pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, type); + piix3 =3D PIIX3_PCI_DEVICE(pci_dev); *isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); =20 return piix3; --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282579; cv=none; d=zohomail.com; s=zohoarc; b=QZr5nd5cAqqorR7SzuARRwye8lp+wJt1LdRw/9plYIEe1b6z8JzCsqC/nV2Iu1tZR09SrsICsjP6GUmA/3tjhcr8rgC34DU/lnH3BjU+gnR/aZSde8o0ocm2pVbHkjiVU1gEgM8NhVugaF6NkGxiTIjRwLVWMmdBESeJBM22hYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282579; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QHXHopLynfUeqrSBaWrq8DdgLg5VwHyVMXO3auGVcqg=; b=cYPeiJXlNRqxP8tR4s3z089pnFtd44eB//bN/CfjjkoOHJlZ8cMFwdWuphgFIe6mZg78FqRyoNO4SjVwta2DCR6FDtyQY3bV8YfCz4Va8/Q+Gp5XtjUnugD1g/MKowYiPMdHsn32aYivfiHZoR81YmFaJXj+mDmmy3w1zI5yZ4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165428257988644.87043070104528; Fri, 3 Jun 2022 11:56:19 -0700 (PDT) Received: from localhost ([::1]:57490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCT4-000703-GL for importer@patchew.org; Fri, 03 Jun 2022 14:56:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCOE-0007Hp-Ge for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:18 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:41783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCOC-0004CH-Ld for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:17 -0400 Received: by mail-ej1-x62c.google.com with SMTP id u12so17610052eja.8 for ; Fri, 03 Jun 2022 11:51:16 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QHXHopLynfUeqrSBaWrq8DdgLg5VwHyVMXO3auGVcqg=; b=H3xiMqPyhHZZi5zDwocEyX7Z8lV8FMMfO4LvC5nWz7njnG1UY+8iY6soXiAdxqUZcj ib7HgYRXPb/f6Wak4bXTMbJF4rKUMuB06s2Xj4rUXNbHOuENYvU/K6i7Ao4tj2vHe9rH iK+bznS7WBdH9+46qAL+CQUpcCWpYiSwEtXLWO3pixlYViVYGeMKNcK8b8IdkafvKcx+ 65fircniyo9XLCI3PkSSkff8ecLmF9dk6iJCHUFrb3RsLTsvoC5x7wzLuZaJMp1gTTed fXaMvGv9mWiQDzH8/YdFXgcQ1kDYUW23faEMmXgUQ1YQ6KBqvA+BmmIOMbiwJK+CqJmG h9/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QHXHopLynfUeqrSBaWrq8DdgLg5VwHyVMXO3auGVcqg=; b=BI+05G6cWmOTwGz8LM5pQDmvEhLtqOpnU4kQVQnj85AAW0/oZ4DaDsT7v71zkJ/C+i ZH9PddwDPsML1W49mvB6HaEMuqYHbxx6KRlfnjhq9rPsBTQzilUHJ1QRePHB/MpKrkns PXsZTqPRp6uQtyuceoC28Dy1aCBVcV15itChsb/vDTuRC26NA1ygz5Cy0uZaBjwIUe1r WxsKb2Ra7GZ2fCPbppos/YkLX+hpBqXUQF/3LoNo3G1SFvtcWqiCrprFEfkEET45fndS 4uGy/LJXFfmNb7pTJnOJ9PfzPSTxLOBaBPuN4QYKSSluWqfxPvKs9omxL4xgt9A68MdF p1GQ== X-Gm-Message-State: AOAM532Uq7t+2+hdHxHVqDAfdZ1hXQWKg65wKmEZIwG7mYdDtA3tuiRd 5KYjR7sISZo2pwVM1dSpJoXpV9mwWooUog== X-Google-Smtp-Source: ABdhPJzw/AXHHEuT4JykRq0JuJnLe5uBPc9/3jO9Dz8K0u2fj3tq8mNhvlQmx9/Dja3n8QvV2j5y+A== X-Received: by 2002:a17:907:7f06:b0:6fe:b81f:f885 with SMTP id qf6-20020a1709077f0600b006feb81ff885mr9999583ejc.621.1654282275117; Fri, 03 Jun 2022 11:51:15 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Mark Cave-Ayland Subject: [PATCH v4 10/11] hw/isa/piix3: Factor out ISABus retrieval from piix3_create() Date: Fri, 3 Jun 2022 20:50:44 +0200 Message-Id: <20220603185045.143789-11-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282580389100001 Content-Type: text/plain; charset="utf-8" Modernizes the code. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland --- hw/i386/pc_piix.c | 3 ++- hw/isa/piix3.c | 3 +-- include/hw/southbridge/piix.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index d6668b7c06..c884d1a489 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -207,9 +207,10 @@ static void pc_init1(MachineState *machine, pci_memory, ram_memory); pcms->bus =3D pci_bus; =20 - piix3 =3D piix3_create(pci_bus, &isa_bus); + piix3 =3D piix3_create(pci_bus); piix3->pic =3D x86ms->gsi; piix3_devfn =3D piix3->dev.devfn; + isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); } else { pci_bus =3D NULL; i440fx_state =3D NULL; diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index de532cc692..c6ff7795f4 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -400,7 +400,7 @@ static void piix3_register_types(void) =20 type_init(piix3_register_types) =20 -PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus) +PIIX3State *piix3_create(PCIBus *pci_bus) { PIIX3State *piix3; PCIDevice *pci_dev; @@ -409,7 +409,6 @@ PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_= bus) =20 pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, type); piix3 =3D PIIX3_PCI_DEVICE(pci_dev); - *isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); =20 return piix3; } diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 9a2dd93c2d..f805fb8683 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -68,6 +68,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, #define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" #define TYPE_PIIX4_PCI_DEVICE "piix4-isa" =20 -PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus); +PIIX3State *piix3_create(PCIBus *pci_bus); =20 #endif --=20 2.36.1 From nobody Wed May 8 21:11:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1654282971; cv=none; d=zohomail.com; s=zohoarc; b=YUdpH6Yeri+/o0OB90ksRcdPjXdqh53/2iUIMZU2Cn1ezlj24rrhc7/w4lR4TIyjA778VbuofMTnvWNdF65QfAhiyPFvAJeCXpS3Sg+IBi6qEmvpI5pf3aqdRXpRUlo5gSCaZXOF+oKo7I0atWAjAew9pDkgpaX3zLVUtKJsI1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654282971; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Jc4MKfgMJx8u8UCAhQmdavk8QSdZLeuW9RwLxX0XHzY=; b=mXfIcmvQ63g0ccJjnBeN4tvrEBvmGxRf2mvKUDbfCOvYQhQekX7D01WXrc2qvCm9QmP8+zu3gEMJvc9zBgLk47Lz451wjNyRTCde6Uiv4aQ8TcS+VcVT51cnRaecrNeRdQe9aa3JOyr+2HjFcwo5eA0TyY44ScUJGE52AX2B7Zg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654282971087484.66643520930313; Fri, 3 Jun 2022 12:02:51 -0700 (PDT) Received: from localhost ([::1]:40842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxCZN-0006ZJ-VU for importer@patchew.org; Fri, 03 Jun 2022 15:02:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxCOF-0007Jk-Mu for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:19 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:36607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxCOE-0004CR-8l for qemu-devel@nongnu.org; Fri, 03 Jun 2022 14:51:19 -0400 Received: by mail-ed1-x52b.google.com with SMTP id fd25so11315430edb.3 for ; Fri, 03 Jun 2022 11:51:17 -0700 (PDT) Received: from osoxes.fritz.box (pd9ed79c4.dip0.t-ipconnect.de. [217.237.121.196]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b006fe8c831632sm3066160ejc.73.2022.06.03.11.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 11:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jc4MKfgMJx8u8UCAhQmdavk8QSdZLeuW9RwLxX0XHzY=; b=dSrA32Bq09z+93G3SA44grIgVCtQ8Vzgf0Upp/Dk+ileI8/Tsu1lXNogB5QR+nEu4r PC+Cgi+ZmG40SH42np8w4+VaB7WJmFI5zgLyfqWdXCYyw5EbTPvGJwiZfZkBpl/rtypy pspfCXKIUU+NnEiGriiTbEevGJGKc5Gj6ZoQDkCLugInvRPMWZl3QK9b3elFDOk/6S3E 1KPxneN5KeqLGqofbdBA94Eqxn3kRljuhkIG7vOCbB8ktzBa2C9xjxuTFreiKWdYgWoH CO8kTsjymCyyq0gDRdwLs/1SPgVJMJBz8qOOl/GHBCVIIqL+oANLlaGZQvET2xVr3jT1 xPNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jc4MKfgMJx8u8UCAhQmdavk8QSdZLeuW9RwLxX0XHzY=; b=oeyhjk8bVRTCq1CrKqNwQyG8E2NQON9nhC1NnRLcuPNqoalOsn9ToZ2fpX6pxAELjP EiwVO6+9BMUDS7SYpd8wwABNyJwIvEHpra/wb9x06hWTCXe2AtfdbbNGcmGaP9J1ury/ u1Abk/Hz4Ay9BFWcEng0p07+azVappNzdWDkk0SkZFDN5FPVdQnB+Kgto1OsjAtSjFfY o0+Ijp/qBEtAwGUfOP2IyjGj6i22pKN6/kOwBi/KGpo6/8zEooSSvL89HbOCvkCn7I52 LS6Nu5feA4prLpC4CjUiXyOaoc8yywhL/ZLWwh/fjThoGdD67/q5MktklL9+OALsbixf bGvg== X-Gm-Message-State: AOAM530JYX97vQglwON5tmKP9FQCmm7yKfpzW65uY2hB+/eCyw/a/5Zt EUU4//5nYnSoztKCJVIMJoW4wi2FYsCvYA== X-Google-Smtp-Source: ABdhPJzbQTZ0RbuNdOajp3U7Ts2M/O0282vsaiE37xNi/hpOeJHdz8AIWiYLFnNX/ITIiD9qji0uhw== X-Received: by 2002:aa7:c55a:0:b0:42a:adfa:9150 with SMTP id s26-20020aa7c55a000000b0042aadfa9150mr12325038edr.57.1654282275973; Fri, 03 Jun 2022 11:51:15 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow Subject: [PATCH v4 11/11] hw/isa/piix3: Inline and remove piix3_create() Date: Fri, 3 Jun 2022 20:50:45 +0200 Message-Id: <20220603185045.143789-12-shentey@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603185045.143789-1-shentey@gmail.com> References: <20220603185045.143789-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=shentey@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1654282972731100003 During the previous changesets piix3_create() became a trivial wrapper around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland --- hw/i386/pc_piix.c | 6 +++++- hw/isa/piix3.c | 13 ------------- include/hw/southbridge/piix.h | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index c884d1a489..b58fbd4815 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -197,6 +197,9 @@ static void pc_init1(MachineState *machine, =20 if (pcmc->pci_enabled) { PIIX3State *piix3; + PCIDevice *pci_dev; + const char *type =3D xen_enabled() ? TYPE_PIIX3_XEN_DEVICE + : TYPE_PIIX3_DEVICE; =20 pci_bus =3D i440fx_init(host_type, pci_type, @@ -207,7 +210,8 @@ static void pc_init1(MachineState *machine, pci_memory, ram_memory); pcms->bus =3D pci_bus; =20 - piix3 =3D piix3_create(pci_bus); + pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, typ= e); + piix3 =3D PIIX3_PCI_DEVICE(pci_dev); piix3->pic =3D x86ms->gsi; piix3_devfn =3D piix3->dev.devfn; isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index c6ff7795f4..01c376b39a 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -399,16 +399,3 @@ static void piix3_register_types(void) } =20 type_init(piix3_register_types) - -PIIX3State *piix3_create(PCIBus *pci_bus) -{ - PIIX3State *piix3; - PCIDevice *pci_dev; - const char *type =3D xen_enabled() ? TYPE_PIIX3_XEN_DEVICE - : TYPE_PIIX3_DEVICE; - - pci_dev =3D pci_create_simple_multifunction(pci_bus, -1, true, type); - piix3 =3D PIIX3_PCI_DEVICE(pci_dev); - - return piix3; -} diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index f805fb8683..2693778b23 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -68,6 +68,4 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE, #define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen" #define TYPE_PIIX4_PCI_DEVICE "piix4-isa" =20 -PIIX3State *piix3_create(PCIBus *pci_bus); - #endif --=20 2.36.1