From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023596; cv=none; d=zohomail.com; s=zohoarc; b=IL0qrAvhZFQ6Ocd9SZJY9waWy6ugEobBw1SBc+3Pf4+xDXH5CoyQ56DAoWO1HG1vhmTdS+pCzZo0DVAb3tUln3C/796LEb9wWwy+SD9r8q61Ts25MWw3chGlXvpca0lmR3dNUpmJF/CTtRbCeNr0urJjawldtYOAuFqnIYUTOFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023596; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=F4m0v/in85DGPLUDveir9W6g6TNXCVbXdqiQPBjdgEs=; b=OxsupXH3dlHdSIJNM6c0Ql4mLgBXrZK5n/WsCfFPaz1vbrbLQDNzOlPTsu59J892N/6OCy5v2C9li1heB1Tci9u23bK54cvKSfd8KTftxXp8De9YZ4We5YYE2q+JTtrIjUBCI000TntvG9xuITfK8WZxJ8EPSccGmwiy2YoIf58= 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 1709023596493429.89712708569925; Tue, 27 Feb 2024 00:46:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0N-0005rR-FY; Tue, 27 Feb 2024 03:40: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 1ret0M-0005qU-Dw for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:02 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret0K-0007MY-Kn for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:02 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-412a14299a4so19365665e9.1 for ; Tue, 27 Feb 2024 00:39:58 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id m22-20020a056000175600b0033d1b653e4csm10609691wrf.54.2024.02.27.00.39.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023197; x=1709627997; 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=F4m0v/in85DGPLUDveir9W6g6TNXCVbXdqiQPBjdgEs=; b=DBJSLat2yaKXo9mPcMH5NLel2QodCcVSKNyi4J950M+fe3Da8JWf2nWEwo1DbFse20 QVV+WLHyGGI7Ip2LL3W4YgWZEx2UbjSIyLwYq66Zm7YJ5atWmebVZpDrh7hbSpdPVeyB UsuWAdn4U7vsB4m0ELV/IhlJoUG0eUeA3Tdm183sl7NgdRsdx87CXAJWw/ntzC2udYm5 879UEOQUltR6j6pwKKgChN2XMKlgcsUbrB8N+xFewmPm9jLn6iTGMBs+qxQmaGonFWHh fT/iBV7S7tRqXACMUg4cGobRYpcLktKWerTTQ5wYvhNFOrvyf+GOn6FgPVi2feA+oedG co5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023197; x=1709627997; 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=F4m0v/in85DGPLUDveir9W6g6TNXCVbXdqiQPBjdgEs=; b=gSRFPlvLQWIVD+F2V4E42hWV+C3kudy8Nfk/Og/Qj85N/NLhdPr3kRP8IB3ywnGRBh Uj1ge9+qC9V/d8GYFTZYPynSq/61Y8WKpECQ1DDGXYcxbkJvvtqRTpbZJmgi3qXr/aZp wrJIDFW8zyqsObeWRcNQdxcOduSKVOx6lpnRi8hsXAG5IZKBOl7hfkLOXAcHuqwBRJLi zX1AtFvY6IwngcBIYvoc8E32w+vlqC55E4j/C4cSnetX7D+IK3PbHjkArG8u76J7YVGJ XkZgagCnkKDX7UqtA4iuj7dYDo11OK2KGK4g/j6mhshg0yGKeUxZwkh0CPyF/LwlF51e zIBQ== X-Gm-Message-State: AOJu0YwiuuCkGnIwRp5KtQOYdbl0WWpCvAxuPLIqxFylwYzD25eE4JAO OkIaeMAyS2Zeu0sqPyuPZKORSCgiAX1Jpe/z7IBeJaeK5GsQf0T/pkLV+FpOrzR4E629pKszPVS L X-Google-Smtp-Source: AGHT+IEEnJlLvJWBb1m5MP2/aP43IqfvjxmdwHQUEHjmUidYllIDHumkJYi0anWv+qlbvnykKw5irg== X-Received: by 2002:a05:6000:71b:b0:33d:c652:7c41 with SMTP id bs27-20020a056000071b00b0033dc6527c41mr6627002wrb.71.1709023196656; Tue, 27 Feb 2024 00:39:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 01/30] hw/arm: Inline sysbus_create_simple(PL110 / PL111) Date: Tue, 27 Feb 2024 09:39:17 +0100 Message-ID: <20240227083948.5427-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023597883100017 We want to set another qdev property (a link) for the pl110 and pl111 devices, we can not use sysbus_create_simple() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240226173805.289-2-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/arm/integratorcp.c | 5 ++++- hw/arm/realview.c | 5 ++++- hw/arm/versatilepb.c | 6 +++++- hw/arm/vexpress.c | 10 ++++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index f016d20485..5b002da350 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -670,7 +670,10 @@ static void integratorcp_init(MachineState *machine) smc91c111_init(0xc8000000, pic[27]); } =20 - sysbus_create_simple("pl110", 0xc0000000, pic[22]); + dev =3D qdev_new("pl110"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0xc0000000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[22]); =20 integrator_binfo.ram_size =3D ram_size; arm_load_kernel(cpu, machine, &integrator_binfo); diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 9058f5b414..77300e92e5 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -238,7 +238,10 @@ static void realview_init(MachineState *machine, sysbus_create_simple("pl061", 0x10014000, pic[7]); gpio2 =3D sysbus_create_simple("pl061", 0x10015000, pic[8]); =20 - sysbus_create_simple("pl111", 0x10020000, pic[23]); + dev =3D qdev_new("pl111"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[23]); =20 dev =3D sysbus_create_varargs("pl181", 0x10005000, pic[17], pic[18], N= ULL); /* Wire up MMC card detect and read-only signals. These have diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index d10b75dfdb..7e04b23af8 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -299,7 +299,11 @@ static void versatile_init(MachineState *machine, int = board_id) =20 /* The versatile/PB actually has a modified Color LCD controller that includes hardware cursor support from the PL111. */ - dev =3D sysbus_create_simple("pl110_versatile", 0x10120000, pic[16]); + dev =3D qdev_new("pl110_versatile"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10120000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[16]); + /* Wire up the mux control signals from the SYS_CLCD register */ qdev_connect_gpio_out(sysctl, 0, qdev_get_gpio_in(dev, 0)); =20 diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index aa5f3ca0d4..671986c21e 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -276,6 +276,7 @@ static void a9_daughterboard_init(VexpressMachineState = *vms, { MachineState *machine =3D MACHINE(vms); MemoryRegion *sysmem =3D get_system_memory(); + DeviceState *dev; =20 if (ram_size > 0x40000000) { /* 1GB is the maximum the address space permits */ @@ -297,7 +298,9 @@ static void a9_daughterboard_init(VexpressMachineState = *vms, /* Daughterboard peripherals : 0x10020000 .. 0x20000000 */ =20 /* 0x10020000 PL111 CLCD (daughterboard) */ - sysbus_create_simple("pl111", 0x10020000, pic[44]); + dev =3D qdev_new("pl111"); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[44]); =20 /* 0x10060000 AXI RAM */ /* 0x100e0000 PL341 Dynamic Memory Controller */ @@ -650,7 +653,10 @@ static void vexpress_common_init(MachineState *machine) =20 /* VE_COMPACTFLASH: not modelled */ =20 - sysbus_create_simple("pl111", map[VE_CLCD], pic[14]); + dev =3D qdev_new("pl111"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, map[VE_CLCD]); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[14]); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); pflash0 =3D ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flas= h0", --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023239; cv=none; d=zohomail.com; s=zohoarc; b=Gf8mHBajXtTNtrIRCkBVi7kiaLvsKmcilqnlVciv7KZxQ96DZV3+jR/to5gN5qf1jAEV6LW6aveb/vkaqeGybqj/lWKlBJnNajOHyawAgdS6RdghlBRK7oDopH5lBa6KYBR1TyhSnrYRV3GuMhq7BpIMkgJSLQ7XoR4f3Gy0DEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023239; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VnEDXtHkt/194uNClzvCuVob3BL+zj1HTpnUIrcdYvs=; b=QZPZYpsL5ev/5R/Qf2REN7paJZHAvzenmqi0i4vqYhxTb71kgkQcAqPhklQ9tXcM0HJxa4241KCGZ4oy3Ao3p9MEDLZwyY1tWPIjdqxq6+3Rir29fEMBANHYZ2nc95CRf9oHVQ+YC0ERFkA1/56/jG7eGECM0ixK89n34mgMDVI= 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 1709023239952738.2778239657589; Tue, 27 Feb 2024 00:40:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0V-0005uj-Tx; Tue, 27 Feb 2024 03:40:11 -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 1ret0S-0005tU-Vi for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:09 -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 1ret0P-0007TE-Qz for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:08 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33d6fe64a9bso3081052f8f.0 for ; Tue, 27 Feb 2024 00:40:04 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id ay25-20020a5d6f19000000b0033da430f286sm10910899wrb.69.2024.02.27.00.40.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023203; x=1709628003; 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=VnEDXtHkt/194uNClzvCuVob3BL+zj1HTpnUIrcdYvs=; b=Rf4ROqkTvbsei6T97sud1aTVhEN/7e3cdHwmJ1gfjSVtpm/lM0ZihaH/J/wkjWikdq 4aAJXNuzHCac9FF2XshYdabBcdTjEsDdUpLtK8fggCVO1REWdqfugiR8IKKeHm3dCflj JvtSFDqk2gZ5ZohW+fP+z+9OBfk6zfLXpmxYaUGSQyjrJGUXOV/tFi7/AxFpDaE1OGRR lSTD7PFcAEtRj4GsEYpY1fBjqS9QYfDIdrbxUmtyWaUIfwZbuhCPIUl5zi7kVmg+W/iK ZCJKiMBjBlElCePa20LgiH7qjSoKa8mwt3508thIllQ1KXDr6gC59zQiUSBU9JhR4LVV 9JxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023203; x=1709628003; 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=VnEDXtHkt/194uNClzvCuVob3BL+zj1HTpnUIrcdYvs=; b=YyImn58uNlQWliZsFwUZoU902nUx+rgXvVORGwpA7XaBCuaoLr9yWBzYiSusqPxKJo bLYux4tNvA4KZKsJ/UdR0SKQ1CjahKh0d/XlKXwdUzFn5T6JzymuQV+H188+zpDdbNny 1CE/fu8JGnAGSCrujeFVqWSLUqVO4dKsFOsR+QczvuHQ2EoMcbLm2D43xicvKrxq7CxT ihIx7ZqJJNStEitCPfhR+sMk9UGHW4G/9ENyLxBQWnbFkVH297rV4p1DHksHoo41Dv01 Car2nB2EP2WwHYVe8moIOPDKkVT1IrpTWbcz/ylbJ77QEaYCuYx3UjAc/TQmw8RD/ckR XSIQ== X-Gm-Message-State: AOJu0YwM7KnUMlWwluabtk2BRJr1tZ18J8Qnhg6ih8/pDyfDEnkEfdoF p/mf4t5AqIa7Hc2i8TB4Jl8LP6K5Y73B32HBp0qmh7Eyj/8usLi0MGj7qRoBRM/WAfSyavR04Dr e X-Google-Smtp-Source: AGHT+IHRARJjaOUFJe3eETVUwkN8VOvOPz0me9pEW/kcepRH8ZoAq7ea7WHtCzTNq+1v2fDkRSKfIg== X-Received: by 2002:a05:6000:1816:b0:33d:f51f:2d9f with SMTP id m22-20020a056000181600b0033df51f2d9fmr146659wrh.44.1709023202800; Tue, 27 Feb 2024 00:40:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 02/30] hw/display/pl110: Pass frame buffer memory region as link property Date: Tue, 27 Feb 2024 09:39:18 +0100 Message-ID: <20240227083948.5427-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023241658100003 Add the PL110::'framebuffer-memory' property. Have the different ARM boards set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240226173805.289-3-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/arm/integratorcp.c | 2 ++ hw/arm/realview.c | 2 ++ hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 5 +++++ hw/display/pl110.c | 20 ++++++++++++++++---- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 5b002da350..feb0dd63df 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -671,6 +671,8 @@ static void integratorcp_init(MachineState *machine) } =20 dev =3D qdev_new("pl110"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(address_space_mem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0xc0000000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[22]); diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 77300e92e5..b186f965c6 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -239,6 +239,8 @@ static void realview_init(MachineState *machine, gpio2 =3D sysbus_create_simple("pl061", 0x10015000, pic[8]); =20 dev =3D qdev_new("pl111"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[23]); diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 7e04b23af8..d48235453e 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -300,6 +300,8 @@ static void versatile_init(MachineState *machine, int b= oard_id) /* The versatile/PB actually has a modified Color LCD controller that includes hardware cursor support from the PL111. */ dev =3D qdev_new("pl110_versatile"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10120000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[16]); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 671986c21e..de815d84cc 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -299,6 +299,9 @@ static void a9_daughterboard_init(VexpressMachineState = *vms, =20 /* 0x10020000 PL111 CLCD (daughterboard) */ dev =3D qdev_new("pl111"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[44]); =20 @@ -654,6 +657,8 @@ static void vexpress_common_init(MachineState *machine) /* VE_COMPACTFLASH: not modelled */ =20 dev =3D qdev_new("pl111"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, map[VE_CLCD]); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[14]); diff --git a/hw/display/pl110.c b/hw/display/pl110.c index 4b83db9322..7f145bbdba 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "hw/irq.h" #include "hw/sysbus.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "ui/console.h" #include "framebuffer.h" @@ -17,6 +18,7 @@ #include "qemu/timer.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qapi/error.h" #include "qom/object.h" =20 #define PL110_CR_EN 0x001 @@ -74,6 +76,7 @@ struct PL110State { uint32_t palette[256]; uint32_t raw_palette[128]; qemu_irq irq; + MemoryRegion *fbmem; }; =20 static int vmstate_pl110_post_load(void *opaque, int version_id); @@ -210,7 +213,6 @@ static int pl110_enabled(PL110State *s) static void pl110_update_display(void *opaque) { PL110State *s =3D (PL110State *)opaque; - SysBusDevice *sbd; DisplaySurface *surface =3D qemu_console_surface(s->con); drawfn fn; int src_width; @@ -222,8 +224,6 @@ static void pl110_update_display(void *opaque) return; } =20 - sbd =3D SYS_BUS_DEVICE(s); - if (s->cr & PL110_CR_BGR) bpp_offset =3D 0; else @@ -290,7 +290,7 @@ static void pl110_update_display(void *opaque) first =3D 0; if (s->invalidate) { framebuffer_update_memory_section(&s->fbsection, - sysbus_address_space(sbd), + s->fbmem, s->upbase, s->rows, src_width); } @@ -535,11 +535,22 @@ static const GraphicHwOps pl110_gfx_ops =3D { .gfx_update =3D pl110_update_display, }; =20 +static Property pl110_properties[] =3D { + DEFINE_PROP_LINK("framebuffer-memory", PL110State, fbmem, + TYPE_MEMORY_REGION, MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void pl110_realize(DeviceState *dev, Error **errp) { PL110State *s =3D PL110(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 + if (!s->fbmem) { + error_setg(errp, "'framebuffer-memory' property was not set"); + return; + } + memory_region_init_io(&s->iomem, OBJECT(s), &pl110_ops, s, "pl110", 0x= 1000); sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); @@ -577,6 +588,7 @@ static void pl110_class_init(ObjectClass *klass, void *= data) set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->vmsd =3D &vmstate_pl110; dc->realize =3D pl110_realize; + device_class_set_props(dc, pl110_properties); } =20 static const TypeInfo pl110_info =3D { --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023233; cv=none; d=zohomail.com; s=zohoarc; b=DU3SWKOuz25qKrsSYHhSSVeDnA6BUmIDdHG9F67tMllWQVdZHRCklcANzBQvanRi+RNf19YnciKYKrWkx2lAf2n5XYMasuPmBgByBTy5eaPohCEn03upk/Ahmz2GT4sLAf66oO6DS4PFC3I4Jhz2WT2gLicdKyq8EOCFQVwV5J0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023233; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=B2Yugy2awLwnvm6DU00n3Q4waoAG+V4YGcUxNOBpaJg=; b=ZnVUyKsgloq3hBimrp8DmdbEM2luAZOo2jJ9LqGYgtfr8+eSMO+4WrrzZM3TC7x44t1gJOA252fvfrx9Y4+ce009YHNiafi0wEVAgc5nT+B34u5G72ttXfNWgaexswtDAdH5KaCoLsHF+YCNFtskD8ctnk27pu60hWCP+AfopdI= 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 1709023233326299.57953228431245; Tue, 27 Feb 2024 00:40:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0f-00062O-VZ; Tue, 27 Feb 2024 03:40: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 1ret0c-0005yS-3g for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:18 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret0W-0007c0-NL for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:17 -0500 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d094bc2244so46831601fa.1 for ; Tue, 27 Feb 2024 00:40:11 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id t19-20020a7bc3d3000000b00410dd253008sm14327564wmj.42.2024.02.27.00.40.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023209; x=1709628009; 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=B2Yugy2awLwnvm6DU00n3Q4waoAG+V4YGcUxNOBpaJg=; b=b2HjFy+wR092Oic1IG/ugYXwtBb8mswBlD26hOsDQ2rELtK+fVaOoNLZXY9UY5JthL 8A0rF+d/fsapuplz6opr6JU4+g9FQ96ABnYH4NAlBTkldyWTJtpwxc1OxMHRYAXafciW juzPxJYdhZzAl+S/v03YWAlsShT81kYaY9VbZQj+UgMiX+v9W8kbSKWCNrwTYV9GNr8n SN1mhzsfe/CHm/J999UDfi1YSNQoWtkfxWGXxHxFmdzBIaw4UsrVic9fAmZqd3TM8YTG rJqbDb9fKs5tZs3BElTDbi0RvtnUq6kWtuk5PQoG2WJ/Af6uETpTZ34rhfdOJhSBeU// it1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023209; x=1709628009; 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=B2Yugy2awLwnvm6DU00n3Q4waoAG+V4YGcUxNOBpaJg=; b=crw0g+F6PuaM1Mx5C+H0wY398rvsCeYsAZa1DyvyOaAQUPx4mr5V1YoVbCEIThpXee XB3s8u5vCrHCVaLA7k1LDxZ9Z34sPqUnwkN1qzLkgpkg7h4tzBSOb/2EGqZkq38G6qf0 aqYBkzyeHM3VHimOB9YS6iFcmN4xzilo6/JEi21d7sy0BZQ53kpjoi0E/zo1U0lo/hEc pfm+spZLjcn518tSc8nsubR7pZlkkR8Fi6VttE/gSplp3XmaMutCZ515B8NcG8TYNMVw 7Yf9fEYtJyWm0cr2ZrvdL+KwSeKwrWqz2nXt78QCKP6nqklvS/W4EVEPD+S25+A/C3oL ocyg== X-Gm-Message-State: AOJu0YznMaWO6VUUXMHKNmeRKd7a1SjIlxbAjr25YBPPb0Rl0PYbARXh FaNSdnZ5i9pTyh0YmzQf1utGNbAA1s0VeG44z14qB7Dn4EqtoUPQ2qEi50SUW6omQQ/xaAfSckQ U X-Google-Smtp-Source: AGHT+IEUpyakfCbAFpBING9pjQzCMhWHuZ1TG4a3yU9Mc3U5kCoBi3iKJQPjBjL81/mY1MxiukBf1A== X-Received: by 2002:a05:651c:d2:b0:2d2:86f0:3064 with SMTP id 18-20020a05651c00d200b002d286f03064mr3856029ljr.44.1709023208686; Tue, 27 Feb 2024 00:40:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mitsyanko , Peter Maydell Subject: [PULL 03/30] hw/arm/exynos4210: Inline sysbus_create_varargs(EXYNOS4210_FIMD) Date: Tue, 27 Feb 2024 09:39:19 +0100 Message-ID: <20240227083948.5427-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=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=no 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023233623100001 We want to set another qdev property (a link) for the FIMD device, we can not use sysbus_create_varargs() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-4-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/arm/exynos4210.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 57c77b140c..ab18836943 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -769,11 +769,13 @@ static void exynos4210_realize(DeviceState *socdev, E= rror **errp) } =20 /*** Display controller (FIMD) ***/ - sysbus_create_varargs("exynos4210.fimd", EXYNOS4210_FIMD0_BASE_ADDR, - s->irq_table[exynos4210_get_irq(11, 0)], - s->irq_table[exynos4210_get_irq(11, 1)], - s->irq_table[exynos4210_get_irq(11, 2)], - NULL); + dev =3D qdev_new("exynos4210.fimd"); + busdev =3D SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(busdev, &error_fatal); + sysbus_mmio_map(busdev, 0, EXYNOS4210_FIMD0_BASE_ADDR); + for (n =3D 0; n < 3; n++) { + sysbus_connect_irq(busdev, n, s->irq_table[exynos4210_get_irq(11, = n)]); + } =20 sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, s->irq_table[exynos4210_get_irq(28, 3)]); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023316; cv=none; d=zohomail.com; s=zohoarc; b=UufyCt+iDgPw8JPQsoZrW/OZ0LSmYa31wbPs/yMY0olPzn5uXZgFDBe4g/GuEW/0KVDa/QaFwmhiYVK4zIkJQW6oQBF8sDX8uL8n02o/+HhvGVQ/BLRnFFWYk8zzDWD9HzTBdxvMeEnvS90/QvrP+1oOEx+wwDuCdWYms1S9ot0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023316; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vqc0dN+90FxlJ0ZwXpMXw0U7lDa+rLwNm5jLhzGNtec=; b=ZOiva2OgjIApQYPpoO9zRU9aCGc2bNs+s0Bz8or929LUeyJ56E1tgMes8meYN04OD4BST2bX7dFaPeAHGhnHQxSQ/bPl4Gs9eZ/c6zMvNrQfXBlgmJeHeGXBiUvu/WsxOHChAxqHBDgKZkF6TIOLC/QhOLPUn3/hvOVetUmibV8= 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 1709023316881438.3288806837719; Tue, 27 Feb 2024 00:41:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0r-0006K1-V7; Tue, 27 Feb 2024 03:40:33 -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 1ret0p-0006Ee-Vp for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:31 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret0a-0007dr-W5 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:31 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2d29aad15a5so4238471fa.3 for ; Tue, 27 Feb 2024 00:40:16 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id e13-20020a5d594d000000b0033dd53c8f15sm6479143wri.13.2024.02.27.00.40.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023215; x=1709628015; 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=vqc0dN+90FxlJ0ZwXpMXw0U7lDa+rLwNm5jLhzGNtec=; b=QU/VyRbthrO/HXExLka9fsLfP+IcnXxNLVxLfYh/aUJIF2T7Tr9QQlLGpWL/i4Nhxj 9IipRRE0NBVH97LK4KU2oTaHxdtU3jTUK0wb7xvI+LAB2Lzf/dh0uSRzkv4WhYj4TsXG WuPn5OW808x2NYY78I4Aa8sDgbHJUWhrp4CYtxiftUliLhArt4u8FgmmOiTB/sVRyPci KiQEuYwjdoxPJMFavmKydHpaMwh02Qd+1uXhJag/1Fg9gTB/4u2B5ID9Z5r3KlYXRSWw xSeX5C8t9X9Hlv4RoGD++HUt3mI0N3kzmqYsn+4sUZp/mzK9PmBNvqy3SQxJtu/7lJO0 C7tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023215; x=1709628015; 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=vqc0dN+90FxlJ0ZwXpMXw0U7lDa+rLwNm5jLhzGNtec=; b=Gg6UIkiq4UeGb/4DsSSn9T+fxjnp0YIZu0Xwf9VTiZ9JNYIbX0/Si37CJ95Hj1/AJt YPXyoTOLxevw1WaAfGsb8tLrSJgZ+9E/nqXe7QlVlE15WnG+A0meKRGoZSXWnS9WkyzD cuq3yQKvnCebQ6TLmU2giRIFRxVkuwPMnc2PY2oRZV2JzNhGpGBrZX9ggkxcU/mw9aGq 26bvpOYclXddmp1FhD7R0tD20IvFUCV8Zx9Y18LFMInRmHMzdsM7Z8VGacyrp2hi24Z9 cAgO8+zSEiNVTQufN6EvoeXXj3C0/Gutr8VvANnzuQf/hSmI4IXXHJmu9p1wqnm39inN rnOg== X-Gm-Message-State: AOJu0YxW+8YqwySzra4IeRMXXOlJfYDXyemlq7EtmJaKFSbO++Hx+d4i ytd4zSSFwMdveLTUhnIr7hWYqYThWPENOtb8zRuQNpIFIcBxqKn/1F/HnNMtYeSAM4pQ2Uz3gcK d X-Google-Smtp-Source: AGHT+IG149N0nUl7iHITjpa8QcacETQgxuHWEPA7On90oNdu4DPgxnGuTWAC4Q3AqtQaCj0M6eJfxA== X-Received: by 2002:a2e:9c92:0:b0:2d2:628e:7fbf with SMTP id x18-20020a2e9c92000000b002d2628e7fbfmr5750458lji.36.1709023214817; Tue, 27 Feb 2024 00:40:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mitsyanko , Peter Maydell Subject: [PULL 04/30] hw/display/exynos4210_fimd: Pass frame buffer memory region as link Date: Tue, 27 Feb 2024 09:39:20 +0100 Message-ID: <20240227083948.5427-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023317986100002 Add the Exynos4210fimdState::'framebuffer-memory' property. Have the board set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240226173805.289-5-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/arm/exynos4210.c | 2 ++ hw/display/exynos4210_fimd.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index ab18836943..e3f1de2631 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -770,6 +770,8 @@ static void exynos4210_realize(DeviceState *socdev, Err= or **errp) =20 /*** Display controller (FIMD) ***/ dev =3D qdev_new("exynos4210.fimd"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(system_mem), &error_fatal); busdev =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(busdev, &error_fatal); sysbus_mmio_map(busdev, 0, EXYNOS4210_FIMD0_BASE_ADDR); diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 84687527d5..5712558e13 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "hw/qdev-properties.h" #include "hw/hw.h" #include "hw/irq.h" #include "hw/sysbus.h" @@ -32,6 +33,7 @@ #include "qemu/bswap.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qapi/error.h" #include "qom/object.h" =20 /* Debug messages configuration */ @@ -302,6 +304,7 @@ struct Exynos4210fimdState { MemoryRegion iomem; QemuConsole *console; qemu_irq irq[3]; + MemoryRegion *fbmem; =20 uint32_t vidcon[4]; /* Video main control registers 0-3 */ uint32_t vidtcon[4]; /* Video time control registers 0-3 */ @@ -1119,7 +1122,6 @@ static void exynos4210_fimd_invalidate(void *opaque) * VIDOSDA, VIDOSDB, VIDWADDx and SHADOWCON registers */ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned wi= n) { - SysBusDevice *sbd =3D SYS_BUS_DEVICE(s); Exynos4210fimdWindow *w =3D &s->window[win]; hwaddr fb_start_addr, fb_mapped_len; =20 @@ -1147,8 +1149,7 @@ static void fimd_update_memory_section(Exynos4210fimd= State *s, unsigned win) memory_region_unref(w->mem_section.mr); } =20 - w->mem_section =3D memory_region_find(sysbus_address_space(sbd), - fb_start_addr, w->fb_len); + w->mem_section =3D memory_region_find(s->fbmem, fb_start_addr, w->fb_l= en); assert(w->mem_section.mr); assert(w->mem_section.offset_within_address_space =3D=3D fb_start_addr= ); DPRINT_TRACE("Window %u framebuffer changed: address=3D0x%08x, len=3D0= x%x\n", @@ -1924,6 +1925,12 @@ static const GraphicHwOps exynos4210_fimd_ops =3D { .gfx_update =3D exynos4210_fimd_update, }; =20 +static Property exynos4210_fimd_properties[] =3D { + DEFINE_PROP_LINK("framebuffer-memory", Exynos4210fimdState, fbmem, + TYPE_MEMORY_REGION, MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void exynos4210_fimd_init(Object *obj) { Exynos4210fimdState *s =3D EXYNOS4210_FIMD(obj); @@ -1944,6 +1951,11 @@ static void exynos4210_fimd_realize(DeviceState *dev= , Error **errp) { Exynos4210fimdState *s =3D EXYNOS4210_FIMD(dev); =20 + if (!s->fbmem) { + error_setg(errp, "'framebuffer-memory' property was not set"); + return; + } + s->console =3D graphic_console_init(dev, 0, &exynos4210_fimd_ops, s); } =20 @@ -1954,6 +1966,7 @@ static void exynos4210_fimd_class_init(ObjectClass *k= lass, void *data) dc->vmsd =3D &exynos4210_fimd_vmstate; dc->reset =3D exynos4210_fimd_reset; dc->realize =3D exynos4210_fimd_realize; + device_class_set_props(dc, exynos4210_fimd_properties); } =20 static const TypeInfo exynos4210_fimd_info =3D { --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023316; cv=none; d=zohomail.com; s=zohoarc; b=TPPX30nxjDesyAsUyB/3APSVYiCWo1vZH3K85Wm8lGVGZ71HUh6kaj34Yw4jyLiQmWtwZJ17lB9f8LvCGp05KQNzlIoro9FIK3rqphP9bkKDdVcBrYHedgAa2Ux94J00VPMV5ehFfEs8i3SAyf7M69pn9V/GJe9p0BI8SBiBBD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023316; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; b=AOkHRGENWRjBBPRgTBy+hd9UnwOCnl/FP6/XX8nFVULfS2VwpVJ3dL3swa/BAdY3yJtuy30WqlIC6PwAPRqBfH2rOMbTPJNGzQ2i8SDGU3jmEINTiwR7fzhJgRSnng2jLXnJDNLY0CkCu8Ot54h3nZlq2fTNsxn2T5bdcs7GTl8= 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 1709023316600677.3275550025808; Tue, 27 Feb 2024 00:41:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0j-00066p-4o; Tue, 27 Feb 2024 03:40:25 -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 1ret0i-00066F-4V for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:24 -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 1ret0g-0007i6-E8 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:23 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33ddd1624beso893705f8f.1 for ; Tue, 27 Feb 2024 00:40:21 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id bj29-20020a0560001e1d00b0033d81d9c44esm10779692wrb.70.2024.02.27.00.40.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023221; x=1709628021; 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=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; b=V7dI4Ho9LDLuMHQi8UHl5tXKKI397zCeRb9GHzzXNOEam4+/VNpWpgfnYHzVLct2ig DnD8aAqV9UH7QV54v/dl/yxsQwdYXa7oNVpZsPCJg2lVW9KM+mMEs52UrHSLkghwvtnj x7m6UlhN+KnfkDuffXG8KPRJbdGJSwOTZuTmdLxaCH+hpt7cuorr9RLJhS4XVtXkyzCf JzC12yO15gAFqiKHNDOG0TlYsyPRAoJPUPznTpVIp/evLuViPoWcxHzlk0jKNnZ1LO+a i9n5sfLh7tvs9x7K85iKGZZLsdJ4nKEGxTiq+tpm4crQyYrMLDSnDFVN2FoT7WHTj8+k Ur4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023221; x=1709628021; 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=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; b=Z7uaKPshVfxKF3vGzyLbAaWY3vwdbZAYefl/L8xfZmTMCKXOQNphWRM8kUYfDa8MWU n81EG4xGX92ZmGw6tcvX+WWF2ypn4myuYnNbAyF/XzgcCgw1EJ5eIY4tAiBD3RU7bJl+ yuoqkGEyN0bdixCpaN/cQqX9/yRVpK63dEOrjZNSqfEv68u6BSZxAEJnx64FcIVLcxdd s/yJjm70EKKlC4jyJWXQp0p7oSNMEt2lopvI7dqMJd17XWI2GPMacDYq2RZUjjsq2AfT oudoyJ9DdhGbTqMj+aMBaGw5HW8yjakx42JC/R3BLg66LDcFmGfto3fMj5O+k21ASd4u R3RQ== X-Gm-Message-State: AOJu0YwLIh9GrpclfmWXIPX64QGnjXneUqRKlrwPRWCyl7St+GJ2yUZt M/hbCnJFvwnmQl71BJHTY8KebgswCw1A3jRA1IIWY3iZ8lbr7Tezc9H4kWgVqMbGXkLTJhqdZup / X-Google-Smtp-Source: AGHT+IHlowSWUgonUicezcAUv37tfeY2t4fNQ8ilz1Ff3gwsIZgFc3bnnF3Er3iJzfWjvl1FPo7WKg== X-Received: by 2002:a5d:4106:0:b0:33d:90c2:c7f4 with SMTP id l6-20020a5d4106000000b0033d90c2c7f4mr8225142wrp.14.1709023220812; Tue, 27 Feb 2024 00:40:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost , kvm@vger.kernel.org Subject: [PULL 05/30] hw/i386/kvmvapic: Inline sysbus_address_space() Date: Tue, 27 Feb 2024 09:39:21 +0100 Message-ID: <20240227083948.5427-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023317985100001 sysbus_address_space(...) is a simple wrapper to get_system_memory(). Use it in place, since KVM VAPIC doesn't distinct address spaces. Rename the 'as' variable as 'mr' since it is a MemoryRegion type, not an AddressSpace one. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-6-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/i386/kvmvapic.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 20b0300357..61a65ef2ab 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -58,6 +58,7 @@ typedef struct GuestROMState { =20 struct VAPICROMState { SysBusDevice busdev; + MemoryRegion io; MemoryRegion rom; uint32_t state; @@ -581,19 +582,17 @@ static int vapic_map_rom_writable(VAPICROMState *s) { hwaddr rom_paddr =3D s->rom_state_paddr & ROM_BLOCK_MASK; MemoryRegionSection section; - MemoryRegion *as; + MemoryRegion *mr =3D get_system_memory(); size_t rom_size; uint8_t *ram; =20 - as =3D sysbus_address_space(&s->busdev); - if (s->rom_mapped_writable) { - memory_region_del_subregion(as, &s->rom); + memory_region_del_subregion(mr, &s->rom); object_unparent(OBJECT(&s->rom)); } =20 /* grab RAM memory region (region @rom_paddr may still be pc.rom) */ - section =3D memory_region_find(as, 0, 1); + section =3D memory_region_find(mr, 0, 1); =20 /* read ROM size from RAM region */ if (rom_paddr + 2 >=3D memory_region_size(section.mr)) { @@ -614,7 +613,7 @@ static int vapic_map_rom_writable(VAPICROMState *s) =20 memory_region_init_alias(&s->rom, OBJECT(s), "kvmvapic-rom", section.m= r, rom_paddr, rom_size); - memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000); + memory_region_add_subregion_overlap(mr, rom_paddr, &s->rom, 1000); s->rom_mapped_writable =3D true; memory_region_unref(section.mr); =20 --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023392; cv=none; d=zohomail.com; s=zohoarc; b=HKnjuLfoR1EqeLtp3GaFUlHhkG8xk/kmC0K+PgbCfQgSGbfsKegyA5NbITRfFFOYMhWhOpMv5dFfUXxN/jcPvjwTDBijKvrMkflMWvwSdm1J/WIobR9v57st1qtCwpW0PgV2kcvOxrumq766hn7GHK9NtmigqdNqUNJ7GfMPlLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023392; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vsQjpNWm982u5XBOq7wYo0dWEjdVwmwHsexBrMcBwNc=; b=eQmn1WxsJl1k2L+DTXPi0Ly/c9rr7tXGV9YtkpGqpcEDgxV6ItJAJo4/YFEu5M3EDxhxFxkxt6SUXdcAsV1+JD4F3Z5Yymnwxe6cBmgOXX/QIo0lhh2TBlraPLBkPjbjX9TvjyeubGwl0y1n/XnNSGOi82AypI+4Wop65B4fClo= 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 1709023391924853.8603985536311; Tue, 27 Feb 2024 00:43:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0s-0006Kc-GF; Tue, 27 Feb 2024 03:40:34 -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 1ret0q-0006Gz-Lk for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:32 -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 1ret0m-0007m2-Lj for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:32 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-412a390347dso15440125e9.3 for ; Tue, 27 Feb 2024 00:40:28 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id v13-20020a05600c444d00b0041294d015fbsm10703245wmn.40.2024.02.27.00.40.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023226; x=1709628026; 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=vsQjpNWm982u5XBOq7wYo0dWEjdVwmwHsexBrMcBwNc=; b=Rvjr6+DU3dQC41Ae7eoHfoWyzEnJRjAp/YYZ3SbM/fUnZ3nyCG4GO/L4JiRL/XzM/S JG5mC4wmdYCGc8sm8j2GOAzY7q8Jz6DzA/8bjSaDyhM8g78K8q6KWNfs5ojgsJAImMNN 65HCK3pdkmoE6PcZVPOPgJRR5wGGWJJyu51VhUmHhbve6FGq2XCL7dajqFRPmXrTLlT3 7ub+AP3Gv50xYZPnWVL+Q0SBQaS/YsjxxhXpmmJTgmzlUuI/EcqYtJfA/qJ7/uVXeEl/ RRZmKkbYKGjDWpoVqecc4of/VFgcQ9qVA3kXHCX0H5EjXtCoev+jScNsjIvgPlJFGoEJ nRtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023227; x=1709628027; 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=vsQjpNWm982u5XBOq7wYo0dWEjdVwmwHsexBrMcBwNc=; b=muDhs35AO7fQB7ersMjzrI+A/3RSC/oxaoqKMXb7mEyYzo1rNZ2hzxQCkxJHnMDvO+ 1kfNfKiO5+Kw7BS7OmsxDQk3OULbxP51WJ3bT5GfaH7v273yRSSg4nX9/lzIKH9LE9Kw RehFizC9rlXF6kyeRnlGJXPxFFdnUSwMEaEjHuS2AB7jd8k4RISz2SYhfwwbdQ8zFiBl nvdrNPwmrAiIlzTD8a/DtdtdzUd7m2UACOGwl0ODEiDK6/zJDLmkxp22SH1XFR3LL5hO INYGLSlQWoOTUcwkKhTmmH1vQpRVntxD1i5TROR+8+rNUEmSLscG6+7PXIbQJTFYe6sP 3c/g== X-Gm-Message-State: AOJu0Yx53OmLz3vUeezLBN482UCt14T2MoHRvpEXUZPh7DxWT5UKuz1T kSd/wnLSr4DUTs4Ph48Oayi2HXSS98xW3BhrptS6q8Zax+yv7YMLQGaAPama7/LZunnojFdPutO Z X-Google-Smtp-Source: AGHT+IErJBBmx4zjFABE1Uqqw2nQRDhjrWUBL+1wOBFLgxhyGfVsFze/IcvH0x++arNzbU4bYe99Zw== X-Received: by 2002:a05:600c:1546:b0:412:a2c7:9d13 with SMTP id f6-20020a05600c154600b00412a2c79d13mr4064489wmg.6.1709023226656; Tue, 27 Feb 2024 00:40:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 06/30] hw/sysbus: Remove now unused sysbus_address_space() Date: Tue, 27 Feb 2024 09:39:22 +0100 Message-ID: <20240227083948.5427-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023394108100003 sysbus_address_space() is not more used, remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-7-philmd@linaro.org> Reviewed-by: Peter Maydell --- include/hw/sysbus.h | 1 - hw/core/sysbus.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 14dbc22d0c..3cb29a480e 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -83,7 +83,6 @@ void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr add= r); void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, int priority); void sysbus_mmio_unmap(SysBusDevice *dev, int n); -MemoryRegion *sysbus_address_space(SysBusDevice *dev); =20 bool sysbus_realize(SysBusDevice *dev, Error **errp); bool sysbus_realize_and_unref(SysBusDevice *dev, Error **errp); diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 9f1d5b2d6d..ad34fb7344 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -298,11 +298,6 @@ static char *sysbus_get_fw_dev_path(DeviceState *dev) return g_strdup(qdev_fw_name(dev)); } =20 -MemoryRegion *sysbus_address_space(SysBusDevice *dev) -{ - return get_system_memory(); -} - static void sysbus_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k =3D DEVICE_CLASS(klass); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023711; cv=none; d=zohomail.com; s=zohoarc; b=LVoYDNL6U/6zZHNC1Xq4uPoHs7ul3NRJVHNTmDdQMqijJDNTCi+mBQgmpfyCTtNUan/+vPgyXF215WAkMjcLwybWdP6yktGkZt7/H5FS909V5GGLvOdDt45qRocPRNlDcpGezyQKY0F1sop7VjDjmvhTJqQNdTaam73FXSgNUw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023711; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VFksONIBdqYx5443JbI5pC5i+NSIyfbO3mN1D7EMdV4=; b=nZnY6qA7UCYam43yKHkqdszimn/J59gxqivSzhYm0EE1uwlZbu1HH89ne/zc94kSVCPfqMc32y7IEHQnUvkcwqpQSry2GIDGsyhceAB1WBKaqEwyHUq/kI27Wt8M09le/Zqz9In574rNOG60T1J3p7IVbpBzE72LSYgru3vDQdA= 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 1709023711065235.97562948493203; Tue, 27 Feb 2024 00:48:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0x-0006Nr-8L; Tue, 27 Feb 2024 03:40:39 -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 1ret0v-0006Mw-OH for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:37 -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 1ret0s-0007oG-Kb for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:36 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-412af574659so875515e9.2 for ; Tue, 27 Feb 2024 00:40:34 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id e13-20020a05600c4e4d00b00412ad7c8298sm1016497wmq.8.2024.02.27.00.40.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023232; x=1709628032; 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=VFksONIBdqYx5443JbI5pC5i+NSIyfbO3mN1D7EMdV4=; b=M9rBA+wkHQinY9Wx6xSndxiOK6YJ9GlEZsdqoijNFtW3aNGxtKFPuEmeXDIzQKlDCz SQBnmviT8XLh8N3Drff4U2TUIdYpaybaRSTlb0CIx9HNCJvgwkuFDkkiO5jdqmsQmsSQ e8dnNwIyHNPLPX7qQSX4hWtBj6eQhiaHDV9yPSLqsmAYek02eblUpy3Wi99ngG42Q2RV ucw8naiSVz6SyAwdqYDHngfuFGzmEI2rvIqojZaXR5xnRiWNF/irnVyCdCvyRz+B2n9H B3OD/fXU+D1hxVUx+bq9nZMpybJnh8x+g+chBxezQWZu/xducHM0ZEBVM6ZvGmHHWIOc nbOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023232; x=1709628032; 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=VFksONIBdqYx5443JbI5pC5i+NSIyfbO3mN1D7EMdV4=; b=RdnKU7K5bfnNvermtmjLRvnrftvIHDB1fX3oniIv4Kth9mS1YUuHFNKHWXUN2T8vhz mF1TLeMpetF7YANU939hpYq8M0JHRfjDnSFlv3QGZKQ1jkUapgIKBuWwdJgWnXF1sSnp +uC86PRRdLmfEbeTINFmH+Nwt1UuDCbAEJrCqBK3bTxexMx2PY40wbqbjPoO6OXW8fKZ uUrQF5bpGsEGXL/66fMfD6VjQ4puMFPW924psdbWsDimL7qyVrkOm0U9tiY98O1hDXU1 pKMr3hDSy59LmWPTKcPDZYhJ6vSP0Bn6io3KajdOdmD6p4qRrsD9tGwi4FneU9vm2/pY v/0A== X-Gm-Message-State: AOJu0YzSAWDdvkYvt9MsGvP0tVn2HE+0iEr3oDcn1i6hzHFGddiP6MxJ 6biQhSEHOvofvxjIHG6FHdkJHK2N5Wd3zt5peLpK5RkHx9DuKrHDH0e7SjXgBqgW5SYaeeOUZjD J X-Google-Smtp-Source: AGHT+IFjfaT4JHPc0z/TAs3m/80pAdTwcyrEIitLqCYksLyOFCjLQ9YqhOIBTe1sHoBUUXJHJn3DYw== X-Received: by 2002:a05:600c:3b08:b0:412:a0e5:728f with SMTP id m8-20020a05600c3b0800b00412a0e5728fmr5388423wms.21.1709023232617; Tue, 27 Feb 2024 00:40:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 07/30] hw/nubus-device: round Declaration ROM memory region address to qemu_target_page_size() Date: Tue, 27 Feb 2024 09:39:23 +0100 Message-ID: <20240227083948.5427-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023712243100003 From: Mark Cave-Ayland Declaration ROM binary images can be any arbitrary size, however if a host = ROM memory region is not aligned to qemu_target_page_size() then we fail the "assert(!(iotlb & ~TARGET_PAGE_MASK))" check in tlb_set_page_full(). Ensure that the host ROM memory region is aligned to qemu_target_page_size() and adjust the offset at which the Declaration ROM image is loaded, since N= ubus ROM images are unusual in that they are aligned to the end of the slot addr= ess space. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Message-ID: <20240111102954.449462-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/nubus/nubus-device.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c index 49008e4938..be4cb24696 100644 --- a/hw/nubus/nubus-device.c +++ b/hw/nubus/nubus-device.c @@ -10,6 +10,7 @@ =20 #include "qemu/osdep.h" #include "qemu/datadir.h" +#include "exec/target_page.h" #include "hw/irq.h" #include "hw/loader.h" #include "hw/nubus/nubus.h" @@ -30,7 +31,8 @@ static void nubus_device_realize(DeviceState *dev, Error = **errp) NubusDevice *nd =3D NUBUS_DEVICE(dev); char *name, *path; hwaddr slot_offset; - int64_t size; + int64_t size, align_size; + uint8_t *rom_ptr; int ret; =20 /* Super */ @@ -76,16 +78,24 @@ static void nubus_device_realize(DeviceState *dev, Erro= r **errp) } =20 name =3D g_strdup_printf("nubus-slot-%x-declaration-rom", nd->slot= ); - memory_region_init_rom(&nd->decl_rom, OBJECT(dev), name, size, + + /* + * Ensure ROM memory region is aligned to target page size regardl= ess + * of the size of the Declaration ROM image + */ + align_size =3D ROUND_UP(size, qemu_target_page_size()); + memory_region_init_rom(&nd->decl_rom, OBJECT(dev), name, align_siz= e, &error_abort); - ret =3D load_image_mr(path, &nd->decl_rom); + rom_ptr =3D memory_region_get_ram_ptr(&nd->decl_rom); + ret =3D load_image_size(path, rom_ptr + (uintptr_t)(align_size - s= ize), + size); g_free(path); g_free(name); if (ret < 0) { error_setg(errp, "could not load romfile \"%s\"", nd->romfile); return; } - memory_region_add_subregion(&nd->slot_mem, NUBUS_SLOT_SIZE - size, + memory_region_add_subregion(&nd->slot_mem, NUBUS_SLOT_SIZE - align= _size, &nd->decl_rom); } } --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023320; cv=none; d=zohomail.com; s=zohoarc; b=Z9Y3tPFHBCM+9yG+mQl+wQKosrNhxHBjT6BcHLfEN0x5fuJcqWfoyMgk0Razxg1pIrWWHhTn9BTHleEAhdqL3Ci2ojLzP7Vb7Qe15pEGQp12z6xPPDrqfN/SC8aTKM5ZuBzNTuodjHCqqOknxVWhvhiwsghncGWQbLFE+gbs0+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023320; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tJyS5qt8DjA8G6kRexYPEmNOufFI9EWHlHMdi9Zk7Sg=; b=UZl8qCH4CZ4reuO8VMbMMGy+gz+QKUiQk00Qy0hOpT90/p41nMMZOr287UabQxyouN3TwTMvSKvV2RIHwMSIA7FirSJn1LrHeA0HFlzDem3O6TuzHWv7uZNAqVi+eiKRio4s6GZUkPzRmNQKkD84u4Rx06IxvvuyE7gxh68iDZ0= 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 1709023320369864.467139149875; Tue, 27 Feb 2024 00:42:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret11-0006a9-VU; Tue, 27 Feb 2024 03:40:44 -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 1ret10-0006UH-Cs for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:42 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret0x-0007pK-VF for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:42 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33d36736d4eso2476904f8f.1 for ; Tue, 27 Feb 2024 00:40:39 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id bt1-20020a056000080100b0033d9c7eb63csm11023879wrb.84.2024.02.27.00.40.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023238; x=1709628038; 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=tJyS5qt8DjA8G6kRexYPEmNOufFI9EWHlHMdi9Zk7Sg=; b=in1tBdvNoik6s04JJiuCezTZcHJ/oF/OAo/pO3EeWoRojTanmVjcWgdA460JI8LfZL mbfSb0B5iTf68HTYC0KNVOaUnULtxbHMLDHAoJpmMvgW9OZ5yjCik3ysviXozq7KJIzE bWY9xA0545mUfDS7DsoswsNApYHIqSXM+nUkgwxF6VK8qJM40SLYdYrhThAR/1Mf9wyc wRhzmBvQdmdhC9bbHm1AxqhhmimbNzUQnXZAUvy1dkFyN+Vf0r5ivZMuPQVzaFAJ/zfI e33LiY1ivysuXa+oz85ACFTfUdqyzPQsxdulWeGAKFClUnx/SkLp86dqiG2emYzOxFkS 0fXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023238; x=1709628038; 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=tJyS5qt8DjA8G6kRexYPEmNOufFI9EWHlHMdi9Zk7Sg=; b=v9jUSDSWqdcpelGXH/JS0pISKfzTeT4frXrAYdn+huOqBVyu+JAhYdlAu0hq85kUhO HVmXYnQlGVqccdJF0qkJ7kOvWvK7JZW14LULSFEORa2shZr/kK6UnonblFR01PeCHQZu kQEvQwTKDfJ5q6GYlIEvCIOMP6LiAmCFnxCQfR3c9K9NmyjarR46a3otCi/pFT35Ao1d dFrs+PVy8GEbFjrMaIqP5+q+MvZ7axq/+v22gT7zQWiBbJ2O2BX0jKQpFGXeqxrDAXcV du10g6yz8R8GrwWuSAEF3lfeeAKfRAEQ6ZfA6Fx9gAN4uxvkjBD2qjqAjHiM7byd1OHI uN3g== X-Gm-Message-State: AOJu0YwacqxkXCnldrlnwmewz7WGpKvUpmCoyHk23VJuSJKn19HTslIs SVWyVOQLEAq+ywknRT5pLXmHgEHOOlIeM4eX/ioBVcBanvWvo4cDcytRcQWHRfRb7VXCfAZNuZF W X-Google-Smtp-Source: AGHT+IF1jtyHafkZSI+78yE7AAE4YQku7yF6yWVst9Y+apCsP6UMwiZuZmiNYke9vjpqC9/NsQxciQ== X-Received: by 2002:adf:ee4b:0:b0:33d:eb12:508b with SMTP id w11-20020adfee4b000000b0033deb12508bmr904783wro.48.1709023238379; Tue, 27 Feb 2024 00:40:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 08/30] hw/nubus: increase maximum Declaration ROM size from 128k to 1Mb Date: Tue, 27 Feb 2024 09:39:24 +0100 Message-ID: <20240227083948.5427-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023321912100005 From: Mark Cave-Ayland Whilst 128k is more than enough for a typical Declaration ROM, a C compiler configured to produce an unstripped debug binary can generate a ROM image t= hat exceeds this limit. Increase the maximum size to 1Mb to help make life easi= er for developers. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier Message-ID: <20240111102954.449462-3-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/hw/nubus/nubus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index b3b4d2eadb..fee79b71d1 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -51,7 +51,7 @@ struct NubusBus { qemu_irq irqs[NUBUS_IRQS]; }; =20 -#define NUBUS_DECL_ROM_MAX_SIZE (128 * KiB) +#define NUBUS_DECL_ROM_MAX_SIZE (1 * MiB) =20 struct NubusDevice { DeviceState qdev; --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023713; cv=none; d=zohomail.com; s=zohoarc; b=Db94+vDYUHXVE3Dx2ljkZmcdQvmYUIBvHPVHvs9Fmu9/uf/Vu8hfCGjZyRA0V6ds7vuXjmaXfVwlnB4OGAAp1p2FLwyeVWxwcrpjTVgxL3soO/iNmm8kJm/7z2p6OaIqijdCiHIngtj1RITjEpIyeBjYjDGPKFzmP7ue43PoOlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023713; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XSLapJ/N2+XLeA9rBJUgjR1T0MBY+vpck1YklG7N1oM=; b=LGHHP70mT4uWLfLE1+J1c7pEB7lvGs0Ut/GmsJ0MiQbsQ+6ZPP/G7OlE+E6g0UrwWNBqWhRSIOuNqxlHFVSTKKAXTrl/KjCTQonmNwTSqJTIQJ8HsdMwjuuvD0QBCa9XVN1NubjZ08SZ3OEqLAWKgiaKAX9er0DtkSpjxuC6jRE= 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 1709023713415713.2549045177846; Tue, 27 Feb 2024 00:48:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret18-0006hu-MX; Tue, 27 Feb 2024 03:40: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 1ret17-0006gA-2H for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:49 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret14-0007r7-6c for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:48 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5654f700705so5262695a12.1 for ; Tue, 27 Feb 2024 00:40:45 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id cs5-20020a0564020c4500b00562d908daf4sm542409edb.84.2024.02.27.00.40.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023244; x=1709628044; 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=XSLapJ/N2+XLeA9rBJUgjR1T0MBY+vpck1YklG7N1oM=; b=WQxwkUQ3OsSwO528RyhjnNnnx7a+8WB6IZ4jzFL7fxyXSDO0EAEJWgOb3gR62bSag0 rxDmEIFx24AlJHZQDIABmuy2wndQD/4MsweJggJTHcHLZPrdu67xKLy4t9TzMF14mxHV lV6BNaKz1E9YFkjoorEihjbveU7T/gk/rR4ALSELoikhlJH4/f18QeJ6uu2nqIEKutfH J5tctzG70El+oAsdzXKHSWrrTfA9ca0TWf+iEfo7Fsofuqr8DkjqVI3h/cIsz8Aze0VH LCTJWxCqk5Sx4XIYbG81LzSgQRLDRagQivBIjBoO9uz3+dMN6dbUND4nGDXSPn+QxtSP jpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023244; x=1709628044; 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=XSLapJ/N2+XLeA9rBJUgjR1T0MBY+vpck1YklG7N1oM=; b=QpnqyxhzR316y8xifOtj8cQCscUcbKprfH914by5m8spRlMuaBhvEi1bhfbozGOWA+ 55J8tlxccucTHqFg06OysCTeeiUdbIB2EhpRxEvIyDAGJie/a9ETnhDxuPdDz9baVIMp 9fsMHaIyO20rujBF77WSan7iurRk8hPbk6tcJn0A6uYPJxymLh2UatUGOElVQrVdm0yu clIhDiJ44MpCKDnXvTBFPcV+33b+G3L5e117Ioh526l61sRCJ9lsV5fFIWVZK9LjJ7Ob muqa+/CUlCrlkzlkJVKK0okLa1Ga6PSamClbCLPTkZNdAB/IxT5Ujg3FXfF7Zzn22VUu 9EWw== X-Gm-Message-State: AOJu0Yz7L7D5fy0cOfbkwtQyTEU8B2S6Z9LhIv58Phd8TqMOIqTozHg9 hiNKfhSk2GzJ/ifHa5ScckBplJTPiX1VU5lQy+UXi6IdYrN6PGQDvZIRrGafJ1YH75JxNqiMhr7 Y X-Google-Smtp-Source: AGHT+IG34tHzNic2vEbsxr/yqpb7KEyn1KgdcvqySNz9F9ODhY49dXusJfmfSYDHxkyV0aZN6PtStg== X-Received: by 2002:aa7:d912:0:b0:565:6c31:9a47 with SMTP id a18-20020aa7d912000000b005656c319a47mr7299942edr.39.1709023244355; Tue, 27 Feb 2024 00:40:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 09/30] hw/nubus: add nubus-virtio-mmio device Date: Tue, 27 Feb 2024 09:39:25 +0100 Message-ID: <20240227083948.5427-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023714212100009 From: Mark Cave-Ayland The nubus-virtio-mmio device is a Nubus card that contains a set of 32 virt= io-mmio devices and a goldfish PIC similar to the m68k virt machine that can be plu= gged into the m68k q800 machine. There are currently a number of drivers under development that can be used = in conjunction with this device to provide accelerated and/or additional hyper= visor services to 68k Classic MacOS. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier Message-ID: <20240111102954.449462-4-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/hw/nubus/nubus-virtio-mmio.h | 36 ++++++++++ hw/nubus/nubus-virtio-mmio.c | 102 +++++++++++++++++++++++++++ hw/nubus/meson.build | 1 + 3 files changed, 139 insertions(+) create mode 100644 include/hw/nubus/nubus-virtio-mmio.h create mode 100644 hw/nubus/nubus-virtio-mmio.c diff --git a/include/hw/nubus/nubus-virtio-mmio.h b/include/hw/nubus/nubus-= virtio-mmio.h new file mode 100644 index 0000000000..de497b7f76 --- /dev/null +++ b/include/hw/nubus/nubus-virtio-mmio.h @@ -0,0 +1,36 @@ +/* + * QEMU Macintosh Nubus Virtio MMIO card + * + * Copyright (c) 2023 Mark Cave-Ayland + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_NUBUS_VIRTIO_MMIO_H +#define HW_NUBUS_VIRTIO_MMIO_H + +#include "hw/nubus/nubus.h" +#include "qom/object.h" +#include "hw/intc/goldfish_pic.h" +#include "hw/virtio/virtio-mmio.h" + +#define TYPE_NUBUS_VIRTIO_MMIO "nubus-virtio-mmio" +OBJECT_DECLARE_TYPE(NubusVirtioMMIO, NubusVirtioMMIODeviceClass, + NUBUS_VIRTIO_MMIO) + +struct NubusVirtioMMIODeviceClass { + DeviceClass parent_class; + + DeviceRealize parent_realize; +}; + +#define NUBUS_VIRTIO_MMIO_NUM_DEVICES 32 + +struct NubusVirtioMMIO { + NubusDevice parent_obj; + + GoldfishPICState pic; + VirtIOMMIOProxy virtio_mmio[NUBUS_VIRTIO_MMIO_NUM_DEVICES]; +}; + +#endif diff --git a/hw/nubus/nubus-virtio-mmio.c b/hw/nubus/nubus-virtio-mmio.c new file mode 100644 index 0000000000..58a63c84d0 --- /dev/null +++ b/hw/nubus/nubus-virtio-mmio.c @@ -0,0 +1,102 @@ +/* + * QEMU Macintosh Nubus Virtio MMIO card + * + * Copyright (c) 2024 Mark Cave-Ayland + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/nubus/nubus-virtio-mmio.h" + + +#define NUBUS_VIRTIO_MMIO_PIC_OFFSET 0 +#define NUBUS_VIRTIO_MMIO_DEV_OFFSET 0x200 + + +static void nubus_virtio_mmio_set_input_irq(void *opaque, int n, int level) +{ + NubusDevice *nd =3D NUBUS_DEVICE(opaque); + + nubus_set_irq(nd, level); +} + +static void nubus_virtio_mmio_realize(DeviceState *dev, Error **errp) +{ + NubusVirtioMMIODeviceClass *nvmdc =3D NUBUS_VIRTIO_MMIO_GET_CLASS(dev); + NubusVirtioMMIO *s =3D NUBUS_VIRTIO_MMIO(dev); + NubusDevice *nd =3D NUBUS_DEVICE(dev); + SysBusDevice *sbd; + int i, offset; + + nvmdc->parent_realize(dev, errp); + if (*errp) { + return; + } + + /* Goldfish PIC */ + sbd =3D SYS_BUS_DEVICE(&s->pic); + if (!sysbus_realize(sbd, errp)) { + return; + } + memory_region_add_subregion(&nd->slot_mem, NUBUS_VIRTIO_MMIO_PIC_OFFSE= T, + sysbus_mmio_get_region(sbd, 0)); + sysbus_connect_irq(sbd, 0, + qdev_get_gpio_in_named(dev, "pic-input-irq", 0)); + + /* virtio-mmio devices */ + offset =3D NUBUS_VIRTIO_MMIO_DEV_OFFSET; + for (i =3D 0; i < NUBUS_VIRTIO_MMIO_NUM_DEVICES; i++) { + sbd =3D SYS_BUS_DEVICE(&s->virtio_mmio[i]); + qdev_prop_set_bit(DEVICE(sbd), "force-legacy", false); + if (!sysbus_realize_and_unref(sbd, errp)) { + return; + } + + memory_region_add_subregion(&nd->slot_mem, offset, + sysbus_mmio_get_region(sbd, 0)); + offset +=3D 0x200; + + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(DEVICE(&s->pic), i)); + } +} + +static void nubus_virtio_mmio_init(Object *obj) +{ + NubusVirtioMMIO *s =3D NUBUS_VIRTIO_MMIO(obj); + int i; + + object_initialize_child(obj, "pic", &s->pic, TYPE_GOLDFISH_PIC); + for (i =3D 0; i < NUBUS_VIRTIO_MMIO_NUM_DEVICES; i++) { + char *name =3D g_strdup_printf("virtio-mmio[%d]", i); + object_initialize_child(obj, name, &s->virtio_mmio[i], + TYPE_VIRTIO_MMIO); + g_free(name); + } + + /* Input from goldfish PIC */ + qdev_init_gpio_in_named(DEVICE(obj), nubus_virtio_mmio_set_input_irq, + "pic-input-irq", 1); +} + +static void nubus_virtio_mmio_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + NubusVirtioMMIODeviceClass *nvmdc =3D NUBUS_VIRTIO_MMIO_CLASS(oc); + + device_class_set_parent_realize(dc, nubus_virtio_mmio_realize, + &nvmdc->parent_realize); +} + +static const TypeInfo nubus_virtio_mmio_types[] =3D { + { + .name =3D TYPE_NUBUS_VIRTIO_MMIO, + .parent =3D TYPE_NUBUS_DEVICE, + .instance_init =3D nubus_virtio_mmio_init, + .instance_size =3D sizeof(NubusVirtioMMIO), + .class_init =3D nubus_virtio_mmio_class_init, + .class_size =3D sizeof(NubusVirtioMMIODeviceClass), + }, +}; + +DEFINE_TYPES(nubus_virtio_mmio_types) diff --git a/hw/nubus/meson.build b/hw/nubus/meson.build index e7ebda8993..9a7a12ea68 100644 --- a/hw/nubus/meson.build +++ b/hw/nubus/meson.build @@ -2,6 +2,7 @@ nubus_ss =3D ss.source_set() nubus_ss.add(files('nubus-device.c')) nubus_ss.add(files('nubus-bus.c')) nubus_ss.add(files('nubus-bridge.c')) +nubus_ss.add(files('nubus-virtio-mmio.c')) nubus_ss.add(when: 'CONFIG_Q800', if_true: files('mac-nubus-bridge.c')) =20 system_ss.add_all(when: 'CONFIG_NUBUS', if_true: nubus_ss) --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023373; cv=none; d=zohomail.com; s=zohoarc; b=IEftS1bhr/2ISH+AuiMUC040wzox43g1LBRPHDE93D+H+z5+aS9Rbfzc/YqNTEuxgfnScAKIOfFVfyuMp5VYCZSIpavUFAze+Kb7YGAMcSd9emE06OvzdZTdqQz7hPpfRj956AV4EnfzaXKEwFDLL3nePT6BCngI2LC78Uw4ov4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023373; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E6yWLTnbIVuSgabgdZE6+CbUi7y4Wg3nnktwesa/iZ0=; b=Xyht2bQzqz9ROlArnqH9m4xwp+djCfTxSXLVhiYxGm6BHfuVkBpPo45ZOYZewHlJoRipr0a8ECmqK82Ufx4fozcSDv76zCbLx4s6qhXK5NptcDrkk4zaXc5egj+nHVyZc1dooDEI8MTh7mvn7nalRD2DyCajQmleLxsetkpVS2s= 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 1709023373847250.6894929474356; Tue, 27 Feb 2024 00:42:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret1J-00076g-Av; Tue, 27 Feb 2024 03:41:01 -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 1ret1F-0006ue-CR for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:58 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1C-0007uD-DK for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:56 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2d2505352e6so56117771fa.3 for ; Tue, 27 Feb 2024 00:40:53 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id t6-20020a2e7806000000b002d2607e6d29sm1152340ljc.70.2024.02.27.00.40.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023252; x=1709628052; 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=E6yWLTnbIVuSgabgdZE6+CbUi7y4Wg3nnktwesa/iZ0=; b=U65eYhk/PeJFL3WAaAxf++ol8F/5rQmNlsZZoFL1XHn4A7pow6IfjSM2JwwiQDiBb6 HaumDhAr1eDA+SadYXdEnMRb5U+WPyWh9XAy/h+UcmrOcSfYRA3s6MOiowtUI4DIbQx/ ufKT0t7MhlWmoqiUon+nRPODYVCNhQc2Q826me1wY4jNdZcM90zRrlYRN/1Vx+lQGFbX FaYV4ccVxEpqbjaQFjUIy0W81clbHa9m69/012jK7P9/b2FozHkqP7OdLXa8hIUiap94 G+DaExg+TqTz4LthBm78JZjGUF56iEUqrVGtunZ/v5hxtH2WTeiZHPnQrGMQ3ShdW9rJ bWHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023252; x=1709628052; 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=E6yWLTnbIVuSgabgdZE6+CbUi7y4Wg3nnktwesa/iZ0=; b=RZPCuDNYVVPg4xyL2V/VyBzyfzq+YQHhvVu1O+dqXnIvYjzRATGVBwL/pprW1IjtGn dloxceXjU2N1p0AZF1GPDleWBVR1hQ0VsYp1So5bZ3xf2WHeQUbZ282R5poagZZ40F0o iD5uQ4v6TMdtCO288jx7U8uJzYQS3PYrXogdKxLuENuAsY8FYURzWIPbeFDiymd/7j/u LVcsIXQwlqX8DT6vCtbjvyfEuqCKYUr3gU+dPuxCP2TLt64SPFGyQE7e9M4vaNqpYl5y yHPvMJGPbLDqnLR5hkSnogRl19hiY5UrGwCCxBc9HXoe+P7o3MioFGHmnru5uO2Y3NvF viYg== X-Gm-Message-State: AOJu0YxeR5DjD4Pcj9egsECidTROtyeU2dmjhWD0lbNXaTJKL/rQF2M+ qfxbyAdsxrJKaqyWcvJ1In3+ZhbalslrYYtlCq6WvY4anS0ULdpRU35/IbwpG93kW+Vlscl1Tyg S X-Google-Smtp-Source: AGHT+IERriWrOmUZd6CiDb7F6TpFnr9Nj6guJjU0ve4EhUBPrD+c8ZRWTz+Z6wvVFxhPZtpPJvKLYg== X-Received: by 2002:a05:651c:786:b0:2d2:a38c:d706 with SMTP id g6-20020a05651c078600b002d2a38cd706mr300847lje.17.1709023251896; Tue, 27 Feb 2024 00:40:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 10/30] hw/acpi: move object_resolve_type_unambiguous to core QOM Date: Tue, 27 Feb 2024 09:39:26 +0100 Message-ID: <20240227083948.5427-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023374046100003 From: Paolo Bonzini object_resolve_type_unambiguous provides a useful functionality, that is currently emulated for example by usb_bus_find(). Move it to core code and add error reporting for increased generality. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-2-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/qom/object.h | 13 +++++++++++++ hw/i386/acpi-build.c | 20 +++++--------------- qom/object.c | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index afccd24ca7..e9ed9550f0 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1550,6 +1550,19 @@ Object *object_resolve_path(const char *path, bool *= ambiguous); Object *object_resolve_path_type(const char *path, const char *typename, bool *ambiguous); =20 +/** + * object_resolve_type_unambiguous: + * @typename: the type to look for + * @errp: pointer to error object + * + * Return the only object in the QOM tree of type @typename. + * If no match or more than one match is found, an error is + * returned. + * + * Returns: The matched object or NULL on path lookup failure. + */ +Object *object_resolve_type_unambiguous(const char *typename, Error **errp= ); + /** * object_resolve_path_at: * @parent: the object in which to resolve the path diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index d3ce96dd9f..896ff87519 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -192,21 +192,10 @@ static void init_common_fadt_data(MachineState *ms, O= bject *o, *data =3D fadt; } =20 -static Object *object_resolve_type_unambiguous(const char *typename) -{ - bool ambig; - Object *o =3D object_resolve_path_type("", typename, &ambig); - - if (ambig || !o) { - return NULL; - } - return o; -} - static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) { - Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); - Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); + Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM, NULL); + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE, = NULL); Object *obj =3D piix ? piix : lpc; QObject *o; pm->cpu_hp_io_base =3D 0; @@ -1428,8 +1417,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, Range *pci_hole, Range *pci_hole64, MachineState *machine) { - Object *i440fx =3D object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOS= T_BRIDGE); - Object *q35 =3D object_resolve_type_unambiguous(TYPE_Q35_HOST_DEVICE); + Object *i440fx =3D object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOS= T_BRIDGE, + NULL); + Object *q35 =3D object_resolve_type_unambiguous(TYPE_Q35_HOST_DEVICE, = NULL); CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; CrsRangeSet crs_range_set; diff --git a/qom/object.c b/qom/object.c index 2c4c64d2b6..d4a001cf41 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2229,6 +2229,22 @@ Object *object_resolve_path_at(Object *parent, const= char *path) return object_resolve_abs_path(parent, parts, TYPE_OBJECT); } =20 +Object *object_resolve_type_unambiguous(const char *typename, Error **errp) +{ + bool ambig; + Object *o =3D object_resolve_path_type("", typename, &ambig); + + if (ambig) { + error_setg(errp, "More than one object of type %s", typename); + return NULL; + } + if (!o) { + error_setg(errp, "No object found of type %s", typename); + return NULL; + } + return o; +} + typedef struct StringProperty { char *(*get)(Object *, Error **); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023595; cv=none; d=zohomail.com; s=zohoarc; b=jHmsslOd+X++FcWI8V6xbPiMjretSK8ANCHruBB4Aw9AslKikW87jY4ASL3VrpltlDlYCQEvWZwUVf6USNSiI77HH8O2REoUTNfjH+XRAUS/4OBceFU0hN1ofJOxbaLCf78G9i50J3DF9WvqbvK0EoYLu5iMg+m4wOE9xTp8zbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023595; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GZ6f3MtsvPODeQCNs+mWuntTgICcd/owb4II9I6fwgI=; b=O9dGFav7gee7DiX6sH1Ui9qxzlSonG+imat2DKTcz3ZLXj9QhVk7Kt9NTZ45qaMZyFMGIPURfQ35YoGbuFbJ08wj7+fPaVZSIe91ke23Hd/AORd4Z28yc+OmKmn2xv+LuqIcLrnI8tF5ZsbBK7XAOvvNOfcWOQug3xunV1ujIEQ= 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 1709023595261575.8377266868313; Tue, 27 Feb 2024 00:46:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret1L-0007HX-US; Tue, 27 Feb 2024 03:41: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 1ret1K-0007FD-KQ for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:02 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1I-0007vr-19 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:02 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a3e7f7b3d95so447511466b.3 for ; Tue, 27 Feb 2024 00:40:59 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id st14-20020a170907c08e00b00a3f5c39bf2asm545546ejc.0.2024.02.27.00.40.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023258; x=1709628058; 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=GZ6f3MtsvPODeQCNs+mWuntTgICcd/owb4II9I6fwgI=; b=a8fqtYMqZils9PEkchOrB5mu/ZWfMsy4xsh2wj3HSERIyYi12J+jt2rle2RrNoEhIy eDG0/TxObkCvlaaB9h4VgyTOHvgPGe3Ml+s91PyKNfOh05bfOrWbBp/DExiTIhfbqUYH WKz8OQ63Ie6OXJiCTp58IuRCb6J4hoxQl1YOeUyxPr0vXZRAkt0p0Eo31MyqTMqy79Ej 9wf6IIet7J0T8Bewt3DTHFXDi1/2Txtxr79BueKBY9D+b6o0oBr3M0prBC9UwD9vNQVs ueI/LJWZA4sORB0U4x/XIP44f0180iRDA1JUUHackNDnLj55/ALdr+vUTPa0a909CEzl fQLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023258; x=1709628058; 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=GZ6f3MtsvPODeQCNs+mWuntTgICcd/owb4II9I6fwgI=; b=AHFRwpAoVptSaa4rkCvdPYPm4BPnKYSoiJtFFeBfF36A+he/O6nJ5u3jFCtsoFKasb g2yXNCuS651hSLg9u6/QQRKH5oYDAl0gos8diaxBW3x13oUEXEBMcEZuhszweuhQse8r PQ8qbmk+aUkqzHwn83/Inj3imiU5TN/Taakl8MrBhuX0rdajswpP2pLOg+NVXrGObGkH QRo/3aFQg365W33ZhkVXX/rBD5v+a9sMakF2trDrvRNf7+KEIIk+nUAIcEN3ktCjIdOF 3MfgfYKjoFV8W5DLLL14TGs6vvYBv+9cTE6tDmc9bqOATBSoM5EE6TmLfOiQ6ebxiwKk 6XFg== X-Gm-Message-State: AOJu0YyAdBabvCzXjNZlGuXeIYQoqgI5xEsHqHtFDOKo8IyzJDffX2eB pH304qkKXkYlp5u7Ux7mz71lr6Sy/6Z2lFRZu36mYe6ZtcAEymTYuSsTa7mWq11H1pjkURUZXDH d X-Google-Smtp-Source: AGHT+IFFM8SM3fW0I3GKRBmlwgZ3Qzdxdyjlv9vG3FxOdWLCg9KqaWDo1yE3op+x5xE1oXXCw8yYGw== X-Received: by 2002:a17:906:54b:b0:a43:77c6:e3f3 with SMTP id k11-20020a170906054b00b00a4377c6e3f3mr2397043eja.17.1709023258286; Tue, 27 Feb 2024 00:40:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , BALATON Zoltan Subject: [PULL 11/30] hw/ppc/sam460ex: do not use usb_bus_find() Date: Tue, 27 Feb 2024 09:39:27 +0100 Message-ID: <20240227083948.5427-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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=philmd@linaro.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023595912100001 From: Paolo Bonzini usb_bus_find() is always used with argument -1; it can be replaced with a search of the single USB bus on the machine. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Message-ID: <20240223124406.234509-3-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/ppc/sam460ex.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index a28498f39c..7e34b6c5e0 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -274,6 +274,7 @@ static void sam460ex_init(MachineState *machine) DeviceState *uic[4]; int i; PCIBus *pci_bus; + USBBus *usb_bus; PowerPCCPU *cpu; CPUPPCState *env; I2CBus *i2c; @@ -421,8 +422,10 @@ static void sam460ex_init(MachineState *machine) sysbus_realize_and_unref(sbdev, &error_fatal); sysbus_mmio_map(sbdev, 0, 0x4bffd0000); sysbus_connect_irq(sbdev, 0, qdev_get_gpio_in(uic[2], 30)); - usb_create_simple(usb_bus_find(-1), "usb-kbd"); - usb_create_simple(usb_bus_find(-1), "usb-mouse"); + usb_bus =3D USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS, + &error_abort)); + usb_create_simple(usb_bus, "usb-kbd"); + usb_create_simple(usb_bus, "usb-mouse"); =20 /* PCIe buses */ dev =3D qdev_new(TYPE_PPC460EX_PCIE_HOST); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023323; cv=none; d=zohomail.com; s=zohoarc; b=iI1h7Eyf8fouQAxKZVQ9qVJQE0asNGntXN9nvqapkPWjzpg2ox1I9yTFqmQvzZ+bE+kRRB+qxFzLM2rLztaS5OxDcFUza/ffp/ZuDX0ad9+wzkdJ/OUq4rTBXi+QrSUMdIorZPE694nMUUk7R1S5GI37TrVrJp6ti/5+LyBmmqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023323; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rHGNJ1XUlxhgdMpKga7hKHkmc9UPr7ny3TDpRoUFz4k=; b=fPjGTix3JV0A+tGa7a76q7x3WOQXFQZRh/YnSXio7E5MJ5anF/5z33GqRZcLRDoLej9p5osg60u9FUyxroIPNvXSP7xwrGjXnlBIdGphNncCu/XfsDwm7v/PTzMNaKC0VnHCashQ7nbbb0S+1K9Q12k8qwY7iP6OoWdOA1u1tdA= 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 1709023323723952.9405234249671; Tue, 27 Feb 2024 00:42:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret1o-0007Wt-9h; Tue, 27 Feb 2024 03:41:35 -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 1ret1X-0007Pq-OD for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:18 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1P-0007xX-HV for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:12 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a3e72ec566aso505139666b.2 for ; Tue, 27 Feb 2024 00:41:06 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id lt16-20020a170906fa9000b00a3d99415705sm538091ejb.73.2024.02.27.00.41.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023264; x=1709628064; 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=rHGNJ1XUlxhgdMpKga7hKHkmc9UPr7ny3TDpRoUFz4k=; b=ScGUZdQ+xhNJsXb9uZijJaVK7ZxRWmkvdWfUa5hpz5lg8ELpZqoI9pSpqp+tX2qkko 0zUx8vv7IxOkCCLgmb6qYCcYvi5ge+roO+vZL9+oqspwXJ4doWXmLT59tdvts9v8OdrT mwXj1ymQxs1UQ/Clqfohsfz/9fDIdwVN4Sd48JFe7r/938fE6wwgQMur21XAmsHRj1EN escNXI0nlBDnM5G2TX0r5Uhd/8KdI9uuakmey+TGtLQ8uCHKevBeMB/Q/sPiXLRhfruv I4EHrUSXkfcHheJiLoxH7KhqlLvOgtAwJyLw5dPbLayt2k6NkO60neVZZK24IlP3WhaP lYrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023264; x=1709628064; 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=rHGNJ1XUlxhgdMpKga7hKHkmc9UPr7ny3TDpRoUFz4k=; b=ScL5gXsUnWM/k1VJrgQ4D7YZXs/FGo7qMwRZpuWxwZ+WK0lUdVjCCvOFSCN+cWUKxj BPaDz3Ujgnz0B7YqIHYD09Clq797jElWsr9xMmmMtWWkAEVofS33XDqyIctjqHrRwxV/ S73kpsWRgD+X+QCZOhlDf0UFhGe1ha7WL+esSDMIyK1R7yfkKPUHjTKV9YR6ltwXLNht pBD5TbJkTKGKbJeXrWB7DflNgz5WzymgQePtTo1i1vNLt3RBTLQbnepOSD7+zq0QnYVS fLW2ZM3YSfHBYrRFZ37PuGpJm3WjAdiL8AcMduSGwNTyWyQKQbRV6tH4Z/7Nuhz29fwC s4zQ== X-Gm-Message-State: AOJu0Yw+Y2phVNl2jZCdAvP3CjeWm7etH1APKwT91XHPy0CembzT70Gq 6TDcvcHpJMZN9WSjU4EXavc7pr2E0fk8VWEK/VEEZdvK/sHfyoqNEWNXvWkW0WwPtmacewcnsrD 7 X-Google-Smtp-Source: AGHT+IG6YZ+TarG1eefUcbisnXuu9W8bdUaNMxsC3j10s6+mgL1Rx0WQC/S8yHTKAB81PRbS/Je+NA== X-Received: by 2002:a17:906:7f89:b0:a43:5840:b8ac with SMTP id f9-20020a1709067f8900b00a435840b8acmr2968766ejr.42.1709023264502; Tue, 27 Feb 2024 00:41:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Yoshinori Sato , Magnus Damm Subject: [PULL 12/30] hw/sh4/r2d: do not use usb_bus_find() Date: Tue, 27 Feb 2024 09:39:28 +0100 Message-ID: <20240227083948.5427-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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=philmd@linaro.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023323974100009 From: Paolo Bonzini usb_bus_find() is always used with argument -1; it can be replaced with a search of the single USB bus on the machine. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Message-ID: <20240223124406.234509-4-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/sh4/r2d.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index c73e8f49b8..e5ac6751bd 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -244,6 +244,7 @@ static void r2d_init(MachineState *machine) SysBusDevice *busdev; MemoryRegion *address_space_mem =3D get_system_memory(); PCIBus *pci_bus; + USBBus *usb_bus; =20 cpu =3D SUPERH_CPU(cpu_create(machine->cpu_type)); env =3D &cpu->env; @@ -312,7 +313,9 @@ static void r2d_init(MachineState *machine) pci_init_nic_devices(pci_bus, mc->default_nic); =20 /* USB keyboard */ - usb_create_simple(usb_bus_find(-1), "usb-kbd"); + usb_bus =3D USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS, + &error_abort)); + usb_create_simple(usb_bus, "usb-kbd"); =20 /* Todo: register on board registers */ memset(&boot_params, 0, sizeof(boot_params)); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023523; cv=none; d=zohomail.com; s=zohoarc; b=KeJ+F0QvbCgRFTL5PkhJxJAeU3krAPE5VfO0Rf4xWEZ1NtjNsKv6G9SqFHzTIUqcT4TNfEqAOkQ+0rBh7Ii0K8EGQH1FKAUaHEPLQAwN674USZUCxLQ7EyqSH3FFF4pZIpZhHnX3G4gOoWnb5zvIGHAobI2e3/ZOrVBLlohCaPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023523; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZLHfM0e3DYucUBGQJ+x+1h4RF1QPnXlDRfnIizT5lrk=; b=IQjEF8QdsRDzpqKxmwaOk7pUdERGuzgwkvAWKwhMFP5gIjBmsMJqA59WguwXSTbEuCTVjhyxvJxe+NP1GQ/bFsxV8TIB154td02IeBkglf65VJ86B5KWNUDA6ujRzUB7p1GeC2SD4Ab3YMJseVNN9qoQnQuF2QaSmM4FUhSk61Y= 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 1709023523833750.0698272588678; Tue, 27 Feb 2024 00:45:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret21-0007u4-IK; Tue, 27 Feb 2024 03:41:47 -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 1ret1c-0007U2-R0 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:21 -0500 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1X-0007yj-HG for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:19 -0500 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2d21cdbc85bso62627591fa.2 for ; Tue, 27 Feb 2024 00:41:12 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id s23-20020a2e81d7000000b002d29faf0466sm106051ljg.104.2024.02.27.00.41.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023271; x=1709628071; 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=ZLHfM0e3DYucUBGQJ+x+1h4RF1QPnXlDRfnIizT5lrk=; b=y+f9hwJzX+n2Lg28oMAbyj+MKGZD5ToNb95fsT6Loz5OZod9gfoKn7tQWf/WQAgw// CO6LvhBtTuv23iZI1MJPEUYczT66Ym7bGTncFr+G/TBcJUst2yzQJt3qVA+9xd/T2GRH vOUDGfar+85ADxnLmDTA95ITbQaPc8B56equQLrDXtE2N1oI0Q1aQFkVH9Fy5pyvgBdX tvA8kHK15D4PY1VxUMpbbNPKAdg5GI92mC/Nr1XKsKvoy/eeEMeEn9bFMxVQvUAISF7Z wuYo/oIBU82XbtGNldbhaWQlghnaKcjBqQYq40zteHVM+rKBKxnp4+f2ixYT0iS/WY59 S7zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023271; x=1709628071; 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=ZLHfM0e3DYucUBGQJ+x+1h4RF1QPnXlDRfnIizT5lrk=; b=RfMthKOsdjQMgcWj7QZwgg0NEGPDuc0uYCRW0KuEw0Qd3A/pxJcd1E+2e5B/YZ9042 TNkBLb3i1+z24XDWn6owxT7aitwAMuYOk4Qr1PPj2qpXOVGhRxOUsgZcWryfjuSATTtL g8f9jCRtIel2lhW2jaZZgCXKSwGh5nEvLlbsLWXUBxIcfLS9YGs3Ee9EsXi+1bsHdBqD Rz3OSy7q6Tj+fahRO0I9j7EHT+wWGR+qqXW5fMc/cmMr7xodE557cn4YcR9QzPwMDlcD doBilUskT0QQREblmjCfYg3F+TYYYsqxef5XMXu6hHTEpSMV3CcqIp9RW4Qxj5gYqWVc NXmg== X-Gm-Message-State: AOJu0Yy2OxPUcq65gcfXl17pv3TeUTBsRJp18nAn3fGL5uIFgoJFfgo3 IIs2D5QF5zqfKnlVvzbmwPvj5rUNdfwAmTVVf2sWNTA3hg5dhEl/ScrW8BM7G4RpOD10kU31caY h X-Google-Smtp-Source: AGHT+IGtyeEMCP0NS/yqy4ixkdyjU3NN1AxwsEFgT2vXa2DCiu4YYjC9N2Bp854rnk/rPTx01EVi8g== X-Received: by 2002:a2e:9547:0:b0:2d0:f258:df02 with SMTP id t7-20020a2e9547000000b002d0f258df02mr4874682ljh.51.1709023271120; Tue, 27 Feb 2024 00:41:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PULL 13/30] hw/mips/loongson3_virt: do not require CONFIG_USB Date: Tue, 27 Feb 2024 09:39:29 +0100 Message-ID: <20240227083948.5427-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023525787100003 From: Paolo Bonzini Once the Kconfig for hw/mips is cleaned up, it will be possible to build a binary that does not include any USB host controller and therefore that does not include the code guarded by CONFIG_USB. While the simpler creation functions such as usb_create_simple can be inlined, this is not true of usb_bus_find(). Remove it, replacing it with a search of the single USB bus created by loongson3_virt_devices_init(). Signed-off-by: Paolo Bonzini Message-ID: <20240223124406.234509-5-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/mips/loongson3_virt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index caedde2df0..b10a611a98 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -446,9 +446,13 @@ static inline void loongson3_virt_devices_init(Machine= State *machine, pci_vga_init(pci_bus); =20 if (defaults_enabled() && object_class_by_name("pci-ohci")) { + USBBus *usb_bus; + pci_create_simple(pci_bus, -1, "pci-ohci"); - usb_create_simple(usb_bus_find(-1), "usb-kbd"); - usb_create_simple(usb_bus_find(-1), "usb-tablet"); + usb_bus =3D USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS, + &error_abort)); + usb_create_simple(usb_bus, "usb-kbd"); + usb_create_simple(usb_bus, "usb-tablet"); } =20 pci_init_nic_devices(pci_bus, mc->default_nic); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023748; cv=none; d=zohomail.com; s=zohoarc; b=dJxForv+5U4zjSArDOaEslso6iRmkDrigpTPWxKtDSgea9FN5Db3LooYE7fNjizj3Lq/ongGruVUrQoKCbqaPehxDYnfrBK+vvh0IPGnR0+kkUuDOlIIG0uIO0LCi66zYl8r3bNlF1mYoXUr1YssJeyKd7R6DHoQC/v2tB3rsn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023748; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PlYoLDbUbjomSEd23m1u/ajnPye5YRTUfebEkIuJSY0=; b=N/BNojLXsqGsht3lqW4jzRg8qAyKqRZixYudGgiTJGA3sXfEIJJw2b9UErfFFsTgeIUeu1o2HiejUwWvOmS0uZmNcC8j1mygz3BYTBmWw9G4/ysWSOOdA4+uar24j4ti5b0jZ9n43hOtHsMSx/qtTkmIB4Dg4dVr7OkmZkEXLTo= 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 1709023748219534.8623693778309; Tue, 27 Feb 2024 00:49:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret28-0008QX-8Y; Tue, 27 Feb 2024 03:41:52 -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 1ret1k-0007dT-PP for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:32 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1c-000809-30 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:28 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-512a65cd2c7so5549014e87.0 for ; Tue, 27 Feb 2024 00:41:19 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id j5-20020a19f505000000b00512daaef13bsm1109312lfb.102.2024.02.27.00.41.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023278; x=1709628078; 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=PlYoLDbUbjomSEd23m1u/ajnPye5YRTUfebEkIuJSY0=; b=bXMBlr8Pfz8cayLou3WQFdkwZJ17kFeaYYSjO0S8lDZjMCsRfacf0BFVl8hlj9dfGw ABIbgR1KLM2y0TcQ78rE/yE3DlpH/7Ml79Exh3EygiLWypMbxx6ffz98OfFEbztWiRfl lzECAWN7YS/+WFUeBYKamNmTNSvEoagSZgYi04eSE084SwliIerRuOO11kZWXvbU2huN qPaCbsIMq3GLXXwOXng1VbeBcU6JqMxhgESfXgV8BgMiqqPtP4HBczx05VYSNWGYdo/+ WwIgn6A91b0LsQSRgWrI4QSfgfIFp871Rf2cKOe5la5Z6MG2f72DRiciI9P42ApM75q7 JzuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023278; x=1709628078; 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=PlYoLDbUbjomSEd23m1u/ajnPye5YRTUfebEkIuJSY0=; b=A1nIE4Qjb84Wk9rcCo7TeGih1n8Ou5PnhMpM2ATgiSTV/gCQIAL09k5ymFyGT3y2GH T5fPpR2EjO2yfSVVgqEnyfvp7eLdu5QpKrEdZJG+1iVi9vxx71BftavhVDxTQDN6GpKw mJAXQLP7alteB15bLtWTuhJJb7h/A4E2Hn8YD6jJ09HTgWje73XjoGfmY85tGqgoeE5T OXZ+FXtc+igljZLbC9bsjzRFLLbYbLwoGA5rSZJUykJqIxwBY1zG3UxJ40yXOiYzrabT Lwm2u3bba0/NKDJSe8eeQQWxB9sOEUET+qvTAYXVfYnaYm1TLFKtJqqzjUhals70b0KT NDZg== X-Gm-Message-State: AOJu0Yx1uClYa1YAWu6umBL123UMzgnipiSwA2dGsPUztRGBDg18s+ht mr5mBzDRuXxbxY9VhZiENroufSsC2YJxetrZk0goB1bgiLXVdDhpHjvk/Q6EVFlZTIr8FGsqfXR C X-Google-Smtp-Source: AGHT+IGLLOYV3D+5HRrVOa/za+fkZoPSCpx6sl0EAkvOP6CREgkO1DSGwEFeHXF2vqjzYbeDmin7oA== X-Received: by 2002:ac2:58d9:0:b0:512:febe:ab20 with SMTP id u25-20020ac258d9000000b00512febeab20mr2406231lfo.17.1709023277754; Tue, 27 Feb 2024 00:41:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller Subject: [PULL 14/30] hw/hppa: do not require CONFIG_USB Date: Tue, 27 Feb 2024 09:39:30 +0100 Message-ID: <20240227083948.5427-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023750372100003 From: Paolo Bonzini With --without-default-devices it is possible to build a binary that does not include any USB host controller and therefore that does not include the code guarded by CONFIG_USB. While the simpler creation functions such as usb_create_simple can be inlined, this is not true of usb_bus_find(). Remove it, replacing it with a search of the single USB bus on the machine. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-6-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/hppa/machine.c | 10 +++++++--- hw/hppa/Kconfig | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 5fcaf5884b..37ee6387e0 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -396,10 +396,14 @@ static void machine_HP_common_init_tail(MachineState = *machine, PCIBus *pci_bus, } =20 /* create USB OHCI controller for USB keyboard & mouse on Astro machin= es */ - if (!lasi_dev && machine->enable_graphics) { + if (!lasi_dev && machine->enable_graphics && defaults_enabled()) { + USBBus *usb_bus; + pci_create_simple(pci_bus, -1, "pci-ohci"); - usb_create_simple(usb_bus_find(-1), "usb-kbd"); - usb_create_simple(usb_bus_find(-1), "usb-mouse"); + usb_bus =3D USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS, + &error_abort)); + usb_create_simple(usb_bus, "usb-kbd"); + usb_create_simple(usb_bus, "usb-mouse"); } =20 /* register power switch emulation */ diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig index dff5df7f72..ee7ffd2bfb 100644 --- a/hw/hppa/Kconfig +++ b/hw/hppa/Kconfig @@ -2,6 +2,7 @@ config HPPA_B160L bool imply PCI_DEVICES imply E1000_PCI + imply USB_OHCI_PCI imply VIRTIO_VGA select ASTRO select DINO @@ -17,4 +18,3 @@ config HPPA_B160L select LASIPS2 select PARALLEL select ARTIST - select USB_OHCI_PCI --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023328; cv=none; d=zohomail.com; s=zohoarc; b=KAyG49+qauvcRJQ9vU/qHebeFxPPRgY3W64f2pi0j0b8FJ1WaOiBpAiD4pqEZFRPH2wvAecV/LMMQUieLRKvqqLedVZBQms3xolBS0jz+qXMCwqX4+3vJSuB2pEF36onSZlPvwlCP4NRRM8UHujSWBojfuDAh6IlNO0KYW8snjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023328; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zrAS4uF/4VkX4b6o0R6cH2vfMrmpv4t1vXliE0xdsAk=; b=nIN5U7i912QY2xCPiqMkXcbkhakvQIwA/z4xpeXGhL6JxSEJCRHb0khAQmG0CZc2y2s5r3hDGi612n2afN8PmSNHCH810W6f/NnsNsospptsqberTPTljnv54w7J50orEQf/Wf2CJ0Molgvs8H91WPQnVRTm1VZtAYNkeU8+zNk= 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 1709023328328692.3301870914622; Tue, 27 Feb 2024 00:42:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2F-0000SH-Fy; Tue, 27 Feb 2024 03:41: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 1ret23-00084N-AR for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:47 -0500 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1j-00084N-Qc for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:46 -0500 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-512cc3ea7a5so4084887e87.3 for ; Tue, 27 Feb 2024 00:41:25 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id o26-20020ac25b9a000000b00512e1361dacsm1112097lfn.299.2024.02.27.00.41.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023284; x=1709628084; 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=zrAS4uF/4VkX4b6o0R6cH2vfMrmpv4t1vXliE0xdsAk=; b=FaKhxFRvxohk1iXNJNWrC7T4XESLVOkiWWkvtOqwNvX3hVJXkD0p2SPGSBZa0mBTH4 7lxorQMUKqRwN7fccSoVbxHnFcj2P6PRBMyHORZbq5m0vsjFVVDinzSEpk6CGA28GYeO vtN5/E5HjeLN4/CJwkynnrWM9l5bP1E9lGxH8lEK8td7hMN1ZZ0oBJ6ibH0Hd9thkQ/z 2iLBW7x5Htv2E9fYBTn6ZH0uiosVZEn4qY4G1ZOInF8Hnf3CvgES7QmHlbEzizeN4ofG d2WdOy2OPttl/JIjJ9TulQJgYsxySll7HODvqad2W6vSkO2M453A6f2viZEmKNDuoh7L k1Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023284; x=1709628084; 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=zrAS4uF/4VkX4b6o0R6cH2vfMrmpv4t1vXliE0xdsAk=; b=DLl02HKqtP92iBCwzkZ0fpLfFjKhAKZ+yIYOwHehxL08LizQPN8Ujz+HyopShhMXeV pAvRaFMsQvNGATJCspkkWBOrKhRpAQ9/pndYIafgsLG52ThjvoPVb1jVybR49GlJ7qLZ mITb7lWULCr5Vo283cPx2ye6EPU/edwl0R6eSvOW27mpyHtHdRWmlnoiTXTkMwiNy4SJ 1aUZuoumXe0ci1QjBXYk7qYtQVYpxC+WfLhNs1rHy2la8WO2xtwRkQy0VxzlAdXmIhy/ IHsnHPM4i3+MwBZbrSw6RBIakZ2Rh9cDFZDXUGwsLw3PEEKPRTD6XuuitBluYX3fyUaL BGbg== X-Gm-Message-State: AOJu0YyV1lh07VEIQ/sq7PFwtGn3FVoHNyXuIZVqr7MdCRgX+mnBGb+6 A68bjMOoI5tzOxD0zo9A9mcDGqbSD8bpT6/K6U8fKvuLjR/CfuJm4sqLjppB49JcSU5YrGdKwd/ H X-Google-Smtp-Source: AGHT+IGmzA352zWrHeoC7ubRalFfI4h0DhI58g+xJw81JMNJjqMdWvZENgLJH5fbFkVqSFZBaunTwA== X-Received: by 2002:a05:6512:15a2:b0:512:ed89:7152 with SMTP id bp34-20020a05651215a200b00512ed897152mr6532027lfb.55.1709023284258; Tue, 27 Feb 2024 00:41:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland Subject: [PULL 15/30] hw/ppc/mac_newworld: do not require CONFIG_USB Date: Tue, 27 Feb 2024 09:39:31 +0100 Message-ID: <20240227083948.5427-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::129; envelope-from=philmd@linaro.org; helo=mail-lf1-x129.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023329958100001 From: Paolo Bonzini With --without-default-devices it should not be required to have devices in the binary that are removed by -nodefaults. It should be therefore possible to build a binary that does not include any USB host controller or any of the code guarded by CONFIG_USB. While the simpler creation functions such as usb_create_simple can be inlined, this is not true of usb_bus_find(). Remove it, replacing it with a search of the single USB bus on the machine. With this change, it is possible to change "select USB_OHCI_PCI" into an "imply" directive. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-7-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/ppc/mac_newworld.c | 4 +++- hw/ppc/Kconfig | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index b36dbaf2b6..3e796d2f6d 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -431,8 +431,10 @@ static void ppc_core99_init(MachineState *machine) /* U3 needs to use USB for input because Linux doesn't support via= -cuda on PPC64 */ if (!has_adb || machine_arch =3D=3D ARCH_MAC99_U3) { - USBBus *usb_bus =3D usb_bus_find(-1); + USBBus *usb_bus; =20 + usb_bus =3D USB_BUS(object_resolve_type_unambiguous(TYPE_USB_B= US, + &error_abort= )); usb_create_simple(usb_bus, "usb-kbd"); usb_create_simple(usb_bus, "usb-mouse"); } diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index a890699082..c5aeb6b3f2 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -119,13 +119,13 @@ config MAC_NEWWORLD imply PCI_DEVICES imply SUNGEM imply TEST_DEVICES + imply USB_OHCI_PCI select ADB select MACIO select MACIO_GPIO select MAC_PMU select UNIN_PCI select FW_CFG_PPC - select USB_OHCI_PCI =20 config E500 bool --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023596; cv=none; d=zohomail.com; s=zohoarc; b=O6+g3EPFLbhLlpz6EPta/wBTYnnUm9zMpTHZRRDz+nOFTRbmAA6ZfP/vdk2iIe8LXR2O6tjX30MH6gNc6chBMb5mOayAKpZHz1AewrHflYT2Nf/GqXFP2aZW1AV4Z5NJYOqEIEiS6Xseijgf/gQWKRUiE68nhNQT357UBywzRyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023596; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q16/BH7ujul6MroAh0WIw+sirhkolVXk4q/90kZo96k=; b=D6qHKY8zOwrQ77l5ePya5ky2ItCDkac0sjzS12FcVvl5pVMiM50Kbdz6R+y/L39SYmBipUfmhNGbg+HQpr8A4Q0Apog4NsmaP0g7omjQPNMNJ85zJftm0t5HK39+Gj0uLcCnxBh7X7SwEsVygHTc28jE4rSGvim5WCl1GqU2ZnY= 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 170902359645027.624398807639295; Tue, 27 Feb 2024 00:46:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2E-0000KA-7w; Tue, 27 Feb 2024 03:41: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 1ret1u-0007rx-Mz for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:41 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1s-00087y-8O for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:38 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-512d19e2cb8so5964325e87.0 for ; Tue, 27 Feb 2024 00:41:32 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id c18-20020ac24152000000b00512ab050435sm1121123lfi.100.2024.02.27.00.41.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023291; x=1709628091; 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=q16/BH7ujul6MroAh0WIw+sirhkolVXk4q/90kZo96k=; b=KTWu26fHP0wTOJh9MM66SSaXjjfeNYcssJKm9OSWZHqNZAil6Qb0M/dehxehj8c7aw 58kKBDpE2WlaB0//H9n+slMzDotrqJz3xJCRlJheSXvhU0TqfLrfsA64/FQBdcZiCC3Z VtQIII2+EsKFnQL8Xa9otpAG4xevwNyHbLDwBV7wccmZEARUbC9SHIduRBJeUCtpGKbG AoEYMg6DGVnHKD2NtKv6CelvvMCz0eAGXTg6YbcA2FjKfBm3fKfaowQtGiSON3sP9Ukx XTEdoajbemzwaBkF8bztuHcBE5P7nZ5bY0E2euu9DOYffvndwOxcx4vAKPmfyLS9ziZ1 VHzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023291; x=1709628091; 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=q16/BH7ujul6MroAh0WIw+sirhkolVXk4q/90kZo96k=; b=Ik40PbD+sj+OM1RI2RCq/2nWuNQOfPJvm27f2E3fNa1+B7FQYdcmpxYn/1khhhDhcM ymwsdoX6AkPMeTSLB+VObEUbBfgy05bKSnz0C1WgRsG2l4IvtzWu6L5s7LWeOfPi5SIm ASH6eMGEKHBi1EW3rkFwsB2CdM/3biqwMbXqdgKLRpRZTHSpsfKIDyD0dE1fBlKmE2FK wDgPoCZaTWO29jGP+G5WpFC8GsADWY0V8si/Rr65mhZHqS6d/OczQJGTmNDF8oitNtVO CoM607yPP3SBb+0fhzXToq5x3lNVP75dlzOyjrHfqNKu4l1YjoxajZr2TPolnXOXhmSQ EM5Q== X-Gm-Message-State: AOJu0Yx6oD7VXDoAmCKK04kWBwamPLGTs5k+GVe3gF1HPgPGEgtCUApQ 58Q/bBVQx6pHG8MOuIOI0D6kyik2D8qw0aCShLfxQ3q0zbnA+XmPc67h8Z2lgoq94+LSUh5CZIs P X-Google-Smtp-Source: AGHT+IHg9w67z4u/F09JeatGg8K0Tbdq/enXZAp+R6BMkqVsRN1eOvEg9paicoiW2FsUDJTkyUHQyA== X-Received: by 2002:ac2:424a:0:b0:512:8ac0:1f76 with SMTP id m10-20020ac2424a000000b005128ac01f76mr4813228lfl.66.1709023291132; Tue, 27 Feb 2024 00:41:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Harsh Prateek Bora Subject: [PULL 16/30] hw/ppc/pseries: do not require CONFIG_USB Date: Tue, 27 Feb 2024 09:39:32 +0100 Message-ID: <20240227083948.5427-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023598012100019 From: Paolo Bonzini With --without-default-devices it is possible to build a binary that does not include any USB host controller and therefore that does not include the code guarded by CONFIG_USB. While the simpler creation functions such as usb_create_simple can be inlined, this is not true of usb_bus_find(). Remove it, replacing it with a search of the single USB bus on the machine. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-8-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/ppc/spapr.c | 4 +++- hw/ppc/Kconfig | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d1c6d70d8d..55263f0815 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3024,8 +3024,10 @@ static void spapr_machine_init(MachineState *machine) } =20 if (has_vga) { - USBBus *usb_bus =3D usb_bus_find(-1); + USBBus *usb_bus; =20 + usb_bus =3D USB_BUS(object_resolve_type_unambiguous(TYPE_USB_B= US, + &error_abort= )); usb_create_simple(usb_bus, "usb-kbd"); usb_create_simple(usb_bus, "usb-mouse"); } diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index c5aeb6b3f2..b664d0eb37 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -1,5 +1,6 @@ config PSERIES bool + imply USB_OHCI_PCI imply PCI_DEVICES imply TEST_DEVICES imply VIRTIO_VGA --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023595; cv=none; d=zohomail.com; s=zohoarc; b=FKS2ReMW6cm3VZS+LD3yvISOQw/S0is8+9q2wbdRmLI9nG5ku+cSiuF65CENRDS5AhAtXtyeUY84VYj1pwYMMly1J+Hk63QVSwPENcyVGnVSW7qKgZcPTDCIi2Y3Av+TWOLQaOeShs2o37d18G32Xr2SEObCyCPDxSYkKcmNsqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023595; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; b=MuYJL37HJi3EIlRNlB0qcrLcU7NDaNQg+PPG00EfHHPpLUlYjt8xd/A6WX7bOccP3iFrah79Ai3gVTsNSvrH2tbB6nwULZ2xsTDqno7tCfjSClUrMEeW2j+d6AT5Fp2rOMlkjPwc2VzX16o4pUUPOllHsJ+ANQtIlQyo0CIbbIo= 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 1709023595318291.7467218002796; Tue, 27 Feb 2024 00:46:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2H-0000j2-Ma; Tue, 27 Feb 2024 03:42:01 -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 1ret1x-0007u6-KN for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:43 -0500 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1w-0008AR-0R for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:41 -0500 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2d220e39907so63255661fa.1 for ; Tue, 27 Feb 2024 00:41:39 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id n1-20020a2e82c1000000b002d236114533sm1162859ljh.75.2024.02.27.00.41.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023297; x=1709628097; 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=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; b=rcJligoQblwAJ4JCuYj7ylTS9+N3IYln4qB/Be9hSHJGr8Na6JAqdv8q1MBbLHKePm UXarjKcg70IsR1k25gI19UVIUG2Q9GA3/zcVNTI3K8nS2FT+eSNHfezttGMqos1IoNqi U8J09SlkTtSXxqiHInisBATNsaX7J8yWC9vpSpEKtW19xgswqGiAL+1Zl4vHJooO1/72 wJ/zoGrvKZLA5JXeF24aDgE8Vm/M0yPYabPx8kJloQY0krQvhWC9Ix2yOTuL7FBWtjW/ qgDa3UBlrj3H56xN3N+NraT9wUyFFWFp9pAZMu4xxkBdGRnrTaHpPrzNMBOFLkE9afNE WHew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023297; x=1709628097; 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=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; b=X8ORfNwXY4oQtrDy7bJYP0EUN9YMbC4fCmGusm/wcRB4RPmKSgPOqsqepv2yHUBqj0 5CAlHDsbUl5uWFExK5qBByjV93eZ5qhIQIR7Ar2MqH38N+7ZO6dqZqyvfS3ilJ4tL/4Q cptQk3mky+WXWhK/7X5g6rbu51rI5yoc5H/4w6qCArYFUBtl+OqtWfSJev2P/hll7aWV BChFlzCX7wycTyJ7IPuvbWr+pB1KNJYtPCJrwJ/+hbtzXH1lp6s7loUj7O3p7KJHjmJF 1XcxxMM796Rb0G79MvtNyudQ/kYivMjDtb1KQfABz/h1MSTwXsdtyHycTwTBDnusZWPf 4omA== X-Gm-Message-State: AOJu0YzxzBHiDPGz6Mec+PnNiAD4JumONGYlOimoMnj8muDWAMzirknw Ni7OGyt2EvcA09qPgtAUcfiXKzpafeXtWB0n5VcfIr/P2dAwppfVB8PVHUnLjw40nJ29b01ldWo J X-Google-Smtp-Source: AGHT+IFcaDayJbT4H+1fH7SfXNgHNb226cHPP5331/6xu5QjiH4t6uJV5SqFwlEyBu/IKD0duQzz6w== X-Received: by 2002:a2e:8784:0:b0:2d2:3c10:4b6c with SMTP id n4-20020a2e8784000000b002d23c104b6cmr5534555lji.24.1709023297560; Tue, 27 Feb 2024 00:41:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PULL 17/30] hw/usb: remove usb_bus_find Date: Tue, 27 Feb 2024 09:39:33 +0100 Message-ID: <20240227083948.5427-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023595913100002 From: Paolo Bonzini Inline the sole remaining use, which is for the -usbdevice command line. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-9-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/hw/usb.h | 1 - hw/usb/bus.c | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index cfeead2840..d46d96779a 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -498,7 +498,6 @@ struct USBBusOps { void usb_bus_new(USBBus *bus, size_t bus_size, USBBusOps *ops, DeviceState *host); void usb_bus_release(USBBus *bus); -USBBus *usb_bus_find(int busnr); void usb_legacy_register(const char *typename, const char *usbdevice_name, USBDevice *(*usbdevice_init)(void)); USBDevice *usbdevice_create(const char *cmdline); diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 76fda41b7e..796769fadb 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -100,19 +100,6 @@ void usb_bus_release(USBBus *bus) QTAILQ_REMOVE(&busses, bus, next); } =20 -USBBus *usb_bus_find(int busnr) -{ - USBBus *bus; - - if (-1 =3D=3D busnr) - return QTAILQ_FIRST(&busses); - QTAILQ_FOREACH(bus, &busses, next) { - if (bus->busnr =3D=3D busnr) - return bus; - } - return NULL; -} - static void usb_device_realize(USBDevice *dev, Error **errp) { USBDeviceClass *klass =3D USB_DEVICE_GET_CLASS(dev); @@ -643,7 +630,7 @@ HumanReadableText *qmp_x_query_usb(Error **errp) /* handle legacy -usbdevice cmd line option */ USBDevice *usbdevice_create(const char *driver) { - USBBus *bus =3D usb_bus_find(-1 /* any */); + USBBus *bus =3D QTAILQ_FIRST(&busses); LegacyUSBFactory *f =3D NULL; Error *err =3D NULL; GSList *i; --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023372; cv=none; d=zohomail.com; s=zohoarc; b=Q9G2BICZqe4t+sBWHnQiHBztxoVFaLPYFpNv83APoHthC+DJfq16h3d0ioeH7hC1oKBJmrMGjjXa9j+heRjfd6JFpRv8JMCYYlixEEfb6cnr4PXMQtUzp7lmkHWAOzRDkdU/hmTsOtNElP9QVsMnisEaxUaGJJkIKB6a/+oA3Q8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023372; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lmW74QYufIRbTKyOkpXlvcTJBN9wQd/cfaQmVuqVO8w=; b=UzGI4sy3cnrAdZ/tavXFvGB5uwm9poBJa3Xyg6uBi3/iK53Sx4DyKytmLME7C1PSVC6H9PukvXUq5JgtM0dENhI2ABxGCaHcIKXqepyZzj598P1U6/w4KxyGEzCraN7J/TXIGERd8xIoBwdAB2L10AXRIx+/gbbPzjpnTR8psjU= 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 1709023372562548.2592400089159; Tue, 27 Feb 2024 00:42:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2J-0000x4-1T; Tue, 27 Feb 2024 03:42: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 1ret25-00087Q-9n for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:49 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret23-0008CH-2n for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:49 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a26fa294e56so677401966b.0 for ; Tue, 27 Feb 2024 00:41:45 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id hu21-20020a170907a09500b00a42eb167492sm533512ejc.116.2024.02.27.00.41.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023304; x=1709628104; 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=lmW74QYufIRbTKyOkpXlvcTJBN9wQd/cfaQmVuqVO8w=; b=I2KHydPuyiDM6fM3+0GlkaBrRMuaSISIJAlZDkuPnrnTmdRXUbzPXQA1h/RxqqZQJz rh+Wsy0lXIFONeSjNAMNg/04Re7Ac9KHu0JqgSj3ojYA91Rvra05PETC4Urnhe2Lnq8I drmB0nubCZkn5JhzgaapC5Wgf9e7Le0yCnCFu5fa8XiiWAe5+t6K3B8UEpH+BGE3hIvx DeWbdMHSGrpgjW0EgsA35vveTTZDlz2jriifQCsGUadmL0FFJChmxn3twfmMX3TKAr/S StvF/uvlE7qtzHp3Qnf0eEG9gTmG6zp1aSSi7NB8TprOswjSMUQL7naf3P/r1qSzEJ3X MESg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023304; x=1709628104; 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=lmW74QYufIRbTKyOkpXlvcTJBN9wQd/cfaQmVuqVO8w=; b=nZerJEbv+41Rbrl6teEtNNPEQIsfwtycWXzH8XPVW46wFS6oMCq8oy3PlbSWjgCCOB l6VMxeG733rifq8KlA97L8+Sj3S8ActkE3U+G7hQ1H1K5Noz8TGp4fxowE1H8vbVZ3w3 YR/KEdw1j4mExhQwSBAimKUAPlMzgjq9xUSCQ4EHcaEBawIRJ4ClRcY1t+uJAHlmYTJN KTsnfkj23N5KEK1EUHRLqCEXxxhTFP8x/AwhDaFDFCnVWOL+eU8GBCjO9ptBOfMgDta1 21tVbkwNK+pnVQuDFehzu1zkE2psBvhjEJbEA51j8kfoGf9tChu1a3KgPCsg599MZ4Pa AQjQ== X-Gm-Message-State: AOJu0YxbAWqpdOKrN/VTGK6sSSHxSahoZGFldsJ1lu3dnk1+ZACPpQ6T NYSwrTiKx/zo+C65xwGLWZwp1P0nmH1cOZeHUioMzq9atdJ3ddnjJOfe8wcmQLNHvvga6AlgaAG E X-Google-Smtp-Source: AGHT+IGW2atA/0oZ9Y6sWIYT32s6NIwjOB+0oCtJkLON++dGoRwR6OPmF/rlchLN4wITbFs0LFv8lA== X-Received: by 2002:a17:906:796:b0:a3f:5c5c:33ac with SMTP id l22-20020a170906079600b00a3f5c5c33acmr7194711ejc.62.1709023304289; Tue, 27 Feb 2024 00:41:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Yoshinori Sato , Gerd Hoffmann Subject: [PULL 18/30] hw/usb: extract sysbus-ohci to a separate file Date: Tue, 27 Feb 2024 09:39:34 +0100 Message-ID: <20240227083948.5427-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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=philmd@linaro.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023374070100004 From: Paolo Bonzini Split the sysbus version to a separate file so that it is not included in PCI-only machines, and adjust Kconfig for machines that do need sysbus-ohci. The copyrights are based on the time and employer of balrog and Paul Brook's contributions. While adjusting the SM501 dependency, move it to the right place instead of keeping it in the R4D machine. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-10-pbonzini@redhat.com> [PMD: Rename some functions using 'ohci_sysbus_' prefix] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/usb/hcd-ohci-sysbus.c | 88 ++++++++++++++++++++++++++++++++++++++++ hw/usb/hcd-ohci.c | 58 -------------------------- hw/arm/Kconfig | 12 +++--- hw/display/Kconfig | 1 + hw/ppc/Kconfig | 2 +- hw/sh4/Kconfig | 1 - hw/usb/Kconfig | 4 ++ hw/usb/meson.build | 1 + 8 files changed, 102 insertions(+), 65 deletions(-) create mode 100644 hw/usb/hcd-ohci-sysbus.c diff --git a/hw/usb/hcd-ohci-sysbus.c b/hw/usb/hcd-ohci-sysbus.c new file mode 100644 index 0000000000..6fba7f50f8 --- /dev/null +++ b/hw/usb/hcd-ohci-sysbus.c @@ -0,0 +1,88 @@ +/* + * QEMU USB OHCI Emulation + * Copyright (c) 2006 Openedhand Ltd. + * Copyright (c) 2010 CodeSourcery + * Copyright (c) 2024 Red Hat, Inc. + * + * 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 "hw/irq.h" +#include "qapi/error.h" +#include "qemu/module.h" +#include "qemu/timer.h" +#include "hw/usb.h" +#include "migration/vmstate.h" +#include "hw/sysbus.h" +#include "hw/qdev-dma.h" +#include "hw/qdev-properties.h" +#include "trace.h" +#include "hcd-ohci.h" + + +static void ohci_sysbus_realize(DeviceState *dev, Error **errp) +{ + OHCISysBusState *s =3D SYSBUS_OHCI(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); + Error *err =3D NULL; + + usb_ohci_init(&s->ohci, dev, s->num_ports, s->dma_offset, + s->masterbus, s->firstport, + &address_space_memory, ohci_sysbus_die, &err); + if (err) { + error_propagate(errp, err); + return; + } + sysbus_init_irq(sbd, &s->ohci.irq); + sysbus_init_mmio(sbd, &s->ohci.mem); +} + +static void ohci_sysbus_reset(DeviceState *dev) +{ + OHCISysBusState *s =3D SYSBUS_OHCI(dev); + OHCIState *ohci =3D &s->ohci; + + ohci_hard_reset(ohci); +} + +static Property ohci_sysbus_properties[] =3D { + DEFINE_PROP_STRING("masterbus", OHCISysBusState, masterbus), + DEFINE_PROP_UINT32("num-ports", OHCISysBusState, num_ports, 3), + DEFINE_PROP_UINT32("firstport", OHCISysBusState, firstport, 0), + DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 0), + DEFINE_PROP_END_OF_LIST(), +}; + +static void ohci_sysbus_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->realize =3D ohci_sysbus_realize; + set_bit(DEVICE_CATEGORY_USB, dc->categories); + dc->desc =3D "OHCI USB Controller"; + device_class_set_props(dc, ohci_sysbus_properties); + dc->reset =3D ohci_sysbus_reset; +} + +static const TypeInfo ohci_sysbus_types[] =3D { + { + .name =3D TYPE_SYSBUS_OHCI, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(OHCISysBusState), + .class_init =3D ohci_sysbus_class_init, + }, +}; + +DEFINE_TYPES(ohci_sysbus_types); diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index d73b53f33c..fc8fc91a1d 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1955,31 +1955,6 @@ void ohci_sysbus_die(struct OHCIState *ohci) ohci_bus_stop(ohci); } =20 -static void ohci_realize_pxa(DeviceState *dev, Error **errp) -{ - OHCISysBusState *s =3D SYSBUS_OHCI(dev); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - Error *err =3D NULL; - - usb_ohci_init(&s->ohci, dev, s->num_ports, s->dma_offset, - s->masterbus, s->firstport, - &address_space_memory, ohci_sysbus_die, &err); - if (err) { - error_propagate(errp, err); - return; - } - sysbus_init_irq(sbd, &s->ohci.irq); - sysbus_init_mmio(sbd, &s->ohci.mem); -} - -static void usb_ohci_reset_sysbus(DeviceState *dev) -{ - OHCISysBusState *s =3D SYSBUS_OHCI(dev); - OHCIState *ohci =3D &s->ohci; - - ohci_hard_reset(ohci); -} - static const VMStateDescription vmstate_ohci_state_port =3D { .name =3D "ohci-core/port", .version_id =3D 1, @@ -2054,36 +2029,3 @@ const VMStateDescription vmstate_ohci_state =3D { NULL } }; - -static Property ohci_sysbus_properties[] =3D { - DEFINE_PROP_STRING("masterbus", OHCISysBusState, masterbus), - DEFINE_PROP_UINT32("num-ports", OHCISysBusState, num_ports, 3), - DEFINE_PROP_UINT32("firstport", OHCISysBusState, firstport, 0), - DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 0), - DEFINE_PROP_END_OF_LIST(), -}; - -static void ohci_sysbus_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - - dc->realize =3D ohci_realize_pxa; - set_bit(DEVICE_CATEGORY_USB, dc->categories); - dc->desc =3D "OHCI USB Controller"; - device_class_set_props(dc, ohci_sysbus_properties); - dc->reset =3D usb_ohci_reset_sysbus; -} - -static const TypeInfo ohci_sysbus_info =3D { - .name =3D TYPE_SYSBUS_OHCI, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(OHCISysBusState), - .class_init =3D ohci_sysbus_class_init, -}; - -static void ohci_register_types(void) -{ - type_register_static(&ohci_sysbus_info); -} - -type_init(ohci_register_types) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index b372b819a4..7caebdd98e 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -185,7 +185,7 @@ config PXA2XX select SERIAL select SD select SSI - select USB_OHCI + select USB_OHCI_SYSBUS select PCMCIA =20 config GUMSTIX @@ -256,7 +256,7 @@ config REALVIEW select PL310 # cache controller select ARM_SBCON_I2C select DS1338 # I2C RTC+NVRAM - select USB_OHCI + select USB_OHCI_SYSBUS =20 config SBSA_REF bool @@ -339,7 +339,7 @@ config VERSATILE select PL080 # DMA controller select PL190 # Vector PIC select REALVIEW - select USB_OHCI + select USB_OHCI_SYSBUS =20 config VEXPRESS bool @@ -395,6 +395,7 @@ config ALLWINNER_A10 select AXP2XX_PMU select SERIAL select UNIMP + select USB_OHCI_SYSBUS =20 config ALLWINNER_H3 bool @@ -408,7 +409,7 @@ config ALLWINNER_H3 select ARM_TIMER select ARM_GIC select UNIMP - select USB_OHCI + select USB_OHCI_SYSBUS select USB_EHCI_SYSBUS select SD =20 @@ -424,7 +425,7 @@ config ALLWINNER_R40 select ARM_TIMER select ARM_GIC select UNIMP - select USB_OHCI + select USB_OHCI_SYSBUS select USB_EHCI_SYSBUS select SD =20 @@ -530,6 +531,7 @@ config NPCM7XX select SSI select UNIMP select PCA954X + select USB_OHCI_SYSBUS =20 config FSL_IMX25 bool diff --git a/hw/display/Kconfig b/hw/display/Kconfig index 1aafe1923d..07acb37dc6 100644 --- a/hw/display/Kconfig +++ b/hw/display/Kconfig @@ -77,6 +77,7 @@ config SM501 select I2C select DDC select SERIAL + select USB_OHCI_SYSBUS =20 config TCX bool diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index b664d0eb37..37ccf9cdca 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -70,7 +70,7 @@ config SAM460EX select SM501 select SMBUS_EEPROM select USB_EHCI_SYSBUS - select USB_OHCI + select USB_OHCI_SYSBUS select FDT_PPC =20 config AMIGAONE diff --git a/hw/sh4/Kconfig b/hw/sh4/Kconfig index ab733a3f76..e0c4ecd1a5 100644 --- a/hw/sh4/Kconfig +++ b/hw/sh4/Kconfig @@ -6,7 +6,6 @@ config R2D select I82378 if TEST_DEVICES select IDE_MMIO select PFLASH_CFI02 - select USB_OHCI_PCI select PCI select SM501 select SH7750 diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig index 0f486764ed..f569ed7eea 100644 --- a/hw/usb/Kconfig +++ b/hw/usb/Kconfig @@ -11,6 +11,10 @@ config USB_OHCI bool select USB =20 +config USB_OHCI_SYSBUS + bool + select USB_OHCI + config USB_OHCI_PCI bool default y if PCI_DEVICES diff --git a/hw/usb/meson.build b/hw/usb/meson.build index 2c13c52878..94f0e3b034 100644 --- a/hw/usb/meson.build +++ b/hw/usb/meson.build @@ -15,6 +15,7 @@ system_ss.add(when: 'CONFIG_USB', if_true: files( system_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c')) system_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c')) system_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'= )) +system_ss.add(when: 'CONFIG_USB_OHCI_SYSBUS', if_true: files('hcd-ohci-sys= bus.c')) system_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c')) system_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'= )) system_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c',= 'hcd-ehci-sysbus.c')) --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023356; cv=none; d=zohomail.com; s=zohoarc; b=oDalsN3J33eKrYvYaB6XdywkVCK2Fyrn0DCkeUGqa+LprC513mI7A0sLPN5rRo3CnTlmgCQgfPzn4Z/SYUefhNVlQn5m8e9l/l97Cs/gf5Lha35cepHaSqZPX6DkRFLLzzJejCtBxxkCwINbvbk/yC9mdECEOjyEUizhcUYUgOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023356; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FdunaCtONvoL0LEtBUlp2r4jkZ1zPWdyiyr1Q1lshPs=; b=ITv1CizizteWmJ+jLrnPu6kFdlXvoimZjbpeRut06ABN+uwQW23J3HDSJNIhdkqbKnpBl86CgloiErzKtNkpUjOBGGUi/eMMKnwjy6Cfint799j+qR+/C/iJdfRQwpQkKFETz3qlaN3mO91BNMtHfGVY2LKfbmVu5rp7DG2cv80= 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 1709023355995973.6142895003286; Tue, 27 Feb 2024 00:42:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2K-0001G4-UR; Tue, 27 Feb 2024 03:42:04 -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 1ret2C-0000GT-59 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:57 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret29-0008FV-7t for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:55 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-512e39226efso5409682e87.0 for ; Tue, 27 Feb 2024 00:41:52 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id x26-20020a056512079a00b0051298559337sm1108107lfr.3.2024.02.27.00.41.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023310; x=1709628110; 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=FdunaCtONvoL0LEtBUlp2r4jkZ1zPWdyiyr1Q1lshPs=; b=MZr0XQSFLNea0P2LPFz3HWQQ94aTf3KUR9r64rDzOmMEMjmyf9kTaCWugbwl70HWAZ Tm8PSRn4dYIkOY2X+nHDbyOwSiWA2os6laPiIDAWPFnYGLJYZ+Qk7ohfKrMF5TLTAPSJ 2FNiq2ld2Ze2jSjUhTh5ErEw1lG4cREC/qj8V1HEKdlraTaeLhUIC3WOjtvmXwdxNYwF It/KjDpRGS9A5jViThuXmesHtwoDqIgYVmTQ4+54dH2Dcu9cTMd9PRFfyG8UWP++ypod PNm6JvdrNlYi+rtt4+1WHurBM0fXdHT1X5jTT81eYerjvx5KGsw0b+CxUhxUrUmmQfF4 SJ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023310; x=1709628110; 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=FdunaCtONvoL0LEtBUlp2r4jkZ1zPWdyiyr1Q1lshPs=; b=YxYH/mBfjrOKQ+qq3boMYj6cK7Rysmp/DTuYkB4/lHCeVwGP5oP8ah1c5FALM2y1TL YGUwrBCYHEZiba/xEW4H0EdRBkYERrfo0VOXxb86MM+s3qlALb2EouHIrCQUtfhTXHXX rMnvTww+6wpVhlXEJz5c5Kc34ZBl1yQH6kjJEqdvXTGAVydwj40dsGTheTL+nd9cHY+i VrfHO9/HODU1yfg5f4WcggxuNOpK+vef/0WhAuBMs0IxpuwS3H8/HupG0gLRF0zqka0U LgA9V2Tyd7GhLHkyw5ag0d5YF2kPUtxQfstkrmeT04iqV+ewIKHzSpV1zueSSiWRdeTT RvHg== X-Gm-Message-State: AOJu0Yya+porP6pDgxO8mL0KQVwj0YKwZu1dsbAnst8CzqdNtdsAc0j9 0FnwcgbQu0zuBCLBfDNz6qCzHm2bISqcvNm00WxcuBqMp5BySx69DnxSidhs80uAJddn8E522ck d X-Google-Smtp-Source: AGHT+IGUh98kJH5o+ZtvmSqzuA5FPzqfYFg7iwjZ+nvpa60/ZtPKkAyaLFEtEcxbewc8UCQg4Z9pgA== X-Received: by 2002:a05:6512:3e24:b0:512:fdc7:9200 with SMTP id i36-20020a0565123e2400b00512fdc79200mr3728406lfv.11.1709023310633; Tue, 27 Feb 2024 00:41:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PULL 19/30] hw/usb: remove duplicate file in system_ss Date: Tue, 27 Feb 2024 09:39:35 +0100 Message-ID: <20240227083948.5427-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023358003100003 From: Paolo Bonzini Because USB_EHCI_SYSBUS selects USB_EHCI, there is no need to include hcd-ehci.c explicitly. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-11-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/usb/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/meson.build b/hw/usb/meson.build index 94f0e3b034..aac3bb35f2 100644 --- a/hw/usb/meson.build +++ b/hw/usb/meson.build @@ -18,7 +18,7 @@ system_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files= ('hcd-ohci-pci.c')) system_ss.add(when: 'CONFIG_USB_OHCI_SYSBUS', if_true: files('hcd-ohci-sys= bus.c')) system_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c')) system_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'= )) -system_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c',= 'hcd-ehci-sysbus.c')) +system_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci-sys= bus.c')) system_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c')) system_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c'= )) system_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sys= bus.c')) --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023606; cv=none; d=zohomail.com; s=zohoarc; b=R/iIaFdNnumudYrNIDZvw9PgcdPr4ANteyVXJ7UuknC/FDh4WnMzV/pgspZbCbrUkhA7x3QxvpNXHzvk+OubwZovAo6NPJAxBWsVKX9ypXatVd4w6ANmJmZWT3NEalUNjBCO6Gr91qieAN/vfOQhyzg3hrL06mWiA+9duCrBdn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023606; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2Yy5kHw7b+fXUkeiiZUfupvxhJnRIRkwmG0B4GAOIY0=; b=YQSEHX82ztKoFxc4bjxMwbLArsHSdYwbTfeMiS6+9PR0wbKJBnpNCVyARI0rm1fd22RduQABoMce0vCMqWth+psazDCp2OKYYKmjklvLLfGEPJXKRJmBqui9RkE7sMCqYtWQEZDa1MM1+/o1y2utNfRALkCkzaXCMdRWpSvmkds= 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 1709023606150373.69477278692375; Tue, 27 Feb 2024 00:46:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2Y-0002z7-2G; Tue, 27 Feb 2024 03:42:18 -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 1ret2V-0002br-7q for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:15 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2E-0008HF-O3 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:14 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5640fef9fa6so5196965a12.0 for ; Tue, 27 Feb 2024 00:41:58 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id u11-20020aa7db8b000000b005653f390f77sm541381edt.10.2024.02.27.00.41.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023317; x=1709628117; 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=2Yy5kHw7b+fXUkeiiZUfupvxhJnRIRkwmG0B4GAOIY0=; b=GonaCAdQfNf93rro4lzApaXfoma/f/Yw5A4oyNEFDtWcKpAYkgK1ZINyAygZOSLhAZ plj/dBbovFwz6yN1BDVm8Hh7FmWkXSnOVa1g4De5RvDF4Ocbr1y/EQRUfb5sy6qchCoS isQTtEVGygvvkgH983UOdTCFuUdVK9F02tJYJWBlYCdxv3xIfsgIx3oNqJoozeCRKSWF K6We8GpnFciPV4N7tvgCxoOmkQ8lvSF7AwHQZvFIos8EPWbfdCK2fqfZfLUNwb++/fPa 2buf+JyDtK9LgLciI6WRWO389/16lYDGGntEnGQUFrfU/s90vrdd1UpMXExTPAoW4m5E ck3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023317; x=1709628117; 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=2Yy5kHw7b+fXUkeiiZUfupvxhJnRIRkwmG0B4GAOIY0=; b=HjeuYAYo0BkirMLgrplC/MPSTRi3WPtNWZcLFus1DhwNVcrUXEC1Bq2sinDbSHkPv8 U/kjYqY8iG187RV+ANn4SD7LmH/oOTZCH+nNDFOu44NNDKLi8tXv4qfWSIRiHYUnNH6U MlUXPPPMxFC1pwuUJ5B7GWITr933RL+54HD8tFB55Ki7Jixh6FLUaPm5I4Ig/aGzMfLn 0GSJQLkJHCU9CQn/juj5Y7KsKlEMGCTGYd5gxuvLtSlixNi1NY+kalgLDHmwnCFBz4u0 MUpepTUU5pgayrc1BqaNtzXSsQH3ILO+CW9UyJIDZn5sspvC0I6LOvGpN+fqjHYirxFP jFzg== X-Gm-Message-State: AOJu0YwjninTE4/hEU1cY0d5i2qjFLBOYBW3ZX+8zTUPslh674ZpRzJZ jBJMnv4mlByeKnsoFeO8YI7N0P42tiE2D9StgsQ8q8Y1JxOYqLv+UDtryC+4e8a4G2DyK+6TCi/ 6 X-Google-Smtp-Source: AGHT+IHHc8tKw27KX8go56zhStviVqM7V4J8HDd3+0hvKaXP5YUBIaBeMMaEzZLMBiaFlruDU2OX4w== X-Received: by 2002:a05:6402:b14:b0:565:63d6:40d7 with SMTP id bm20-20020a0564020b1400b0056563d640d7mr7121911edb.5.1709023316976; Tue, 27 Feb 2024 00:41:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Klaus Jensen , Kevin Wolf , Minwoo Im , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Keith Busch , Klaus Jensen Subject: [PULL 20/30] hw/nvme: fix invalid endian conversion Date: Tue, 27 Feb 2024 09:39:36 +0100 Message-ID: <20240227083948.5427-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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=philmd@linaro.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023607886100003 From: Klaus Jensen numcntl is one byte and so is max_vfs. Using cpu_to_le16 on big endian hosts results in numcntl being set to 0. Fix by dropping the endian conversion. Fixes: 99f48ae7ae ("hw/nvme: Add support for Secondary Controller List") Reported-by: Kevin Wolf Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im Message-ID: <20240222-fix-sriov-numcntl-v1-1-d60bea5e72d0@samsung.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index f026245d1e..76fe039704 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7924,7 +7924,7 @@ static void nvme_init_state(NvmeCtrl *n) n->aer_reqs =3D g_new0(NvmeRequest *, n->params.aerl + 1); QTAILQ_INIT(&n->aer_queue); =20 - list->numcntl =3D cpu_to_le16(max_vfs); + list->numcntl =3D max_vfs; for (i =3D 0; i < max_vfs; i++) { sctrl =3D &list->sec[i]; sctrl->pcid =3D cpu_to_le16(n->cntlid); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023595; cv=none; d=zohomail.com; s=zohoarc; b=W6PTiu96DLbKetYMgnCnV9YJcCVcI0/hK4P+b/bRegenFkUfm0+vxHZCc3STFYJG4TxS3uOviDd3PpoSHGseUEX8TDSTQRsJcPwob8FPFY2ttXrcC97BmkNgOmuRhj4TvvXNoO+/rQsP4O+oxaxHQHbpr9DD9eAHWFSyTZCRxBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023595; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iX8uZlTT6wTjiMtTqjR3dj/PxPssyXNBBI6GxQRZqxI=; b=bGbmoagIw1rVWpEheWY6XbnIGfPL/t34iPcNJxkAdXr6aka2qDMKiouH61DWQbWK3DvKw2abla0n5dLY2Tw5q2TyP0mUFuj/6Sf5h7AhFq3L6cpBLIkroNP5LazaLEQDulLxTm4ostSn0SrwAwt9/AzmQlMa2UWMyB6DRgHN0/Q= 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 1709023595269869.2443402723087; Tue, 27 Feb 2024 00:46:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2P-0001q5-Ia; Tue, 27 Feb 2024 03:42:09 -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 1ret2N-0001X2-3R for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:07 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2L-0008Ip-7H for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:06 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5663273e390so533477a12.3 for ; Tue, 27 Feb 2024 00:42:04 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id i2-20020a0564020f0200b005651ae4ac91sm542918eda.41.2024.02.27.00.42.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023323; x=1709628123; 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=iX8uZlTT6wTjiMtTqjR3dj/PxPssyXNBBI6GxQRZqxI=; b=UiJ4RsntLYaqtxmRuL7CPxLIHVqs9MuduWTme3Dqnjxt55rTIUd153GI33+mNA1Z7T jzrMFh6WIE2erQYfs94AfzvMCOMHa0+W0my6wqL/ErT93VcIfqRo4PNott8wlhq1m8Sy kmvlPs0M7ehyiBFdkqytDQxR40L8S0uriTToEvEYfNZ4jxS8fvvB2JoLGAu7sbwaaIlJ b67PRfoCRcrTQcLPi5JTABMAssLXcIZG1L8Fgpjnurvpvr6iQKm+loxfNiOl7LynHxbW xhPefnJJdo77w9rsDFR20XgcEbfCSckhqdl4x19OQnmQBL3jdsZw+z+goR2J6+TTJVJA 8MCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023323; x=1709628123; 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=iX8uZlTT6wTjiMtTqjR3dj/PxPssyXNBBI6GxQRZqxI=; b=Sf7OdukTKJ3cXNKr67JjjDyVpgx1EOp/Ls7tW/sUAxWVXTLf0GTQdjHNgAHUbBdvVR n6JdD8Ot6tACtwvc+q79r+bXas86HtGvJQU528uNkCHqiHOar3Oslo7KcOSDdq8DZl+e v2sGq7kHbMkWAAVmQkO9rJiN02nh8SA9OyhFIhkRGALYGS8WuLv4zD5aLLKllJYLX2fw 7LG80CwhChlOKd7HEbvhsfGdTj+Nzfq/fyWXvU1DiZtthiqMvVAFkzI6122MhHrn3o7o MYpNTu8JM9OTT4X5g4Qh8hb1AsPWi8RQbRLSRrlI/63vEXn/Y96GZApC8eoVgFjSuJ1H zsxQ== X-Gm-Message-State: AOJu0YyqFNqGLXUQJawmqnJg6g9IOrzwfCYif/oKdISW60HO8ZLoSX0y WGuke5T6ZCDUSoZSC2WW4xtWubDwsf3RqVNN0oq3Q4DUpHW/5Blk9alDDuPTNEsTM35wGfIT8KU q X-Google-Smtp-Source: AGHT+IGisEqRQFzyQeAsM9alRoTB8oJYoLKxVH4SFxHu/nRrwo3YOttRiyP1dOLTQXa+bS/yS0uAoQ== X-Received: by 2002:a05:6402:795:b0:566:4459:920b with SMTP id d21-20020a056402079500b005664459920bmr311301edy.41.1709023323449; Tue, 27 Feb 2024 00:42:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow , "Michael S . Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Sergio Lopez , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 21/30] hw/i386/x86: Let ioapic_init_gsi() take parent as pointer Date: Tue, 27 Feb 2024 09:39:37 +0100 Message-ID: <20240227083948.5427-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023595925100003 From: Bernhard Beschow Rather than taking a QOM name which has to be resolved, let's pass the pare= nt directly as pointer. This simplifies the code. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/hw/i386/x86.h | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc_piix.c | 7 +++---- hw/i386/pc_q35.c | 2 +- hw/i386/x86.c | 7 +++---- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 8e306db7bb..4dc30dcb4d 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -139,7 +139,7 @@ typedef struct GSIState { =20 qemu_irq x86_allocate_cpu_irq(void); void gsi_handler(void *opaque, int n, int level); -void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name); +void ioapic_init_gsi(GSIState *gsi_state, Object *parent); DeviceState *ioapic_init_secondary(GSIState *gsi_state); =20 /* pc_sysfw.c */ diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index ca55aecc3b..61a772dfe6 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -175,7 +175,7 @@ static void microvm_devices_init(MicrovmMachineState *m= ms) &error_abort); isa_bus_register_input_irqs(isa_bus, x86ms->gsi); =20 - ioapic_init_gsi(gsi_state, "machine"); + ioapic_init_gsi(gsi_state, OBJECT(mms)); if (ioapics > 1) { x86ms->ioapic2 =3D ioapic_init_secondary(gsi_state); } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ec7c07b362..7724396ead 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -107,6 +107,7 @@ static void pc_init1(MachineState *machine, X86MachineState *x86ms =3D X86_MACHINE(machine); MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *system_io =3D get_system_io(); + Object *phb =3D NULL; PCIBus *pci_bus =3D NULL; ISABus *isa_bus; Object *piix4_pm =3D NULL; @@ -189,8 +190,6 @@ static void pc_init1(MachineState *machine, } =20 if (pcmc->pci_enabled) { - Object *phb; - pci_memory =3D g_new(MemoryRegion, 1); memory_region_init(pci_memory, NULL, "pci", UINT64_MAX); rom_memory =3D pci_memory; @@ -303,8 +302,8 @@ static void pc_init1(MachineState *machine, pc_i8259_create(isa_bus, gsi_state->i8259_irq); } =20 - if (pcmc->pci_enabled) { - ioapic_init_gsi(gsi_state, "i440fx"); + if (phb) { + ioapic_init_gsi(gsi_state, phb); } =20 if (tcg_enabled()) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 53fb3db26d..c89ff63579 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -263,7 +263,7 @@ static void pc_q35_init(MachineState *machine) pc_i8259_create(isa_bus, gsi_state->i8259_irq); } =20 - ioapic_init_gsi(gsi_state, "q35"); + ioapic_init_gsi(gsi_state, OBJECT(phb)); =20 if (tcg_enabled()) { x86_register_ferr_irq(x86ms->gsi[13]); diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 684dce90e9..807e09bcdb 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -640,20 +640,19 @@ void gsi_handler(void *opaque, int n, int level) } } =20 -void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) +void ioapic_init_gsi(GSIState *gsi_state, Object *parent) { DeviceState *dev; SysBusDevice *d; unsigned int i; =20 - assert(parent_name); + assert(parent); if (kvm_ioapic_in_kernel()) { dev =3D qdev_new(TYPE_KVM_IOAPIC); } else { dev =3D qdev_new(TYPE_IOAPIC); } - object_property_add_child(object_resolve_path(parent_name, NULL), - "ioapic", OBJECT(dev)); + object_property_add_child(parent, "ioapic", OBJECT(dev)); d =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(d, &error_fatal); sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS); --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023713; cv=none; d=zohomail.com; s=zohoarc; b=bomq2/2nCZTlXDM64FiIDMrpb8zJyYCUpVkPzYvXLEKEFZ/9ygajSOS9aKYGC54FnFYdrNv86wTC/ay/femneG9Da7QOBOzZcV/txuxgF385gHA3boXXVrzi2Ogz7zMprIqKY0rycJv6bsQ7fthSqdJpUhaEAjhmlKvboe7ABoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023713; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9zD/OKW2eI569vD83pviooB+9Gzp5s2IN5noJR3qtG4=; b=n+mbLFpBHXSDXP3LVQv1Oo/JS+XyxmzUSv3LoTGf6PIe12EklMGcyhnG97guXB55r/Sn+SeU7Y/lCc3F66g9DHrvRI5z87XNZo/a5HO2riH9t4VgZTdo2+OTJHWiOHMjdQHjetb0LH1sfX6piuSZs94D4OrOrsNcLQjFpxWE9MM= 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 1709023713858225.50906822732065; Tue, 27 Feb 2024 00:48:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2Z-00038v-0H; Tue, 27 Feb 2024 03:42: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 1ret2V-0002aM-2r for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:15 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2R-0008KK-SX for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:14 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-564fc495d83so4580865a12.0 for ; Tue, 27 Feb 2024 00:42:11 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id q7-20020a056402040700b00566220e204csm543399edv.15.2024.02.27.00.42.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023330; x=1709628130; 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=9zD/OKW2eI569vD83pviooB+9Gzp5s2IN5noJR3qtG4=; b=AgV0M77zCe75IXST6dLnYlJLJt8+WKT8/UA4JivMuWP0NFz1T+j1Bh27hWmLHZx5M0 6ohlK84p7VLz8hLg7DlUCuRGbn8mysBOIM4tPIabeu2Syml1aIcUyKvenQZCtiHt8cOM Nt8mDefoQI6tGA5lPGlKReiiJWz3WBKuTyjioySLUu6cF1PWUcIeOp1eFtzpocGyvPkD IRWrMXvh5thl3dqAyO/rF3T/a9bP0ZhOvUUQ24pTTpDJm66qDLGiMtf/xmvqbBoh3inJ h0WU/ikGpiymU7ELoF+plxIE2WFNq3ZeFRfak9qyl0rUt+pr1yQcn4R24ewA69xU3C8m Rtrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023330; x=1709628130; 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=9zD/OKW2eI569vD83pviooB+9Gzp5s2IN5noJR3qtG4=; b=PdKPjK7478eFD8qU5cpUCnWYgeKE8njTBVMyTis+e1dHHqaoMMg1XTsfXxQHcWtlHt xlZsWY1FA7+FmUjjhsUy31hgDu8fRNdeYA58CAVOcPy/k4LDv2//+P+937OV/viZMWcH ud1MpuepP3Ylg+wxkMffQ/M8WSIQe3oFonl3l2WHK3P8Q2x5F6wG/XbngPGTIBGtDLYJ M8uF5cP9B33Z9SmrphfCgvBZvwnBqmfDWVTlwVodFpEegpnVcgG2kW9OBZNlU61IFB1a czgOWDvOhtOGucZ95WtRTQUEkeMeOhGs6NipSbcqC2xn/AAdX/ja7hAe5e2SM5jqll2Y +iIg== X-Gm-Message-State: AOJu0Yz9afXVYaSK5p4mtNJEdAx0lJ+zu4EkLMmYqT08Y19ltqhAnhd8 6tUgto+OC7cEjY0S2fdncvNg4KUr64HzQoidpF2PtZI3CiVQF8QW0GVJjFf3UL2athNl/O24yNF I X-Google-Smtp-Source: AGHT+IE02bMtvZpWaB9ce3nfzypPQuqHvxqyi/6ii5I60rSE3K89IJ/uqNDmgkBPVMwaHCPTB+Lgjg== X-Received: by 2002:a05:6402:6da:b0:566:aa2:8433 with SMTP id n26-20020a05640206da00b005660aa28433mr2734239edy.36.1709023329828; Tue, 27 Feb 2024 00:42:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 22/30] hw/i386/sgx: Use QDev API Date: Tue, 27 Feb 2024 09:39:38 +0100 Message-ID: <20240227083948.5427-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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=philmd@linaro.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023714184100007 Prefer the QDev API over the low level QOM one. No logical change intended. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240215142035.73331-4-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/i386/sgx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index 70305547d4..de76397bcf 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -286,7 +286,6 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) SGXEPCState *sgx_epc =3D &pcms->sgx_epc; X86MachineState *x86ms =3D X86_MACHINE(pcms); SgxEPCList *list =3D NULL; - Object *obj; =20 memset(sgx_epc, 0, sizeof(SGXEPCState)); if (!x86ms->sgx_epc_list) { @@ -300,16 +299,15 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) &sgx_epc->mr); =20 for (list =3D x86ms->sgx_epc_list; list; list =3D list->next) { - obj =3D object_new("sgx-epc"); + DeviceState *dev =3D qdev_new(TYPE_SGX_EPC); =20 /* set the memdev link with memory backend */ - object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memde= v, - &error_fatal); + object_property_parse(OBJECT(dev), SGX_EPC_MEMDEV_PROP, + list->value->memdev, &error_fatal); /* set the numa node property for sgx epc object */ - object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, list->value-= >node, - &error_fatal); - object_property_set_bool(obj, "realized", true, &error_fatal); - object_unref(obj); + object_property_set_uint(OBJECT(dev), SGX_EPC_NUMA_NODE_PROP, + list->value->node, &error_fatal); + qdev_realize_and_unref(dev, NULL, &error_fatal); } =20 if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) { --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023440; cv=none; d=zohomail.com; s=zohoarc; b=Q8KM5tzHnVNAdCQSA6LvbU1hDCLAH6nloIDcXwp6I04aXW2TG4clbi4/edbjdZTfwHuWyuXe0cG9KYMuq8KjsWyexvQWdUod7RgdmztzymH8OYs9yS0RcOajj2vW6zbnGcHxvT+tTOa6rhf/+Hf1CK1EcF9GHRXpoRBjj11tY2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023440; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SMgxNB+QPGXCEfWk+9rOGkNmwlpFY1sXlU4z6trziko=; b=RHk0anlRbJh8H1ng+A644Iu0AsRe1YRMpJ4SOsYXUnKCe782hE04jhyJ/J1Bw5FQgeoJYEu+XkQ6zXOKd3DZL6S7PR/gfc4REKV/JDTCGwLAJi2cWoPfeyzVzU2icRopW0+kcBdZfPxF6PP9Cjwya5f5kuOKTEysSyV+wgL2ZFw= 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 1709023440128548.3375607518841; Tue, 27 Feb 2024 00:44:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2c-0003TH-90; Tue, 27 Feb 2024 03:42: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 1ret2a-0003Ne-Rk for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:20 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2Y-0008MP-56 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:20 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a3122b70439so482055266b.3 for ; Tue, 27 Feb 2024 00:42:17 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id lt16-20020a170906fa9000b00a3d99415705sm539438ejb.73.2024.02.27.00.42.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023336; x=1709628136; 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=SMgxNB+QPGXCEfWk+9rOGkNmwlpFY1sXlU4z6trziko=; b=Um9Gm5mKbkYa9S+8ajIcML0zxcgRN4VOKd6aAmzZSGARRzyrOlgJQwhCmCd8prmvM4 Mqt061HBFkuzrInGsAS4pJwkhyBR2OambTXWAQB5ftVB5kTVbqU/cxxpey0FKGuy25/U RibjKHLNO1k5LjtpDqNqNBdR9/vosdTqWOIWtaoScz7IrzJ2ffpQ6LYkIMINEyzmL3u/ MsNgFy61JuqhAX8M7dwpNwnvH0qDjPXw22ttNhZOFiwQPqLdatMr0iKE1LWCV+7vIzWA Z0TKojRXYiIySiSZsUmLLlGUKgB2eh6CeZOGYYG0t2Xx9dVV0K7kND9W1v0TAtxIa+IE z16A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023336; x=1709628136; 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=SMgxNB+QPGXCEfWk+9rOGkNmwlpFY1sXlU4z6trziko=; b=iPTd45ErBZQ0BXPNQUNVQBVDBJkannJK4WBsUiU4/o+Whlf7MBCaK3n5i69bgDtvUX +6Kfxg+RdqSqoH/q7gTKPhVKlwhhXk4lC2A1DuuWTD0mih87cY7HW43/HRv+dYDfhDU7 UmCotTKXYYmMeJ7QhXv4UP8h19kJ2QG2V7iOv/vXYfZiL0nY/69kGgTyvf9W4/SJ+8qO R+tk2TGVSA2CKHbTUwhZ0zbYZrBr92nYy7GLketTuTp1SSXtGEANaP+jy0KIRPshWbYP 3OjdtXUk0hZ93NbuP7OJMN+W4f32kjnSyDp2hRU3kQXkKH1rdNCBCmRzFHTIEKZsOGDg vK+A== X-Gm-Message-State: AOJu0YxbbKFTBhgDHRq1k3cGa4lphLoG5ihY1WNokT5GDnCwc7gG7fMp hG3eJ0Ah1TL/J/6FJ7rS/mrmA2kAPFZq4ISohELkr4N2cp7+T3EcZxSAeStOlJW6ULEylmb2Xrw t X-Google-Smtp-Source: AGHT+IHxUIaibn4q+A/VJCnSG6EuEJLplZETvzp1M+/mn3zX/TbW2Soh1ct8HiXtyeWfkxoiCc5G6w== X-Received: by 2002:a17:906:1854:b0:a3e:b726:20ef with SMTP id w20-20020a170906185400b00a3eb72620efmr5739587eje.34.1709023336228; Tue, 27 Feb 2024 00:42:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 23/30] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header Date: Tue, 27 Feb 2024 09:39:39 +0100 Message-ID: <20240227083948.5427-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::632; envelope-from=philmd@linaro.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023442204100003 "hw/acpi/acpi.h" is implicitly included. Include it explicitly to avoid the following error when refactoring headers: hw/i386/pc_q35.c:209:43: error: use of undeclared identifier 'ACPI_PM_PROP_= ACPI_PCIHP_BRIDGE' ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Message-Id: <20240226090600.31952-3-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/i386/pc_q35.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index c89ff63579..3c80f37ead 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -30,6 +30,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" +#include "hw/acpi/acpi.h" #include "hw/char/parallel-isa.h" #include "hw/loader.h" #include "hw/i2c/smbus_eeprom.h" --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023864; cv=none; d=zohomail.com; s=zohoarc; b=IkQhQ7Ci1Ec4P1A/LaW1Dnjvan5cTtMDYWGVaI4IvEtr4nMXZB6Vy5jLrAD0Wxv9qmBISQ2K87p6IVh8I+DGO9DZL6aCtkjwUsaJkuEEH4xSaz9R4C9Vti8xFKNF1FdCGWVuYW+tdf9ybO/keJSm0hRsGdG/SzBGDU8S5Yy4RDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023864; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5Gdk5QbogljYxnMuj3DzgKa5vdSTLOp9WH/RDQu3ZVU=; b=V/erkeXKE/IndXoD5L6Sp2A5rG8TWRvCP5jbHpdlaNK92PAk1oF3iLp8kNRPnKRWcPiK5jGHewGdHqrdlmirI5eM6NWbToY7YJuTEaSQUWddp56j+CHEieaOiexDecqknZ8XyxaDFc4OXFcnLX7GScManxi7lDMAp7i/mHQ7GXU= 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 1709023864048502.27736349599013; Tue, 27 Feb 2024 00:51:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2t-0004MO-P4; Tue, 27 Feb 2024 03:42:39 -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 1ret2r-0004EV-Tm for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:37 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2g-0008O6-BZ for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:37 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33ddd1624beso894565f8f.1 for ; Tue, 27 Feb 2024 00:42:24 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id bs19-20020a056000071300b0033df49c9d00sm398994wrb.17.2024.02.27.00.42.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023343; x=1709628143; 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=5Gdk5QbogljYxnMuj3DzgKa5vdSTLOp9WH/RDQu3ZVU=; b=VpRCVtEscIS96Co0fLlEeURNAIJYOqGC3Yx9gAc5NFdw3nXQ69owarEjh3zXxg9tA9 GY+glaUfwhVRNr6N48bpPXbdxyMkQPsgnqED+ZI/JsLHL9uh70n6Bp07d7ED44gRpIte sefy0OwYO6EGXMrRGiMTdkDPb9FJBiyyEmCex2laF6eUAmR7TMrwuOghwdnmoolvcpEe SlfBrR7gcy9qr7BrpMRbISO6yAUQs0vPuiQNfxNC5+VF1O1AZc/Xjx5Kefh03C/HKfBS 4DXOgsoKzlGSaklKPg0vVbO4a8DkjFLDalQsSDy0NZXe8BBad3H3KgubR/uy1fhFA0FT k4oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023343; x=1709628143; 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=5Gdk5QbogljYxnMuj3DzgKa5vdSTLOp9WH/RDQu3ZVU=; b=eHw4xMw2qf1pNTusLwOePwcG2ARo4deylaZxwOMeA+t2u8B7GwjKOYf4kVqmXy54i/ QWDtQZCBUbSfOur7YKSf+5WFYmu6slMHfXXdeUibwjafvURag0oqnjQo0A+3nqle9XQ3 hNErw+K3wDeCYud0sxk7aIeeMTiM4/MLbhN0HIJWFd6cjpp6oRcRD/aT7oXGZCxFwaKY ekGZv/n3qsXuJXDrCnfrh5jM2R/U5B7RskazC27vvWXtlXG4dtXnNZfaCu3Tm25qGmwl jW3UdZEnnvm3YPC3vXGGWShJ5985ptlwWiB0jROQyGPieEI+7GCquMNcEiJlWkesGYiv XXBw== X-Gm-Message-State: AOJu0YyOVLb6jiW/rNZ3m2Cz5CAjkXCAn05sZXlwYbu+QHbrBEWeMXQO meT6zE/xCVdgdr1JmvzZVSDg0Bo2JwTifD4lbEaiybuTskbIzlp7du79UFGnCpyKKjmi0fAewFN z X-Google-Smtp-Source: AGHT+IE+hlwWU1hQR2h4tvI0lGSghQ/k/PAA7uWOG5PDlEMAAvsUSm0LVXo5toBFpldpRMN0L1fagg== X-Received: by 2002:a5d:440f:0:b0:33d:1974:4ae8 with SMTP id z15-20020a5d440f000000b0033d19744ae8mr6733729wrq.16.1709023342825; Tue, 27 Feb 2024 00:42:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Jason Wang , David Woodhouse , Paul Durrant Subject: [PULL 24/30] hw/i386/pc: Rename "bus" attribute to "pcibus" Date: Tue, 27 Feb 2024 09:39:40 +0100 Message-ID: <20240227083948.5427-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023864664100002 From: Bernhard Beschow The attribute is of type PCIBus; reflect that in the name. It will also mak= e the next change more intuitive. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/hw/i386/pc.h | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/amd_iommu.c | 2 +- hw/i386/intel_iommu.c | 2 +- hw/i386/kvm/xen_evtchn.c | 2 +- hw/i386/pc.c | 8 ++++---- hw/i386/pc_piix.c | 6 +++--- hw/i386/pc_q35.c | 2 +- hw/i386/x86-iommu.c | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index e88468131a..27834043c3 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -31,7 +31,7 @@ typedef struct PCMachineState { Notifier machine_done; =20 /* Pointers to devices and objects: */ - PCIBus *bus; + PCIBus *pcibus; I2CBus *smbus; PFlashCFI01 *flash[2]; ISADevice *pcspk; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 896ff87519..15242b9096 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1546,7 +1546,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } =20 crs_range_set_init(&crs_range_set); - bus =3D PC_MACHINE(machine)->bus; + bus =3D PC_MACHINE(machine)->pcibus; if (bus) { QLIST_FOREACH(bus, &bus->child, sibling) { uint8_t bus_num =3D pci_bus_num(bus); diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 7329553ad3..6d4fde72f9 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1584,7 +1584,7 @@ static void amdvi_sysbus_realize(DeviceState *dev, Er= ror **errp) MachineState *ms =3D MACHINE(qdev_get_machine()); PCMachineState *pcms =3D PC_MACHINE(ms); X86MachineState *x86ms =3D X86_MACHINE(ms); - PCIBus *bus =3D pcms->bus; + PCIBus *bus =3D pcms->pcibus; =20 s->iotlb =3D g_hash_table_new_full(amdvi_uint64_hash, amdvi_uint64_equal, g_free, g_free); diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index cf933189d3..cc8e59674e 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4183,7 +4183,7 @@ static void vtd_realize(DeviceState *dev, Error **err= p) MachineState *ms =3D MACHINE(qdev_get_machine()); PCMachineState *pcms =3D PC_MACHINE(ms); X86MachineState *x86ms =3D X86_MACHINE(ms); - PCIBus *bus =3D pcms->bus; + PCIBus *bus =3D pcms->pcibus; IntelIOMMUState *s =3D INTEL_IOMMU_DEVICE(dev); X86IOMMUState *x86_iommu =3D X86_IOMMU_DEVICE(s); =20 diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c index 0171ef6d59..a5052c0ea3 100644 --- a/hw/i386/kvm/xen_evtchn.c +++ b/hw/i386/kvm/xen_evtchn.c @@ -371,7 +371,7 @@ static int set_callback_pci_intx(XenEvtchnState *s, uin= t64_t param) return 0; } =20 - pdev =3D pci_find_device(pcms->bus, bus, devfn); + pdev =3D pci_find_device(pcms->pcibus, bus, devfn); if (!pdev) { return 0; } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f8eb684a49..353edeb2ea 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -675,7 +675,7 @@ void pc_machine_done(Notifier *notifier, void *data) PCMachineState, machine_done); X86MachineState *x86ms =3D X86_MACHINE(pcms); =20 - cxl_hook_up_pxb_registers(pcms->bus, &pcms->cxl_devices_state, + cxl_hook_up_pxb_registers(pcms->pcibus, &pcms->cxl_devices_state, &error_fatal); =20 if (pcms->cxl_devices_state.is_enabled) { @@ -685,7 +685,7 @@ void pc_machine_done(Notifier *notifier, void *data) /* set the number of CPUs */ x86_rtc_set_cpus_count(x86ms->rtc, x86ms->boot_cpus); =20 - fw_cfg_add_extra_pci_roots(pcms->bus, x86ms->fw_cfg); + fw_cfg_add_extra_pci_roots(pcms->pcibus, x86ms->fw_cfg); =20 acpi_setup(); if (x86ms->fw_cfg) { @@ -1250,8 +1250,8 @@ void pc_basic_device_init(struct PCMachineState *pcms, xen_evtchn_create(IOAPIC_NUM_PINS, gsi); xen_gnttab_create(); xen_xenstore_create(); - if (pcms->bus) { - pci_create_simple(pcms->bus, -1, "xen-platform"); + if (pcms->pcibus) { + pci_create_simple(pcms->pcibus, -1, "xen-platform"); } xen_bus_init(); xen_be_init(); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7724396ead..3393b93007 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -216,7 +216,7 @@ static void pc_init1(MachineState *machine, pci_bus_map_irqs(pci_bus, xen_enabled() ? xen_pci_slot_get_pirq : pc_pci_slot_get_pirq); - pcms->bus =3D pci_bus; + pcms->pcibus =3D pci_bus; =20 hole64_size =3D object_property_get_uint(phb, PCI_HOST_PROP_PCI_HOLE64_SI= ZE, @@ -480,8 +480,8 @@ static void pc_xen_hvm_init(MachineState *machine) } =20 pc_xen_hvm_init_pci(machine); - xen_igd_reserve_slot(pcms->bus); - pci_create_simple(pcms->bus, -1, "xen-platform"); + xen_igd_reserve_slot(pcms->pcibus); + pci_create_simple(pcms->pcibus, -1, "xen-platform"); } #endif =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 3c80f37ead..549c0bc041 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -218,7 +218,7 @@ static void pc_q35_init(MachineState *machine) =20 /* pci */ host_bus =3D PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); - pcms->bus =3D host_bus; + pcms->pcibus =3D host_bus; =20 /* irq lines */ gsi_state =3D pc_gsi_create(&x86ms->gsi, true); diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index 726e9e1d16..60af896225 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -101,7 +101,7 @@ static void x86_iommu_realize(DeviceState *dev, Error *= *errp) QLIST_INIT(&x86_iommu->iec_notifiers); bool irq_all_kernel =3D kvm_irqchip_in_kernel() && !kvm_irqchip_is_spl= it(); =20 - if (!pcms || !pcms->bus) { + if (!pcms || !pcms->pcibus) { error_setg(errp, "Machine-type '%s' not supported by IOMMU", mc->name); return; --=20 2.41.0 From nobody Tue Nov 26 06:40:13 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023468; cv=none; d=zohomail.com; s=zohoarc; b=CY6px4uOqHwL6LHtW35eUyE3qmfIKjjM5dIwHnVS/9SPFlujaKbUvozte/x0HK07zjbfBZEwdwU00dGvhBifbdp245WGSAx8i9JhKXDiW5MjZvLRscpur2E2CcfX2+cATMTXYJY6VBQUK70bJ2QE2dJAc51jNeSBeUlHnJB7kFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023468; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6n+lSFzDNPiqC0LaZPK+z4bhN6r8eJn5HjneFPDs130=; b=f4YFoBlHKXXCxvGyn8MzlwMXc0HUtXZo381XiSm+Z3CyKptM3NBiR+/wijcV7wY8ln0SnhU/aL9rYJQ+8lA3hMg9SlvGJ8OHcQvzpIU50pSupemyOW9voHDkwRwEOsEFtYW+V4rAqLCLKSJQB/DBTUC9V+OoybzCFWOt3iOCx0U= 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 1709023468207599.4539900582164; Tue, 27 Feb 2024 00:44:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2w-0004cv-6G; Tue, 27 Feb 2024 03:42: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 1ret2t-0004Nj-Ot for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:39 -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 1ret2k-0008PC-UO for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:39 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3392b045e0aso3338656f8f.2 for ; Tue, 27 Feb 2024 00:42:30 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id h4-20020a5d4304000000b0033d6c928a95sm10651527wrq.63.2024.02.27.00.42.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023349; x=1709628149; 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=6n+lSFzDNPiqC0LaZPK+z4bhN6r8eJn5HjneFPDs130=; b=QItaDzK+d0e9PPr5rCmQlWI3GceZIPTQBLHcHoV7bWDEZfC7j6FlO4qNL/pSQ/h5y8 ++kPyC/Xg65wDdcLOzNxCIrtJ89I7HZV/0zWRu6mqQi9Eiu1SxBm93k5BuA2j7QPNE7c Rm1cI+er66wOSGDmlc/JinhH+OZF5QqLTvh3RcD1ZTd70qlqG0F1g9v075hVxdEcBfST lW3T/raLlXmLyrYmncKo4wTAXKiedARS9H5OgqQ7xGXL+Y0oZefmm4hPNSRkLgnc/12C ZzZX/QD/+snYCXxjHfF73w35jSj2l0RFIv7o8r+czZhZC2yNBUmYAeOhCDXubQGkHMyX Cimw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023349; x=1709628149; 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=6n+lSFzDNPiqC0LaZPK+z4bhN6r8eJn5HjneFPDs130=; b=XSxwjHB5CnLHoQuMrumZ64E422/eMKGGMfENjS1mN0laZhpYU91nUVcCqYhE17w1zp REhLEzPmXxyUe2bUwIUa+NEsjb1P5AFhlOhAfYjwhRm+4HuSXwXthZm56NxPc6R2TBNt VhHlumETig5oMqq4HZXZ4dLDBeU8xIlOM2kP8N4hmQjAiWUmdSpyKRScMedPvyf8DARH rsevHWW0vLPkZJMvx+XKIYznCMq+2W70mt1kb2zMkNQbT0Qw0oX1s9Wcn/HcuGLjDqeV gFlHtHm12gFW2cwGNXdnxmRI/IU6og3+dHXmBSigQibmHOzs2YnT5zQdl7Lo2KI6d8Iv TTyA== X-Gm-Message-State: AOJu0Yy8gF8qTL29K39v2mDG4+UETHpcQ1fQ1z3OH26Zg5Zs9GS9FSpM HylgkW0KLyKG5iLgw9atd+xtC9z/Pn/S7Qy2otrSlg+tQR121QPEnv7lSAAAnq/VuiP4LLl1L1g 0 X-Google-Smtp-Source: AGHT+IF8q8gfAJHOTCX7PEWFh8PpuCnCY4f2YHr5+0f74w9LfA9EVmTiqht62H8BY2KN7xZMpzI4Xg== X-Received: by 2002:adf:ea81:0:b0:33d:74f2:820e with SMTP id s1-20020adfea81000000b0033d74f2820emr7496378wrm.30.1709023349088; Tue, 27 Feb 2024 00:42:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow , "Michael S . Tsirkin" , Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 25/30] hw/i386/pc_{piix, q35}: Eliminate local pci_bus/pci_host variables Date: Tue, 27 Feb 2024 09:39:41 +0100 Message-ID: <20240227083948.5427-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023470335100003 From: Bernhard Beschow There is no advantage in having these local variables which 1/ needlessly h= ave different identifiers in both machines and 2/ which are redundant to pcms->= bus which is almost as short. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-4-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/i386/pc_piix.c | 14 ++++++-------- hw/i386/pc_q35.c | 16 +++++++--------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 3393b93007..814d24326d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -108,7 +108,6 @@ static void pc_init1(MachineState *machine, MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *system_io =3D get_system_io(); Object *phb =3D NULL; - PCIBus *pci_bus =3D NULL; ISABus *isa_bus; Object *piix4_pm =3D NULL; qemu_irq smi_irq; @@ -212,11 +211,10 @@ static void pc_init1(MachineState *machine, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal); =20 - pci_bus =3D PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pci.0")); - pci_bus_map_irqs(pci_bus, + pcms->pcibus =3D PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pci.0")); + pci_bus_map_irqs(pcms->pcibus, xen_enabled() ? xen_pci_slot_get_pirq : pc_pci_slot_get_pirq); - pcms->pcibus =3D pci_bus; =20 hole64_size =3D object_property_get_uint(phb, PCI_HOST_PROP_PCI_HOLE64_SI= ZE, @@ -261,7 +259,7 @@ static void pc_init1(MachineState *machine, for (i =3D 0; i < ISA_NUM_IRQS; i++) { qdev_connect_gpio_out_named(dev, "isa-irqs", i, x86ms->gsi[i]); } - pci_realize_and_unref(pci_dev, pci_bus, &error_fatal); + pci_realize_and_unref(pci_dev, pcms->pcibus, &error_fatal); =20 if (xen_enabled()) { pci_device_set_intx_routing_notifier( @@ -273,7 +271,7 @@ static void pc_init1(MachineState *machine, * connected to the IOAPIC directly. * These additional routes can be discovered through ACPI. */ - pci_bus_irqs(pci_bus, xen_intx_set_irq, pci_dev, + pci_bus_irqs(pcms->pcibus, xen_intx_set_irq, pci_dev, XEN_IOAPIC_NUM_PIRQS); } =20 @@ -310,7 +308,7 @@ static void pc_init1(MachineState *machine, x86_register_ferr_irq(x86ms->gsi[13]); } =20 - pc_vga_init(isa_bus, pcmc->pci_enabled ? pci_bus : NULL); + pc_vga_init(isa_bus, pcmc->pci_enabled ? pcms->pcibus : NULL); =20 assert(pcms->vmport !=3D ON_OFF_AUTO__MAX); if (pcms->vmport =3D=3D ON_OFF_AUTO_AUTO) { @@ -321,7 +319,7 @@ static void pc_init1(MachineState *machine, pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, true, 0x4); =20 - pc_nic_init(pcmc, isa_bus, pci_bus); + pc_nic_init(pcmc, isa_bus, pcms->pcibus); =20 #ifdef CONFIG_IDE_ISA if (!pcmc->pci_enabled) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 549c0bc041..9e4b8f79c2 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -123,7 +123,6 @@ static void pc_q35_init(MachineState *machine) PCMachineClass *pcmc =3D PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms =3D X86_MACHINE(machine); Object *phb; - PCIBus *host_bus; PCIDevice *lpc; DeviceState *lpc_dev; ISADevice *rtc_state; @@ -217,8 +216,7 @@ static void pc_q35_init(MachineState *machine) sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal); =20 /* pci */ - host_bus =3D PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); - pcms->pcibus =3D host_bus; + pcms->pcibus =3D PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); =20 /* irq lines */ gsi_state =3D pc_gsi_create(&x86ms->gsi, true); @@ -232,7 +230,7 @@ static void pc_q35_init(MachineState *machine) for (i =3D 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); + pci_realize_and_unref(lpc, pcms->pcibus, &error_fatal); =20 rtc_state =3D ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "r= tc")); =20 @@ -284,7 +282,7 @@ static void pc_q35_init(MachineState *machine) AHCIPCIState *ich9; =20 /* ahci and SATA device, for q35 1 ahci controller is built-in */ - pdev =3D pci_create_simple_multifunction(host_bus, + pdev =3D pci_create_simple_multifunction(pcms->pcibus, PCI_DEVFN(ICH9_SATA1_DEV, ICH9_SATA1_FUNC), "ich9-ahci"); @@ -298,14 +296,14 @@ static void pc_q35_init(MachineState *machine) =20 if (machine_usb(machine)) { /* Should we create 6 UHCI according to ich9 spec? */ - ehci_create_ich9_with_companions(host_bus, 0x1d); + ehci_create_ich9_with_companions(pcms->pcibus, 0x1d); } =20 if (pcms->smbus_enabled) { PCIDevice *smb; =20 /* TODO: Populate SPD eeprom data. */ - smb =3D pci_create_simple_multifunction(host_bus, + smb =3D pci_create_simple_multifunction(pcms->pcibus, PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC), TYPE_ICH9_SMB_DEVICE); @@ -317,8 +315,8 @@ static void pc_q35_init(MachineState *machine) pc_cmos_init(pcms, rtc_state); =20 /* the rest devices to which pci devfn is automatically assigned */ - pc_vga_init(isa_bus, host_bus); - pc_nic_init(pcmc, isa_bus, host_bus); + pc_vga_init(isa_bus, pcms->pcibus); + pc_nic_init(pcmc, isa_bus, pcms->pcibus); =20 if (machine->nvdimms_state->is_enabled) { nvdimm_init_acpi_state(machine->nvdimms_state, system_io, --=20 2.41.0 From nobody Tue Nov 26 06:40:14 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023529; cv=none; d=zohomail.com; s=zohoarc; b=Awa/5SdEP6JnxoInSwE+AgMYBt43dwwRh1mCyI0UNr1XrLr+ZC1/Azqj1fBVA+kfvMW5zQSsYQ5mKxh2WwjaiMpXYr/7/lS1aW5rDZomSTlls+jG8XuR3TOUEM67ZpSStyvLXj6lKppITY3Jaggu+1sUJoQz4WoEaTF1XhfoHMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023529; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8FdaM9hjFygoV+600zSMTUb6h8PNn83HRuFk/DcEkWM=; b=dzrNXqAd4bfpb97GSlOWyiamsv/16WmzJ1YOZrp3oWHCDmgetS9uiri77vXdPO0dnI9dBhiUqZmPwaWRiDNp193YMZNHLPjA8lac9pxhGsSo8pU+ngG447rg+KXoWtgJ9ZmRw1OAiA2fO5MTdKQR0q5gHNTzpbDb3TGsYBC+1Ds= 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 1709023529401972.4006790647213; Tue, 27 Feb 2024 00:45:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2x-0004lm-Oc; Tue, 27 Feb 2024 03:42:43 -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 1ret2w-0004fx-G9 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:42 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2s-0008QT-KA for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:42 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33d32f74833so2217846f8f.3 for ; Tue, 27 Feb 2024 00:42:37 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id bq8-20020a5d5a08000000b0033b684d6d5csm10815918wrb.20.2024.02.27.00.42.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023355; x=1709628155; 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=8FdaM9hjFygoV+600zSMTUb6h8PNn83HRuFk/DcEkWM=; b=wiGf60xIDbVToLcQFzBWI7nENk8qMq/gTW+K85iPXD9u84dFociocAIL8/7fO2CLiV bshQ+P00e7wSXudAuA2zoyiZM2dlDK1bSNDpS7KPiN79qmfqKAjWHcXYCLx7t7w6XWOv 0AdJPUd+F2ts7Vz6x1TEn/thnO1xeVW/yUkfkI3KRHz8KaFqmudA0gJ34wFba0XF2bSW C0JRDS2qG7VXDan7/FzNUaJF7RjcFc4dj1af4PrBqEX8q1UTPjv3MtyMCqbpiySGR0Qp n5ZjtpPDi03tYciZEFnB79sR1LnXAIpmtZgMXUOjaA5vz4rxQTwyTRYK5NxejN2WkqLU XgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023355; x=1709628155; 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=8FdaM9hjFygoV+600zSMTUb6h8PNn83HRuFk/DcEkWM=; b=Up43fxSUy9JBO8OpBRxJxY3Uv529zkTo6TkKNmye+6DlvQ5jJtJ2Pc1FuR5q18cxeG 8j0LozoOJDJR4ldo3CFt4nDnPnUbN8PM0MUiDLPpBr7dJ80su8Rx9yoczkUU7WalVlft 2aR4l87VWI6WZfkjY1Ulab9DW+/HK8A3je7Misa2Hk80lAcyjeqHOVMqSPUmUOO5ndOW TfqlFv5FPQm5cFJ12W4xWUBAupPYOBhETdZ9fE6uk9uM5XCLGfMdv5EN/dwUHjObJzmv +I/RSs5uhfGSkfhJZ+Y54CHHg2p7ouvkeDrRwzoneJW1o0RJzHBs/9wZRtn9tCoWS0iW HOuA== X-Gm-Message-State: AOJu0YxL+szMknUXTLiXXsLfX5loaAghKa9ahgDbMj+49rS+obJYkzN2 YPeiETFt1EEVij7cjB3bFYEXIAid4skoa/qFnseKmNynWCavKzrPjf8vJOmdsI64kModEpiU+3/ E X-Google-Smtp-Source: AGHT+IFdSsjcWnXTI18uJa7c021cMHQExZFABwlT8KepkOq3fEPIpA+qU9mnz5CbbJa11PX38qpJ8Q== X-Received: by 2002:a5d:4109:0:b0:33d:701f:d179 with SMTP id l9-20020a5d4109000000b0033d701fd179mr5574325wrp.19.1709023355631; Tue, 27 Feb 2024 00:42:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 26/30] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled" Date: Tue, 27 Feb 2024 09:39:42 +0100 Message-ID: <20240227083948.5427-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023529683100001 From: Bernhard Beschow PCMachineClass introduces the attribute into the class hierarchy and sets i= t to true. There is no sub class overriding the attribute. Commit 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15" removed the last overrides of this attribute. The attribute is now unneeded and can be remov= ed. Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.1= 5" Cc: Thomas Huth Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- include/hw/i386/pc.h | 1 - hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 27834043c3..4bb1899602 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -92,7 +92,6 @@ struct PCMachineClass { =20 /* Device configuration: */ bool pci_enabled; - bool kvmclock_enabled; const char *default_south_bridge; =20 /* Compat options: */ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 353edeb2ea..a80f809b83 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1799,7 +1799,6 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) pcmc->smbios_uuid_encoded =3D true; pcmc->gigabyte_align =3D true; pcmc->has_reserved_memory =3D true; - pcmc->kvmclock_enabled =3D true; pcmc->enforce_aligned_dimm =3D true; pcmc->enforce_amd_1tb_hole =3D true; /* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K rep= orted diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 814d24326d..49d5d48db9 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -184,7 +184,7 @@ static void pc_init1(MachineState *machine, pc_machine_init_sgx_epc(pcms); x86_cpus_init(x86ms, pcmc->default_cpu_version); =20 - if (kvm_enabled() && pcmc->kvmclock_enabled) { + if (kvm_enabled()) { kvmclock_create(pcmc->kvmclock_create_always); } =20 --=20 2.41.0 From nobody Tue Nov 26 06:40:14 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023692; cv=none; d=zohomail.com; s=zohoarc; b=Uq8/pJcH0B7RrJPtgSrctch+3hDv2s4ZdK7zmJmaMN/QvN/E01Rbm8nmrqtdkwT39gx5t1GqpZ7IkqX6IcUaveAlk2eN032uJZAZ7zR2GrZh+hE9zMW1OUSXrPsNBxRQMwhEoMBQJ9pDIjfCwPmKcD6Corxo/Yx80qdy6+fPKbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023692; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AxCElssAJQElNOBysOkvX3JvR87QOEk2FLy7QknFoAM=; b=e7F+x3Qv6yrRznd7oOol2DUuTgE4yNPWPpnY2Eeu7eFcvfNAN+Huy0kM4NBjYlQoKstPZlqn3DSUP0S6SmZy1GoAal7FqEtDNEv7nLXal+eszJSvliiwDV52ASLwkqX1nMhJeU4FGEs+ZgQSarK7IVWBsbz8B0MjUqkm7lKLsWU= 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 1709023692802281.3895855689294; Tue, 27 Feb 2024 00:48:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret34-0005Pu-8X; Tue, 27 Feb 2024 03:42: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 1ret31-0005AM-C8 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:47 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret2x-0008SS-EW for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:47 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-33da51fd636so2399277f8f.3 for ; Tue, 27 Feb 2024 00:42:42 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id r29-20020adfa15d000000b0033de7a30b4fsm2031402wrr.26.2024.02.27.00.42.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023361; x=1709628161; 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=AxCElssAJQElNOBysOkvX3JvR87QOEk2FLy7QknFoAM=; b=VQ1Mkk1Cj7SDrEYNCK4co8bU44HBS3UTI1F3lBj8WG854/q2G2+oDSOkXB5UTyLobB 2pVtPBq1KqmILs1cJ/0TQatYNgfdvnHOnUeBls84TJaBZljdfvtehnaSgReX+lDTdjNn 5XcOb7Fn8wkcKGKmNnrPTA7k1O3eLsWGzEwsHt38jp/SaFG2Hr2/rGA1bI6abH/geVlk 7GeREy4TTF4htOmYT0z2Lp5VPPkDKJQ6BhATsUtOnPtWF6YFg4T2iiBPmz84bQTXh6la QIqk015TePbaeBf+5C4K2YJtz4B09Q9MwJRKe6grSXeOU8vysTr5HRKu+ftTyUgCSovN SOrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023361; x=1709628161; 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=AxCElssAJQElNOBysOkvX3JvR87QOEk2FLy7QknFoAM=; b=W8ijPpyfb6paiJl9YpimjbLGnuqPlG3dkDSYx/V3ghJhK8nsDPpat9wa1UJDcItTxr 4ncH11Rm0U/8c0AntAYqHgxGxOF9YuH88pfORiohoaw43Ai+FHd8c/naiy9Y2KCPVIha QdX5Pqn367PqEmzIkMVtASsVCHR9bsWDrldiilVWaUPT7kQMNxlxlshET7/ISxKdYcPG 7omAK/K/pFu9YSZ6MUC7tEspkRjSrSLWEfCTGB17fS5Jcjppbr6NYy1uGT+06Y5vfD4C cRtObs5v9uyTL/YVby8KC+y3/ttwHDvdFuSP0PWFMLCjfpwlbKbP6LAXGQeZS4llqy+7 bhIg== X-Gm-Message-State: AOJu0YwDWUFoMEreabCpEJZpO+0GThwArcojP3NoDyC+aHOPed5eLe0f kEb4dPudqZEWdGXEOPsOV3xW9+U4CplV4dy/btPBxb4i5l4Nk8S7ltO04LuaXLuU1XCk/L2mfPj C X-Google-Smtp-Source: AGHT+IHtHtoWlYY1DI0MsRQqR9n+hgloKf0qD4fCrdPD+MlI2PncENG9lttaUS2YvcQk9cf6lkihGw== X-Received: by 2002:adf:f10a:0:b0:33d:afc6:3ba6 with SMTP id r10-20020adff10a000000b0033dafc63ba6mr7099097wro.34.1709023361722; Tue, 27 Feb 2024 00:42:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Bernhard Beschow , "Michael S . Tsirkin" , Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 27/30] hw/i386/pc: Populate RTC attribute directly Date: Tue, 27 Feb 2024 09:39:43 +0100 Message-ID: <20240227083948.5427-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023694769100003 From: Bernhard Beschow Both the piix and the q35 machines introduce an rtc_state variable and defe= r the initialization of the X86MachineState::rtc attribute to pc_cmos_init(). Res= olve this complication which makes pc_cmos_init() do what it says on the tin. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/i386/pc.c | 8 -------- hw/i386/pc_piix.c | 15 +++++++-------- hw/i386/pc_q35.c | 7 +++---- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a80f809b83..880e95de26 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -611,14 +611,6 @@ void pc_cmos_init(PCMachineState *pcms, mc146818rtc_set_cmos_data(s, 0x5c, val >> 8); mc146818rtc_set_cmos_data(s, 0x5d, val >> 16); =20 - object_property_add_link(OBJECT(pcms), "rtc_state", - TYPE_ISA_DEVICE, - (Object **)&x86ms->rtc, - object_property_allow_set_link, - OBJ_PROP_LINK_STRONG); - object_property_set_link(OBJECT(pcms), "rtc_state", OBJECT(s), - &error_abort); - set_boot_dev(s, MACHINE(pcms)->boot_config.order, &error_fatal); =20 val =3D 0; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 49d5d48db9..ce6aad758d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -112,7 +112,6 @@ static void pc_init1(MachineState *machine, Object *piix4_pm =3D NULL; qemu_irq smi_irq; GSIState *gsi_state; - ISADevice *rtc_state; MemoryRegion *ram_memory; MemoryRegion *pci_memory =3D NULL; MemoryRegion *rom_memory =3D system_memory; @@ -276,8 +275,8 @@ static void pc_init1(MachineState *machine, } =20 isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(pci_dev), "isa.0")); - rtc_state =3D ISA_DEVICE(object_resolve_path_component(OBJECT(pci_= dev), - "rtc")); + x86ms->rtc =3D ISA_DEVICE(object_resolve_path_component(OBJECT(pci= _dev), + "rtc")); piix4_pm =3D object_resolve_path_component(OBJECT(pci_dev), "pm"); dev =3D DEVICE(object_resolve_path_component(OBJECT(pci_dev), "ide= ")); pci_ide_create_devs(PCI_DEVICE(dev)); @@ -288,9 +287,9 @@ static void pc_init1(MachineState *machine, &error_abort); isa_bus_register_input_irqs(isa_bus, x86ms->gsi); =20 - rtc_state =3D isa_new(TYPE_MC146818_RTC); - qdev_prop_set_int32(DEVICE(rtc_state), "base_year", 2000); - isa_realize_and_unref(rtc_state, isa_bus, &error_fatal); + x86ms->rtc =3D isa_new(TYPE_MC146818_RTC); + qdev_prop_set_int32(DEVICE(x86ms->rtc), "base_year", 2000); + isa_realize_and_unref(x86ms->rtc, isa_bus, &error_fatal); =20 i8257_dma_init(OBJECT(machine), isa_bus, 0); pcms->hpet_enabled =3D false; @@ -316,7 +315,7 @@ static void pc_init1(MachineState *machine, } =20 /* init basic PC hardware */ - pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, true, + pc_basic_device_init(pcms, isa_bus, x86ms->gsi, x86ms->rtc, true, 0x4); =20 pc_nic_init(pcmc, isa_bus, pcms->pcibus); @@ -343,7 +342,7 @@ static void pc_init1(MachineState *machine, } #endif =20 - pc_cmos_init(pcms, rtc_state); + pc_cmos_init(pcms, x86ms->rtc); =20 if (piix4_pm) { smi_irq =3D 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 9e4b8f79c2..45a4102e75 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -125,7 +125,6 @@ static void pc_q35_init(MachineState *machine) Object *phb; PCIDevice *lpc; DeviceState *lpc_dev; - ISADevice *rtc_state; MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *system_io =3D get_system_io(); MemoryRegion *pci_memory =3D g_new(MemoryRegion, 1); @@ -232,7 +231,7 @@ static void pc_q35_init(MachineState *machine) } pci_realize_and_unref(lpc, pcms->pcibus, &error_fatal); =20 - rtc_state =3D ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "r= tc")); + x86ms->rtc =3D ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "= rtc")); =20 object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, TYPE_HOTPLUG_HANDLER, @@ -274,7 +273,7 @@ static void pc_q35_init(MachineState *machine) } =20 /* init basic PC hardware */ - pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, !mc->no_flo= ppy, + pc_basic_device_init(pcms, isa_bus, x86ms->gsi, x86ms->rtc, !mc->no_fl= oppy, 0xff0104); =20 if (pcms->sata_enabled) { @@ -312,7 +311,7 @@ static void pc_q35_init(MachineState *machine) smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } =20 - pc_cmos_init(pcms, rtc_state); + pc_cmos_init(pcms, x86ms->rtc); =20 /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, pcms->pcibus); --=20 2.41.0 From nobody Tue Nov 26 06:40:14 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023440; cv=none; d=zohomail.com; s=zohoarc; b=irZT2BbFjC0Q3wNKpdGdAPrlys/fV10yq043VmEvWJ/ONHvomhbiOIFPR58ICx0Pmkdaj4fVQBOgsFSf2ZaxONKX0Jqop1N7/atBB9kvy3fGiKPAjlq4bQOC2cUqxtauyA2xsgQ1q/ubZj3/v48TjyuNyJPErKUjamhvxTBZneY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023440; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=neUNa6vtFGWdPhcBeRIzla/viNhIcPd+5ZZ+Q+4SiBQ=; b=SV+XT6tZLhkgHGJrTLCYDMwG1jdUkPqB8K6Bih4Ww80Tv9xS7to7LzAMzQq6Zyy9nMjVYuJn+W2myO/l4cxJaIPzZVtAxSo9r92Jk3ep7S8rcYO46yHu2mwJ2oguDUgFtO5p9OXukpNBqT8jGgTFVPhwhrLBDh4HaalThp3eFCc= 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 1709023440759547.919490717431; Tue, 27 Feb 2024 00:44:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret36-0005l1-Ul; Tue, 27 Feb 2024 03:42:53 -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 1ret35-0005ab-Jw for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:51 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret33-0008UF-L4 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:51 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-412a38e2adaso14860715e9.1 for ; Tue, 27 Feb 2024 00:42:49 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id w15-20020a05600c474f00b004129860d532sm10692174wmo.2.2024.02.27.00.42.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023368; x=1709628168; 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=neUNa6vtFGWdPhcBeRIzla/viNhIcPd+5ZZ+Q+4SiBQ=; b=qlxc+0l3qktB0xYiqXIShrzXLBeV7yE5lNuJvjpJMZTDEm+mpqeqAp9KFfGuucbj/c 1GfXW+nDwPP9QH7p7cOkJeTxN1EecQ0ulij/eFGBPKBfl9PK8uTI7SDR7rUqMT1+HC3T k+TuWCNYBlikHR4lOQ2g8nyOYtR3CWPNiZZ1uGsFURh7iIn+7SWnp7Nv5ez4Rkju5VOa /0qP6tUiC/7yMKN8t8OiVL+UM+W5zy34jy4QrK32NeU47ZXrFbSnK0JCwTIgoCB0PfPi 6BS4fmz/zsNFkA1AIYIrtq+N3fjdQkG4N8TaWimYZHpTp8InZmkx4HSZTtDch/Lc0SWC jG6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023368; x=1709628168; 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=neUNa6vtFGWdPhcBeRIzla/viNhIcPd+5ZZ+Q+4SiBQ=; b=JMlhuyHVNSPUKNTKQaYssu4eHSg01FAIkHXDjjv6X6llszT288aBvIVK+pqOBrKqrF 4HoOZx5oWSJwKvbB3sfb44TDTghamFm7ZvkG+6cGgzP3Fpp2BXCFnOKrSYUCzOfr34tt nKupZXYg5a3zuQg6Ka935qTB4e0ZHFB6kd7je+sDMkZzVGYokpiI+5NiowLJocBAFTeG duVVoUCrdewyBYkHPzt6ox4eYLw2RMOitpixVfTWKucG9P4i1bSu6AAFPirAKP/V+iER ZEAIaUY2xM8S1fqZcVbEHveMVElbnpvxnjxwyIo3qh1l2FQ5Ze/Uel0AZCP9mZ+0KmLO AOfA== X-Gm-Message-State: AOJu0Yy0XowrYerCGTPlIGJXHTHdkjsushvhxfshB0F8ZiMlPN+gSBcZ NVdABMG51L8DhDoDavDmDwTOkasLS0ITi+ZNsQJRtlQZvAM5sAIdUOVOqjEeFX64Zi6mZ5USl0J 2 X-Google-Smtp-Source: AGHT+IHWKNxGAz+HFAhsktoQM7CSw6qeZ7fo8vmgNcCMJR3X6jfdp5OFBdZSJnEjWksrv4g07okMMA== X-Received: by 2002:a05:600c:34d2:b0:412:afa6:cf28 with SMTP id d18-20020a05600c34d200b00412afa6cf28mr186075wmq.30.1709023367753; Tue, 27 Feb 2024 00:42:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Radoslaw Biernacki , Peter Maydell , Leif Lindholm , Marcin Juszkiewicz Subject: [PULL 28/30] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs() Date: Tue, 27 Feb 2024 09:39:44 +0100 Message-ID: <20240227083948.5427-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023442263100005 Use ahci_ide_create_devs() instead of open-coding it. Not accessing AHCIDevice internals anymore allows to remove "hw/ide/ahci_internal.h" (which isn't really a public header). Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240226080632.9596-2-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/arm/sbsa-ref.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 5d3a574664..4a59e2fd37 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -37,7 +37,6 @@ #include "hw/block/flash.h" #include "hw/boards.h" #include "hw/ide/internal.h" -#include "hw/ide/ahci_internal.h" #include "hw/ide/ahci-sysbus.h" #include "hw/intc/arm_gicv3_common.h" #include "hw/intc/arm_gicv3_its_common.h" @@ -571,8 +570,6 @@ static void create_ahci(const SBSAMachineState *sms) DeviceState *dev; DriveInfo *hd[NUM_SATA_PORTS]; SysbusAHCIState *sysahci; - AHCIState *ahci; - int i; =20 dev =3D qdev_new("sysbus-ahci"); qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS); @@ -581,14 +578,8 @@ static void create_ahci(const SBSAMachineState *sms) sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(sms->gic, = irq)); =20 sysahci =3D SYSBUS_AHCI(dev); - ahci =3D &sysahci->ahci; ide_drive_get(hd, ARRAY_SIZE(hd)); - for (i =3D 0; i < ahci->ports; i++) { - if (hd[i] =3D=3D NULL) { - continue; - } - ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]); - } + ahci_ide_create_devs(&sysahci->ahci, hd); } =20 static void create_xhci(const SBSAMachineState *sms) --=20 2.41.0 From nobody Tue Nov 26 06:40:14 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023545; cv=none; d=zohomail.com; s=zohoarc; b=fpM8pwJgHD8uK9TnndqGzhLBt7o+IFgJRrfO2ZST/OxbaL1oiRQ14sgv9+Nq3kOdZ5DoH2tS0uI8dX+pqfPKVFCONopw2O26iB3nK2zE1cl5TPEitAIGIdOkVwVdQI4WZ1c9Isw4gdc+orgilGmevwNurNu59OnJ6VWlT3r9I0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023545; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=scR0cVRlUQ+FFZFfcolEQrGBOQjFaxkZH3KxNR75t0E=; b=VISJ3AyyyZ5aGCaHYV02dcCIVAiuu1i6pPYMlls7pby8zvTDHFWUH+GNc0V0gLuIEiRP1aR7tDJ2Irrlm4vMmO893+Dy89yCSGW0tH3wIUgNn4JfLMOrNhkkmxM+u4K7DpcFvnMyRs9Yggdv6mowrnhbXXwLcqCwllgsxTMCJIM= 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 170902354544711.528170576231787; Tue, 27 Feb 2024 00:45:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret3F-0006OA-Ex; Tue, 27 Feb 2024 03:43:01 -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 1ret3D-0006H0-HA for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:59 -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 1ret3A-00005m-Np for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:42:59 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-412ae15b06fso1899165e9.1 for ; Tue, 27 Feb 2024 00:42:56 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id u16-20020a05600c211000b004126732390asm14316282wml.37.2024.02.27.00.42.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023374; x=1709628174; 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=scR0cVRlUQ+FFZFfcolEQrGBOQjFaxkZH3KxNR75t0E=; b=JfKiBKhvAIxJUB1Vl1vpD0KgcYBHw49OT6Q+K5+nfbK04tzUPHdqWYtPYAH9P+OPrA WfUAG4QYHaTpMia8IGl1ZGQt4c92+3o3getzEgmOVUJlB05ecvAzX5NwD4RN0JTBoFR6 EBAmTXkxB/W7qEAXNn6k5EAtu/7e4whQDuvXLtgE+Ld3OEVVhlQX93ZLl7lYgf2hBO92 9UeymH7HCQ9l59SnijxA9jQeVJqo9Drm8hZCsmabE5w2BcaWRsOJxpNJoDind5QCLlm7 L5DIgbfyAI9V82hAnuLvgm3s3qD/T+foTmZsOc1kSvcHhsMDrdN/CLDaKBEFBFA52Zja Fwrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023374; x=1709628174; 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=scR0cVRlUQ+FFZFfcolEQrGBOQjFaxkZH3KxNR75t0E=; b=MixCeGccquBRxdXjtjL6igJAIB6YNgLAMrsWyBNjmROmttgAjWE+ukTOXLHvY47UVE QOBGRP2NG0wwMD4ZIpL+ScUjmL6Sa5z/UJhhNgMA+Ql6MRrIh16CYilB32xtZwrPfALj QfSNb0Tyy8ZtgzidDX7E9YcZKEjLVvlnaVGlnN6TMue8jZ6d1Qs6LjHyaYHojlQC1dbV WhKSEANc8g6FNb25hIqE4AOpMY5omaCGp3ZK6wpzMVhClfPDwXpprOne+n2oQ/8u37WV EG3lUDn/LJuwZyrnTfNQAE0qDn5atIpTlkTdAa45OxlgHxScU49WQKMVmn7MneuX1GEt mRuw== X-Gm-Message-State: AOJu0YyHr5MudW6QRIX2KavZx8n/F48b04B2SZo/H27MQEGWDx3bkrSv R7oeb12RPHV3WODEh++BLw/U87Fm1t5HkwOSoHthDbxD3YqN8kQ0RGf5Y2raPNLcABE3C8zy+Tn I X-Google-Smtp-Source: AGHT+IHKiSwpHMDm0QCksk1OSAVc8Wa5O5fe4dYvRzdN9IaQFzE8AXGmkVdhjJYJYqfyigWu81wlrg== X-Received: by 2002:a05:600c:3490:b0:412:acf1:29a7 with SMTP id a16-20020a05600c349000b00412acf129a7mr726180wmq.20.1709023374029; Tue, 27 Feb 2024 00:42:54 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Radoslaw Biernacki , Peter Maydell , Leif Lindholm , Marcin Juszkiewicz , Mark Cave-Ayland Subject: [PULL 29/30] hw/ide: Remove last two uses of ide/internal.h outside of hw/ide/ Date: Tue, 27 Feb 2024 09:39:45 +0100 Message-ID: <20240227083948.5427-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023545742100001 From: BALATON Zoltan Remove last two includes of hw/ide/intarnal.h outside of hw/ide and replace them with newly added public header to allow moving internal.h into hw/ide to really stop exposing it. Fixes: a11f439a0e (hw/ide: Stop exposing internal.h to non-IDE files) Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-ID: <20240223142633.933694E6004@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- {include/hw =3D> hw}/ide/internal.h | 0 include/hw/misc/macio/macio.h | 2 +- hw/arm/sbsa-ref.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename {include/hw =3D> hw}/ide/internal.h (100%) diff --git a/include/hw/ide/internal.h b/hw/ide/internal.h similarity index 100% rename from include/hw/ide/internal.h rename to hw/ide/internal.h diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 86df2c2b60..2b54da6b31 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -28,7 +28,7 @@ =20 #include "hw/char/escc.h" #include "hw/pci/pci_device.h" -#include "hw/ide/internal.h" +#include "hw/ide/ide-bus.h" #include "hw/intc/heathrow_pic.h" #include "hw/misc/macio/cuda.h" #include "hw/misc/macio/gpio.h" diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 4a59e2fd37..13dde50cba 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -36,7 +36,7 @@ #include "hw/arm/smmuv3.h" #include "hw/block/flash.h" #include "hw/boards.h" -#include "hw/ide/internal.h" +#include "hw/ide/ide-bus.h" #include "hw/ide/ahci-sysbus.h" #include "hw/intc/arm_gicv3_common.h" #include "hw/intc/arm_gicv3_its_common.h" --=20 2.41.0 From nobody Tue Nov 26 06:40:14 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023786; cv=none; d=zohomail.com; s=zohoarc; b=DpR8NcfMxJIseQhytfpGwamejnWsBSNp1QGxt6Ud/gdXCzCpif/hu1E/d3AjR/Cpl8HVjeDv3IONOSdzaCPkoWL6JV9ZZ5Wj0pZ+Zi3GRljuJEOSduPrhaeAr2uRkrXtMp31eCu8D7cCFHWldn1WaSlooCPLv0QHj7LrcJoG1sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023786; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1OlS5g1x3kQBWH0+dTr65wKR69P3qOgR0yhMaMPUG6A=; b=V61m68VcBUAhxywAYnJj1y6e2z7xA1+cCSGImUTHF0J8vjrDeratwSa+sg1ic2DJNY1ooRT9dWNpEWls7qHWZ408CFgVLaDCEuylAXyAEoaQZLyW3DJMxbZVQnCQOUaD9qKBt6698cZss73sEaL0p+8HdMpJTnZutQKnOcMPsv0= 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 1709023786041766.9990905203955; Tue, 27 Feb 2024 00:49:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret3L-0006V4-8b; Tue, 27 Feb 2024 03:43:07 -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 1ret3K-0006Qu-As for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:43:06 -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 1ret3G-00007N-Ii for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:43:06 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-412a14299a4so19382665e9.1 for ; Tue, 27 Feb 2024 00:43:01 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b00412157dc70bsm10788193wms.30.2024.02.27.00.42.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023380; x=1709628180; 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=1OlS5g1x3kQBWH0+dTr65wKR69P3qOgR0yhMaMPUG6A=; b=vtYHII0vZ8Y/egEBftW9wpg4NX7mRbXNrSL0Iwxu2hu796Z0zkB7Vnx8lLtn2dSXGt njR0IuseAD47myn2aA+d/w4/cifZfCdsqVxY5p3qroHUkkt+bVdwspuLoJk51uOG72Bf GcBmWB0ukoUNg5SHr9yEPMTGEB91CV9npCzZ0WeXjI57ZkS0kAUx3/UVglMl8p5NAV72 3klNWWpuNWNZDK4TcCOtMiTI6/L7SluJ+FF4FK3fS62rFz0rEGbnUinvKL623Iu7m5z6 fdsNtT3QzOVv7QcOjThksHqVdVu1mrjYT1gUvul6zPLVSOG7R9mk06WvCf8kPZdjR6Ik TrFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023380; x=1709628180; 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=1OlS5g1x3kQBWH0+dTr65wKR69P3qOgR0yhMaMPUG6A=; b=PWtJT/MEAi9/x9xCqIgHXCtlmIbVa4Hwj5zjghEenl67c/1lvTQ4zfNleGa9QR9eJS aavLGf7fJTo3EuE3yiFK51ZctSTXP0T5SIz4Lvul9zrO2hN+85jDMxfVVGudvQ710Zym XZHcEnXzqQzHS1hwcXNN34hkeVV5HAyW3CUBGwIxl94V49pf5+7+9XmJxWwM0+nF/IKN rok4FGFeeQgAq57BVt9vl43TltD7J3mcQbutxo9tq8MEn4dnK2wCdjgqQFpkMx6J9FJb hNBCJO6tPxId3g1uo0oiVEpaaB0ouUZBb+zbsdIRgu8GT0Do1R8rALfRjlrrKLVlWJvF UCmA== X-Gm-Message-State: AOJu0Yw00l6ayIAP3H2FGnrUPRrJ5CSg/EqG/DnZh5i/cmV5VvOfa+Kd kwwPhf19y+b+dEz9ZEwda5FJNE8oRyAVtl716BthMe3+wtPp2U2jH3YpqQ0tIw/SYGfhPHHFEOz F X-Google-Smtp-Source: AGHT+IHF+FF2aPEI92LYwYdejDLzaW+tO2bYPYChMLn3MlLa8xQoS1PtNrl0+eWni1Sxzxsfq/jlTw== X-Received: by 2002:a05:600c:3582:b0:412:94be:a169 with SMTP id p2-20020a05600c358200b0041294bea169mr6078523wmq.26.1709023380349; Tue, 27 Feb 2024 00:43:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow , BALATON Zoltan Subject: [PULL 30/30] hw/ide: Include 'ide-internal.h' from current path Date: Tue, 27 Feb 2024 09:39:46 +0100 Message-ID: <20240227083948.5427-31-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023786492100001 Rename "internal.h" as "ide-internal.h", and include it via its relative local path, instead of absolute to the project root path. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240226080632.9596-4-philmd@linaro.org> Reviewed-by: Peter Maydell --- hw/ide/ahci_internal.h | 2 +- hw/ide/{internal.h =3D> ide-internal.h} | 0 hw/ide/ahci.c | 2 +- hw/ide/atapi.c | 2 +- hw/ide/cmd646.c | 2 +- hw/ide/core.c | 2 +- hw/ide/ide-bus.c | 2 +- hw/ide/ide-dev.c | 2 +- hw/ide/ioport.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/macio.c | 2 +- hw/ide/microdrive.c | 2 +- hw/ide/mmio.c | 2 +- hw/ide/pci.c | 2 +- hw/ide/piix.c | 2 +- hw/ide/sii3112.c | 2 +- hw/ide/via.c | 2 +- 17 files changed, 16 insertions(+), 16 deletions(-) rename hw/ide/{internal.h =3D> ide-internal.h} (100%) diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h index 4e13329bb2..7e63ea2310 100644 --- a/hw/ide/ahci_internal.h +++ b/hw/ide/ahci_internal.h @@ -25,8 +25,8 @@ #define HW_IDE_AHCI_INTERNAL_H =20 #include "hw/ide/ahci.h" -#include "hw/ide/internal.h" #include "hw/pci/pci_device.h" +#include "ide-internal.h" =20 #define AHCI_MEM_BAR_SIZE 0x1000 #define AHCI_MAX_PORTS 32 diff --git a/hw/ide/internal.h b/hw/ide/ide-internal.h similarity index 100% rename from hw/ide/internal.h rename to hw/ide/ide-internal.h diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 54c9685495..b8123bc73d 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -34,11 +34,11 @@ #include "qemu/module.h" #include "sysemu/block-backend.h" #include "sysemu/dma.h" -#include "hw/ide/internal.h" #include "hw/ide/pci.h" #include "hw/ide/ahci-pci.h" #include "hw/ide/ahci-sysbus.h" #include "ahci_internal.h" +#include "ide-internal.h" =20 #include "trace.h" =20 diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index dcc39df9a4..73ec373184 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -24,10 +24,10 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ide/internal.h" #include "hw/scsi/scsi.h" #include "sysemu/block-backend.h" #include "scsi/constants.h" +#include "ide-internal.h" #include "trace.h" =20 #define ATAPI_SECTOR_BITS (2 + BDRV_SECTOR_BITS) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 23d213ff01..8cebd1b63d 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -33,7 +33,7 @@ #include "sysemu/reset.h" =20 #include "hw/ide/pci.h" -#include "hw/ide/internal.h" +#include "ide-internal.h" #include "trace.h" =20 /* CMD646 specific */ diff --git a/hw/ide/core.c b/hw/ide/core.c index 9c4a812902..130c4d8865 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -41,7 +41,7 @@ #include "qemu/cutils.h" #include "sysemu/replay.h" #include "sysemu/runstate.h" -#include "hw/ide/internal.h" +#include "ide-internal.h" #include "trace.h" =20 /* These values were based on a Seagate ST3500418AS but have been modified diff --git a/hw/ide/ide-bus.c b/hw/ide/ide-bus.c index 57fe67b29c..37d003dd9a 100644 --- a/hw/ide/ide-bus.c +++ b/hw/ide/ide-bus.c @@ -21,10 +21,10 @@ #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" +#include "ide-internal.h" =20 static char *idebus_get_fw_dev_path(DeviceState *dev); static void idebus_unrealize(BusState *qdev); diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index c8e2033469..799bd4b6ec 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -23,11 +23,11 @@ #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" #include "qapi/visitor.h" +#include "ide-internal.h" =20 static Property ide_props[] =3D { DEFINE_PROP_UINT32("unit", IDEDevice, unit, -1), diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index 0b283ac783..a2f457f0bd 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -25,7 +25,7 @@ =20 #include "qemu/osdep.h" #include "hw/isa/isa.h" -#include "hw/ide/internal.h" +#include "ide-internal.h" #include "trace.h" =20 int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) diff --git a/hw/ide/isa.c b/hw/ide/isa.c index cc865c83dc..934c45887c 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -32,8 +32,8 @@ #include "sysemu/dma.h" =20 #include "hw/ide/isa.h" -#include "hw/ide/internal.h" #include "qom/object.h" +#include "ide-internal.h" =20 /***********************************************************/ /* ISA IDE definitions */ diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 0d2c6ba910..aca90d04f0 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -33,7 +33,7 @@ #include "sysemu/block-backend.h" #include "sysemu/dma.h" =20 -#include "hw/ide/internal.h" +#include "ide-internal.h" =20 /* debug MACIO */ // #define DEBUG_MACIO diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index a7f415f0fc..3bb152b5d3 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -31,8 +31,8 @@ #include "sysemu/dma.h" #include "hw/irq.h" =20 -#include "hw/ide/internal.h" #include "qom/object.h" +#include "ide-internal.h" =20 #define TYPE_MICRODRIVE "microdrive" OBJECT_DECLARE_SIMPLE_TYPE(MicroDriveState, MICRODRIVE) diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index e8f41c0610..8736281305 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -30,8 +30,8 @@ #include "sysemu/dma.h" =20 #include "hw/ide/mmio.h" -#include "hw/ide/internal.h" #include "hw/qdev-properties.h" +#include "ide-internal.h" =20 /***********************************************************/ /* MMIO based ide port diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 73efeec7f4..4675d079a1 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -30,8 +30,8 @@ #include "sysemu/dma.h" #include "qemu/error-report.h" #include "qemu/module.h" -#include "hw/ide/internal.h" #include "hw/ide/pci.h" +#include "ide-internal.h" #include "trace.h" =20 #define BMDMA_PAGE_SIZE 4096 diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 1773a068c3..80efc633d3 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -30,9 +30,9 @@ #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 "ide-internal.h" #include "trace.h" =20 static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 321b9e46a1..af17384ff2 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -13,11 +13,11 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ide/internal.h" #include "hw/ide/pci.h" #include "qemu/module.h" #include "trace.h" #include "qom/object.h" +#include "ide-internal.h" =20 #define TYPE_SII3112_PCI "sii3112" OBJECT_DECLARE_SIMPLE_TYPE(SiI3112PCIState, SII3112_PCI) diff --git a/hw/ide/via.c b/hw/ide/via.c index cf151e70ec..a32f56b0e7 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -25,7 +25,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ide/internal.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "qemu/module.h" @@ -34,6 +33,7 @@ #include "hw/isa/vt82c686.h" #include "hw/ide/pci.h" #include "hw/irq.h" +#include "ide-internal.h" #include "trace.h" =20 static uint64_t bmdma_read(void *opaque, hwaddr addr, --=20 2.41.0