From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523520; cv=none; d=zohomail.com; s=zohoarc; b=SxeC5oNBjed6sytsX2WCnV3S9tKE7ZV52SLu+8CekYXpf55YZqkCdccEZmH+nkIN+hnmk0+AorPcbxbaAKgvNUAJG8eLlWgk3fhZfE04G34m2qTrFChKvO05Hl0QBeZGuSPMunjGHNMoDslGkx0Q2V6cQ/PfmTx0tMatd6i23oY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523520; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7iycG/CYzi5qr7Pya6NhclvK6Ts8hrm+dv8CLlGtddE=; b=YA6XhCnD0/3mXLsBHzqcIFrBKIGmMYtqGDaxtG4TpZUx4PVjZl9LT+W8px0QswWpiu08E9/x8eCXURYtugr9gdaNkv+x3Oc/VOXGUHHm4WGK5pxSLlraCg87LzHs1KLXi4I4yhTm9OzdEJt1p5YKv6hzBORjQjuNMJUiHyO4g0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523520874682.3190919018862; Sat, 4 Feb 2023 07:12:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKBy-0002Oa-96; Sat, 04 Feb 2023 10:11: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 1pOKBw-0002NZ-4J; Sat, 04 Feb 2023 10:11:00 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKBu-0006a3-Cu; Sat, 04 Feb 2023 10:10:59 -0500 Received: by mail-ej1-x634.google.com with SMTP id m2so22876227ejb.8; Sat, 04 Feb 2023 07:10:57 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=7iycG/CYzi5qr7Pya6NhclvK6Ts8hrm+dv8CLlGtddE=; b=IL6I6keXxU5QiwlRSgq7W9jNNPgXuQ+RbXsuVIon+EsEhFk2Pz7ZetpZl5Py9AzYWO EbGSd+Op3hWJvy9nNbOTaGwb7xAjfRFTVutXM9RH49Ryc0hrr2LYNhTi85DL9fWvl+JL iymufPr/sGw39TNTaNoATAA1F48Sr0hJlZOQWY/Ui2471xJz8LF96f0Lr8yKOVE4DOBy uFm0ajU5i0CxXyncHv3ux45llDNPNsBfUAeqpyVXx7ej+HXxaFF93RcljYyG8rqn9BP6 rvEOv9nZCFEITBr/FigYg1oGLHAfXT3QjuShjJEU60owV3DtXu7ipCjZzfgpYe3lNs9c OYbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7iycG/CYzi5qr7Pya6NhclvK6Ts8hrm+dv8CLlGtddE=; b=NSnCGtqQ6sAgSdvpNfeu9ZSKIR4k/3MJaf8jmnMEc4VtTFSP2JeKtPueJvSWbpSzyL 3ZFKrDpREA7z4Zx38PE9s0hw24ndOHRFBN+qJZ4EGzxOzZ9JL+TAKrywTzkx0SavF61v DidBbQ6qZ8T1fosRI2qOgCDKCibBDp0Wf7DN5I12nNSHoB0sTDwI303ZKtgTYfSQqLlQ wxzJ5yccq8jSZwixRvdqwRd8GRaDdbhiKD3wtXu5k76JAWdsHix9VK6WCNjemUm4iviI kXNSjzePcJSKkOeOhhOhoGgokI5mefriBFktON4HJZqVCAAhwaQRaAwgKc6f0S0oRkEf RDXg== X-Gm-Message-State: AO0yUKXa7vUbuJ78iwJxwoA68GdO/DqwBPOIFS4DcXHvOz9qJUMS4GVk 1U4FLWVLPYPxON5f5jX9hd4O04NzXvc= X-Google-Smtp-Source: AK7set+HvxgNr+CeLGIYEV8hD5SgMiQsb06bB125tFisVIP6N+RrReltkNmig0jZ+FVVL+4xs/vKTQ== X-Received: by 2002:a17:907:8d16:b0:812:d53e:1222 with SMTP id tc22-20020a1709078d1600b00812d53e1222mr14342456ejc.31.1675523456421; Sat, 04 Feb 2023 07:10:56 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 1/9] hw/pci-host/i440fx: Inline sysbus_add_io() Date: Sat, 4 Feb 2023 16:10:19 +0100 Message-Id: <20230204151027.39007-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523522360100001 Content-Type: text/plain; charset="utf-8" sysbus_add_io() just wraps memory_region_add_subregion() while also obscuring where the memory is attached. So use memory_region_add_subregion() directly and attach it to the existing memory region s->bus->address_space_io which is set as an alias to get_system_io() by the pc machine. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/i440fx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 262f82c303..9c6882d3fc 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -27,6 +27,7 @@ #include "qemu/range.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/i440fx.h" #include "hw/qdev-properties.h" @@ -217,10 +218,10 @@ static void i440fx_pcihost_realize(DeviceState *dev, = Error **errp) PCIHostState *s =3D PCI_HOST_BRIDGE(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 - sysbus_add_io(sbd, 0xcf8, &s->conf_mem); + memory_region_add_subregion(s->bus->address_space_io, 0xcf8, &s->conf_= mem); sysbus_init_ioports(sbd, 0xcf8, 4); =20 - sysbus_add_io(sbd, 0xcfc, &s->data_mem); + memory_region_add_subregion(s->bus->address_space_io, 0xcfc, &s->data_= mem); sysbus_init_ioports(sbd, 0xcfc, 4); =20 /* register i440fx 0xcf8 port as coalesced pio */ --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523526; cv=none; d=zohomail.com; s=zohoarc; b=UNPE4dSoQIdzF3AuIDiYqYOEbqnb14n/HwX15+l85KPnCBLtLTFgKmmH2sWQjLQBXHnEBTSiEL4hl2evJLLtxyMu/X0K7TfaGeMXIgoFFnrq4oJy1rc5EeW4lLsVeM7HHotD26uM+YLej+8VykYfIObf9aHdmJJ3vL3Vx9dRt3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523526; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LA6ZuoQya0s6wnCk3SNGbAuFteCxPNtvbIq0Ce0nCis=; b=e8mYM5pZNyUdWeZQsWh4hyjEkli4sWo/JEUbJfnF/uaR+dpdJ0n8uJruh89evDTo9Q4HmuGA6qDdfcZqUWQVTgI2AtMOWKq1IPRh814bJ3u1jx9ee/RIvvi0uGKw73cAcfKmRAE3gaY8Y6rZlg/M4yhBHtiU7GIp7fZjcB81pMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523526430738.4171780415417; Sat, 4 Feb 2023 07:12:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKBz-0002PB-4G; Sat, 04 Feb 2023 10:11: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 1pOKBx-0002Nr-3x; Sat, 04 Feb 2023 10:11:01 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKBv-0006aD-Ir; Sat, 04 Feb 2023 10:11:00 -0500 Received: by mail-ej1-x62d.google.com with SMTP id me3so22884470ejb.7; Sat, 04 Feb 2023 07:10:58 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=LA6ZuoQya0s6wnCk3SNGbAuFteCxPNtvbIq0Ce0nCis=; b=YI88LN/t4Lm2N6GWYuEPcwEXt2SnegGrLFt2/87lYbqa2Net4cFpzGXIhbigG3ccRW H3HO7//L3eTZM6vd5f07KivEQBKA8+C3EKOP+jUPToZnRn0LCSe1cWUjYfEhP0W2KLOF eTkGrv0HUmjw0mVG7jny1hptyX0vDtexaDMzjfdv7IL8vWdHQzycevFkWygSiYVgvXDh J5OM+hOy4X+WHmu2dnXtM5891I2CXbOcdJxsZpgR5NGnEaXzDEEaGbwjjVkYAxfzFJbp BlZaUDXlJGHbsTB320dCPhlIbdAfRImfA4ST4cIWHK0qJ6dItNhoTthQMuxDJnU7ANs/ V3pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LA6ZuoQya0s6wnCk3SNGbAuFteCxPNtvbIq0Ce0nCis=; b=nlkGOsMIomFB0YUbkyi1SRY/4a8zJRa8Wz17n9T5bjcxX1qyRcPc3heZUafYJkSFwm xJAqBWiMbYBevU5p9U0CrLyy450ql5b+Ipc2898k7QoWyK8fT0uE8SFCXlX8qwmox0Xo k7y0cqzAu9rRvFq2JEkuuJgj4VG5OhLHnTWSYY1rpuVctQSWF7Au+c6jVdiJttGqS6hO Ox6zPzP6EbI9gmvW69C36CYyC3tvFGVqDOpgD9pxBzW8SkqvHaiRAsPmts2qBI4m91Wp q2UTMSc6+nsBVXX9ACwDmEyBu6J6z4+FQFiZcOr3j4Qp09PSMJXFBmC3cJar+MEhLSrl zz3A== X-Gm-Message-State: AO0yUKXFSRp7F2F8xe/Sa1I+jse+fbeW0H5kvZFVJx3Nz79l4PngLmtr akRdMWxE+iExZg0RpxzcEND1VoaRxuA= X-Google-Smtp-Source: AK7set+NjoLkA+OkSXzV8o5XGvFhc85fome84pNCw1nDoCgum8RSmxHIrnCy29s8M+V6ag3dE0bOaA== X-Received: by 2002:a17:906:9f06:b0:82e:a57b:cc9b with SMTP id fy6-20020a1709069f0600b0082ea57bcc9bmr4752073ejc.24.1675523457739; Sat, 04 Feb 2023 07:10:57 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 2/9] hw/pci-host/q35: Inline sysbus_add_io() Date: Sat, 4 Feb 2023 16:10:20 +0100 Message-Id: <20230204151027.39007-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523528144100001 Content-Type: text/plain; charset="utf-8" sysbus_add_io() just wraps memory_region_add_subregion() while also obscuring where the memory is attached. So use memory_region_add_subregion() directly and attach it to the existing memory region s->mch.address_space_io which is set as an alias to get_system_io() by the q35 machine. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/pci-host/q35.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 26390863d6..fa05844319 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -50,10 +50,12 @@ static void q35_host_realize(DeviceState *dev, Error **= errp) Q35PCIHost *s =3D Q35_HOST_DEVICE(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 - sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem); + memory_region_add_subregion(s->mch.address_space_io, + MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_me= m); sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, 4); =20 - sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem); + memory_region_add_subregion(s->mch.address_space_io, + MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_me= m); sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4); =20 /* register q35 0xcf8 port as coalesced pio */ --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523523; cv=none; d=zohomail.com; s=zohoarc; b=lD42DAjqSsFrcjLM0ANVSNgjyt30E6LYbOK00WL+Xnbtt9toFcuiEkrcrugbhutZrA75TQlQcEWCql87kbuSafAC4Er92BVxyGvQZ05YWbjG+Fa3eEtiKlOV9AvlW0FoHImrUNIlNsL5rPyxE5tVzbux+zPftKnh3Aak/HOW6UU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523523; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XW7xO6YJKL9F4WjdLXKBwfmeW/OQ9/AIW0Vshsiq+Yw=; b=EopNm4wSL4v8orOiPzjztKc8M08LdRzrCoGAkszIrGT+K5rjZmVZfniXsJj2PE4oXomYqcbjPNG0dfDWQcAVcwgob5AuP0T0wdFae3YG7Ti7f1bXliE/29VKr1yyTsYa/u68vWQmCqz+nMisIYR5XlMHH8ZuARq1WVmWrGFbHr8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523523035383.11629697619026; Sat, 4 Feb 2023 07:12:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKBz-0002PN-Ud; Sat, 04 Feb 2023 10:11: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 1pOKBy-0002Of-9P; Sat, 04 Feb 2023 10:11:02 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKBw-0006aO-Om; Sat, 04 Feb 2023 10:11:01 -0500 Received: by mail-ej1-x62e.google.com with SMTP id hx15so22827396ejc.11; Sat, 04 Feb 2023 07:11:00 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=XW7xO6YJKL9F4WjdLXKBwfmeW/OQ9/AIW0Vshsiq+Yw=; b=oKxEQj43Nb9bm/a9aS/FmKx1bBwsd/F2JsqsDgQBxIenn2ahRL79/tnlzTMffGDInm gs9IReEyQAMrCYnfvupBNGZt7kSY9gSycbaM2JqJGOz5tY+7XjQCV8nehYuhiNHY83oC aT99dS4O+alQIHGxtyZfPDMPHQ5W+TUjXgoYYe1l0TOlQ550+eJ3iLtj5OfF5QWmO7Fg iLFESZzAkPNGZcdmF5+HLJjb1+/99ePXnSwVEhNm5mCVb0FXPsIiw5ahep1HVpAm5CAP GB96WR2pflhdPoLFlaumDXnYywbdbHnfgdSZQv3Hz3xZAFT8QdFeXVfBA8rK2zUBOG5Y kJqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XW7xO6YJKL9F4WjdLXKBwfmeW/OQ9/AIW0Vshsiq+Yw=; b=B7e+nYYCCmMyVRF9v6KRpWqtp3QKYrS+CJCWmUHiWOngxnaPFx3ldMdH+etn0ifd/k YQrBVzYvUBy1dWfJuYTz3c0B4X072JaM2is5r390WaVYDQtPpeiHcGh6Y00PFNLeu5UI egGhwQxuMuHaoFUe+F4OocQvCfjF69G4E5tnJhryOGmbCc3fh3kfo+WTKwAmLKEjWQE5 eI1YWFjMEoOJL09OgvXDtYjhEILb2GgewFsd96CgMXDkcqA1Fq7tf7o4WG2sgwo+KvTU B+vZzjX63FNjbzEQnphURWpjmOejMYWHiUzRMz8H/UNkjhUVhgPrO4qBmjGxdVBDSvBl vTVg== X-Gm-Message-State: AO0yUKVhvclvmThwM7UebSGvi/iKsrtDZ+6+Uw8uSxBEF7mAR0luMlFV 3ognHL5MHz+ZFsIevOtVsTLqQg08gyc= X-Google-Smtp-Source: AK7set8tDojRDYPkEmcoQ2m/eTFJtcprMY04G6gaIjyCjMAEhpkr0SNGKBGci+gr3+oylNcz9uZsuw== X-Received: by 2002:a17:907:762e:b0:878:7650:469c with SMTP id jy14-20020a170907762e00b008787650469cmr14715186ejc.52.1675523459022; Sat, 04 Feb 2023 07:10:59 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 3/9] hw/i386/pc_q35: Reuse machine parameter Date: Sat, 4 Feb 2023 16:10:21 +0100 Message-Id: <20230204151027.39007-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523523917100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 66cd718b70..dee2b38474 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -218,7 +218,7 @@ static void pc_q35_init(MachineState *machine) pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory, pci_hole64_size); =20 - object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host)); + object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host)); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, OBJECT(ram_memory), NULL); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523619626890.9712301712408; Sat, 4 Feb 2023 07:13:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKC1-0002Qx-8C; Sat, 04 Feb 2023 10:11:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKBz-0002PC-8A; Sat, 04 Feb 2023 10:11:03 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKBx-0006aD-Os; Sat, 04 Feb 2023 10:11:03 -0500 Received: by mail-ej1-x62d.google.com with SMTP id me3so22884680ejb.7; Sat, 04 Feb 2023 07:11:01 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=bgVF//6qdegoQOeHpGSSVSFmoQkzYIklU+oVnDZbsfw=; b=DbPCJnl7LGlojoy4S3QAjfoXQNFhrZmYsE0pHK7RadL9aQtlbyQ2jGlLs4ozkNgGWC C5v+Ded2SApVICBpewp/LMEZ8VRv43Ash5g7ewekIrrafA+QobAXpI3FNeTBxu5J5Fuq ILXVME/R4asfk/Eeg5jppm4UkqovKUrxxHbHbOHGXQGlIH8gtq35jgKT5SK/4MjPoIdj zinF9S4e4mxhevkF+ge6msyxOZhQW2vsrBMk6B1pS8UKN80U894ORIXvRdszgp8IZwmZ Z4Qg1w2rCAktgVY+yIvm7IKA3s6GnUEUH/w/nbbyhLS/ENvVQ31Y7uqsbe+12RMYFpz7 9eBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bgVF//6qdegoQOeHpGSSVSFmoQkzYIklU+oVnDZbsfw=; b=RlGbRVfrQKn5Dc8+WRs2oFJRUexngVFeL8yO9yqWWtgQJUZAZIj7N7BMnTrCM99srF +m+akidphXjnxtvrcbkb2mPwSndqH1HlmmySPhK18fI4Yty25E18ilUr7MYwvzxY16x7 gnDtNCyBZudexdI5WW+YUpzpf3xIc9JseaH0Jv6vzeAhLM7Xjp8JH9PZlaM7vDnw9KQV GhMztEbmzpZcbX98iSRqRcdiIrn4+HRi4M1I0nelssR8t+5rCom10/I0DwpYK/Vp76Fc PsEHbERUycc8B6Jp5rQRwIzxxY91IPEUmkfGYxtvhagPgeDXGVukEcCyShhOHn0mNL8M /L1A== X-Gm-Message-State: AO0yUKX63pyxS5AYOCJNTQzy9NYTWJ5Y+M2TzGmzmqXmtk9fLL///ZrN gTCqxwTJ9bjt2xBjf4fIa40LSifZbss= X-Google-Smtp-Source: AK7set+dLnKzz7/8zPKTbIF7noe4dDlPrp15r56rYz0SU1PFG1FM11ZihAJJfGr9lkl5b2aIANhZig== X-Received: by 2002:a17:906:2b9b:b0:809:c1f4:ea09 with SMTP id m27-20020a1709062b9b00b00809c1f4ea09mr14772737ejg.69.1675523460446; Sat, 04 Feb 2023 07:11:00 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/9] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name Date: Sat, 4 Feb 2023 16:10:22 +0100 Message-Id: <20230204151027.39007-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1675523620338100001 No need to repeat the descriptions. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index df64dd8dcc..ee9d9a4175 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -197,7 +197,7 @@ static void pc_init1(MachineState *machine, if (pcmc->smbios_defaults) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", + smbios_set_defaults("QEMU", mc->desc, mc->name, pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, pcms->smbios_entry_point_type); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index dee2b38474..71b7a30bb9 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -199,7 +199,7 @@ static void pc_q35_init(MachineState *machine) =20 if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", + smbios_set_defaults("QEMU", mc->desc, mc->name, pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, pcms->smbios_entry_point_type); --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167552357904568.53327233155585; Sat, 4 Feb 2023 07:12:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKC2-0002RX-V0; Sat, 04 Feb 2023 10:11:06 -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 1pOKC1-0002RB-Ns; Sat, 04 Feb 2023 10:11:05 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKC0-0006ax-3F; Sat, 04 Feb 2023 10:11:05 -0500 Received: by mail-ej1-x62b.google.com with SMTP id k4so22951445eje.1; Sat, 04 Feb 2023 07:11:03 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=drXiSmMhmqlJvPhiv+dKQt+fuq5k4HQA4wYOcYoI5f8=; b=L6ASOPBAMRP8vARV3n7PTanMy3IXr3+XNeH9ZqaBsIhtkyb88nZ/+IEFZkLERmlNM6 lX2H8edcR5ogbZILSF+pNA/kBrHqY0i03WmvOeY1IgHX7xxJSw5hOa2WDVxfY6yPNRiu awkjWlk6aLEbw6STFkX+H2nyaxFaeTmwin69J2lpsoCed3fUYKauxPmek04vDWl0YO3r 7YSLl4RRDPqRdbyfI3BZoAlXfgigGurBPdGL44sYoMoi9kHd6uDU3fQxWbaKTv6gFXpB 9zb3up3dFr3RK70o36uJZoQbfJ2HY+kTwMeCaZo22FCibEjzyCvXq73xfQXZKaFFWaUJ xQmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=drXiSmMhmqlJvPhiv+dKQt+fuq5k4HQA4wYOcYoI5f8=; b=Eh5q88LieEbMtYeCRyesNsNoKktU7+yaqR6DLxN+KNUNZKuHm8fiGwigxrWXBb3cbD ofs2CBBZSg/OKIYsVXt16XVVFjWxqeddp8j8ZfurLuiGD8NScTFs+1kwyDFVFrQUnmZy UIpaJQFWj6jRgNdv17o8IxE/LHW+gSOSwvokeyvFF5cPsitM74B+9MnveMikPwZPZHck Uj0LJc7ULzNaZUjZtVGCus2mgWxmvaBRbKuKzeah+be3sHRCXBXqGlghImt6q5K3wgke dbeQmzid7Ln82lmUckuM0ldQ9jJaAvXe8K7z2EOgnOZP9CNAyMVFlGe2zactcWBS6aTE 5w+A== X-Gm-Message-State: AO0yUKUvQFRKX8xZfe45GdxmGzL6jgvqFDtH/dFX6aElgjhoTL0+3KG9 e4D5xQg8RKZqkBoxPj3oW1HwmjuYs+c= X-Google-Smtp-Source: AK7set9NVeGVkEuhNJvF/Ls3orC8GrzDRzXTd+T9evyD9perDe4BM5fefpR+VHB4V+52vsFExgg2tg== X-Received: by 2002:a17:906:9c95:b0:87b:bbdc:468 with SMTP id fj21-20020a1709069c9500b0087bbbdc0468mr15955281ejc.70.1675523461656; Sat, 04 Feb 2023 07:11:01 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 5/9] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory() Date: Sat, 4 Feb 2023 16:10:23 +0100 Message-Id: <20230204151027.39007-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1675523580139100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ee9d9a4175..5bde4533cc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -241,7 +241,7 @@ static void pc_init1(MachineState *machine, isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); } else { pci_bus =3D NULL; - isa_bus =3D isa_bus_new(NULL, get_system_memory(), system_io, + isa_bus =3D isa_bus_new(NULL, system_memory, system_io, &error_abort); i8257_dma_init(isa_bus, 0); pcms->hpet_enabled =3D false; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 71b7a30bb9..8253b49296 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -125,6 +125,7 @@ static void pc_q35_init(MachineState *machine) DeviceState *lpc_dev; BusState *idebus[MAX_SATA_PORTS]; ISADevice *rtc_state; + MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *system_io =3D get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; @@ -192,7 +193,7 @@ static void pc_q35_init(MachineState *machine) rom_memory =3D pci_memory; } else { pci_memory =3D NULL; - rom_memory =3D get_system_memory(); + rom_memory =3D system_memory; } =20 pc_guest_info_init(pcms); @@ -215,7 +216,7 @@ static void pc_q35_init(MachineState *machine) } =20 /* allocate ram and load rom/bios */ - pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory, + pc_memory_init(pcms, system_memory, rom_memory, &ram_memory, pci_hole64_size); =20 object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host)); @@ -224,7 +225,7 @@ static void pc_q35_init(MachineState *machine) object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory), NULL); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM, - OBJECT(get_system_memory()), NULL); + OBJECT(system_memory), NULL); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_IO_MEM, OBJECT(system_io), NULL); object_property_set_int(OBJECT(q35_host), PCI_HOST_BELOW_4G_MEM_SIZE, --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523570; cv=none; d=zohomail.com; s=zohoarc; b=IheVMZ2NYrOYWWjeVw7Fl9u+bI6eAsfnuPZnQ5035Hcm10tIywAsj62jHDkzNpTRNkV6jzhDA962Pvg+s348aPNM2J8uda3zeKXY37u8vcwgKDmZdsWpZ0AdAFeMDhZzpXHU8GDYdSjfoSOCi4rjlMz2nCGfWsGajdmP9PuvWVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523570; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=APEL4mR2mjWxIDbTlk214qLngpqhM7APvX4Zo2lwqlc=; b=L0bITvUav9TiClZE2dW3FAAHUMJIUwFn1Id0gIOjmrOaRjQRqoij3io+FVoz9bZMzUlGDwtLOakgLOR/AocbBTHY4NSAbMbIQUXvbBmFGiuT9s1N4M8mYWV27eHUKYRitF5EvHxvyaT+lnfHuZ2bYTHoUgUYhT2qsKhT564FGO4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523570510821.9065080934496; Sat, 4 Feb 2023 07:12:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKC6-0002Ua-4k; Sat, 04 Feb 2023 10:11:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKC2-0002RP-HD; Sat, 04 Feb 2023 10:11:06 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKC0-0006b8-SO; Sat, 04 Feb 2023 10:11:06 -0500 Received: by mail-ej1-x62c.google.com with SMTP id k4so22951548eje.1; Sat, 04 Feb 2023 07:11:04 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=APEL4mR2mjWxIDbTlk214qLngpqhM7APvX4Zo2lwqlc=; b=Bemxb2m3mQ0W3JHWL8l7ubGC8SB0zKxsxG31NDd8j7AG1gLmhU8cUqa81a5qG9uAO+ FsADbHVTxa36gDqXk37hnyvHrtyugZzsPQ+ekQcFIi/5JCyP506BKibaarFWd5t9JgoM QSBTy8bnpZYhCzLCw5NrumW36jkR/84Rsx2KcTc3c6/XFM6fwMn5SN/V2TZfFBy07JM8 BDB9TK0X3v4ZAJwdfwpNueAvKYoWb+Psj8exkb411CLcQ76VdOs2kCJt3brDvb5v0gKD syP63alpcHfbPC9Cl67+qU/Jl29A/pfpt7i703vKxhvhlBbeGigPLkRyIyI2E4TDAkoZ /dTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=APEL4mR2mjWxIDbTlk214qLngpqhM7APvX4Zo2lwqlc=; b=hZYgoNrps82VRyrjzcGMgM/BEa30swmHXuWNFZreiko/PQynMflIj3cdOWgFdcQ3u0 i3ZiXQ75vgPnTd2uHMjiBjgtRgIAeUtL13gIkQxnhBBxFe4TNHEJn/t/+Y+D31mPLyY1 MjQL/5QeAPOYkmyLQzb98+s3/WmkSHVDEoBEF0tNInKgQkf27L3jOeNONgVN3+Uo7RoY E5iakPsVzeON4W2p2zOVW1ajV3QP0c8EvTPFy5xz3wrO03lpq54wgoKxllnFd9FJuxh6 dGw4Tte8iB7Pehz+twijh7ZKBw3GEeCmuCD343Svy6w38OsWDn0Zfp7Lddf2Jp4Fa1U4 vr7A== X-Gm-Message-State: AO0yUKXC/LpqUgrm40Z8uKNcHpb71Ty/lxkbrhApRJ63Y3oLdf6KXTo1 AAw2Svej0dC1RoSRxKUtOz6bPyojHSI= X-Google-Smtp-Source: AK7set/+ASBde+I5UmWbR2s3AdEarmneWXpCUeOP3fvmYasypmgka0IHeGothseWbaUMJa1uz/7H7Q== X-Received: by 2002:a17:906:53d4:b0:878:7ef1:4a20 with SMTP id p20-20020a17090653d400b008787ef14a20mr14151094ejo.4.1675523462933; Sat, 04 Feb 2023 07:11:02 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 6/9] hw/i386/pc: Initialize ram_memory variable directly Date: Sat, 4 Feb 2023 16:10:24 +0100 Message-Id: <20230204151027.39007-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523572128100001 Going through pc_memory_init() seems quite complicated for a simple assignment. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/pc.h | 1 - hw/i386/pc.c | 2 -- hw/i386/pc_piix.c | 4 ++-- hw/i386/pc_q35.c | 5 ++--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 66e3d059ef..b60b95921b 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -162,7 +162,6 @@ void xen_load_linux(PCMachineState *pcms); void pc_memory_init(PCMachineState *pcms, MemoryRegion *system_memory, MemoryRegion *rom_memory, - MemoryRegion **ram_memory, uint64_t pci_hole64_size); uint64_t pc_pci_hole64_start(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6e592bd969..8898cc9961 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -936,7 +936,6 @@ static hwaddr pc_max_used_gpa(PCMachineState *pcms, uin= t64_t pci_hole64_size) void pc_memory_init(PCMachineState *pcms, MemoryRegion *system_memory, MemoryRegion *rom_memory, - MemoryRegion **ram_memory, uint64_t pci_hole64_size) { int linux_boot, i; @@ -994,7 +993,6 @@ void pc_memory_init(PCMachineState *pcms, * Split single memory region and use aliases to address portions of i= t, * done for backwards compatibility with older qemus. */ - *ram_memory =3D machine->ram; ram_below_4g =3D g_malloc(sizeof(*ram_below_4g)); memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", machine->= ram, 0, x86ms->below_4g_mem_size); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5bde4533cc..00ba725656 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -143,6 +143,7 @@ static void pc_init1(MachineState *machine, if (xen_enabled()) { xen_hvm_init_pc(pcms, &ram_memory); } else { + ram_memory =3D machine->ram; if (!pcms->max_ram_below_4g) { pcms->max_ram_below_4g =3D 0xe0000000; /* default: 3.5G */ } @@ -205,8 +206,7 @@ static void pc_init1(MachineState *machine, =20 /* allocate ram and load rom/bios */ if (!xen_enabled()) { - pc_memory_init(pcms, system_memory, - rom_memory, &ram_memory, hole64_size); + pc_memory_init(pcms, system_memory, rom_memory, hole64_size); } else { pc_system_flash_cleanup_unused(pcms); if (machine->kernel_filename !=3D NULL) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 8253b49296..88f0981f50 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -129,7 +129,7 @@ static void pc_q35_init(MachineState *machine) MemoryRegion *system_io =3D get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; - MemoryRegion *ram_memory; + MemoryRegion *ram_memory =3D machine->ram; GSIState *gsi_state; ISABus *isa_bus; int i; @@ -216,8 +216,7 @@ static void pc_q35_init(MachineState *machine) } =20 /* allocate ram and load rom/bios */ - pc_memory_init(pcms, system_memory, rom_memory, &ram_memory, - pci_hole64_size); + pc_memory_init(pcms, system_memory, rom_memory, pci_hole64_size); =20 object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host)); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523609; cv=none; d=zohomail.com; s=zohoarc; b=IFvxuf/8W2HyD1lWS4/r65r2XDJCjO/b51kVff98ZrWTusBM/LHhkpThrwYqHFIbFsLM3Xwg5B/ldK1RCgIvSqGHU+YtjPvx9Nl4vAWVZM2GoPllRHOkJcoUDzOP6GKIOP88XBtphcrZDSfgKnazj02dfJPSeWUmKj0gGLoNiTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523609; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6Z9BSrGLPwa8H52MdZBz+kDsknrSpQNb66zdwdFnT9g=; b=QzPQ3VwQF+MzKXE1jxoLq4InjROMoX2JhFeDQjWiY+GsK79wAqUJb4uaF0IB0P3VAt7O9aZijS+mH3zdngc4rEIgRfKezci3dfJodCKyxVmQcv2MeqrUpeuIWZIJz+daeuXJycjSjKRgat3OQ29MQs9xct/6beT7uaLqT3dJtxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523609139433.43602662149794; Sat, 4 Feb 2023 07:13:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKC6-0002Ut-Qs; Sat, 04 Feb 2023 10:11:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKC5-0002U3-1d; Sat, 04 Feb 2023 10:11:09 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKC3-0006bQ-Ar; Sat, 04 Feb 2023 10:11:08 -0500 Received: by mail-ej1-x62c.google.com with SMTP id p26so22795845ejx.13; Sat, 04 Feb 2023 07:11:06 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:11:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=6Z9BSrGLPwa8H52MdZBz+kDsknrSpQNb66zdwdFnT9g=; b=cLP8qQbbKfrL5sf1m8dzcqVjo3JiWDFYGh95ky9Ja/DPV/J7AWcuy+dP4XKTfhX+3Y +HGzUayZq+rCb066EoQrYIBMutlTJamd9YjW8x49Nr4A7q0M0o8OPLyAM/wy29Jivo85 piw+W/8brvFGKbAL4kGJhn4TspmRG2MOOSdnonzpnXRCARIG7/ZKgspe7qFjEADFvzuM bXEJiYbsVgDCy2mhMEDHsoDeHmHloi2e2g3NB+jFBJNH+jZ8Fn/z44r4eR+zollOPCvm 1k5Qg2cj/rsIy/6PkFnGEIQ2THHHjlp4WU0ZUGELAZrEOZYMKOacFT0SgthxQZE2hiYy cfrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6Z9BSrGLPwa8H52MdZBz+kDsknrSpQNb66zdwdFnT9g=; b=Ca32l0eZEW/Qlb1Akt0oPJmyGrN7BonHbWaIi7y7NfTR/AzIkMLEQXVnLyMXxovYI0 v8BP/1b67EVJLgTJP9r1+ZdI2RWDGvqfPfLK2P94KCDvIRWlgCbEiwvxs6rYOCd3Ytr8 j39iRVn0JSV1QN+OQRjiDGUczUChOB8FDcKPVbzzyYF8QGsYDLcw+p6Brd+6Tt27O4CP W8AqIdyTagEri3odB/zYZ+dk69C7KlghQ+H4qjY6ZnJoSYNIDfaNEawwM5wjiwsuYQ7z hhgUwEXcDuYm69hp7U2JgDg/LNhvlVkSJFumfI+Sg/v8Q6GrezEqGNvS8HD3ElGaunR6 ppwA== X-Gm-Message-State: AO0yUKXNwvjPX2B5IDD7+7vVhDBsAR2AljjwKVClK7px++B3z2lt5hF7 5ijYIfkYw5XnhMIBVCtCgT0c6DwzqRo= X-Google-Smtp-Source: AK7set/lmeMdEbTBXfAU2Ve05oH2LD8UW4pImsbw7kco8U+gLjdfVSz03Yr+5lMlQ0LwbS2KEcfZ/w== X-Received: by 2002:a17:906:135a:b0:881:d1ad:1640 with SMTP id x26-20020a170906135a00b00881d1ad1640mr13454640ejb.57.1675523465366; Sat, 04 Feb 2023 07:11:05 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 7/9] hw/pci-host/pam: Make init_pam() usage more readable Date: Sat, 4 Feb 2023 16:10:25 +0100 Message-Id: <20230204151027.39007-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523610329100001 Content-Type: text/plain; charset="utf-8" Unlike pam_update() which takes the subject -- PAMMemoryRegion -- as first argument, init_pam() takes it as fifth (!) argument. This makes it quite hard to figure out what an init_pam() invocation actually initializes. By moving the subject to the front this should become clearer. While at it, lower the DeviceState parameter to Object, also communicating more clearly that this parameter is just the owner rather than some (heavy?) dependency. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/pci-host/pam.h | 5 +++-- hw/pci-host/i440fx.c | 10 +++++----- hw/pci-host/pam.c | 12 ++++++------ hw/pci-host/q35.c | 8 ++++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/hw/pci-host/pam.h b/include/hw/pci-host/pam.h index c1fd06ba2a..005916f826 100644 --- a/include/hw/pci-host/pam.h +++ b/include/hw/pci-host/pam.h @@ -87,8 +87,9 @@ typedef struct PAMMemoryRegion { unsigned current; } PAMMemoryRegion; =20 -void init_pam(DeviceState *dev, MemoryRegion *ram, MemoryRegion *system, - MemoryRegion *pci, PAMMemoryRegion *mem, uint32_t start, uin= t32_t size); +void init_pam(PAMMemoryRegion *mem, Object *owner, MemoryRegion *ram, + MemoryRegion *system, MemoryRegion *pci, + uint32_t start, uint32_t size); void pam_update(PAMMemoryRegion *mem, int idx, uint8_t val); =20 #endif /* QEMU_PAM_H */ diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 9c6882d3fc..61e7b97ff4 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -292,12 +292,12 @@ PCIBus *i440fx_init(const char *pci_type, object_property_add_const_link(qdev_get_machine(), "smram", OBJECT(&f->smram)); =20 - init_pam(dev, f->ram_memory, f->system_memory, f->pci_address_space, - &f->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE); + init_pam(&f->pam_regions[0], OBJECT(d), f->ram_memory, f->system_memor= y, + f->pci_address_space, PAM_BIOS_BASE, PAM_BIOS_SIZE); for (i =3D 0; i < ARRAY_SIZE(f->pam_regions) - 1; ++i) { - init_pam(dev, f->ram_memory, f->system_memory, f->pci_address_spac= e, - &f->pam_regions[i+1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, - PAM_EXPAN_SIZE); + init_pam(&f->pam_regions[i + 1], OBJECT(d), f->ram_memory, + f->system_memory, f->pci_address_space, + PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE); } =20 ram_size =3D ram_size / 8 / 1024 / 1024; diff --git a/hw/pci-host/pam.c b/hw/pci-host/pam.c index 454dd120db..68e9884d27 100644 --- a/hw/pci-host/pam.c +++ b/hw/pci-host/pam.c @@ -30,24 +30,24 @@ #include "qemu/osdep.h" #include "hw/pci-host/pam.h" =20 -void init_pam(DeviceState *dev, MemoryRegion *ram_memory, +void init_pam(PAMMemoryRegion *mem, Object *owner, MemoryRegion *ram_memor= y, MemoryRegion *system_memory, MemoryRegion *pci_address_space, - PAMMemoryRegion *mem, uint32_t start, uint32_t size) + uint32_t start, uint32_t size) { int i; =20 /* RAM */ - memory_region_init_alias(&mem->alias[3], OBJECT(dev), "pam-ram", ram_m= emory, + memory_region_init_alias(&mem->alias[3], owner, "pam-ram", ram_memory, start, size); /* ROM (XXX: not quite correct) */ - memory_region_init_alias(&mem->alias[1], OBJECT(dev), "pam-rom", ram_m= emory, + memory_region_init_alias(&mem->alias[1], owner, "pam-rom", ram_memory, start, size); memory_region_set_readonly(&mem->alias[1], true); =20 /* XXX: should distinguish read/write cases */ - memory_region_init_alias(&mem->alias[0], OBJECT(dev), "pam-pci", pci_a= ddress_space, + memory_region_init_alias(&mem->alias[0], owner, "pam-pci", pci_address= _space, start, size); - memory_region_init_alias(&mem->alias[2], OBJECT(dev), "pam-pci", ram_m= emory, + memory_region_init_alias(&mem->alias[2], owner, "pam-pci", ram_memory, start, size); =20 memory_region_transaction_begin(); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index fa05844319..fd18920e7f 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -645,12 +645,12 @@ static void mch_realize(PCIDevice *d, Error **errp) object_property_add_const_link(qdev_get_machine(), "smram", OBJECT(&mch->smram)); =20 - init_pam(DEVICE(mch), mch->ram_memory, mch->system_memory, - mch->pci_address_space, &mch->pam_regions[0], + init_pam(&mch->pam_regions[0], OBJECT(mch), mch->ram_memory, + mch->system_memory, mch->pci_address_space, PAM_BIOS_BASE, PAM_BIOS_SIZE); for (i =3D 0; i < ARRAY_SIZE(mch->pam_regions) - 1; ++i) { - init_pam(DEVICE(mch), mch->ram_memory, mch->system_memory, - mch->pci_address_space, &mch->pam_regions[i+1], + init_pam(&mch->pam_regions[i + 1], OBJECT(mch), mch->ram_memory, + mch->system_memory, mch->pci_address_space, PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE); } } --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523523; cv=none; d=zohomail.com; s=zohoarc; b=Mk5XPCaQMRQKK5RcKAk8O2zHTvwQvjF3o5vtrno9fcwEeez86j6usoDwamx0fTFmVeK0ZRjiRgxRBuhTTC3h/V1Qml0k1zScy5mu3uQNi5aeeqZm9I1JPpKqjE6N1URlu7ZE8AU9KruCRQfl2xvdu4IpH+g3mL/bNuB44UMVJlA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523523; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Mjveo29i4v6itcYX0Kaf2tWeC9tv54XMT35HAFBe98g=; b=Z5hTg6kYOZAjbn4gHru1QfV4z3ORzrsX4aL91Sj2Yg+m5A2mO4ENysG9CGHLLOp8/mtE72+FfynA4Yc/Ej2BGHwrxcqsTFPh0h7fbRPBItCjuVDrzX/w5I1qYmwv4wwqMU78S4A3e2Q+lk4DKwcqny2rxnVC41KWluwtIbcb2lk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523523744549.4838962913396; Sat, 4 Feb 2023 07:12:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKC9-0002WA-9s; Sat, 04 Feb 2023 10:11:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKC7-0002V7-8M; Sat, 04 Feb 2023 10:11:11 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKC4-0006ax-0S; Sat, 04 Feb 2023 10:11:10 -0500 Received: by mail-ej1-x62b.google.com with SMTP id k4so22951851eje.1; Sat, 04 Feb 2023 07:11:07 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=Mjveo29i4v6itcYX0Kaf2tWeC9tv54XMT35HAFBe98g=; b=CJS6Km40TqaFSRREtYspbGJerBiTgN+wdmQvt54+OIjvfOI8gqBV7vrKTuB9Md70Hk 7H2luBoTEQtRHYi0h/7XQfxhpbI82iVOOU4DB0CYC/ngqPj1yDbxDSsVIOJFN+WsR9Vh Dmv655+BoSmMQcYS/XUNgy0EfDwAYdy67831MsEUEpIjKnnpPTOR40CH2jr2jL2QWwYd miIcJfU4lKBGtpCEKVUyLLpSE1/IlQI1+CIAMjjoKFvCZ+vkR5UFamp1OUe+c5WuTUul v99ZL9MNCxl9MXakZNAliqI8UYHczgTEkrLsZKf3g++oR+mvKgZkXxIx0K2iOoL+adWb qMsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Mjveo29i4v6itcYX0Kaf2tWeC9tv54XMT35HAFBe98g=; b=k3CDXfJZ6NcrJQeOPpzny0PnUZuKo4hUH/yEv86zDLLq+usWSp8WZBRlIWbgSKyVa0 8q6jW8hMV9rLAKF5Y3HtA1xqFIO7DIK2qxayxPRbVpK++5CyPf4LCU7pXlhThC+rN0Tr NSofNF064BcG6pkmGH68VPtlz2Vm0zYtbsf9PwNFbbRCAEkuXw3LQq+531KbZC93skjm v2rRADy+JO1N0qV+mHApqc60KbXrziJ9A6hw0cq8LWZCYii4qrSYDO5NfgZiy0ZxuTsJ BUmJjV4SyvvzWFOiOMUuFl2DucQ7NOXCIlswzVgKJv4/8U1h08mOeAPAnkpcEbv49iXi TNfg== X-Gm-Message-State: AO0yUKUHEK5eePBOS/h6IyG4QGQOsaqPktSt2DnBNXezOGEjKwarkQ8p JqvfGA4wZkTRAwN2EKOwFzTGAWefr7k= X-Google-Smtp-Source: AK7set+zGOCKy1jx+s6DVgWNL/zy18GodKky3ND/79atgmFsJJbzvdulsIVS/P3Gegg3NX4LSvLRKA== X-Received: by 2002:a17:906:cf83:b0:887:6c23:193f with SMTP id um3-20020a170906cf8300b008876c23193fmr13362488ejb.44.1675523466648; Sat, 04 Feb 2023 07:11:06 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 8/9] hw/i386/x86: Make TYPE_X86_MACHINE the owner of smram Date: Sat, 4 Feb 2023 16:10:26 +0100 Message-Id: <20230204151027.39007-9-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523525970100011 Content-Type: text/plain; charset="utf-8" Treat the smram MemoryRegion analoguous to other memory regions such as ram, pci, io, ... , making the used memory regions more explicit when instantiating q35 or i440fx. Note that the q35 device uses these memory regions only during the realize phase which suggests that it shouldn't be the owner of smram. i440fx activates/deactivates the whole smram memory region depending on the SMRAM_G_SMRAME bit which seems wrong since it should only handle the 128kb region. If this got changed, i440fx would also only use smram during its realize phase. Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 2 ++ include/hw/pci-host/i440fx.h | 7 ++++--- include/hw/pci-host/q35.h | 4 +++- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 ++ hw/i386/x86.c | 4 ++++ hw/pci-host/i440fx.c | 13 +++++-------- hw/pci-host/q35.c | 17 ++++++++--------- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 62fa5774f8..ba6912b721 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -59,6 +59,8 @@ struct X86MachineState { /* Start address of the initial RAM above 4G */ uint64_t above_4g_mem_start; =20 + MemoryRegion smram; + /* CPU and apic information: */ bool apic_xrupt_override; unsigned pci_irq_mask; diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index bf57216c78..e9efdb3c5f 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -28,9 +28,10 @@ struct PCII440FXState { MemoryRegion *system_memory; MemoryRegion *pci_address_space; MemoryRegion *ram_memory; + MemoryRegion *smram; PAMMemoryRegion pam_regions[PAM_REGIONS_COUNT]; MemoryRegion smram_region; - MemoryRegion smram, low_smram; + MemoryRegion low_smram; }; =20 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" @@ -43,7 +44,7 @@ PCIBus *i440fx_init(const char *pci_type, ram_addr_t below_4g_mem_size, ram_addr_t above_4g_mem_size, MemoryRegion *pci_memory, - MemoryRegion *ram_memory); - + MemoryRegion *ram_memory, + MemoryRegion *smram); =20 #endif diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index e89329c51e..fcbe57b42d 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -44,9 +44,10 @@ struct MCHPCIState { MemoryRegion *pci_address_space; MemoryRegion *system_memory; MemoryRegion *address_space_io; + MemoryRegion *smram; PAMMemoryRegion pam_regions[PAM_REGIONS_COUNT]; MemoryRegion smram_region, open_high_smram; - MemoryRegion smram, low_smram, high_smram; + MemoryRegion low_smram, high_smram; MemoryRegion tseg_blackhole, tseg_window; MemoryRegion smbase_blackhole, smbase_window; bool has_smram_at_smbase; @@ -75,6 +76,7 @@ struct Q35PCIHost { */ =20 #define MCH_HOST_PROP_RAM_MEM "ram-mem" +#define MCH_HOST_PROP_SMRAM_MEM "smram-mem" #define MCH_HOST_PROP_PCI_MEM "pci-mem" #define MCH_HOST_PROP_SYSTEM_MEM "system-mem" #define MCH_HOST_PROP_IO_MEM "io-mem" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 00ba725656..41aaaa5465 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -228,7 +228,7 @@ static void pc_init1(MachineState *machine, system_memory, system_io, machine->ram_size, x86ms->below_4g_mem_size, x86ms->above_4g_mem_size, - pci_memory, ram_memory); + pci_memory, ram_memory, &x86ms->smram); pci_bus_map_irqs(pci_bus, xen_enabled() ? xen_pci_slot_get_pirq : pc_pci_slot_get_pirq); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 88f0981f50..480226de2c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -221,6 +221,8 @@ static void pc_q35_init(MachineState *machine) object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host)); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, OBJECT(ram_memory), NULL); + object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SMRAM_MEM, + OBJECT(&x86ms->smram), NULL); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory), NULL); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM, diff --git a/hw/i386/x86.c b/hw/i386/x86.c index eaff4227bd..d7e219b1eb 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -1436,6 +1436,10 @@ static void x86_machine_initfn(Object *obj) x86ms->oem_table_id =3D g_strndup(ACPI_BUILD_APPNAME8, 8); x86ms->bus_lock_ratelimit =3D 0; x86ms->above_4g_mem_start =3D 4 * GiB; + + memory_region_init(&x86ms->smram, obj, "smram", 4 * GiB); + memory_region_set_enabled(&x86ms->smram, true); + object_property_add_const_link(obj, "smram", OBJECT(&x86ms->smram)); } =20 static void x86_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 61e7b97ff4..8f4a4f59a6 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/units.h" #include "qemu/range.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h" @@ -77,7 +76,7 @@ static void i440fx_update_memory_mappings(PCII440FXState = *d) } memory_region_set_enabled(&d->smram_region, !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); - memory_region_set_enabled(&d->smram, + memory_region_set_enabled(d->smram, pd->config[I440FX_SMRAM] & SMRAM_G_SMRAME); memory_region_transaction_commit(); } @@ -246,7 +245,8 @@ PCIBus *i440fx_init(const char *pci_type, ram_addr_t below_4g_mem_size, ram_addr_t above_4g_mem_size, MemoryRegion *pci_address_space, - MemoryRegion *ram_memory) + MemoryRegion *ram_memory, + MemoryRegion *smram) { PCIBus *b; PCIDevice *d; @@ -267,6 +267,7 @@ PCIBus *i440fx_init(const char *pci_type, f->system_memory =3D address_space_mem; f->pci_address_space =3D pci_address_space; f->ram_memory =3D ram_memory; + f->smram =3D smram; =20 i440fx =3D I440FX_PCI_HOST_BRIDGE(dev); range_set_bounds(&i440fx->pci_hole, below_4g_mem_size, @@ -283,14 +284,10 @@ PCIBus *i440fx_init(const char *pci_type, memory_region_set_enabled(&f->smram_region, true); =20 /* smram, as seen by SMM CPUs */ - memory_region_init(&f->smram, OBJECT(d), "smram", 4 * GiB); - memory_region_set_enabled(&f->smram, true); memory_region_init_alias(&f->low_smram, OBJECT(d), "smram-low", f->ram_memory, 0xa0000, 0x20000); memory_region_set_enabled(&f->low_smram, true); - memory_region_add_subregion(&f->smram, 0xa0000, &f->low_smram); - object_property_add_const_link(qdev_get_machine(), "smram", - OBJECT(&f->smram)); + memory_region_add_subregion(f->smram, 0xa0000, &f->low_smram); =20 init_pam(&f->pam_regions[0], OBJECT(d), f->ram_memory, f->system_memor= y, f->pci_address_space, PAM_BIOS_BASE, PAM_BIOS_SIZE); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index fd18920e7f..83f2a98c71 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -246,6 +246,10 @@ static void q35_host_initfn(Object *obj) (Object **) &s->mch.ram_memory, qdev_prop_allow_set_link_before_realize, 0); =20 + object_property_add_link(obj, MCH_HOST_PROP_SMRAM_MEM, TYPE_MEMORY_REG= ION, + (Object **) &s->mch.smram, + qdev_prop_allow_set_link_before_realize, 0); + object_property_add_link(obj, MCH_HOST_PROP_PCI_MEM, TYPE_MEMORY_REGIO= N, (Object **) &s->mch.pci_address_space, qdev_prop_allow_set_link_before_realize, 0); @@ -594,19 +598,17 @@ static void mch_realize(PCIDevice *d, Error **errp) memory_region_set_enabled(&mch->open_high_smram, false); =20 /* smram, as seen by SMM CPUs */ - memory_region_init(&mch->smram, OBJECT(mch), "smram", 4 * GiB); - memory_region_set_enabled(&mch->smram, true); memory_region_init_alias(&mch->low_smram, OBJECT(mch), "smram-low", mch->ram_memory, MCH_HOST_BRIDGE_SMRAM_C_BASE, MCH_HOST_BRIDGE_SMRAM_C_SIZE); memory_region_set_enabled(&mch->low_smram, true); - memory_region_add_subregion(&mch->smram, MCH_HOST_BRIDGE_SMRAM_C_BASE, + memory_region_add_subregion(mch->smram, MCH_HOST_BRIDGE_SMRAM_C_BASE, &mch->low_smram); memory_region_init_alias(&mch->high_smram, OBJECT(mch), "smram-high", mch->ram_memory, MCH_HOST_BRIDGE_SMRAM_C_BASE, MCH_HOST_BRIDGE_SMRAM_C_SIZE); memory_region_set_enabled(&mch->high_smram, true); - memory_region_add_subregion(&mch->smram, 0xfeda0000, &mch->high_smram); + memory_region_add_subregion(mch->smram, 0xfeda0000, &mch->high_smram); =20 memory_region_init_io(&mch->tseg_blackhole, OBJECT(mch), &blackhole_ops, NULL, @@ -619,7 +621,7 @@ static void mch_realize(PCIDevice *d, Error **errp) memory_region_init_alias(&mch->tseg_window, OBJECT(mch), "tseg-window", mch->ram_memory, mch->below_4g_mem_size, 0); memory_region_set_enabled(&mch->tseg_window, false); - memory_region_add_subregion(&mch->smram, mch->below_4g_mem_size, + memory_region_add_subregion(mch->smram, mch->below_4g_mem_size, &mch->tseg_window); =20 /* @@ -639,12 +641,9 @@ static void mch_realize(PCIDevice *d, Error **errp) MCH_HOST_BRIDGE_SMBASE_ADDR, MCH_HOST_BRIDGE_SMBASE_SIZE); memory_region_set_enabled(&mch->smbase_window, false); - memory_region_add_subregion(&mch->smram, MCH_HOST_BRIDGE_SMBASE_ADDR, + memory_region_add_subregion(mch->smram, MCH_HOST_BRIDGE_SMBASE_ADDR, &mch->smbase_window); =20 - object_property_add_const_link(qdev_get_machine(), "smram", - OBJECT(&mch->smram)); - init_pam(&mch->pam_regions[0], OBJECT(mch), mch->ram_memory, mch->system_memory, mch->pci_address_space, PAM_BIOS_BASE, PAM_BIOS_SIZE); --=20 2.39.1 From nobody Fri Apr 26 16:01:59 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1675523531; cv=none; d=zohomail.com; s=zohoarc; b=TLF1Ezy9OzKof2irtwHUN8ibkEtrhXjEgPTiP5Y8649u5ZwOwEznKzqVJlhdN3wabh/e2SupavtCYXwXPST7u5SUdRCKkSSyBnm7JPCtsOzJairuO7Tksli0VbiP1fxA9+kMyuZW7LzQZJcpm36rgrgSGoFbQCge9i6Cie/ZsSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675523531; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dPYELRlFV8w4s2mD+NwhDzTDZ9N/FFBC8a9zFFIEtf8=; b=U673Izss983arLOp+g8taMaqOcK5U/DglNTZNDHgQlpZOX1fFSwrDf1j61ECkCmhipgc93Pm925BkPBlvDU3kjV5lD51vcq/NuGXUbJj1vspYs9cbzmjsu6KUePA7faiBra32/MvQzRWMSGvDbHSVbJtTsEdLxPSvz53ep38jJg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675523531180457.9617959756241; Sat, 4 Feb 2023 07:12:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKC9-0002WE-QR; Sat, 04 Feb 2023 10:11:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKC8-0002Vc-4p; Sat, 04 Feb 2023 10:11:12 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKC6-0006bk-3v; Sat, 04 Feb 2023 10:11:11 -0500 Received: by mail-ej1-x62d.google.com with SMTP id ud5so22931017ejc.4; Sat, 04 Feb 2023 07:11:09 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=dPYELRlFV8w4s2mD+NwhDzTDZ9N/FFBC8a9zFFIEtf8=; b=CYWk3AJBu3SFq9tGsGcY97tj6hgZtcGnwfiAyl2g6Q9xvAOLCv55Ddh/dQ8558DKet x8TjUcod1Sa3ZrnIoABp3duTYpLIbRMoljH416SCXaev3Cbjz/iK0HZu+cpa6WLeFIl9 msCwNih12aq1Pz/OpTdf5+W9QD/ZM9qQ0DXTJVEpXdqr8XBwqej0iIlq3PyvP14G5iVc y7hd1FTqrHCZK4Me1jE6IJd9/xp87mox0y0iTkA5b36xeyPhXhVMPr2EwMWFEMUHedxD zW/XFZc99YmTkf3LuenFl1mrZ6luMqXJbzPhdDhKft5nQvbApbNxJtFD5VWgJorTtSYf ySgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dPYELRlFV8w4s2mD+NwhDzTDZ9N/FFBC8a9zFFIEtf8=; b=VUhBE5Xz5okuUn8A/QKOhf1sF/QKQTP6iNTvhrsa6NdNvWKZn2i65njDyMmTHlsHOG adKiyvLd2vC5Z4mss/CtpU38VTC2LXg7D3s4R9A9jt7+3pmAlbv3UPTLOIFxReO9McwP sJEOrMD3oi51ZEXN2WxckEW+BbC/StRXaMNPIpXO46E3lCOLUAYvX8OwLhoYaAvk1UTm hoUiS2XpB74wUoZW/D8Og3tn6foLd3ECMlkHkSk/III15s/3RCq+m62iN1PCU6g18RFg /oGPzcS3x4pPJC0Z213POF7B/2hNcQfKHjUPWkZZrtDcUX3YACZlw46e6NNK8myryMFQ YcxQ== X-Gm-Message-State: AO0yUKXmIJcSgMv2noU13ywOrKZrEYNAqzUpVkqfQiB9TyUC/7T9gLRV 3Kwb72zy5aprfnk0lGslgRUCvk878c8= X-Google-Smtp-Source: AK7set/CD0tzk+xuenxj3W/QPe6SMokzE1EbORVEQ8n4bamR3JM+7aIPXlGLaSJtVkVEULeR/E6CcA== X-Received: by 2002:a17:906:8a70:b0:84c:a863:ebe6 with SMTP id hy16-20020a1709068a7000b0084ca863ebe6mr12324233ejc.43.1675523468317; Sat, 04 Feb 2023 07:11:08 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 9/9] target/i386/tcg/sysemu/tcg-cpu: Avoid own opinion about smram size Date: Sat, 4 Feb 2023 16:10:27 +0100 Message-Id: <20230204151027.39007-10-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204151027.39007-1-shentey@gmail.com> References: <20230204151027.39007-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675523531911100001 Content-Type: text/plain; charset="utf-8" When setting up the CPU's smram memory region alias, the code currently assumes that the smram size is 4 GiB. While this is true, it repeats a decision made elsewhere which seems redundant and prone to inconsistencies. Avoid this by reusing whatever size the smram region was set to. Signed-off-by: Bernhard Beschow --- target/i386/tcg/sysemu/tcg-cpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/i386/tcg/sysemu/tcg-cpu.c b/target/i386/tcg/sysemu/tcg-= cpu.c index c223c0fe9b..8f5ce6093c 100644 --- a/target/i386/tcg/sysemu/tcg-cpu.c +++ b/target/i386/tcg/sysemu/tcg-cpu.c @@ -22,7 +22,6 @@ #include "tcg/helper-tcg.h" =20 #include "sysemu/sysemu.h" -#include "qemu/units.h" #include "exec/address-spaces.h" =20 #include "tcg/tcg-cpu.h" @@ -36,7 +35,7 @@ static void tcg_cpu_machine_done(Notifier *n, void *unuse= d) if (smram) { cpu->smram =3D g_new(MemoryRegion, 1); memory_region_init_alias(cpu->smram, OBJECT(cpu), "smram", - smram, 0, 4 * GiB); + smram, 0, memory_region_size(smram)); memory_region_set_enabled(cpu->smram, true); memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->smram, 1); --=20 2.39.1