From patchwork Fri Feb 16 15:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13560240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3EB2C48260 for ; Fri, 16 Feb 2024 15:36:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0FT-00044N-GF; Fri, 16 Feb 2024 10:35: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 1rb0FQ-000437-L4 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:33 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0FN-0008AI-Ry for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:32 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d220e39907so2713421fa.1 for ; Fri, 16 Feb 2024 07:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097727; x=1708702527; 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=kV0Ad1FDMlSK0WAR0PyajC3eAS8o+2asLjvJepPvncc=; b=HpUsT+RlZVpYnQ6h9RCN+nUP1cq60oJ5XTz2Wtf557ztUG3ojkGYgh7iQLX4BVIO3o UkNYCbIMSd81wxIGBl6GGgQuNJyuM/CcY7MocFJlllFzvm8BbH4d6JWMKFEerpciD18R g10EnuZHiVpMCb8fp08hs2iBjoGAVdNOzjMQkO3dpc67UlaK7KeS35wBBumbHvWV43io 7PlQ2KuqGI/OhY4shGkiws4MZm3hkkKn5N5B2RTk7Q4o1p1n8Ab1Wpj2UWTvAtUeCz0a v8264ovUU+OX/Jc4esMED2EQgeqGOuputz3ngcaDf507JyoY7L6OqntbM2vz2tztaj+Y cvJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097727; x=1708702527; 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=kV0Ad1FDMlSK0WAR0PyajC3eAS8o+2asLjvJepPvncc=; b=rhooZrIReiuYjf/RmtdtS5TkVWQlLTAwkWCiAk+ZRNxgffinsq2zUnKRfYjIj1Wr4c nAgECbpuem/Magi83/EAH3GiRKo/+rcF8hX6ZOOPWly7k78luftYdXpmo7h2u4EdjaSO boN8cQdIcuC3XrrCApczZ4siH3R9r0HQS8qrvuuahQ1RDt/uxJ0VDaPOQ17RlL10qgfw sDPdweOBM9JOHRBMfib2pc7V+CzbIh3eP5vN5/saff/55f4YcZXzWYFAe9fU9Tt0qjZb UUVbFU59AaxYh4kmcxKCjTvW2G0+9eawu8pifMqPg6KhFvM3pFzOce52IdkGZx9kHb/7 B3ag== X-Gm-Message-State: AOJu0Yy6mzoPpBZygBmhkxaMWs5X0zHRgjiwpNyLJ+Xdlw9BmlwgsLUP Iz4x8yy/1QvAmW86h/mphW2uKi2SbClEm7o3MPkyqATQiw5BbarLcQfHDmd4s8wSnjMZA62q2fX f X-Google-Smtp-Source: AGHT+IGfgXbpqZgKjNCGN8KVVHtzk2yqUaFF2+wmjjuAVnYD5GbeKX6Jl3GUMNEQNUdVj+AH74b60A== X-Received: by 2002:a05:6512:20ce:b0:511:78bb:1a4d with SMTP id u14-20020a05651220ce00b0051178bb1a4dmr3559454lfr.17.1708097727158; Fri, 16 Feb 2024 07:35:27 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id rn28-20020a170906d93c00b00a36c5b01ef3sm42951ejb.225.2024.02.16.07.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111) Date: Fri, 16 Feb 2024 16:35:12 +0100 Message-ID: <20240216153517.49422-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 --- hw/arm/realview.c | 5 ++++- hw/arm/versatilepb.c | 6 +++++- hw/arm/vexpress.c | 10 ++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) 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 Fri Feb 16 15:35:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13560238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72A04C48260 for ; Fri, 16 Feb 2024 15:36:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0Fd-00048v-GR; Fri, 16 Feb 2024 10:35:45 -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 1rb0Fb-00047P-I3 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:43 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0FT-0008BS-NL for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:43 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a3566c0309fso266609866b.1 for ; Fri, 16 Feb 2024 07:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097733; x=1708702533; 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=wZ1SK8UcIGNjoS5oUCJZaLlSaFI2o9jBSpbbsKbpCUU=; b=CNuSANL2Eops5l//6bnMB1f2GchJ+D5MDNthI3t2EeyRdclohcB98lzc2IWbt9q6Bj c7nO6O9sViqemSNMKvb11m/VMLi/8J1ZwQcQjbJfhkh+F2goYi+zJNSzTxMkwRkk89x9 UaFfYjlH4MHJ10BUPT9FFyG3+jxTPxW6nNbtoLAZI/sv6OuM9Ml44qjiyKnOrn1THhHH MPTnbUqGZPbO8cRlUKpNNtuCxC7OdkndXgCWBJp1lCXRI23Y4v9ezZE6nNtG0UCQ3QkL r8eaUBlgkeEQYPLv/sYCmXNIzBb7o7gJrjgJduFuFSeriZMlXF2AQhYZvYhmUsun8GoI KCXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097733; x=1708702533; 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=wZ1SK8UcIGNjoS5oUCJZaLlSaFI2o9jBSpbbsKbpCUU=; b=BrjHjBgSbBKCrqVusad1nI6LdiZbat2AT0HhS/3XHSmowgaEW0MvPjLKvvFbLuZjuK pgdkyQ+bBabrdyNEyWLwiIMpmGkILdPIe6T+a42bYKlUNm229u0RzK4DuHoCKojU90yB xBLPC4aI3wdeRpMaHAxfVJHcBz7gub4T2nZGO2fM9P8RtgZRj25aEfVCStZg9H42d4kD JvLYjIsaIGAy8rhUyV51hJmHkAHqoiLo1W6tSmurPWrgJIs5Ul7/cmi/mFI0nE8Ckof/ 7X9m6oG+Ncha7vuWPtd21s5IgYa6WBbrUssdE513fITvE5Bnmrjih4r4CRR0ba77lpfq iaTA== X-Gm-Message-State: AOJu0Yyb2q+/qZD9CKZS2SHAKEnhTweWJloyvk84dagYXpWN3nAzWR8o 2Wy24llEP0WIdwj6nqMcOMGpFuaE1u0stS4ZzKVhpO3mNm5lUZ4Kd+aHeBPGutfuHVuEKA/+mqj u X-Google-Smtp-Source: AGHT+IH9BTAcIohzCR8eVt3EE/x7HR0y4dxLNcTYXzXwSeNEodcpT2ESRISuFuitM7rP6Rj400gYrw== X-Received: by 2002:a17:907:119c:b0:a3d:4037:73e7 with SMTP id uz28-20020a170907119c00b00a3d403773e7mr3369329ejb.48.1708097733048; Fri, 16 Feb 2024 07:35:33 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id qw17-20020a170906fcb100b00a3d25d35ca5sm52716ejb.16.2024.02.16.07.35.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 2/6] hw/display/pl110: Pass frame buffer memory region as link property Date: Fri, 16 Feb 2024 16:35:13 +0100 Message-ID: <20240216153517.49422-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 --- hw/arm/realview.c | 2 ++ hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 5 +++++ hw/display/pl110.c | 20 ++++++++++++++++---- 4 files changed, 25 insertions(+), 4 deletions(-) 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 Fri Feb 16 15:35:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13560242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1B01C48260 for ; Fri, 16 Feb 2024 15:37:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0Fp-0004A8-1G; Fri, 16 Feb 2024 10:35:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fa-00046y-8X for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:43 -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 1rb0FY-0008Fd-GE for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:41 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a3dfb2e03e7so46946666b.3 for ; Fri, 16 Feb 2024 07:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097739; x=1708702539; 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=FHq12xVLql3ZjDkC8k2lRJAF5RJwUJ4vzRZ5Ca5vbxw=; b=aGUvTxVn0CSevQHyBDA9cVw+UVglgY2WrUoRExucsmzbM/eRtrS5afWbUMOl5saiC0 DFasHe2Rr9+TBowErSS1Z8yGmXrQD7zEolWAVbCv3u/pB6icUh03uVvzxSWYi/9GFmGb BP6EInDIox0XWaz7Yp+j+YWO419I9+jWTsAIS5LE6Re2hd5XbihKkBlAQot/4bQEfHbZ /w4luttgu7EWUA9KVsmHc9R1d8NI7mDDKcl5+XcbFZ1KVzA+ZN51Kf3bMD8okv1c4nAj z7aahlG9hehfiZbh8Ys/psowuFQ2tCEiLN30UMG7XBTvZ6kpbggx4yTxdig7KKvFj7aL +UpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097739; x=1708702539; 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=FHq12xVLql3ZjDkC8k2lRJAF5RJwUJ4vzRZ5Ca5vbxw=; b=XmMipHQvcsUOmNJ2F7F9j6PLiTvrEcr1xH6+BwlysCx5EgmCMu4uMZG9/vvS0OsOR2 W11SCbFSU7Aeeq9W3LkK1ZXNlKDD4ulVeVif4L4KnvIti3DxUtmVSJagw1nddIi2CFts Rsgl1Glfq64gAH8jRyFBLtvr9xfeacHTx2JLrvw/SHHhb3/PAuNaeblhLDH8cwpNYPOD jwsMPyr5RU+pM35jjsb7olRX2TPaVy3SFUJb3t6H8iCbO4jCY+6o3GZglBKGoCLRSpt1 ZqbZOBogEh5h6t0jJ0lwZJHeY5edlE2xjOI5Ln8e+igOlXtxCHOESCTEgu7EUlB87G0X BA5g== X-Gm-Message-State: AOJu0YyZDoP4RyaRNMJe9tX7tQqdltxKs7Nd3/1urhh3VFIiRzhpcoa1 SjNxxMmvP1yJC1t3qdrxQ2J48RgVpxN0SjkH58DO9gGvD7tQya/rDlH9qHEgsc92Dbh6rlb2h9K N X-Google-Smtp-Source: AGHT+IEi6meqrapeqjO4OgHfp/p6JY/NLaWMf9AKL7DDim/5nYeDiOvwjmctPUdudVyzB5T7NpBDLw== X-Received: by 2002:a17:907:b9c6:b0:a3d:2e34:30a5 with SMTP id xa6-20020a170907b9c600b00a3d2e3430a5mr3626388ejc.29.1708097738898; Fri, 16 Feb 2024 07:35:38 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id tl7-20020a170907c30700b00a3d1458523esm52110ejc.29.2024.02.16.07.35.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 3/6] hw/arm/exynos4210: Inline sysbus_create_varargs(EXYNOS4210_FIMD) Date: Fri, 16 Feb 2024 16:35:14 +0100 Message-ID: <20240216153517.49422-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 --- 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 Fri Feb 16 15:35:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13560241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E3B0C48260 for ; Fri, 16 Feb 2024 15:36:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0Fr-0004GI-MZ; Fri, 16 Feb 2024 10:35: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 1rb0Fi-0004AJ-J0 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:54 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0Ff-0008Im-Li for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:50 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-55a8fd60af0so3193124a12.1 for ; Fri, 16 Feb 2024 07:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097745; x=1708702545; 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=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=OHbhCNXn0vnVsM5RG9SuZuIctabUQbGfbSYJtKURuTuvdJrs+JGCCQqgFNT5r+aZdg r1OCYf0/ro7oFmtLQWz8061n4f5qIJs6UKMdVffDoCeN1LM2mCZj/qBhlQjzGHQBz4FM bacWMeQvkffmzh5BDVCp7LLzGDaxa55LFp8e13xbN9Bp9Lpp59bhH/vlc2O5lNkUnG2k H47gffriNLc1u/GoMNoKMa0VvA+BMKp07abfufSPnZUmo2poQhGyCtG3qwX7AEY5TtZL UkFMD6ZMzFoCleJiSR0zRVZMumLjbm5yJeVcxP6SoRxkD2gfJcXAslAWbiMKp/CuGWz0 DWHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097745; x=1708702545; 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=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=NZ8Stf+axABhOTSqm5EDXnfA5jZ26VBp1iy9TS+HIqG70C9gYn7PTxcK/vVh0FDGg1 z/gBMoYu3u7FpdwtSK8B7S6YTjDc95b+em4Wqw/mqD7uTgzq+0BiEWYfYRTSZdhUSHtM 6PhEhYBfv81qL6SXXPT1FDgwlf/uUpUlZwWQYxycT1CTwJhyuDPHw42IFj0HLdILodnw tZ6puKUxTIc1aCdVd2qUrdn63M5K7tl88BdN4ShaAZJx6Pt28uoAqSJoNZE0R06Hurww S57XaEhUKxC5i/CSVDnhdxwodpnudCyfm/VkQHW9UnM2kRUbTpKE4cYCGUmB32XwHArV C/eg== X-Gm-Message-State: AOJu0YzcXLagCUTMtnClX8EpxGfndTBxveRlOaieQbRwKCWcsTAPV5m7 m02LT9J9hXX4rnMXY3TLYkFjbKR5HhAzuJ7QOE2RGx4l/FLeUdNUcNXapKkLd62XqIR7hvZH0ql P X-Google-Smtp-Source: AGHT+IGAFxEntDsPXEoYg04THRPSQ35FumBk18CuWooi3xaKjvMlW2W8e2Rd87e9wlVE4krtOGb7/g== X-Received: by 2002:a05:6402:793:b0:564:1c0:bf4b with SMTP id d19-20020a056402079300b0056401c0bf4bmr836119edy.40.1708097744750; Fri, 16 Feb 2024 07:35:44 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id df13-20020a05640230ad00b005621a9b09fbsm83681edb.41.2024.02.16.07.35.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 4/6] hw/display/exynos4210_fimd: Pass frame buffer memory region as link Date: Fri, 16 Feb 2024 16:35:15 +0100 Message-ID: <20240216153517.49422-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 --- hw/display/exynos4210_fimd.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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 Fri Feb 16 15:35:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13560244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8F67C48BC4 for ; Fri, 16 Feb 2024 15:37:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0Fu-0004I6-1V; Fri, 16 Feb 2024 10:36:02 -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 1rb0Fp-0004DI-8H for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:58 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0Fk-0008Ju-Gw for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:54 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-511ac32fe38so3199942e87.1 for ; Fri, 16 Feb 2024 07:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097750; x=1708702550; 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=6fLBBhh1GSx7gD4Lvttkm3NNOOv+Jojp8q0UUHVCrGQ=; b=zpab49GdHR407PIxh5Gd0ldme4YocbRxvc/IrE1JsLfO29RoA+en4LtQ/YGwzhEk77 52+E4OE0qrGgKBtDIdbnbLwLiD5rsGXzEdqwe79M/iLoF0KfmWSdDbaIQJMj43l8+Mv+ P77mzyX8JiZC29066OSSQQDdNY+3dcpr454PAC6buUD+PTdYkF9E3JH2uhet8om/BkJ/ mPNG9QKNG+R8E/VLcU6yrlfKifhnvgUxtBCPoanApzWEwrocshA6Pwt2G6GeajKtG6P/ PO4BqHdgN2qgK9N5/VLBW9/eODa1rZIFyCTNd6nrEj7+qhi9DZJfzJk2oj2T17hwYO5f LypA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097750; x=1708702550; 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=6fLBBhh1GSx7gD4Lvttkm3NNOOv+Jojp8q0UUHVCrGQ=; b=tQYTmlJb4ZfOPB8sRBGD1mEcINwltGyAIzPxheib/tIZGNeBWx/tR/Xbud/6NtWLZl 1Wj0/jO9BmSImjPLkmgrIuP2j2AvOfj/L3uSus+dNknvoQLKbh7VeKRuhk+ItVV+wvw/ 1Ki4RZhDBJngkwmGWyMdqlZJ/8BzM/HVZ9D/DCc/m03f6QP1MY8L7vpkH4LsUxi+qM4H Xcvlt6ncid6H+fwfgmJtA+o4kfLmoyft8GcXoSwez1T9etuVa/XiMHzFRuBRGliL4P8V 82uy6EO5pUZCiddtUmkofTBuJsfDYDHu+rhaRqTuvwg0I3EW2GSXnHI+CPADtLN1waLX QfXw== X-Gm-Message-State: AOJu0YxZgJrL3hjW+P1KMews6AruVJ2E+08W+BQlGcLoYs++D8pUSoqy vwOphpAAIQR5H/LNNgCjD5IrsjFaJukRCq7jgnhjeIAIyU7vHv8OxOiGhntIT1DQ5uR1LywCN75 4 X-Google-Smtp-Source: AGHT+IGNHeZhgcGo12jNmOStEDC3hBsbxmtv6u/9HX9Me13ycUZT94SzgrmFQ42EJFSWhVNwe4Qrpw== X-Received: by 2002:a05:6512:224d:b0:512:99ad:d465 with SMTP id i13-20020a056512224d00b0051299add465mr995055lfu.16.1708097750674; Fri, 16 Feb 2024 07:35:50 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id e1-20020aa7d7c1000000b005621b45daffsm85225eds.28.2024.02.16.07.35.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 5/6] hw/i386/kvmvapic: Inline sysbus_address_space() Date: Fri, 16 Feb 2024 16:35:16 +0100 Message-ID: <20240216153517.49422-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 --- hw/i386/kvmvapic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index f2b0aff479..25321d4f66 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -16,6 +16,7 @@ #include "sysemu/hw_accel.h" #include "sysemu/kvm.h" #include "sysemu/runstate.h" +#include "exec/address-spaces.h" #include "hw/i386/apic_internal.h" #include "hw/sysbus.h" #include "hw/boards.h" @@ -57,6 +58,7 @@ typedef struct GuestROMState { struct VAPICROMState { SysBusDevice busdev; + MemoryRegion io; MemoryRegion rom; uint32_t state; @@ -580,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)) { @@ -613,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 Fri Feb 16 15:35: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: 13560243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04C87C48BEF for ; Fri, 16 Feb 2024 15:37:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0Fu-0004If-UF; Fri, 16 Feb 2024 10:36:02 -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 1rb0Fs-0004HQ-LK for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:36:00 -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 1rb0Fq-0008L5-Lp for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:59 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a293f2280c7so306499866b.1 for ; Fri, 16 Feb 2024 07:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097756; x=1708702556; 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=hOmGAqEBBOEy9P6DsYyadVIEFCheEXAYvta8nSQ9bhE=; b=Il9PjfY1GBNrm1H293ZJGyUpt6q+yo6054KPUfrdvkQIPsbWvqWcH5zQYS/5Fol+FA QmgHa0uAzzGuDEX792phmJpBUeTZJvL7JdZ/lbdh1SZfy7diLp1PGHpg3wjGzpLR9hy1 eS8+j0fg7zTlKZU/pTYlf2cTgq2vX0t0mNIPvd+SULimOlZfR0ywlrUFKiYL+IrTEj+O kYDFAyMrHUYpT2e74iCph96d8xGgDyIDlizB1iYRCa5nJ0sFOg0NHRsaDcPS3KveG8BR 0P2YcsTd1tHzYYe4KmpqRWmteowe+pVqDCYc6rKsFVfUmJFFl2/tRGDCp7wiyZdugoA3 QFoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097756; x=1708702556; 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=hOmGAqEBBOEy9P6DsYyadVIEFCheEXAYvta8nSQ9bhE=; b=WktRJyzJ0PSzKX6nBqIb8+TbnOGJh2EApNmZnE8Vl3ziBZ8K4nNBoOrmYjhEfBPMP5 GUsBu/p6LdHAY695HjJsyQNwQrdEZrW+lJplrvlvL6VMrDYwCXJC3nkE8mbAa3q+bKjh JH9MCLFSm8dxZsWEOBYu1HJwUnZElYEaI53zIgj0AZF4HX0skteLvcksbnUUhOvTVzqQ 2GvkRpWAwQAimlpFzMQgebN5gbMmyqjMQkSxw7+mzJWNTDert5KYXFuoaKDnsZtBlBRK ufaQT0KSBGLF1ZKX8/HLNI9Jvcka5DDhcvIfbEf6fBsEBFp26DKw2N9BbPw1HmG7hrUJ q3UQ== X-Gm-Message-State: AOJu0YxR2qgvJemsiB8TvDTqwlJxnSBsDKEmAYXm5XD2cJC8GIjM9gkb 6lLRq2u+H6CX5Z/TSgEVoxK7055AqQvfJnX/Qm+GuSzOkUrLLrYFPnaGY/9LLN5Y6xnzYEcJRzU B X-Google-Smtp-Source: AGHT+IGBmhb6VOfB2zCo0LEpA88KaKbBg1ovfqo3KF7CJB2va+ushmG+IzCBDpkcDMp91+krbOftmg== X-Received: by 2002:a17:906:c415:b0:a3d:7d6b:2dc3 with SMTP id u21-20020a170906c41500b00a3d7d6b2dc3mr3608466ejz.73.1708097756627; Fri, 16 Feb 2024 07:35:56 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id fy22-20020a170906b7d600b00a3cf4e8fdf5sm44841ejb.150.2024.02.16.07.35.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 6/6] hw/sysbus: Remove now unused sysbus_address_space() Date: Fri, 16 Feb 2024 16:35:17 +0100 Message-ID: <20240216153517.49422-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org sysbus_address_space() is not more used, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- 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 3564b7b6a2..01d4a400c6 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -85,7 +85,6 @@ void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, void sysbus_mmio_unmap(SysBusDevice *dev, int n); void sysbus_add_io(SysBusDevice *dev, hwaddr addr, MemoryRegion *mem); -MemoryRegion *sysbus_address_space(SysBusDevice *dev); bool sysbus_realize(SysBusDevice *dev, Error **errp); bool sysbus_realize_and_unref(SysBusDevice *dev, Error **errp); diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 35f902b582..5524287730 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -304,11 +304,6 @@ void sysbus_add_io(SysBusDevice *dev, hwaddr addr, memory_region_add_subregion(get_system_io(), addr, mem); } -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);