From patchwork Tue Feb 27 08:39:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776183 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52929wro; Tue, 27 Feb 2024 00:46:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWoqIMd8/uPr0bKbMkizS9TjgyowsSkI+WUgFm5kVQRHDpp49VT8mkB4T06+qXY8E1mE2ftsGsGKWamp7ArhEqw X-Google-Smtp-Source: AGHT+IFvmGQx67Vrgfk40MZaYWiw3zk4kwT8pm+o7oFtDSf5nfnHpRPcOMHbFlJ8czZXYdm4cr9W X-Received: by 2002:a0c:9709:0:b0:68f:cd2c:ee9e with SMTP id k9-20020a0c9709000000b0068fcd2cee9emr1379323qvd.11.1709023596801; Tue, 27 Feb 2024 00:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023596; cv=none; d=google.com; s=arc-20160816; b=z5U/9+gBqrj/Vr4wjM8fM8mHio5Fql+Xahd5Cgys+zQrhnT+EV3/gUds7JEgVJShHQ twlFhVU167yIWU6nA/RvwmseOt509mVZ+qOPXY0rWCrFjTt+1MeKZofXKxodVEvsaCNL z8W9bSuuE315oxfh1tHRnYOowmZzzXvI6gWC2hBof2FJ/+xygR6Qi302GSxsoob2UES1 74NY/YKJ/MwB/IJ9aO9FXGyETMY/Os29sd972vv/In6mLUZbOKmLiHNERvqILBr/fREN RmE7igS3BUVqTgiu+czaUGM/odG2JjX5dGXJIay5arNPKXaO1s6h4fsKhXmTz2euigkK FM6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F4m0v/in85DGPLUDveir9W6g6TNXCVbXdqiQPBjdgEs=; fh=RAilKXgZZSQ2VA604P7r8JOHd7UZMoG+TqHgVEWkduM=; b=haa3rFVowm0f8BKLz1+/BllcE6Y60mB6negqiNGOOpnF5J7HvzvYTDF3RJgClL9VLV tY9yycWaHaLaHov3ZdSD+sqDB4TPimAAFimuQeNr0ASdV1MgTNA5/sG2ceZrl5ie2clB v+xlA2HxW3GyOnTXL17yxc/dUqEDEWOC5Dfv72u3IhahVNzf5I5cBbJuJsDR1++t1UZW Z6HsxAPuPLEaCRol8hxrSk9g40raZX92LzqYzeKjsJARZ0LyiS/mMS13WJpC0Ucp4LFM peP1T6sZonYMfyspzmlBuftY9V2T99BijPkR+MeMYQ51zsFjSznHIPk9OFYbSe4gG5lW mkEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DBJSLat2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id js5-20020a0562142aa500b0068f3fccc515si7073082qvb.394.2024.02.27.00.46.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:46:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DBJSLat2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Richard Henderson Message-Id: <20240226173805.289-2-philmd@linaro.org> --- 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]); } - sysbus_create_simple("pl110", 0xc0000000, pic[22]); + dev = 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]); integrator_binfo.ram_size = 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 = sysbus_create_simple("pl061", 0x10015000, pic[8]); - sysbus_create_simple("pl111", 0x10020000, pic[23]); + dev = 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]); dev = sysbus_create_varargs("pl181", 0x10005000, pic[17], pic[18], NULL); /* 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) /* The versatile/PB actually has a modified Color LCD controller that includes hardware cursor support from the PL111. */ - dev = sysbus_create_simple("pl110_versatile", 0x10120000, pic[16]); + dev = 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)); 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 = MACHINE(vms); MemoryRegion *sysmem = get_system_memory(); + DeviceState *dev; 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 */ /* 0x10020000 PL111 CLCD (daughterboard) */ - sysbus_create_simple("pl111", 0x10020000, pic[44]); + dev = qdev_new("pl111"); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[44]); /* 0x10060000 AXI RAM */ /* 0x100e0000 PL341 Dynamic Memory Controller */ @@ -650,7 +653,10 @@ static void vexpress_common_init(MachineState *machine) /* VE_COMPACTFLASH: not modelled */ - sysbus_create_simple("pl111", map[VE_CLCD], pic[14]); + dev = 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]); dinfo = drive_get(IF_PFLASH, 0, 0); pflash0 = ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flash0", From patchwork Tue Feb 27 08:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776162 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51449wro; Tue, 27 Feb 2024 00:40:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcVwv1lNxDUTm1SiKUEuo7vGSUG1oxrA0Aw3yzbD3c2RnOs1ZobpqFv6ZFUxTX4aljMtCAMmDKIOIBmO+UQKyz X-Google-Smtp-Source: AGHT+IGsljJN7n/YpPKVgnRtZTRlC1T8BXG0Tez7kH3zU/6jAlRuyafuz3yAbGaI6kqB6Jqu0EiR X-Received: by 2002:a81:ad20:0:b0:604:9b50:e973 with SMTP id l32-20020a81ad20000000b006049b50e973mr1471992ywh.44.1709023239648; Tue, 27 Feb 2024 00:40:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023239; cv=none; d=google.com; s=arc-20160816; b=pJ9Jrib7yFM4SLLW39AmRUjArzV1qG9nuQKWiwwGW0mObs9Pe3EyBsnMnhha0NasQI iyUFLEaNy6da8j+IGn+BmW0nqzBR/zPtvRfpirgxVqtHXsr2B0PpyviS1lFl8puyGCQY mcG0Ry2uy2fBbo8DGwaujeQu+0CWZi17pSHPxxOhIXbiEztH3fZs1gPFW04KBb/9fxoA jpDn+/N7zZhSdVJaBSz6aR3n6blHauKHEbJBybJZ7revqYSNUKf56ID2Yt+Gf4t7rHXr dmc+3ZQxhjcJuJtn08M2WfmxgwHkAvcWTP8h5QsDbhirO0l4NXcKCDgHTADHPmShdrBk mrZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VnEDXtHkt/194uNClzvCuVob3BL+zj1HTpnUIrcdYvs=; fh=RAilKXgZZSQ2VA604P7r8JOHd7UZMoG+TqHgVEWkduM=; b=b2iPc1rQQCs1cRr0tMDkUeAFMgPfwFwjUWWXE32v9fCeI2/DaeeiBlGMvoTBPDgMa2 o226CNnmdBpq6mjHkUi+D2j8/tQMBglA4C12t0Blcs6ts8YSnOg3czPXeCrKfqT8NioQ t+iwt96+I7Y3UudZvr3io7hExA2Z6RYrxd/5ZpmLZcFznRpoy2ueDDFaz4c+I6HzKoub zHjBYyJp4WKGHl5IiCuIm//l8A0CYRcDJBJhlywmAo4hph7T68iECpSqhNI2DxuE+ycE H3f5Ejjuk5IF4k5wh+VENiL0A8XmZdzCfM69xHnBEiDH9ajMRJbc/EvrEf5r2qV2a9Bh xmww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rf4ROqkT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d22-20020a05620a205600b00787d47364e6si3358280qka.599.2024.02.27.00.40.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:40:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rf4ROqkT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Richard Henderson Message-Id: <20240226173805.289-3-philmd@linaro.org> --- 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) } dev = 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 = sysbus_create_simple("pl061", 0x10015000, pic[8]); dev = 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 board_id) /* The versatile/PB actually has a modified Color LCD controller that includes hardware cursor support from the PL111. */ dev = 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, /* 0x10020000 PL111 CLCD (daughterboard) */ dev = 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]); @@ -654,6 +657,8 @@ static void vexpress_common_init(MachineState *machine) /* VE_COMPACTFLASH: not modelled */ dev = 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" #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; }; 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 = (PL110State *)opaque; - SysBusDevice *sbd; DisplaySurface *surface = qemu_console_surface(s->con); drawfn fn; int src_width; @@ -222,8 +224,6 @@ static void pl110_update_display(void *opaque) return; } - sbd = SYS_BUS_DEVICE(s); - if (s->cr & PL110_CR_BGR) bpp_offset = 0; else @@ -290,7 +290,7 @@ static void pl110_update_display(void *opaque) first = 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 = { .gfx_update = pl110_update_display, }; +static Property pl110_properties[] = { + 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 = PL110(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); + 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", 0x1000); 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 = &vmstate_pl110; dc->realize = pl110_realize; + device_class_set_props(dc, pl110_properties); } static const TypeInfo pl110_info = { From patchwork Tue Feb 27 08:39:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776161 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51429wro; Tue, 27 Feb 2024 00:40:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXz8ddJGTkfoGP6lIPivLdrBbOOJJXBJpTRcbPHHSQY2rY1rzohWAKYn6AgQPK7Qk0sMXXKGEV28+/7x2jUSSNB X-Google-Smtp-Source: AGHT+IHAmKAvdqNKUpVdSTXKPtlZQP1ffU7uYudn+TOAHt7AppG00i42JVXwH5Y6ErgRcAtX/OY/ X-Received: by 2002:ae9:e64d:0:b0:787:635d:abad with SMTP id x13-20020ae9e64d000000b00787635dabadmr1448443qkl.63.1709023232935; Tue, 27 Feb 2024 00:40:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023232; cv=none; d=google.com; s=arc-20160816; b=ac1aJ7+MRxyGRAgcdEaMwrtS0qWeBg1iMA6iSw9NynQRVDSkYE0awadXdU9shIObwM rh9WX9BUpDI7DqWt/4/3GzLc7hFvBYpVK7Shc89SxSOTQ7pst6dU3cbkaUsYs6DTccqR cyNgnY8C4aaSuNDtA5kXLYmOGe4al0jihmMR+d2U2uLlJ9Nr7ky8dkcZWZbbTjfU1UBp P4YVJCUTBxhYwNj7cIfpQJ16zbIBa4N0/8i/tHwLqRGoW5mp3BHyuihiegeN332jyJ67 Hd07abqkKE//FyhqfgfpGyL+MJVehkglbpqD7tX9+5kA0By7dVkLLZ2mszz+xX9Uiv8h dsNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B2Yugy2awLwnvm6DU00n3Q4waoAG+V4YGcUxNOBpaJg=; fh=MScVkeQ2iRsrAkejgD6U6vOGzjwdgMbmd00ccH8lUbg=; b=N9Tz/Qc7WTv/Y5HPs7HCdoE/9q8otYaOGjV05BKSfAKz//y8cIK28iVea7wD/d5hW6 jb9YpcILZWJsDP7Z1vmbXWzp283zeSL/MlefnqEkXUNV8a5XsNHLkjGPbXdywiqSFInK e/W+QAQoX/Wo/RLeiDajXfYYD+y279ojYc5wXeUV2BAMfHvkb6xohzGKDNtStOilEGud Yc5Pfb9POEf3Hhl5D03eAZ9lDVdIpLCow1swpEMK82X8mJtIy6RbKwfxcawSD9v0kSub DAoy8tZ/xy3ElVlo2DLqexzpyENlUQs3DCnuphc/PhtA0eTucjSlu7+T7fU3zO9DCr8d R6RQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2HjFy+w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p20-20020a05620a057400b00785d69d0758si6580618qkp.2.2024.02.27.00.40.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:40:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2HjFy+w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-4-philmd@linaro.org> --- 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, Error **errp) } /*** 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 = qdev_new("exynos4210.fimd"); + busdev = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(busdev, &error_fatal); + sysbus_mmio_map(busdev, 0, EXYNOS4210_FIMD0_BASE_ADDR); + for (n = 0; n < 3; n++) { + sysbus_connect_irq(busdev, n, s->irq_table[exynos4210_get_irq(11, n)]); + } sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, s->irq_table[exynos4210_get_irq(28, 3)]); From patchwork Tue Feb 27 08:39:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776165 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51817wro; Tue, 27 Feb 2024 00:41:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW0fUoG8q95XRlaHMY7H7fE78J7ji4eDtj6TKbjBIe/+owwiNFjszKmFaJ6qRmnX+uzHftY025tev+SXob3iXQL X-Google-Smtp-Source: AGHT+IHhpsxLgLp5aR4sSEijGheCyhUMmQS9X3sRg3JYkuLHQK/BUeoZcdIYeZ3PEKcxWOrONElH X-Received: by 2002:a05:620a:27d1:b0:787:e1e9:a42 with SMTP id i17-20020a05620a27d100b00787e1e90a42mr1529516qkp.5.1709023316558; Tue, 27 Feb 2024 00:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023316; cv=none; d=google.com; s=arc-20160816; b=o9HRyjMRhvzsSjNKoVOspQNeEvcPl3d7eqYUv0qjznZH2maJuSx7rXJoKOEyUyv7Jd BVHfXFYv/mjjeYuaiSGL8YOFLrwEFxC5hHGIKiqpdERkXadiBBaK9QgZzbPg6moJq9lv zRsknY3jpehMV45+nB0mNyDykKLrX3HiXqKO5WC8vxH3IyFV1bTkc3mimXAWIHafTlB2 EXI+qLXQkQzJ/yPEAYkz78UqUU/N2w5od2yA9G+NBb4y+LxNOj/W533WvHlswGrq/02I g4CGCtwdiCjKRkESlKLTZgrM/XLlgRdpMb+6eHzDQGHqHegGt4tHYp7CC+yPvHwxHGgh bW4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vqc0dN+90FxlJ0ZwXpMXw0U7lDa+rLwNm5jLhzGNtec=; fh=MScVkeQ2iRsrAkejgD6U6vOGzjwdgMbmd00ccH8lUbg=; b=XUuWAZ6IDDrrXma64o0ReR5hNSNtMW8l2Zwe/Qt/R8zqsdPbMyeerd/S4qgv11P/tH N3gtYAJcNqh/ZjVENl8961Bv50h/EyvmmxTsDFHGhQ+cYtkH4fNr5b4zPb/lPW9CmaAb ZVv3Pkjz3Tayb86OveaWwF04odZb+Qr+iPT7PJgg+fKP9St5c4NGlB52+ZyYqKP2D5J5 ZDqgGr0qyRGVFI71AEfDeF1fJAK1LZJ74riusf47QQ8W7yI4Q/NzIRN3AAKBVhGvH9dw JOOt2X2hKTdQOBo/1XGkB+SsEb/YNolsn3ENVml5CY4meCmsu7fQW8VwWAVJK6v6BEW5 LU8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QU/VyRbt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z8-20020ae9e608000000b00787e872a47csi410603qkf.571.2024.02.27.00.41.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:41:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QU/VyRbt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Richard Henderson Message-Id: <20240226173805.289-5-philmd@linaro.org> --- 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, Error **errp) /*** Display controller (FIMD) ***/ dev = qdev_new("exynos4210.fimd"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(system_mem), &error_fatal); busdev = 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 @@ */ #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" /* Debug messages configuration */ @@ -302,6 +304,7 @@ struct Exynos4210fimdState { MemoryRegion iomem; QemuConsole *console; qemu_irq irq[3]; + MemoryRegion *fbmem; 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 win) { - SysBusDevice *sbd = SYS_BUS_DEVICE(s); Exynos4210fimdWindow *w = &s->window[win]; hwaddr fb_start_addr, fb_mapped_len; @@ -1147,8 +1149,7 @@ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win) memory_region_unref(w->mem_section.mr); } - w->mem_section = memory_region_find(sysbus_address_space(sbd), - fb_start_addr, w->fb_len); + w->mem_section = memory_region_find(s->fbmem, fb_start_addr, w->fb_len); assert(w->mem_section.mr); assert(w->mem_section.offset_within_address_space == fb_start_addr); DPRINT_TRACE("Window %u framebuffer changed: address=0x%08x, len=0x%x\n", @@ -1924,6 +1925,12 @@ static const GraphicHwOps exynos4210_fimd_ops = { .gfx_update = exynos4210_fimd_update, }; +static Property exynos4210_fimd_properties[] = { + 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 = EXYNOS4210_FIMD(obj); @@ -1944,6 +1951,11 @@ static void exynos4210_fimd_realize(DeviceState *dev, Error **errp) { Exynos4210fimdState *s = EXYNOS4210_FIMD(dev); + if (!s->fbmem) { + error_setg(errp, "'framebuffer-memory' property was not set"); + return; + } + s->console = graphic_console_init(dev, 0, &exynos4210_fimd_ops, s); } @@ -1954,6 +1966,7 @@ static void exynos4210_fimd_class_init(ObjectClass *klass, void *data) dc->vmsd = &exynos4210_fimd_vmstate; dc->reset = exynos4210_fimd_reset; dc->realize = exynos4210_fimd_realize; + device_class_set_props(dc, exynos4210_fimd_properties); } static const TypeInfo exynos4210_fimd_info = { From patchwork Tue Feb 27 08:39:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776164 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51812wro; Tue, 27 Feb 2024 00:41:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8s0mAVmonznC0/YVpmXvsTDdHOtGxsQ/K3lUV8ELDfbfTuJbjfvmYVo9iYK5TCip46Zd6+Iv3Dt5DgM9nSi1W X-Google-Smtp-Source: AGHT+IGItYHc20BxFmcW1KMljrclnIGldDV7hoicFeGn9quIWYLIDieVE4lDSbcJGfcOCiWYcYg8 X-Received: by 2002:a1f:66c4:0:b0:4cb:fc25:7caa with SMTP id a187-20020a1f66c4000000b004cbfc257caamr5830367vkc.14.1709023316060; Tue, 27 Feb 2024 00:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023316; cv=none; d=google.com; s=arc-20160816; b=wSSbgqIgwD1E+++GhymyFLok2cRka5WkCJcHq6M3sQ44J0N8rOVqf8dx7G5LjQRWtm xx4gIU2YDjiPEqQfRmVV7B3FYwtJr51Wo2WRWhvCItfvl7EueVbJyk2shHKyIP6+9V53 DCFBDg+ZGIRR7rLt8IHD6c7XSxvX1QfhxsDmuehxSwZhgT11cr2dGWNQjjaWMASGa1wR mZZ0BnSqDDBSr2u4Z6JdkEDdVvUfyszT4irT1sPdifq9TNmNlTv7GdO6ob5PQPxyvQJ5 pG5QgWoi7RKRP/0MS215DwqdUyaI7BiEVeCGr2xzEWo49543p2PIjEzJBCjSCjgdre/a MEog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; fh=jdqxU0EHxMaoA/JdPsT0JoxMmBNOHKqhZGXVqFVYVfk=; b=A3iz3iev128vldyh58KETQGdB7pAVLsNRN7dRhxkJiNeymfmlI8oLoNRogt+DPlPKi W70QGh3ZLA2rflTujPnNX1yqL/nyxdqeQ4JNqNyVhLZQDzZiarSgM/sG1LBkKMANZhW+ 9EO6Cm1JjwZmVTsJYulTA18gIaiLhaPRfo2NAm1p0rKduBtYBe4yKFlcJAiyUkR2fng9 bW3xhBjN6IqFds3nqH/KtJpoMdT+7ZyFbG469IQKWKS8twvnL4pyth2yrlIzeXsynctz PsydjgyayLeo7wyuYVY0Qgp7bmaUrXJoc8bmmLR1Ab1uTXnNP8nm+SSn0HFlAwqfUpN2 2pHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V7dI4Ho9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g16-20020ac84810000000b0042e7b1c0954si5632467qtq.401.2024.02.27.00.41.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:41:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V7dI4Ho9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-6-philmd@linaro.org> --- 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 { 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 = s->rom_state_paddr & ROM_BLOCK_MASK; MemoryRegionSection section; - MemoryRegion *as; + MemoryRegion *mr = get_system_memory(); size_t rom_size; uint8_t *ram; - as = 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)); } /* grab RAM memory region (region @rom_paddr may still be pc.rom) */ - section = memory_region_find(as, 0, 1); + section = memory_region_find(mr, 0, 1); /* read ROM size from RAM region */ if (rom_paddr + 2 >= memory_region_size(section.mr)) { @@ -614,7 +613,7 @@ static int vapic_map_rom_writable(VAPICROMState *s) memory_region_init_alias(&s->rom, OBJECT(s), "kvmvapic-rom", section.mr, 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 = true; memory_region_unref(section.mr); From patchwork Tue Feb 27 08:39:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776172 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52099wro; Tue, 27 Feb 2024 00:43:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpNBQGnVya31xAIWlA5U1qnpoSy81w2i6KQU1Mb6DdcLxqtCLYm22gMORGM/pjm9hI3To5OSdN4w6NI33Na0o+ X-Google-Smtp-Source: AGHT+IGI2oWWhApJGOlYZ4lfdk9i3s+Ya2wov0CGz89bFjfuaUyGqSy4LNm4AQOpERnk1u0gJWYT X-Received: by 2002:a05:620a:468f:b0:787:a7c1:b450 with SMTP id bq15-20020a05620a468f00b00787a7c1b450mr3086605qkb.4.1709023391526; Tue, 27 Feb 2024 00:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023391; cv=none; d=google.com; s=arc-20160816; b=a3DEfUsFRKTsRkAjRKbG3OId2LNqkvkGABit/s/euv7bmk3wVJf95YUUxm7mFjyryg KJzi8ACisfOjEK5JTJRBi71IThc51D3EwQLmRjTz/KRU6AkoKvfPiZo0d4MZ8dRKWEmb Th5pUpKz+y2DXHfX5jVjj5I+sUhhYPGxx0qEBg3ZrJmX6cccqOYF9asWMobVDjx2y1Bk mdgiipZXt1i8MpgNcrhuwyG4z3hbGHyBDT3gAKExxvWNkJyP24Q7RhJ4nEHZogUhpp2C ApOZ5SBIwHE14v/nII1NYLFgqJJSUcBYyXj8754yc35Y+uoX26rzNOi4ZjPTAU2Wh3hz jG4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vsQjpNWm982u5XBOq7wYo0dWEjdVwmwHsexBrMcBwNc=; fh=DVQDeCyvL8ZObCVntu6D/cc1adgCmny/lLpYkgUViVk=; b=VfQaKXd4kd5vbKfsoE4ScRa/ULVoVo5DHA/a0VD6EiwyomnI0YGD2FQBU7Yax6KreE +nLScaxkNvaw70CRxEnACnokwLKIS212madmBw8PHk4bhxGSrub0YiM8KlYU0Dr+B66S FywNZ+zXoxzndAUY3HAHFP4Qr5u7xe4LYhvGiQiIaEzQivXnhrb/v2tmTzsdYQJ7h1Vs V8bh6GWqSd0Pne5//wu5DlIBnViX2ReEvGylvrFmbuTI2U5Irjl/ramd/E/WZcydEdpc sqa2v5uX8cqqD4RtfnBCgKbUUbB3ZOfv8xR9o+3ekUQlC9bp8T6eqbsjefN7CZBQ9t+r ussQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rvjr6+DU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f30-20020a05620a20de00b007856e7734e9si7017943qka.366.2024.02.27.00.43.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:43:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rvjr6+DU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sysbus_address_space() is not more used, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-7-philmd@linaro.org> --- 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 addr); 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); 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)); } -MemoryRegion *sysbus_address_space(SysBusDevice *dev) -{ - return get_system_memory(); -} - static void sysbus_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k = DEVICE_CLASS(klass); From patchwork Tue Feb 27 08:39:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776186 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp53415wro; Tue, 27 Feb 2024 00:48:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJAihOxsSzUGrA+GdGPgOLSwPoUJ5B0vl9fYCsn+BkU0/xbheUq+8FmJYV9hZJ1SxkX/G1EjOQzycRUpk3/3rX X-Google-Smtp-Source: AGHT+IFVpnCD5FHd1Uxcw6dotT+UYtPF7DiPqJebje/Aai/OAaNI+8C95cA//04YxfiZvdIWZKNn X-Received: by 2002:a05:620a:450f:b0:785:9ed9:b638 with SMTP id t15-20020a05620a450f00b007859ed9b638mr1701854qkp.71.1709023710702; Tue, 27 Feb 2024 00:48:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023710; cv=none; d=google.com; s=arc-20160816; b=w3yC5ifUFfPN/eZC1jRUTTsN3v3NNhsEB6S9SoofZlUAcQRL5rmoW3wpdopVH01AtM EoKnu6KpoYe8qb8J0YEAoPW+SInZ3hKrvN/nA8WbvZca49hEiDFwGd/PLbslY9pPmJfN aw+N0N435eEukxc7h97yu01yJC8Fm1a53DRLIBq6UkMkZChlj0n5EAvYMOeimvAQwMr1 pLSZXzxDJ5E87MXqsheU9AwAdlBGQlyLnvxVh0TPtxRxE16JqLZI0ADICKpmp2jyQBpF ko6bFMSlqp4skhqAn3xeSe4tsHEFBNEWsQYFX9HR6ELuPZjCdQ8iH+QnyeHopj+yZR6c eNQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VFksONIBdqYx5443JbI5pC5i+NSIyfbO3mN1D7EMdV4=; fh=UWsBKeY+UbNZnoXcKfcK9IuZXYZaXHAkv5/tfDi8eN0=; b=Px5dDcoDTpDwoRxACweaMnG+xew+IgJbYbNmFZSbFFC2efn3MoZ1QdT3koIaE2lj9y k935sfeWgP7x7pMi0HSyMc4t+VfonzF1zuuXXwNlBePXvtFcmQM22CBN0pfLRLVHOQWp IHi77pYnRKHXw62E6bY4jNjM2C5sNwkAbI4mLluGX279wrqzyfP8njfLzrwEpGHk0Rds vmqaJAhauYcE82Q31mOZYzi8tIUzki4EcJ2r7UKcFfuykD5PS98HmhWKjPH3nXUFB5sk AOrVtXvcvp1cPxd1/pymTcqyU0tc7I30dPWrlIYO0xnYK8NWBdp1GIq3vozrNR0aTTc1 DQUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M9rBA+wk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id wa26-20020a05620a4d1a00b00787354bed11si7012173qkn.413.2024.02.27.00.48.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:48:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M9rBA+wk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathie?= =?utf-8?q?u-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 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: 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 Nubus ROM images are unusual in that they are aligned to the end of the slot address space. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-ID: <20240111102954.449462-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé --- 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 @@ #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 = NUBUS_DEVICE(dev); char *name, *path; hwaddr slot_offset; - int64_t size; + int64_t size, align_size; + uint8_t *rom_ptr; int ret; /* Super */ @@ -76,16 +78,24 @@ static void nubus_device_realize(DeviceState *dev, Error **errp) } name = 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 regardless + * of the size of the Declaration ROM image + */ + align_size = ROUND_UP(size, qemu_target_page_size()); + memory_region_init_rom(&nd->decl_rom, OBJECT(dev), name, align_size, &error_abort); - ret = load_image_mr(path, &nd->decl_rom); + rom_ptr = memory_region_get_ram_ptr(&nd->decl_rom); + ret = load_image_size(path, rom_ptr + (uintptr_t)(align_size - size), + 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); } } From patchwork Tue Feb 27 08:39:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776166 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51834wro; Tue, 27 Feb 2024 00:42:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX72TY1nuBoBQ2eud7ppw+gNTsq4bRCESKuGXUdDxE9eXkQtq9t26HmHeF1g7rm+YSR+SOdRXxJ7g0Ed+Gu1X3v X-Google-Smtp-Source: AGHT+IFiqFM8gdelCj3I/+DmALpKC/fQo2kTNxjvJ34kG1dn+Z+eW5c+ZsFRvrBHlu/40v0T/K9N X-Received: by 2002:ac8:7f14:0:b0:42e:9146:9eaa with SMTP id f20-20020ac87f14000000b0042e91469eaamr2992227qtk.65.1709023319784; Tue, 27 Feb 2024 00:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023319; cv=none; d=google.com; s=arc-20160816; b=Ddo9lMEy41zyKi8ULOH/GZmRkOnzVoYu1lpwQKZxTDrbtwQBlV6z36g5paYXgWxqTg 8Osq+cTKXTI9JyO1qhKnj0kjlAydp/buT+U/jZMRYG31zeuYbHVRXVt5dUKk1ps8rylL 1FE3I8qhvbAYHxg6RbG19JhoQbFX3QD0MSV+uSfaHsXXyZ9vCHAqI6k1RLSFhplvCjq/ 1XSZHChjzDfvHsNrXjRdoOkJ4uUWpWQ8ziJfsh2hn3IigM4xxvq5gm2kmrmunG0RFv2k OdUIzSvU7nnpbTeKZmbQ+DQbQ+8nV26Ao/BTRuDMUB1UJr4HCKPFctXV4h+orfVn+O95 pCHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tJyS5qt8DjA8G6kRexYPEmNOufFI9EWHlHMdi9Zk7Sg=; fh=Rw0lzz6KIvos3k/dB4p+oAkufNHHqiirxTRZriwe4mg=; b=u41z9p5hzSYZ6dEhiaYUhi3Iv5sRZ6z5AsEKGUP+5JBVeFZQwhfLu7R+AWlr700wUY P4Fm94n6phFEoD+UNyOF3E1vLeSFAbyIeceQmmLPe1qmBjW6Wr6jbfks6kWy9zbgv+8K w5HleuTbdH5djfVd9Ivw3AsP9X3SB5b0h6K0vCpXQNSqiFDLDvSrPhdIVBZ4ls1ctV06 lH7xNd3lMYfZgBvqYlVwAiwvRYR+la4lc+bUEbLbwWFJwV6YvFkAPQzJUq6X+nQVFCLN qx4ZT0gTgUiZOHi5gU8av78u1pzntaQX3HWEFQwyhPQH8tGuMxEH1UYc7Ye4ALXqsM1N S6pw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=in1tBdvN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s17-20020a05622a019100b0042dc7bffb9asi581984qtw.476.2024.02.27.00.41.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=in1tBdvN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 that exceeds this limit. Increase the maximum size to 1Mb to help make life easier 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é --- 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]; }; -#define NUBUS_DECL_ROM_MAX_SIZE (128 * KiB) +#define NUBUS_DECL_ROM_MAX_SIZE (1 * MiB) struct NubusDevice { DeviceState qdev; From patchwork Tue Feb 27 08:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776188 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp53427wro; Tue, 27 Feb 2024 00:48:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUAHONvZQIDraufD3zWHjVO/6rcndbF/l/yO+xUdJjfGRR+yx6u9JowD+t9EQKpI6W3iDRABSteld/oG0jkO+5b X-Google-Smtp-Source: AGHT+IEMSywn1Aww8/TY0jp3lqTIGLVU3HK1OpGRip6jltosGuTRD2QaMb3OA44sDQ3q+QDr+V07 X-Received: by 2002:a05:620a:4593:b0:787:7298:c8eb with SMTP id bp19-20020a05620a459300b007877298c8ebmr1851039qkb.4.1709023713404; Tue, 27 Feb 2024 00:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023713; cv=none; d=google.com; s=arc-20160816; b=vOvIGx6OpYOwhts4sTF/Nk3IrsQWHigxggddD7UgSLIrwx1dtY/HNfX35d+nJD6Bmt 6/DINmxRGcieGNMJiYH+f+eJ8CJZYhL9pcRMFm9BLat8hx3KuwEPcBYwtj+omqTPEIE8 9bsa0yCXXevFTgAul0nH/t+uHn2zQxiPAAG8sctzOgWth2hJIhz3l6GRMhyFTiG9Fsqt TKfUsuzDLGV+q0X9rt3p91MHF29WeDil4rI8/4EdjYUTwMljItkzXgRmYOniikrwg2uD kq2n/2fuzVhkwY3anLsvTAUOo4E3FlMntRpFHQYKLx2KfThS5dduhT24lXlHjQfb4JNK Eo1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XSLapJ/N2+XLeA9rBJUgjR1T0MBY+vpck1YklG7N1oM=; fh=Rw0lzz6KIvos3k/dB4p+oAkufNHHqiirxTRZriwe4mg=; b=PPuZMif2ZIkbvIHQ5oPW3TTW9IDAQVd/2LYsKGjRo646NN88SJzPa4BNz/BHU/RPo3 m0NayQfyWU3FHPFX5fhh15VkNRjEbnDTlwC+RMLWCsfyM07v8ygAFJHVB47xe6c6Hl6Y n19rXL/ZeK8pNDDDKqIOYX+YDro4Q2KOeF0tHePV1QNrOFM0QYX4fHVbl8LvvYfS1kWX 5rt1aFiOdislbiwJMqo+nZsKnFm9evtIAvpe+YMG3FCQwjI4Ft2TkaMmBfGwgL0dlPzg zv56oe4AV+w6e82w9zH31qk66Sd5lpsrBq1b1wdPcyFGvYYONp+ojkXEVeN0RvEJY2s/ yt1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WQxwkUQ3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t2-20020a05620a0b0200b00787843997e3si6931657qkg.209.2024.02.27.00.48.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WQxwkUQ3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Mark Cave-Ayland The nubus-virtio-mmio device is a Nubus card that contains a set of 32 virtio-mmio devices and a goldfish PIC similar to the m68k virt machine that can be plugged 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 hypervisor 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é --- 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 = NUBUS_DEVICE(opaque); + + nubus_set_irq(nd, level); +} + +static void nubus_virtio_mmio_realize(DeviceState *dev, Error **errp) +{ + NubusVirtioMMIODeviceClass *nvmdc = NUBUS_VIRTIO_MMIO_GET_CLASS(dev); + NubusVirtioMMIO *s = NUBUS_VIRTIO_MMIO(dev); + NubusDevice *nd = NUBUS_DEVICE(dev); + SysBusDevice *sbd; + int i, offset; + + nvmdc->parent_realize(dev, errp); + if (*errp) { + return; + } + + /* Goldfish PIC */ + sbd = SYS_BUS_DEVICE(&s->pic); + if (!sysbus_realize(sbd, errp)) { + return; + } + memory_region_add_subregion(&nd->slot_mem, NUBUS_VIRTIO_MMIO_PIC_OFFSET, + 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 = NUBUS_VIRTIO_MMIO_DEV_OFFSET; + for (i = 0; i < NUBUS_VIRTIO_MMIO_NUM_DEVICES; i++) { + sbd = 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 += 0x200; + + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(DEVICE(&s->pic), i)); + } +} + +static void nubus_virtio_mmio_init(Object *obj) +{ + NubusVirtioMMIO *s = NUBUS_VIRTIO_MMIO(obj); + int i; + + object_initialize_child(obj, "pic", &s->pic, TYPE_GOLDFISH_PIC); + for (i = 0; i < NUBUS_VIRTIO_MMIO_NUM_DEVICES; i++) { + char *name = 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 = DEVICE_CLASS(oc); + NubusVirtioMMIODeviceClass *nvmdc = 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[] = { + { + .name = TYPE_NUBUS_VIRTIO_MMIO, + .parent = TYPE_NUBUS_DEVICE, + .instance_init = nubus_virtio_mmio_init, + .instance_size = sizeof(NubusVirtioMMIO), + .class_init = nubus_virtio_mmio_class_init, + .class_size = 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 = 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')) system_ss.add_all(when: 'CONFIG_NUBUS', if_true: nubus_ss) From patchwork Tue Feb 27 08:39:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776171 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52040wro; Tue, 27 Feb 2024 00:42:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUVP4botqXbr3RZZXwwhxitL6ib4cLRu2c12ohUfKNfBC1+qaqB+jT8O6+mZskWzE45rrmls2Su/nWtoyXHK+UJ X-Google-Smtp-Source: AGHT+IFEbWZxVcRwco9IVCcrSH//xlUHYMWoVxjhvKewCkjXNLHlGKfGSZLZsxwZUE7SyTvPdfYT X-Received: by 2002:ad4:4ee4:0:b0:68f:301b:5481 with SMTP id dv4-20020ad44ee4000000b0068f301b5481mr2218034qvb.13.1709023373880; Tue, 27 Feb 2024 00:42:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023373; cv=none; d=google.com; s=arc-20160816; b=OIwO7NcxI0b/mznsVvd6e/U2vkPRUY+jxM4gS9lF3F+GZw0AYOHgrCLJBUdPNhhnUX JPDMrGaRJVL0zKxutZHc3wlIEPM4AYbTYNOiNH78qW7D8SC+C7MK9SYLH4kAMk+ufqY/ 3aNgqT2wwSG+G88kh1BzRAm/XQcx0eiXkaWAwGYPzMLQkA9F4cBxc+dxFOk+jYfDwBFr DBVa/LI0agXZ5paUTbV37iNjGHxKREjG6c8h+/0+s0C0trgJUuH4HZTTvmG9lOiZ0IE+ WkkTKxJnSTZM1V3aPSEhhjC2wf+iOapXGpX9kA9npuvbN+Z5tuGcAGjdeB2G6Fs3tDRd 6RMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E6yWLTnbIVuSgabgdZE6+CbUi7y4Wg3nnktwesa/iZ0=; fh=i12UKNqwkvIvp9x42xvsv4j4bmmofCr3Hvxyqc5yyqw=; b=vofcMQE42b2BMb/UV2LByOrGGRAKBcDIlrg0skergUf1vo/ia0ajOY1moV2kGpaj8P MbINEz0WqdKTuXkzytyWELdKFfVXdawUSyACJVytSLdFWNqgXJVE+vUELt7Tqt8qp/vH NZ70P3tDFnkr5hDCyzYN/r3u/t0UTbMLuGOZqGCTUmWLhcdkIGtcUlM2ukOpY22sRs/d pxz/z9X/RpuCRYjKAEKuxLeh4S+q0bGNbR8SeEnFXOGmoCGCb8kFIxXgLs2vDz+p8cWx Lp+BVGGBFp4ZPI5nORKeZo8XZvlnxFg4e5UVGB2885YAmlhPEtDQK2Ko1v3aFDKiW/so pRdQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U65eYhk/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 9-20020a0562140d4900b0068d14cbf19csi7082008qvr.345.2024.02.27.00.42.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:42:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U65eYhk/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , =?utf-8?q?Daniel_P=2E_Berrang=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-ID: <20240223124406.234509-2-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daudé --- 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); +/** + * 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, Object *o, *data = fadt; } -static Object *object_resolve_type_unambiguous(const char *typename) -{ - bool ambig; - Object *o = 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 = object_resolve_type_unambiguous(TYPE_PIIX4_PM); - Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); + Object *piix = object_resolve_type_unambiguous(TYPE_PIIX4_PM, NULL); + Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE, NULL); Object *obj = piix ? piix : lpc; QObject *o; pm->cpu_hp_io_base = 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 = object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOST_BRIDGE); - Object *q35 = object_resolve_type_unambiguous(TYPE_Q35_HOST_DEVICE); + Object *i440fx = object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOST_BRIDGE, + NULL); + Object *q35 = 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); } +Object *object_resolve_type_unambiguous(const char *typename, Error **errp) +{ + bool ambig; + Object *o = 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 **); From patchwork Tue Feb 27 08:39:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776181 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52918wro; Tue, 27 Feb 2024 00:46:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX8B3lvP3GTDfh2qp+UJmyB2mtx2Z6T1kLtlIz9s9QBqxN2Oyh+B65zHWBKtIoctTzFvA5z7V1IWFFM3zzg9BTW X-Google-Smtp-Source: AGHT+IFrJzDDICF5PtK0+aYO6oll1grQVQMIaJyFLPXkwnuz7rTmehfUr54ON/790vb2iG0YzljT X-Received: by 2002:a05:622a:14cd:b0:42e:5c03:5e13 with SMTP id u13-20020a05622a14cd00b0042e5c035e13mr11630146qtx.10.1709023595249; Tue, 27 Feb 2024 00:46:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023595; cv=none; d=google.com; s=arc-20160816; b=paTaOfJWCujRWQHPQxuV9o7rFtnEJMBvv6G88j2+a0AKOKeUuzt8vc1BDzVI81vRtW TCb9Tfh1ehH3c7CT0nwEM70jRsfDb4tPM3dV7PUtl+dAQt5mr0iWsei7Uypfzckj2DYQ COep+qBTlHqOQR9xmor2T6LNwhXEqJmQYTeNat9bhW28GsNCL8dyWTtUtURnJXy6YaOb 4x1hn0w7a5gyj5yD89xyoRmUgBMYtBBWFkZ5mESpJ49Wlk44drjteDdjEbUTrMYHBNQ+ t6J9hYFIMGyWy4p+KAKj3fyG563BtlGWXtnvNBLpMVbgvHgw6hvRzVJo4tynHuv8jgE/ SzzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GZ6f3MtsvPODeQCNs+mWuntTgICcd/owb4II9I6fwgI=; fh=WXmR5dneUIu9dr2e9bUm1BEgVK1k9p1xrSa9QFHib8M=; b=U3pu2yypmdi3kQqC/f6/VRjDKlzYaeM5tCjhkFL3DBdFENr4uDliFkITDeQ51vulqA RanVPwdKMOTx7ySon0bpVriwwVRm3QGxIb6yJiyDZJ8KFS6KfreZ5AfZXZdysR+Haejy Lo5JZ1oaRyp6+oAfPIhkHC0SLv3Qt9iAeYePhlXuGNixLhuumLVzOOydCkmhJHtj1yYE 6UkuE5C8ZEYwu2ZhwoMsSpJ/Rz7Jmri/1BKB/QHvJ/BgL8JIk0IQU2RfWZWNvugXsbKd U0gR6xGlAcI2kqTpu5ikcF+TziCGfohe0RjIGbyuoJCJAAYhPSeWlbYsCbtZvP5OO4W9 aofw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8fqtYMq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u23-20020ac87517000000b0042e61ea23e7si6762289qtq.515.2024.02.27.00.46.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:46:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8fqtYMq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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é --- 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 = 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"); /* PCIe buses */ dev = qdev_new(TYPE_PPC460EX_PCIE_HOST); From patchwork Tue Feb 27 08:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776167 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51844wro; Tue, 27 Feb 2024 00:42:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXdawWCXQTVJZXFk8zuM6A5YwmWJ1WbGc9rROxKuB2hIh3PHqVd1BTtJcNfKcBWmUKdxsMxSKrP43QQ5neRH8Mq X-Google-Smtp-Source: AGHT+IEV9P25JLlIdR+lKQrL3cJcOajd9uYTnXifgfxx8FDQMoqpa4uH4JIMwjGZQWpNh7HgxK/k X-Received: by 2002:a37:c204:0:b0:787:28b1:f25e with SMTP id i4-20020a37c204000000b0078728b1f25emr1471706qkm.31.1709023323301; Tue, 27 Feb 2024 00:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023323; cv=none; d=google.com; s=arc-20160816; b=ajHns3Qrb6qbagpy1ehAwApj8LTJpCQYaGI7ZrrTbO8tFERcDaN6wtfc8lN/FfiIqL 11x2ICMfY/jrvl3WWkoH5IODxm5vqGBdeLXCLLq/i27HzArMPnYCa43kMamr5dttVonp hMJFZKjPhSwHZq9Xw0STa1USrLnoAkqgGQeTRjzrgLyugSxdsaPA5ae8Wt4LkT5RLjU8 jVvOx4EZT9V9R7CP4LExaGQmAHvJHa9aQdlXBW1FLNs95HvatApxGOU9uOdqe38FhaEN /WKX6ZnpFgMjv+269vAHeNjIINpmxDqoZv3vtvMTpRUledUYk47eWPQceXDCD7ptazZr Grvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rHGNJ1XUlxhgdMpKga7hKHkmc9UPr7ny3TDpRoUFz4k=; fh=t0oDkAaexSpU2iAZ8rUYY3qErkmE8YJGVrjJRcgtKO8=; b=GDj/Cu1cBSv+ADcqfCF3Y2AZpTQqIkuYv7pFwW518XmKAkAKuVGEVtW/103q6UGLtn IhmgLvD+JmMLN20z6qUM/NMECUEkHFIYf8Qz/PKZ7tHMHNc/FseqZJK0suxkZ5zo6MQu XqPNbogDnhvi2hIYdXD01mKtDHKcZBcH2sGhbbvWfYpwW5wvxWNCNFmTdGMB0vYsZqjl DCPV1Otx2V3Yn4CrYq8qRTT7rVq3YtjcXzteT1Lb4fjH8gTqaU+QPxrVOSnnhewqe3+B +KshCfkKJJ33oOraVwS/eN/clmb4x470PZ7pYwjihYHpZc1t5pIPr81F82dTjsR+/Q77 pbIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ScGUZdQ+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u5-20020a05620a120500b00787d1b9fb38si4238100qkj.276.2024.02.27.00.42.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ScGUZdQ+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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é --- 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 = get_system_memory(); PCIBus *pci_bus; + USBBus *usb_bus; cpu = SUPERH_CPU(cpu_create(machine->cpu_type)); env = &cpu->env; @@ -312,7 +313,9 @@ static void r2d_init(MachineState *machine) pci_init_nic_devices(pci_bus, mc->default_nic); /* USB keyboard */ - usb_create_simple(usb_bus_find(-1), "usb-kbd"); + usb_bus = USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS, + &error_abort)); + usb_create_simple(usb_bus, "usb-kbd"); /* Todo: register on board registers */ memset(&boot_params, 0, sizeof(boot_params)); From patchwork Tue Feb 27 08:39:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776176 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52591wro; Tue, 27 Feb 2024 00:45:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU1RZavVJS0Gbz/2bouxi1Mx80Rvq5jH9YmRvHe1U4185BQdTrTb6iy7AAhmS2LD3QAKQAlkzRvUecz+nvWPILk X-Google-Smtp-Source: AGHT+IGJzG48DlHPHkifU7UbGsCAN/oWP59z8yN7b11SkiwYLz1lxQCJoKsQCmr6fpEy1VTOtIk/ X-Received: by 2002:a05:620a:1278:b0:787:c1fc:3ac5 with SMTP id b24-20020a05620a127800b00787c1fc3ac5mr1280402qkl.31.1709023523406; Tue, 27 Feb 2024 00:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023523; cv=none; d=google.com; s=arc-20160816; b=rLRHR61RVv+WeSQD2+qdCgzp0XzBwV0ddVDHHDw0bC7kzR2e3clxoUYM2yp7BjAKSj wrGnsHtUe5i8yVQ0wgqrPF9XcHyd6t5zv7fVHN89zTamnW24sdfR03VRkIZ5vXtM64IJ MgVEfGYT2orZAb7nTtwa2QnnpGIHNlWNcNhWjsUoxMJ7Bp5VlG5qQYQB4fNhSYChhGU+ nZXVePfHV2nsp2Ha2fP6Yc1YEYsfKqKT9I1jKC2hHmfTgs47rULNAMjznSGWAYdy04Kp 2v60cxUN1RDuR5u5G4y7pTmCV3b+wUu9IfOF4Abb4LKvIkQkreDQ6q9RzfpfzTGTdlNP IyyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZLHfM0e3DYucUBGQJ+x+1h4RF1QPnXlDRfnIizT5lrk=; fh=8Yd8SDvYmtn4nFAPAazWSVYSqZp9aeJryJByM52/53c=; b=tM3bakMdoi8MjYGF16xkCJ+k41alDklTodKQoLV9X1OyYNeGGtAstnYs2mWUtlGGU5 21iNSTwtgqWKB0Q1ykXZP/LXKe+d1IJ+8TPsWGqYLZD3owNcBdNz73aRNeuLqVE9dzZf RSK+M2hzy7bfKz9RGSr3l/LES6/VuXGk1zS6ah3ZAoP/c63RcAHUA7bMhnT3Xy5vzmTo 2YTJwFt5ItWPGtuqziASqZJOVWp149uvfS/Qlt+kvQX1fxobCTDd2qeJyqrs9YF0RbYH K2/hXG5svnZYeDVMiWmfEosKscc8reza1r4YfLeWkQvYNMv0fErVUkzp8Blawg1i1gBM jwWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y+f9hwJz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i11-20020a37c20b000000b00787bf50bee6si7061410qkm.25.2024.02.27.00.45.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:45:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y+f9hwJz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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(MachineState *machine, pci_vga_init(pci_bus); 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 = 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"); } pci_init_nic_devices(pci_bus, mc->default_nic); From patchwork Tue Feb 27 08:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776189 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp53549wro; Tue, 27 Feb 2024 00:49:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUoySzfCnVObjJaunknzX7SJBjBLgrbiKnz1joGtTryOmHQoRyrv40G/2EpiE117frcb1A2NjPtk8+muuDz7LDk X-Google-Smtp-Source: AGHT+IEIWYSg0igLf2sYqpajrFQiBSK749D1CaQ2l5q9NyLHtJLYgyAqHo0aJyZpvVGvwIEplQNy X-Received: by 2002:ac8:5753:0:b0:42d:f7d0:b6cb with SMTP id 19-20020ac85753000000b0042df7d0b6cbmr9793449qtx.51.1709023747848; Tue, 27 Feb 2024 00:49:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023747; cv=none; d=google.com; s=arc-20160816; b=B8hka9psLAW+p+NvLqo0SEgJ8PnvkEj3rgw70fNrpd0X9BiSKDR5j3El6AtRrqqXqk fOadlUUBoz/qH3cFu2x2RLMNQ25SWJg+O4Z8pm2fplXlJJwUIaf/nX7gEgb1GbpmdAWq TKEZHLZwFnZNw5GT3RdTM2xjvlrQZxK5toBpjCWaEuxftbgjANp7UsJ1Mk/WGGR7nkYl +DAWnWWKsIoAjGbAxImgLa2ZRhyvkcHG1BIqOYGgF2R4cpMKSUGmbCs61HT9Ixza0CAh JygyemSqo/LR2egKia8mMlO8RejYZ4xeL1ffCyGCz3jYcQblWvCcEe5BWCu2Cr2UqYCc V5Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PlYoLDbUbjomSEd23m1u/ajnPye5YRTUfebEkIuJSY0=; fh=eFJxCG1KNfMqMNMlLXUqhZihmIQ8j+VivV9H7CCA/d0=; b=FxIhol/UobIxSX+GOau/WHW5/eGh477cd574HKwd5eb9G34Ur8MKe3fL+G3epLmHhg yIUOm5Dm5gNFZtwyLZISfO6qqoe9gdDZDuVvS/F28g3gsFRn2Wp+PUlKQMCOP0zQv/hm 8J8iLCyXjp5tscNYuWer5+TdCUeh4Qc+1U14UdnWvNxWIyVkGkjf0UCYF3spyQ775BfR mBJTYnYRWeISBI8BL51xCPezDSYoIRG6Ghun2hYch+fHuQMTVhheYFBtJmvAsef/gySZ OQ4bCgP5XCYM7brLnbaAlwdmi6ySZ8+30451IrWDlCZN16TVqaVPkUlVRuXF2Ky1Wz2e WSYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bXMBlr8P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h8-20020ac85488000000b0042c574e2766si6597251qtq.727.2024.02.27.00.49.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:49:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bXMBlr8P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240223124406.234509-6-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daudé --- 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, } /* create USB OHCI controller for USB keyboard & mouse on Astro machines */ - 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 = 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"); } /* 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 From patchwork Tue Feb 27 08:39:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776168 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51865wro; Tue, 27 Feb 2024 00:42:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUpOmFO7YvJ/uo0POgFjbWvKNrLfRVSFyC/sxtwx7bSL8KPZRUAF/qvBsxEKvaGst9T5Y2rGoR/xl9pUIXqWh1E X-Google-Smtp-Source: AGHT+IGDUxk0sXAUbm1dBozK3wr20o5Z2idUd/+Hr4BymYNwGqI3HzsE24XeIYvdGhIC2kl7P1M6 X-Received: by 2002:a0c:df08:0:b0:68f:2ebf:851d with SMTP id g8-20020a0cdf08000000b0068f2ebf851dmr1452010qvl.1.1709023328441; Tue, 27 Feb 2024 00:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023328; cv=none; d=google.com; s=arc-20160816; b=jjtYCbMP4nbG+oiLNDBQtVIZQutuhEVPt4ivcX02Hgsa1MP6RICfZ249SpUDiy/SSr i7pog1IZJxOXlPEJvM+6EYT2hGBzCLXf4+8HW7YJZTe4GSphxtNTQt7PwMjM1LWWUdmx lRZe44u3rM0GOi6UaL6mP2/Pphzq6XY5q8HGnUAHFjCD4OqQW45Y8FaEOWR4KxMMTdXc m97Ry7Q4oN9O7JfimNONzecKLMuV3/1qmZF6HhZFZ+rcQ+vpOrL1WI12AQAaK7Ipey7+ Zz9EKcRm6IHIPW6NUrDVGx6sAgi8eT+Hq9AZnyn6CfEan2/WpmkJ3wcYpr5h0IZRMtod 3zfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zrAS4uF/4VkX4b6o0R6cH2vfMrmpv4t1vXliE0xdsAk=; fh=mhERGI51MB+RAZFqbawcwU8hkHFg2yDYOdhj3GtTjTU=; b=kAUYFdDNUgr3dWRg2uwCdGuU6C6oiOY4IbZWiirQd+x5Z95lI26gWTefzuZPG7LMOl wPEPzaiJO5328g/sc1dLFsme3o97p6PIvCoXuilE3Y0c17VhgF+5xgp9AFLDy3zrDhS3 zrI1xIi25X1VzfNPo05HIJ/vn1ojsPOA+LWGPU35KRRZ/svgQs1rhFqESIzLmj8WAD/i na02NNhOxUld8mz+pDvHImiTmVmE/exajJjyKUqpI+qjpoXBDtLBuFXkvdrU0RsPMN2d kPgJgoq2xmjSzVL3U09s755sQ6aGD1KgCJlBEhVb1kN/1NwP8O0L4x56TzznCRWkuLYi 1E7w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaKhxFRv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u5-20020ad45aa5000000b0069007a575f5si4422029qvg.226.2024.02.27.00.42.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:42:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaKhxFRv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240223124406.234509-7-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daudé --- 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 == ARCH_MAC99_U3) { - USBBus *usb_bus = usb_bus_find(-1); + USBBus *usb_bus; + usb_bus = 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"); } 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 config E500 bool From patchwork Tue Feb 27 08:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776182 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52928wro; Tue, 27 Feb 2024 00:46:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxSDwf2yiZuc0SHyxskEI20qYD785OMB+Lm0roDMoXtG0IWVIREtFheQXSuq9YmMpmugRQ85htECwqVxA4Xvf7 X-Google-Smtp-Source: AGHT+IEibzmruCqBCznfLAfrjzMCBrlBcBbpWBbFW92PZVvrzR3yt2ghxJKGsgFgG3rQhyGqo10B X-Received: by 2002:a05:620a:a8a:b0:787:c11c:7dda with SMTP id v10-20020a05620a0a8a00b00787c11c7ddamr1444877qkg.1.1709023596747; Tue, 27 Feb 2024 00:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023596; cv=none; d=google.com; s=arc-20160816; b=KU+Y3FJdm2Zk3XdHVRIS3/g+5IAcWB+lnDFxJD4M3+MIUBYHtvFREyL8G2SjLxg+XJ BnzvYDBbyT3XdHEJ5jGO0mTekDpXMGowoJ53QoaHTnTh7HYRwYaQRqqTlwtebclgCu+Q kUmneP8hUQ4WD/8FUUReCQWA5NUdtkUtgJEyD9kVIuDqGArpPw6Yc+H10Yb/YAy8JTnl n3tT+D0VYTSRNx2Bu+rCkHZTa6YnUJWopwy9WyfhtfWSUXVB+s2Q9oibfKTLr4+2reTp w0XJka4n5PYTmpaHERKuf4MlEBrvvlaG3/Aif3eyxm+BWIjHIFoHN0mSr4W06Y70tzEu IEOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q16/BH7ujul6MroAh0WIw+sirhkolVXk4q/90kZo96k=; fh=nFcTv/tSZM46Twl5QfT4dJjn07gikocACC5kvu4nyv4=; b=MZfI82Nnk8XYTgIYHP3MO87AvOmosr3/ABJjACD9thClR2LlHw/jWywz2x+pw2X6Kq b/Fq77CopoDGrNSWc5FQp9Ut7X0ICuDlbVmXYzDHhWoDBxTijW4M2P6iko0KIlEiy7nj TGHfuH4P/cpidJsUV6izmGcFjlN7JlPdhiHaDLjNYUDUH44DPBW3sgeVzGPuLQE42AHR vaa6RJiFiDPLbFOBlwRZmOC+0FLVc83kdo++psaoz3L0SHdiyp9/m2HlJJThXF1If8oM B4nckK6nxu3dlo9HnkppLuSvnYgj97kjquol7fOoYmxv+HwbBxypmLkLMNKVZxniAiDu C+wQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KTWu26fH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g22-20020ae9e116000000b0078553d900c4si6752285qkm.73.2024.02.27.00.46.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:46:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KTWu26fH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240223124406.234509-8-pbonzini@redhat.com> [PMD: Fixed style] Signed-off-by: Philippe Mathieu-Daudé --- 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) } if (has_vga) { - USBBus *usb_bus = usb_bus_find(-1); + USBBus *usb_bus; + usb_bus = 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"); } 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 From patchwork Tue Feb 27 08:39:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776180 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52917wro; Tue, 27 Feb 2024 00:46:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgYzMPezFgNzWzOxcfbtjcg/jeLMPZ+n5mKxaGwJuSkL1ELe3iYNtE4Q5Yr6aWyAu8XbMFwnvYZi0ANP5/IBUp X-Google-Smtp-Source: AGHT+IFDxBaIhMC2P3vffioxHhlQ1SA6cJb81Q5YIhW4YXPyeH/1cy/+2b3OBn3pbN0xCKsDY3/Q X-Received: by 2002:a0c:aa52:0:b0:68f:dddb:747 with SMTP id e18-20020a0caa52000000b0068fdddb0747mr1213657qvb.58.1709023595010; Tue, 27 Feb 2024 00:46:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023594; cv=none; d=google.com; s=arc-20160816; b=WXr7nq/WDMIV9Sqx2V77mdkiSPTFPcFrBq7PkU4zA80oYuZt5VkK/SJo4jNlsNG165 UuehquPv31c8RPf37W2Qjg7GXl02RvU7Hv6P8TLJ9sQyLBUFQtu+SQ+PTPOfMdDQ4hfm aka4JLjRgn9LUMfgriqgLYa26dyAJHmX6wbClJwCy9IYo6v/epknLEpEF9a1UloCty0W XvCvmAVkPCFNLMShT6/bzdLNZWT+vDvhV6NE9Qxfms5gGpB+OsX2i1NK7ATBZzP2gVIE YXlizoYh7gmJBfJfCcBMVbVt+5wCEk1YoOZHK6edxYDdFhkIeJswwWKJ1wmg/uNOVZpR 7LMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; fh=jjs7Eythi1hifcQd4Bhf7UtQ9J4V+Ow9XNAYokBmahk=; b=pfPzBlHq2ve3iV+HC6cHTw4jhA1AkXnpx1kmkfM4b6yKfH7aATuFQyOaGTtjD1AfZ5 VcoUt9cutm6/pK9DSnoO4KUrBiwOp6h5xQ9vyFy4E8YjP+UunksLNqx7hVAU31DgJ4Wz nBwcovvp9+2cqWXUjyJMcLEflrR8n1YiTJyia+gQkHP0QABCiBVakM09+sPnHiRn+N+Y efZZFvRctD1ka34DHLmQr7AWFXS+A9Zke7VGLLMtdHhsyc9K++bWhnvI2RuDyqTbK8XY B781+3cV1PY+H9S2id0FjkXLxFlUWpw4tNLnDlKBXdgG2Gg1jMHmmIrc1NWNERtf2SZh Km2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rcJligoQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t3-20020ad45bc3000000b0068cfc124fe0si7094560qvt.395.2024.02.27.00.46.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rcJligoQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-ID: <20240223124406.234509-9-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- 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); } -USBBus *usb_bus_find(int busnr) -{ - USBBus *bus; - - if (-1 == busnr) - return QTAILQ_FIRST(&busses); - QTAILQ_FOREACH(bus, &busses, next) { - if (bus->busnr == busnr) - return bus; - } - return NULL; -} - static void usb_device_realize(USBDevice *dev, Error **errp) { USBDeviceClass *klass = 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 = usb_bus_find(-1 /* any */); + USBBus *bus = QTAILQ_FIRST(&busses); LegacyUSBFactory *f = NULL; Error *err = NULL; GSList *i; From patchwork Tue Feb 27 08:39:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776170 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52031wro; Tue, 27 Feb 2024 00:42:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV/i9WkXaf+PoEvLKh6JQg6tQG8SEiMlp5O4wXuhCvxJRxOHu+upOWM1LdZRKV/gYn8Dxx/SIqlmKZT0ieZpKV1 X-Google-Smtp-Source: AGHT+IGxt1ISjOpldkLxhju2jLAoUuhg4rxqPwZp+RdorEM7BntLe2M5e0F1ovVh9SIlLKGIHIAw X-Received: by 2002:ac8:5c10:0:b0:42e:586d:1234 with SMTP id i16-20020ac85c10000000b0042e586d1234mr10568211qti.28.1709023372142; Tue, 27 Feb 2024 00:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023372; cv=none; d=google.com; s=arc-20160816; b=vOtfKN2ljp6icsPIl8UPVvp5aH2TJHiXx61TcyEC6b4vOqmMmmBdcZdP4Vs7FjbrSS 2QR6Sl0K+ebuQYjRjGhqnJnoPN87/5zJZP8uhOiL98jIlOdWVYc5TuIW6zfFLZBsxCoP 8TcpxL0v0Cu3ev7ATKLTPaDLEAmwr4ptTpCR4WVX2QYed7VTqT1y93DoglKYTRzx+tmb 0tiUjG1c5A3wQDSTxO7quS1SS6n64FgwWExc5DaHIDM4/EhpW45pnLS2I2SSDf3DHXXq NlF/NNS2tYdltzHLCY7ckkyxrmg4KuJIWP6fQqEYLvXIEESTzi/0dMeuPbQdK0TqL+h6 o3Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lmW74QYufIRbTKyOkpXlvcTJBN9wQd/cfaQmVuqVO8w=; fh=53ym3Vtt5O5cF8/cul4DyqsBwvOVO8xxWUFFsqrrcKM=; b=WGK4RQX9KLnOMHkT7CN5qqVrmAjIr0eRHCNy9+0jSe6PZQk6Ms7RX3UgJnDqcceQKy 1HqsSV1F3lcOrFX6bep5PXLIAKku7CElQiJ8NnNFR5bcYH/Sddzzeyl6E9u2W2Po9XyH FAkX6PjesUUozLFJVuCcIPRnLrYSS1AfK/UdAzH0VXCYMhx7v0rq2qTM2VEVf0wjYWRu Bhz53Iolnp2643xb/XW8DHgleo6bQzjF4zL752rf+HYQ3s03oHPkn6LkAt9VBcajzBsc oyhIUn93sncDrKfm5Xj773BFvyZYi6k8E0maB2TAzaSeY9wRDfbTsRUOhoeZxnVI2w19 uzfw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I2KHydPu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u8-20020a0562141c0800b0068ff701ec47si6144187qvc.9.2024.02.27.00.42.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:42:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I2KHydPu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-ID: <20240223124406.234509-10-pbonzini@redhat.com> [PMD: Rename some functions using 'ohci_sysbus_' prefix] Signed-off-by: Philippe Mathieu-Daudé --- 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 = SYSBUS_OHCI(dev); + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); + Error *err = 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 = SYSBUS_OHCI(dev); + OHCIState *ohci = &s->ohci; + + ohci_hard_reset(ohci); +} + +static Property ohci_sysbus_properties[] = { + 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 = DEVICE_CLASS(klass); + + dc->realize = ohci_sysbus_realize; + set_bit(DEVICE_CATEGORY_USB, dc->categories); + dc->desc = "OHCI USB Controller"; + device_class_set_props(dc, ohci_sysbus_properties); + dc->reset = ohci_sysbus_reset; +} + +static const TypeInfo ohci_sysbus_types[] = { + { + .name = TYPE_SYSBUS_OHCI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(OHCISysBusState), + .class_init = 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); } -static void ohci_realize_pxa(DeviceState *dev, Error **errp) -{ - OHCISysBusState *s = SYSBUS_OHCI(dev); - SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - Error *err = 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 = SYSBUS_OHCI(dev); - OHCIState *ohci = &s->ohci; - - ohci_hard_reset(ohci); -} - static const VMStateDescription vmstate_ohci_state_port = { .name = "ohci-core/port", .version_id = 1, @@ -2054,36 +2029,3 @@ const VMStateDescription vmstate_ohci_state = { NULL } }; - -static Property ohci_sysbus_properties[] = { - 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 = DEVICE_CLASS(klass); - - dc->realize = ohci_realize_pxa; - set_bit(DEVICE_CATEGORY_USB, dc->categories); - dc->desc = "OHCI USB Controller"; - device_class_set_props(dc, ohci_sysbus_properties); - dc->reset = usb_ohci_reset_sysbus; -} - -static const TypeInfo ohci_sysbus_info = { - .name = TYPE_SYSBUS_OHCI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(OHCISysBusState), - .class_init = 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 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 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 config VEXPRESS bool @@ -395,6 +395,7 @@ config ALLWINNER_A10 select AXP2XX_PMU select SERIAL select UNIMP + select USB_OHCI_SYSBUS 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 @@ -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 @@ -530,6 +531,7 @@ config NPCM7XX select SSI select UNIMP select PCA954X + select USB_OHCI_SYSBUS 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 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 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 +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-sysbus.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')) From patchwork Tue Feb 27 08:39:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776169 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp51953wro; Tue, 27 Feb 2024 00:42:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVu/zsrCC3SQ7MU8h+4FHbqnQpkQ69oi3xGDw2Uq0IGVSkSMkhjOka8VeBYSF7WdgK1w7FdvktORcHawKdKVqax X-Google-Smtp-Source: AGHT+IEic9MmFWH6/rIIT6XUm2/xyQ8PkDurmVvCWSv8jn1V7/4NQGEhUYCc63V0pE6C8+46+0CU X-Received: by 2002:a05:622a:180b:b0:42d:c7f4:ed00 with SMTP id t11-20020a05622a180b00b0042dc7f4ed00mr10906289qtc.20.1709023355672; Tue, 27 Feb 2024 00:42:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023355; cv=none; d=google.com; s=arc-20160816; b=kS3BEliOEcwA1hY4OtRjhqi5pghAunKfUgs8/HKLN2MYT4JqDD3tRRozoM+X/jkJh3 BkSa+8zvS+8SGTdoTc2i9ut6D2nEO1SUneco3CPS5TMGhI5VUVnqA4NBohvyiWjgFjYi EMa4tehj1/aWS795uDMuiUbcFOf+rlETt/Yq3etd0YCdgi9/KR+HAW/Qh+vGS92dD/1S keCVDfNWTtWEkW1ZqDxJiMWQL0mUf5+AJvkQLu3yIvljVjKnry9cshj4FXvpF6AIqGSl p6xOwN9F3rUfiU5xSQpgPqaMpzXyCI/ByVbL9Ce+PEa9nKQpHmkJTCJsjLxfR6LGQsih +LkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FdunaCtONvoL0LEtBUlp2r4jkZ1zPWdyiyr1Q1lshPs=; fh=jjs7Eythi1hifcQd4Bhf7UtQ9J4V+Ow9XNAYokBmahk=; b=LyJlVkJx5p+TiL2+r6bVlGLvtVOoA049S4/YCR2sLssEYA63F5M44D9sJr1Elq7y/4 lgYzWExVQagwNk/Yl5Y8if+4lMHa6q0RxeGrCiw3dA2u4vfIuOD1oS0h7CQwdx82DsdU TUybIaqB282EgRW2wF/HVnJxOnmizmcOOz/sUILQeZ7XgctXAPdPWlHS9O4dgW9+a7td SRVu21qiIWBd5gHv2l0OkyFTK28gw1FhVKsbuoseASbbkYRQUZanfACsmhEtLZ5D3/62 bO/tQSY0fk+n285agPElZnoPSerfDAtinP35yG6xGHD0v4fSR/V9VzCTgAqwFRcjUK2h FAtg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MZr0XQSF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f8-20020ac84708000000b0042e77c1c89dsi6427662qtp.172.2024.02.27.00.42.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:42:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MZr0XQSF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-ID: <20240223124406.234509-11-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- 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-sysbus.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-sysbus.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-sysbus.c')) From patchwork Tue Feb 27 08:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776184 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52969wro; Tue, 27 Feb 2024 00:46:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXZ2gDx9NO0Uojv5NLMywinVA9eiw49o6UzSa6IZSU7EXOOMKWWK/twsDhOPJdkMC15Sg+4MQWtEemKkZPPzVtV X-Google-Smtp-Source: AGHT+IFtN95j37Eoyz5TzXOJmXhZCpiMaamvMTaSgI3/BOtpKjPvlp4OisDjjmiavA6UVizF6d3b X-Received: by 2002:a05:620a:290a:b0:787:d984:774b with SMTP id m10-20020a05620a290a00b00787d984774bmr1740349qkp.3.1709023605219; Tue, 27 Feb 2024 00:46:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023605; cv=none; d=google.com; s=arc-20160816; b=TWMi5WBLTsCyeIwSvEoY9o3wk3FnmHYpRS+1OSWZ5R4OhZixHYyahbBQVFwgPbV89I 6R0niHv7RQlEnXhEG4aOJHZw1wP5t+7xBBkIj4FNHVSYA2R0Z7Z9y7r7rJCGsSB1oP69 ZdU2a4hQ0mGyl5FAU7GP9O2Rqe5qAT+QXi4CFfD5KHu5N5gZ7sjs8queUA5n7fqj2BZD 6eb6RCGeAodto1vr4snRztL8q6Gt9Rf1mYEI2JRvf0R8Byg8+qevxgCTWidolmLAgAoY A1mWzofxz13tDYGMKFXRGevcNkn/z8tFX2N4y9qizbCCrLKHMx2owvB3iIK7/1Cc0y/3 M6Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2Yy5kHw7b+fXUkeiiZUfupvxhJnRIRkwmG0B4GAOIY0=; fh=4cdhlMOyyTXwFvnJUm7ORLJOiOgBYycNhJ+cR0m9HFg=; b=T3U5bg90McDPa2vK6OY4pJybcM3QRPb2m+kcExzf1aQLUN45jMzBhjgwu4CstoQtJU ndozK/Hnw7Gk2rypaCJYNdsVUqNl1WZQGk804vDPCjg+4W7EM8ioLEtTv1MiPnYhaKOc +pHqeBmOjJpQQL06glEz9yKtc8Xrx21YPoTbi74Iu4b1vKNUY5i+lE3yVr/vYl0wZWtx Gz/JEUVGSkCiNmz43rsHP1J2sjv2IqeWCcygTu5hKBf4eWdt9wxh0hIj1puc5UzdEDMS Z1Wc14xZRRIaI6P0ZLdHo/7g+M4CiJjrNDf7EkXUJ24xfRo4aNhHgNYvkagdxTEQ6x/7 xyKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GonaCAdQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bj42-20020a05620a192a00b00785b189cc93si7876510qkb.353.2024.02.27.00.46.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:46:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GonaCAdQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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 = g_new0(NvmeRequest *, n->params.aerl + 1); QTAILQ_INIT(&n->aer_queue); - list->numcntl = cpu_to_le16(max_vfs); + list->numcntl = max_vfs; for (i = 0; i < max_vfs; i++) { sctrl = &list->sec[i]; sctrl->pcid = cpu_to_le16(n->cntlid); From patchwork Tue Feb 27 08:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776179 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52915wro; Tue, 27 Feb 2024 00:46:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV4+OV7e3sT/oIPfCaT4fLZWgTlmBsqQcni2y59fRLaKxmUIVwEOnPs9AlNY+5SZREF8EuDiAyC2CF/+nxWOy5a X-Google-Smtp-Source: AGHT+IHLgsvBE+itgGWyUUVpH4Y+UDY4+LfKvV3/vdrArLw882y9IuIR4DgUOryJJxKZLX2R3YnI X-Received: by 2002:a05:620a:1a03:b0:787:b595:8af2 with SMTP id bk3-20020a05620a1a0300b00787b5958af2mr1665122qkb.73.1709023594787; Tue, 27 Feb 2024 00:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023594; cv=none; d=google.com; s=arc-20160816; b=Q34miakHesN603sPGmOPc0+aMCsuyvjxUcgILKFGBOK3CGMjcduLlDB/IyxMxYlQrC itsVyjKxMlpAe8XuK4i/U4ohxo2w2s/WOBDiC7lk7Q1aPX8LoW/jxZwT+mCDrJ+MAFPr eiHJqPoe8Z+pyS9cTX3p/V/U9G2abFDRhHZamRElXEtYKnaWHODTQ6tYJA1JKsBKdY2M oMvgtDzJCk3R/i0V04yA4phLFQGJNxc/W57cr27pi5AGmOYhDeT5mgWOL74qic0lscaG p6QlVctWSzASx1fo+bxB5+eS7xztfRjTNG9Qi+CMJWIUnc9TzWUBWnnwtEoCDoxMKq9o xEmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iX8uZlTT6wTjiMtTqjR3dj/PxPssyXNBBI6GxQRZqxI=; fh=2OEhOoR5lB5qv9ZGvSTVXE1Zs3Shpw3GCCnn7Bp7QdY=; b=WTOOV5CtJbAcLlKLjkbPI7445Y6OZVZhsu1yzgfIOKt+7QKQHrm/vpvo9qwVvYZe5x 68qadahv+kVRZQRRpQrHcTNQOSpQ0Gn1gKDnRcXRP8fz4cJg9Qko9PJrAaPePjyBvVHy uG76Py/jyRpNmALuhGCbBpdax8hJ8TWh5fYCbJZI9w6gYIRgLTIbNlqsMF71E/YfBYif 2zb5BdjZ+HYIuguoenyDbWo7jWaCuJpi4gRYUN0/5IAJiSkCG3yJieKklkOuvSZjA6a9 wa6dRdoxGPl4PJnfyCfOC70IZni2TN93F3djphebOghtVRsW1kX1wPSrokk6xp0MSwCR dtqQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UiJ4Rsnt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bk3-20020a05620a1a0300b00787ac6c856bsi8110994qkb.362.2024.02.27.00.46.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UiJ4Rsnt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Rather than taking a QOM name which has to be resolved, let's pass the parent directly as pointer. This simplifies the code. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- 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 { 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); /* 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 *mms) &error_abort); isa_bus_register_input_irqs(isa_bus, x86ms->gsi); - ioapic_init_gsi(gsi_state, "machine"); + ioapic_init_gsi(gsi_state, OBJECT(mms)); if (ioapics > 1) { x86ms->ioapic2 = 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 = X86_MACHINE(machine); MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); + Object *phb = NULL; PCIBus *pci_bus = NULL; ISABus *isa_bus; Object *piix4_pm = NULL; @@ -189,8 +190,6 @@ static void pc_init1(MachineState *machine, } if (pcmc->pci_enabled) { - Object *phb; - pci_memory = g_new(MemoryRegion, 1); memory_region_init(pci_memory, NULL, "pci", UINT64_MAX); rom_memory = pci_memory; @@ -303,8 +302,8 @@ static void pc_init1(MachineState *machine, pc_i8259_create(isa_bus, gsi_state->i8259_irq); } - if (pcmc->pci_enabled) { - ioapic_init_gsi(gsi_state, "i440fx"); + if (phb) { + ioapic_init_gsi(gsi_state, phb); } 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); } - ioapic_init_gsi(gsi_state, "q35"); + ioapic_init_gsi(gsi_state, OBJECT(phb)); 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) } } -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; - assert(parent_name); + assert(parent); if (kvm_ioapic_in_kernel()) { dev = qdev_new(TYPE_KVM_IOAPIC); } else { dev = 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 = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(d, &error_fatal); sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS); From patchwork Tue Feb 27 08:39:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776187 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp53428wro; Tue, 27 Feb 2024 00:48:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUYPmN6GX2DLPC9tmRslestoY51fvbjc5VEcCBdLMOl14DXZveq//MIGLmZ8VxdHVglFT92lQ7iSmEiSNmplhYd X-Google-Smtp-Source: AGHT+IFFcgOdBjapc5dUcui6WsB9r6wafYDBtmm0yM91dD69vpIQUINITRwgXfo1Df31tV/acZZv X-Received: by 2002:a05:622a:1a13:b0:42d:ae83:e319 with SMTP id f19-20020a05622a1a1300b0042dae83e319mr10347342qtb.18.1709023713422; Tue, 27 Feb 2024 00:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023713; cv=none; d=google.com; s=arc-20160816; b=z7tDycLIE8hRA72WJ2Jw0jneVzZc7wO5CtbG9a0qR5GlBPBC6mgum0pOodqiC762hx 6KYuZhzDHyQrWmlZ2ihguLeqwucF3Hwk+lX3JDOi4vCnwtu1WLGO1fMG9SQ8RXjkF9gn rfhYGO3+D6PqJa4N5WwJWG3AuMG3KsPGt27QzAtSf3hyTOd3c26q4+d2rKkKR5eIy4KQ b3y6F1fM9IwZBZKiU3CcwWIhAY8KEtIc5XLs2UMpyhZltE3LVaV0SuIQaDS6fCtMDGSH lBQKslPum49MM/fOb/7Q3/Ql1RwUbfb8c2vQHmeIK73A0j9nN2ZWdShde6/M6kBxCtOJ PpVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9zD/OKW2eI569vD83pviooB+9Gzp5s2IN5noJR3qtG4=; fh=6J3GwR95IBYJ0/TPOe07fiT7VD8FCULw/76i7UJuWZ8=; b=pErd3lu+44YKb9vlXAW64dol43orlMUJrjWfEUa+B88oKqJS8FfiSEwFsGqSpb4X7n 99OIqcUye8aRlrsSiW8b+5VvA2ho7h4BE18KGYLiPAvHMwE/D1dZl/HFxtZlgLS3eAYq sG/zh8JkBDdGLfOx7M8w/TwSmxidZk++Tnu401sHs1FyK+DVZSGoGtF81C+JJCHrLXMD neIYGYqqIJwZ28ZMZtVA0FKHFL2rC4ibMuNQ6iFeDJtswo89NN83sqvzcUwelpPQ5cdq jg5ktcSlYtkAQRsA0SwYz6AL/Z0xpAapxRNZq7a8MNs5a1KZvRRa71bxBhV7EgYzvmbR 6xdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AgV0M77z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y19-20020ac85253000000b0042e20c04bd0si6801753qtn.204.2024.02.27.00.48.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AgV0M77z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Prefer the QDev API over the low level QOM one. No logical change intended. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240215142035.73331-4-philmd@linaro.org> --- 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 = &pcms->sgx_epc; X86MachineState *x86ms = X86_MACHINE(pcms); SgxEPCList *list = NULL; - Object *obj; 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); for (list = x86ms->sgx_epc_list; list; list = list->next) { - obj = object_new("sgx-epc"); + DeviceState *dev = qdev_new(TYPE_SGX_EPC); /* set the memdev link with memory backend */ - object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memdev, - &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); } if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) { From patchwork Tue Feb 27 08:39:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776173 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52261wro; Tue, 27 Feb 2024 00:43:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU60rRFuIcLjlIMrp4hnOVNkUSSaufZ5XyBnGah8gwR2CqgSu5k4BCDxN/5VGKlEd04gBbxYxIgQixhESI0u4pJ X-Google-Smtp-Source: AGHT+IGs/Kkrg+bwHqr0ADlqtp/CawVSrAbqchaJklFPDsefcJeDKF6jOaKZNDz9Q5EhPj9DdXzA X-Received: by 2002:a37:f512:0:b0:787:ebb1:4a79 with SMTP id l18-20020a37f512000000b00787ebb14a79mr20592qkk.35.1709023439755; Tue, 27 Feb 2024 00:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023439; cv=none; d=google.com; s=arc-20160816; b=u8U/+xTEyOhEwzIt2cxW386SRNP8F06oh3znMbWIWvcDNWGX1Cnr7Rjn3fuWtQtAYj 7u0KfUqLSN9K7RsjbG9b0MxaNfY7jvktgboT1Z418SHW3mIJn7BxVmfxlssHgyw3qL9M jjXKc08Dq3tjs5UpH5WAE+w3dHtq5kYwmTfmNFEQAoGiiSb8dmb8fdenll5+1xZx46x9 oq9aTDXjeD+SYLs8TC7dA4Ga2Bu1/yR6WsZVSLQ5eR4Ft/H1WB+RhwUETlCdovEJZh8q caRLENgIkqDLyy5pf5uKoxkLXO1kUpy0YAS+V19QJAUipE82yLPOVX/OuF4eRLYfPBNq wtGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SMgxNB+QPGXCEfWk+9rOGkNmwlpFY1sXlU4z6trziko=; fh=bxkaLlZ1JDenhvoxCyBF+zKQ87OvrSWsu6A24O+vhPc=; b=Amvzq4XLCyKTKxzTPrrweqrddoMH21ffmrExm33sPcg8cS2m6LEe2x+KWYjsbqpdhE NKxR1h/a3TYaET+yyiaSSednHHqm51/SCth4Fpi0JGdsuS4dVR/KVSU5zfc/onSx6NLk KtK71D1XFjt/xkZW9SKgCU6Yko2WQJv1susU0MsskNzqTWSjse32jj+WdgyvVUiYUAFj rAhKStgUd+CltIExtkEwVO0LPXHx+c/5n4FldTkX5meKwN7T9UpRXokXEzSn1MJH+/13 29KgTmeyV6SnSnDv9BUN850PYGOP4O8mdn/azsXHiXsNPS8HuzaE/YQwpxyR7eB6ge4r 78Lg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Um9Gm5mK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dw11-20020a05620a600b00b00787e85d24d8si494130qkb.686.2024.02.27.00.43.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:43:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Um9Gm5mK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org "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é Reviewed-by: Zhao Liu Message-Id: <20240226090600.31952-3-philmd@linaro.org> --- 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 @@ #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" From patchwork Tue Feb 27 08:39:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776191 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp54023wro; Tue, 27 Feb 2024 00:51:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWIbUeM8XiOd8S90PSXmvZMOOG4xPvQ4wo4eU/shTEe1hZquxn9NcUdO55fhqR8j5asDVlANgDPWNZpZ4oB9Fp/ X-Google-Smtp-Source: AGHT+IHfCIwGBw1r6WvSAg95+PXfgMHgPJSCXQ+9Zv0t6nwtzaK7b5P/tXaq6K8z7YzyguRy9R86 X-Received: by 2002:a05:620a:2a13:b0:787:b0b6:d836 with SMTP id o19-20020a05620a2a1300b00787b0b6d836mr1945859qkp.63.1709023863662; Tue, 27 Feb 2024 00:51:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023863; cv=none; d=google.com; s=arc-20160816; b=qFcwBJYpcj3ceFbXNZTZkXS4+uW4/wmMZqwwcRRwccwXH9j1tkKFICUSuz/0eJyoBN ewtjuwND1GUvJ1+S+Hdxlq2FOX9H9ZtRQjvPoXSW7whQRZQUGGHZ4KeXYG83CdlnpV2v dKNDeUY3dDJ88zH3HjCRPn29ndWMDcGPaJyaXb2BO522pPh0njMXFjHOiLKylOZovHS7 v55RiyDFjHHM2J+FCPB+I3hiA09YfBVdBQBCZbVIi1q3glMGPLgVIjuuAH5eZOB+Yecp jVE1W0IMiGM0EnzHLSyaZeBPxuGWxvbpsruMopaeWHrEmCn1wxXe/zsHh08nIlizH7EL vI5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5Gdk5QbogljYxnMuj3DzgKa5vdSTLOp9WH/RDQu3ZVU=; fh=P0cf5685OIHjiGr0PZFqWzYjujff3VC9sGOxo85mjII=; b=I+ioaZNwF+kTKYB20iN7x81GwnhgecDqwr9OIu6HVxGB1o214IOqNW/ldQKLVG2WLY JUViD104sMVbaP67Fj896KxqJ7sAmiTnrKfcDLtQAQILto0jhcDVGUmu83iHlzTPCsyh x6UexrsbA8T4lOwEFhpD+2IWyVbP1waW6QlZSvKsZmUhnwyogwH8w5fgjhn8yQlQ2CMw 9NVRZjDl0z4IgZCJb8D1OiyQfQHhrRdNWIrgdL1X8wHIOJiDaLhdAeYNRCbOiOOm4kKN OOibvGmJUuVYgT2Jsmoi9Ve7LiQVZdO7WLkjVAcDV83UgcROTCu4xyh2QJFu6tUPe7sO UtiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VpRCVtEs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x13-20020a05620a0ecd00b007873e404d2dsi6981697qkm.348.2024.02.27.00.51.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:51:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VpRCVtEs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow The attribute is of type PCIBus; reflect that in the name. It will also make the next change more intuitive. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- 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; /* 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, } crs_range_set_init(&crs_range_set); - bus = PC_MACHINE(machine)->bus; + bus = PC_MACHINE(machine)->pcibus; if (bus) { QLIST_FOREACH(bus, &bus->child, sibling) { uint8_t bus_num = 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, Error **errp) MachineState *ms = MACHINE(qdev_get_machine()); PCMachineState *pcms = PC_MACHINE(ms); X86MachineState *x86ms = X86_MACHINE(ms); - PCIBus *bus = pcms->bus; + PCIBus *bus = pcms->pcibus; s->iotlb = 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 **errp) MachineState *ms = MACHINE(qdev_get_machine()); PCMachineState *pcms = PC_MACHINE(ms); X86MachineState *x86ms = X86_MACHINE(ms); - PCIBus *bus = pcms->bus; + PCIBus *bus = pcms->pcibus; IntelIOMMUState *s = INTEL_IOMMU_DEVICE(dev); X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s); 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, uint64_t param) return 0; } - pdev = pci_find_device(pcms->bus, bus, devfn); + pdev = 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 = X86_MACHINE(pcms); - cxl_hook_up_pxb_registers(pcms->bus, &pcms->cxl_devices_state, + cxl_hook_up_pxb_registers(pcms->pcibus, &pcms->cxl_devices_state, &error_fatal); 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); - fw_cfg_add_extra_pci_roots(pcms->bus, x86ms->fw_cfg); + fw_cfg_add_extra_pci_roots(pcms->pcibus, x86ms->fw_cfg); 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 = pci_bus; + pcms->pcibus = pci_bus; hole64_size = object_property_get_uint(phb, PCI_HOST_PROP_PCI_HOLE64_SIZE, @@ -480,8 +480,8 @@ static void pc_xen_hvm_init(MachineState *machine) } 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 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) /* pci */ host_bus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); - pcms->bus = host_bus; + pcms->pcibus = host_bus; /* irq lines */ gsi_state = 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 = kvm_irqchip_in_kernel() && !kvm_irqchip_is_split(); - if (!pcms || !pcms->bus) { + if (!pcms || !pcms->pcibus) { error_setg(errp, "Machine-type '%s' not supported by IOMMU", mc->name); return; From patchwork Tue Feb 27 08:39:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776175 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52374wro; Tue, 27 Feb 2024 00:44:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWQ6sjvVng8uGHGVkRb48SMmHMU7J46loV5WWD4jpbyiT/jI+hBaZj0OnVFS+WGp1evNuH7NOKvq/PJ7rMOdUUy X-Google-Smtp-Source: AGHT+IHuEez0meKaEFxlbIkiGBsipPjKuZtvjVOIIhdXdGsJtWzKXOCnxnrqTYKi6gsH5OyTjJ+M X-Received: by 2002:a81:a14b:0:b0:5ff:7cdc:404b with SMTP id y72-20020a81a14b000000b005ff7cdc404bmr1354980ywg.52.1709023467798; Tue, 27 Feb 2024 00:44:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023467; cv=none; d=google.com; s=arc-20160816; b=y9qgjWkyjmqVgTT8XPX/NNYQUPWGWgN0D4wP/NV489ov8OqpblBbngZXoySPjg7QCp ppbPwzf+IprzDQ4MNDxyl9/S1XiBMqOVopZtFOZO/Lj+eMuPaan27qTbcdCdBK2LTxZV ++6E3Oec0EUhmO4QilWJBgUsePhAzAJJZGTMJRY8MO7huTKP9O+QDuydC8FX/7oT07ip xNrjQuR5to9lIdJwS6wm5p8uy++xXY3ucJw2/tcbd4zVUmXOH0goCZQnw3MtsZSxAxq5 uhytX4h/BqvdTrKFaayZDs3vcqQf9762KrTYSMy9D/jnyFKX+iw+tAd86JAEY/jAvbP5 CVTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6n+lSFzDNPiqC0LaZPK+z4bhN6r8eJn5HjneFPDs130=; fh=0MZ0IlRhVhABWR1j1g1ikwjLcFx3VgFxZ33T4n/gHsk=; b=PYYC12afSvCj9ikzbLVMBIiSWQDWunT/s8WIHnYPjHqoYWgzIeor6gNGJWwMW1k/H5 hAnyehHk04/12Ho8VjmLO0YWS2TSe+qFE5Ue5Iy9ZfgSHvpR2rxDzc3e+cSNLv1FiMv8 3Y6dJGUxSH+zM86c8ErBF7gdvKXApa+KkZ/WiKmrpdC+uR59StKB3lI0/QFJaLGpmsIK PnF22RZ9U/MKzz2VGqBZMOFMWZ6BJqF5GjizS1gB9vmRJl/W1U5ApS02FP+LdCXVM0g2 vWVszcSeli8MjlYUitQ221rKDfqOzP/qYwea7u7Fy/kO3DI+rjDvHShpvpM/+3hb+V4N 049w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QItaDzK+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u17-20020a05620a023100b00787ccc153b9si5012577qkm.192.2024.02.27.00.44.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:44:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QItaDzK+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow There is no advantage in having these local variables which 1/ needlessly have 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é --- 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 = get_system_memory(); MemoryRegion *system_io = get_system_io(); Object *phb = NULL; - PCIBus *pci_bus = NULL; ISABus *isa_bus; Object *piix4_pm = 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); - pci_bus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pci.0")); - pci_bus_map_irqs(pci_bus, + pcms->pcibus = 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 = pci_bus; hole64_size = object_property_get_uint(phb, PCI_HOST_PROP_PCI_HOLE64_SIZE, @@ -261,7 +259,7 @@ static void pc_init1(MachineState *machine, for (i = 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); 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); } @@ -310,7 +308,7 @@ static void pc_init1(MachineState *machine, x86_register_ferr_irq(x86ms->gsi[13]); } - pc_vga_init(isa_bus, pcmc->pci_enabled ? pci_bus : NULL); + pc_vga_init(isa_bus, pcmc->pci_enabled ? pcms->pcibus : NULL); assert(pcms->vmport != ON_OFF_AUTO__MAX); if (pcms->vmport == 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); - pc_nic_init(pcmc, isa_bus, pci_bus); + pc_nic_init(pcmc, isa_bus, pcms->pcibus); #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 = PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms = 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); /* pci */ - host_bus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); - pcms->pcibus = host_bus; + pcms->pcibus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); /* irq lines */ gsi_state = pc_gsi_create(&x86ms->gsi, true); @@ -232,7 +230,7 @@ static void pc_q35_init(MachineState *machine) for (i = 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } - pci_realize_and_unref(lpc, host_bus, &error_fatal); + pci_realize_and_unref(lpc, pcms->pcibus, &error_fatal); rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc")); @@ -284,7 +282,7 @@ static void pc_q35_init(MachineState *machine) AHCIPCIState *ich9; /* ahci and SATA device, for q35 1 ahci controller is built-in */ - pdev = pci_create_simple_multifunction(host_bus, + pdev = 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) 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); } if (pcms->smbus_enabled) { PCIDevice *smb; /* TODO: Populate SPD eeprom data. */ - smb = pci_create_simple_multifunction(host_bus, + smb = 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); /* 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); if (machine->nvdimms_state->is_enabled) { nvdimm_init_acpi_state(machine->nvdimms_state, system_io, From patchwork Tue Feb 27 08:39:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776177 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52630wro; Tue, 27 Feb 2024 00:45:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXbI5vj2EBrJnAde7kjSjLDI6XgY4vt6WBIfd/UDwDbZbNVd/d0wydafkdfvKu1hak31SQIFqDJF9tnCBYJI2IO X-Google-Smtp-Source: AGHT+IEcU8IE66RVxCEBqAShoJ1U3TfL4Wgp3PNLwQnlYGAfLrS9qIaGrCtQj84vRDvtRbH5xkwl X-Received: by 2002:a05:620a:28cc:b0:787:da0d:237a with SMTP id l12-20020a05620a28cc00b00787da0d237amr2897825qkp.4.1709023528911; Tue, 27 Feb 2024 00:45:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023528; cv=none; d=google.com; s=arc-20160816; b=l9QyUrrdY/SaNgHNgdCyxQ+W40XzPV4anuspBN2Fh2Xc+lDUQkVcDoQKFDP/+sxVdU LPpiCpPUSZSruwQPreqFqXHe3Oqcm/9JNlj8usxw7FsK+FvInOHeyzuhnUEqRrqkPGBv L+ke47ThrC3VyNrrDJfKoqOjtpONYSkFccLK1kNLLLIof1ud8li9GEZ8PtqVvZUC9sWv mgeGJt0A+BZO52goH9j0rJasF27wgBPY2PnJJCG6GNwNUhEXCBPThov6rVIBKN4sUaOX kLuAf01oZyN8iODS66FH6o3MASlfnJMFPHobMSlfCkgm/J0XBszB6uE9QJRYu/pcBL7t gcIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8FdaM9hjFygoV+600zSMTUb6h8PNn83HRuFk/DcEkWM=; fh=ovajb8wDU7kdy/ufSW8vJ/j9KDz9SZGrhJ9Z58oNhe8=; b=pWtjOo6t28X8uxQ9KtId2Q9E5nXqxHHsumaFMDOzLO/Afck1KkmC8E8LAEtiQGnvwi WJkwsU9CZYqVHZcD5EQPVaJFPVEgk4HlE/nVm2/iIaJrcuKZfc0si7ZKFTKZFRFTrgFa 3FLHLcJ4LamxaorDrfZm4+kVJQldB/16H8T9LE/QFNZfaxvBfOySw/HWVyH1mNvEQPOR WL7eZFthK7eKHTpXUF1pCWb8/ZatJic/7hTsosO7gSioW5uK7XK3b9wzC+z+4NpCu1cA uBEHWxcyL1QnDl14/CZ3aG50DDM9043spbWO+gLTS3yxfbgm+Lz6QZOmbo25vSUz4Gbq Qp3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wiGf60xI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r11-20020a05620a298b00b00787c781083asi6960055qkp.48.2024.02.27.00.45.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:45:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wiGf60xI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow PCMachineClass introduces the attribute into the class hierarchy and sets it 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 removed. Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15" Cc: Thomas Huth Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Message-ID: <20240224135851.100361-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- 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 { /* Device configuration: */ bool pci_enabled; - bool kvmclock_enabled; const char *default_south_bridge; /* 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, void *data) pcmc->smbios_uuid_encoded = true; pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true; - pcmc->kvmclock_enabled = true; pcmc->enforce_aligned_dimm = true; pcmc->enforce_amd_1tb_hole = true; /* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported 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); - if (kvm_enabled() && pcmc->kvmclock_enabled) { + if (kvm_enabled()) { kvmclock_create(pcmc->kvmclock_create_always); } From patchwork Tue Feb 27 08:39:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776185 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp53340wro; Tue, 27 Feb 2024 00:48:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXxpODoDAwoIL5bmLDypnLZQo5A/WGMTR2pcTYDmGA3jD9HZcOlObMPIElAOQB4jA+SdefvT8XLzEhGoIJ8Sch2 X-Google-Smtp-Source: AGHT+IGH4hq8X8Mk/j9ONK0sw3HxNFwBsDYYU8DBKU922VvoQ/bLQAJRUqDMhd84fArnSqaRpZZu X-Received: by 2002:a05:622a:4cc:b0:42e:776b:509f with SMTP id q12-20020a05622a04cc00b0042e776b509fmr10321164qtx.31.1709023692341; Tue, 27 Feb 2024 00:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023692; cv=none; d=google.com; s=arc-20160816; b=rwKnaWDPjOd6Ii0IdQ7t1PfCfa+K8XEUjjfEX+yJ90Zj2EmfwbxzMWqu/MIZknWbap zfGbVGiRgmIYFwwyZQvMGvStyyTt7Iq9TCbBYZjKdig2+S8a8/JkOx7DP4hJbl5HGJNK OUi2TJjI53IJtTulAEmqDAH3jDACq3/xLOp+Q4ekL/BOm56T6hIsFRM+JBqTS6nPzQpR Qkw2TQtsc4fOFxwM39kgLxrIwQQFVRR3UrCSZY6T3QfUlNhnyG2Sw6wi+ImyWCM0AxS2 gtzbjSZxm7fzYKvy621XGXs/tzbavtkkV9MjFrqwR9ielFZgiCnweo0pysANwZRs/+uB bS0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AxCElssAJQElNOBysOkvX3JvR87QOEk2FLy7QknFoAM=; fh=Hi6Oqm6vwWxidCSlzCIK824iSuK+MIrz9/oTDT/sbFA=; b=XtgI604iyT5zjsVsxoQS7rOf/6MovpFkqELM52dPAgC0/fiLhFkPz3VJLIwZMWEfhL Pp9cl3yR0mOjndXbUparoLbdqOjHuBkTNzZEEYVbkCCI30qPjhpHhv80q6H779qcIVfy CU08FrdEphHBExcMH9R6POIZF9nBVENH7tq5kkohEq274zxJgkIiaEesW7jeg9W8Qb2q Fd/3ZCAODt16CJua5ZBkSaPC46aCE95CV/e05l2PMXvfaafBelx6JI5CzibgfUz7i1Z1 /3FjT3KqxOXCPjzReRc19SCkQpWoA7u+ICmA2C9XmvCLmORwSS2AoiqoQ665f0A7jYn+ U8+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VQ1Mkk1C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l19-20020a05622a175300b0042e91448bafsi2719848qtk.767.2024.02.27.00.48.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VQ1Mkk1C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Both the piix and the q35 machines introduce an rtc_state variable and defer the initialization of the X86MachineState::rtc attribute to pc_cmos_init(). Resolve 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é --- 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); - 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); val = 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 = NULL; qemu_irq smi_irq; GSIState *gsi_state; - ISADevice *rtc_state; MemoryRegion *ram_memory; MemoryRegion *pci_memory = NULL; MemoryRegion *rom_memory = system_memory; @@ -276,8 +275,8 @@ static void pc_init1(MachineState *machine, } isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(pci_dev), "isa.0")); - rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(pci_dev), - "rtc")); + x86ms->rtc = ISA_DEVICE(object_resolve_path_component(OBJECT(pci_dev), + "rtc")); piix4_pm = object_resolve_path_component(OBJECT(pci_dev), "pm"); dev = DEVICE(object_resolve_path_component(OBJECT(pci_dev), "ide")); pci_ide_create_devs(PCI_DEVICE(dev)); @@ -288,9 +287,9 @@ static void pc_init1(MachineState *machine, &error_abort); isa_bus_register_input_irqs(isa_bus, x86ms->gsi); - rtc_state = 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 = 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); i8257_dma_init(OBJECT(machine), isa_bus, 0); pcms->hpet_enabled = false; @@ -316,7 +315,7 @@ static void pc_init1(MachineState *machine, } /* 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); pc_nic_init(pcmc, isa_bus, pcms->pcibus); @@ -343,7 +342,7 @@ static void pc_init1(MachineState *machine, } #endif - pc_cmos_init(pcms, rtc_state); + pc_cmos_init(pcms, x86ms->rtc); if (piix4_pm) { smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 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 = get_system_memory(); MemoryRegion *system_io = get_system_io(); MemoryRegion *pci_memory = g_new(MemoryRegion, 1); @@ -232,7 +231,7 @@ static void pc_q35_init(MachineState *machine) } pci_realize_and_unref(lpc, pcms->pcibus, &error_fatal); - rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc")); + x86ms->rtc = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc")); 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) } /* init basic PC hardware */ - pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, !mc->no_floppy, + pc_basic_device_init(pcms, isa_bus, x86ms->gsi, x86ms->rtc, !mc->no_floppy, 0xff0104); if (pcms->sata_enabled) { @@ -312,7 +311,7 @@ static void pc_q35_init(MachineState *machine) smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } - pc_cmos_init(pcms, rtc_state); + pc_cmos_init(pcms, x86ms->rtc); /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, pcms->pcibus); From patchwork Tue Feb 27 08:39:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776174 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52266wro; Tue, 27 Feb 2024 00:44:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWcmrt7Jiq7roGUoe+UWBkcpaJrJ4iELXk3DOtLYX+ARNBHsiYSK1+jYY6A85XZxLI7PD4RWHMPZadMqS2Mf7xs X-Google-Smtp-Source: AGHT+IGYVppYRCy3QBj3cNRTeG+PArbcS3/6WjkQr2jdYzHaLRlY/X07fTE+cABKI0ggPGbE5mQ/ X-Received: by 2002:a05:690c:712:b0:608:bf71:1495 with SMTP id bs18-20020a05690c071200b00608bf711495mr1477361ywb.15.1709023440354; Tue, 27 Feb 2024 00:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023440; cv=none; d=google.com; s=arc-20160816; b=uHT8Ex2Gmpqzkcd/LN6nadaQL75K9k8DjVCUkECU7UTMyO0k9Ae0wlnW9WI+xs1NIg cW5CuRTc0JARnk+dURwtAbywCEun6rbQ/hQ0TWQtz/wQpvulLkQJ+1j5fHyROYp9zgM1 MV6Za1G9cisH+toywbiE2PvwYdGCkTgj330CrYaUTLnr7ogRpmyjkKjNzEP4WBIDhvbf g2L+STLWJiCoCAQ4vrl1hZacWkPBull0CC6kTUn2yBgbYrmjDTjnpjxm94ZeVBb0oCMh bSX/V+djFaipgrMXbVqyOePAZSyk9l7GVpeDBbduU3z/kf1BLNkNH/EgghWc7RzDxihb egvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=neUNa6vtFGWdPhcBeRIzla/viNhIcPd+5ZZ+Q+4SiBQ=; fh=am4D7MwbVIsVwOv6vHbw1dv/mZwUFkyjsCFSKwZ31ZI=; b=zUjP8D7KWIFaURgChz8S8d44cN9J2pMYeEy+ibHIpvgkU8kGlpouGLGmXp3fpJ93ev 47sW7bT4s/SuklTW3e0qO0xL2nIeLTapWmktjEPFjW4KrIvVXyi68BG5q2hP8BKnCkW3 VrQDy+gVvKM1dhfp2OxEuTWsS+9DRCHfww6WevI+AW/ZMCAvVpMAE/9R9UhIhylIuc0R Xj/+Z42RliPc1gKMw+7CRoI3uDigykuPVsieiJtCHb2nnm6UCkCLW+2Cu2dQPp+6hv3w XQIh3QgCrfKVCzbkBnyDhego3LeWQntzfUU2sh7ydqPVoWzEjlmm7WYvTbWzDkZpscr3 Lx0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlxc+0l3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id pn14-20020a056214130e00b00690171413dfsi2470524qvb.498.2024.02.27.00.44.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:44:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlxc+0l3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-Id: <20240226080632.9596-2-philmd@linaro.org> --- 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; dev = 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)); sysahci = SYSBUS_AHCI(dev); - ahci = &sysahci->ahci; ide_drive_get(hd, ARRAY_SIZE(hd)); - for (i = 0; i < ahci->ports; i++) { - if (hd[i] == NULL) { - continue; - } - ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]); - } + ahci_ide_create_devs(&sysahci->ahci, hd); } static void create_xhci(const SBSAMachineState *sms) From patchwork Tue Feb 27 08:39:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776178 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp52694wro; Tue, 27 Feb 2024 00:45:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXTBy2ceOiZSasYefM41Ed6VzK/Gby4nA/5UNyQWgQjtssPdckIv974HsfFjzhYuzOh4eqRHvdenenpvTkfzpIj X-Google-Smtp-Source: AGHT+IG7fqUtwYUaRsCAuiHNII9JZwig6Kkn/DWE/sTVKKbtGhLR5F01vqFWJg2Ga/qKYc4G7eyz X-Received: by 2002:a05:620a:51:b0:787:c498:191f with SMTP id t17-20020a05620a005100b00787c498191fmr1467382qkt.25.1709023544994; Tue, 27 Feb 2024 00:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023544; cv=none; d=google.com; s=arc-20160816; b=GtMIMnUvOvEFHgjDYsKNA/0iB1d5YRxDlPbqiw7n8wydquW1iZ7ZUf8MCkHPjn/IyL G/UCNcfqUZTynoQOSo5rONGlkLJsiGTZmxxp84JNLENd1+gMoJzH6E+/bA3LUxBsY/A8 z7qPH48G58LECytrV/KgfLY/UOKIWimnp4AywrlNFlfdZ74B+vkj1c4tm3WoyMI3Cvlb zHbaB53tkVDrnFOFz5N3HFU0l0QxWhcn2BQaNbOZrGSPGrd+vohomBQEO0+DyfOwQ18P 0VaiCm0L5QLXcobPmlPSwrNoMzYQ7ohOVkhunCAyPAxgjGtbuSfEl6iDUPbNBeZ25qU8 hJRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=scR0cVRlUQ+FFZFfcolEQrGBOQjFaxkZH3KxNR75t0E=; fh=8kxXZUT5LiIBCLsXxxPKQxrNBSL/+YCSu8daB/W1Dfs=; b=ivPxTaD4TF64dVt0zk/vSDsAfXGCSl1bNd8bc4TcC7bU/3Y13/NEaWs4KDDA0+DdhY eQwptXWx7MhjEkusWi3CiZqQ8OSdBNpjb7psM73i9007ABERmcTFpDttDhkJKWgG5CrE OuSsULIK01xKGxlyspbvv7Z6zkJQUS82q3+GURmIaZWxCPwah0IizXJtpfyATQ4gdnRS hKpTfpmiOxjLx5ixMHvW6+F4rum+EyX5h3W73TEebrgzz3Jnbl9LTgCiF4DfSS+Wec3q zsCEDCFQEKYUjQFn/WZ6d3nlcOhJR4yK7QhkGzJidRX6V+3RjNNuB4LepOUyDKpGrtuN RYng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JfKiBKhv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c23-20020a05620a201700b00787761f6926si6792306qka.245.2024.02.27.00.45.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:45:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JfKiBKhv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: 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é Reviewed-by: Thomas Huth Message-ID: <20240223142633.933694E6004@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- {include/hw => 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 => 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 @@ #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" From patchwork Tue Feb 27 08:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 776190 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp53684wro; Tue, 27 Feb 2024 00:49:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEJA9OxguWmdQV498d/f8AGUNhXJ4kODEjc7jCh6E0VXrpUESCsS1rS2kQ9AaevSe9k7gjsxMR/f2yWQU1CACI X-Google-Smtp-Source: AGHT+IF0unF9N+eSb4ERD+553vOkXbTjnwNoywpo/2HRAJpz4rpq1msAkejwILOfJ99EvEk2q6tx X-Received: by 2002:ad4:4eaa:0:b0:68f:b9b8:6a87 with SMTP id ed10-20020ad44eaa000000b0068fb9b86a87mr1862559qvb.12.1709023785684; Tue, 27 Feb 2024 00:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709023785; cv=none; d=google.com; s=arc-20160816; b=KiSIgktyuN9kP6enI+vfM5wtU9NHqi3FBn1ffCm3JE+84BmIoPBUCLAzDq/7tOK9ro G/Au9noSxfG0okLbiTgUNONRAzIMIqcECCRfYy5OyoQ6guU7NNlmv+kkKucntc3Yj8ai GA66egWCwBhKEw8XY21pZeD7Af0ElzqNrNwwdkbohTXgC0NLtLnSfu/EnJZ+yfhPzgV4 D1K+tXTgQ5oLhL8swpMOqL71bpbPiqn/uEBJl+eA9YWGqsNatlkRX9QMjVgx08JSjRC2 FaD0LRg98DfP8B1wBTlm03boTvD3EO4YZlvam548tf4cD9qU+qX6xzNMHSDHxgO+g/pR +IiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1OlS5g1x3kQBWH0+dTr65wKR69P3qOgR0yhMaMPUG6A=; fh=dmi6WEMZimH4GaAoti+lwrPIkROcpaCRVLb2Ho0KmNg=; b=c+r9AEfIwSku6kytxTfoQhXB8+NAfQVTVLJrvytts1Ve/gZ7BTmYP4BTJ9rYrKBFMt kfqA7yBJuK4lp/0zMlrFAH8ezMyX9SVaODQew4PhsRHjat6ZfQf3ZTjXZ2BOx/HEXaeA GmUtDVtKMN6i1hXm3gmBp6AomRUU7QjfRQ9TNh+bGSh+ZoQC+CKCct3ZgKfdBns2nxBE /6hwkJIZ3j3nIgzQ9e0rBY57YpwycZURbSuTKbyFksGmcXj9EBjh09VYaK1OaySAL2os bjR1/gB3Slr2YrBx8c6IfHfaluEcfODoQdvZ3XA/eVNVnirbO7n84+h2ya9FrhrZRrvN mGxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vtYHII0v; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r13-20020a0562140c8d00b0068f1041351bsi6730950qvr.221.2024.02.27.00.49.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 00:49:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vtYHII0v; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-Id: <20240226080632.9596-4-philmd@linaro.org> --- hw/ide/ahci_internal.h | 2 +- hw/ide/{internal.h => 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 => 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 #include "hw/ide/ahci.h" -#include "hw/ide/internal.h" #include "hw/pci/pci_device.h" +#include "ide-internal.h" #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" #include "trace.h" 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 @@ */ #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" #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" #include "hw/ide/pci.h" -#include "hw/ide/internal.h" +#include "ide-internal.h" #include "trace.h" /* 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" /* 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" 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" static Property ide_props[] = { 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 @@ #include "qemu/osdep.h" #include "hw/isa/isa.h" -#include "hw/ide/internal.h" +#include "ide-internal.h" #include "trace.h" 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" #include "hw/ide/isa.h" -#include "hw/ide/internal.h" #include "qom/object.h" +#include "ide-internal.h" /***********************************************************/ /* 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" -#include "hw/ide/internal.h" +#include "ide-internal.h" /* 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" -#include "hw/ide/internal.h" #include "qom/object.h" +#include "ide-internal.h" #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" #include "hw/ide/mmio.h" -#include "hw/ide/internal.h" #include "hw/qdev-properties.h" +#include "ide-internal.h" /***********************************************************/ /* 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" #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" 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 @@ */ #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" #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 @@ */ #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" static uint64_t bmdma_read(void *opaque, hwaddr addr,