From nobody Sun May 5 05:31:01 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=1676305430; cv=none; d=zohomail.com; s=zohoarc; b=ZvODS5NxxW1U/6WQYYpOCXg4z2Pg7sGkPr79RIhZrZTdv/e4r/K+3wbVAawkU3MfxjwX1FCpIfqf0ZobFRgtPXt/owfRzCbL0XIL1k2I5PmHdYzdF50nfXo/GiggBESBhenSPVUw87efdA49IQq5wqi+xF4ViZrMGMfbN2SdVmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676305430; 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=ic3hrix2ufBlGETVgZ7BN7OsG49wLtcyO7b4TxdzmAuK5ak7KaP8cPR2vXO4ZvUoodH4s6gMDZAsQvlzMwvPIOhN5i/aRHBEIfdC2o/+9cIp8lzw03TP+xkxNredQIUMH2JXSGE4jKVvlVO3FmOfgoECLJMYz1x3oXSFWKMviWk= 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 1676305430195297.19709147298704; Mon, 13 Feb 2023 08:23:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZN-0004aI-Aa; Mon, 13 Feb 2023 11:20: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 1pRbZJ-0004YZ-W6; Mon, 13 Feb 2023 11:20:42 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbZH-0007vM-Uk; Mon, 13 Feb 2023 11:20:41 -0500 Received: by mail-ej1-x62a.google.com with SMTP id dr8so33120053ejc.12; Mon, 13 Feb 2023 08:20:39 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:37 -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=TZAvFc2p81l79U83YOv+5eTOPz5jm6oJ74pAumWmTlFASK2ztkbkCBZ7Q4lEEMnfiW AlMgqWJozMWKLjf0UTTntOKDMWKE9gSQmbfB6L4oMMQfSw58Y0IoP3ayvrtcIi5c6xQv ftJSmdppH9jbanQusxybOmFgI/6EPRCHhVqrB4JfIoLFwxegA98vMp1x+6MCQhV6Wern JI/HJG1xF5it7/Q9xaE+UJY0ELj/dD+yoc0ae4yxxZbpJj052xMvuMHexXYuX7OgXEiI raqh1+n2YTWoO9hX2ATjYZ4ZKy5CnDyVOR3oYKD2iSYpzhd2+BMSx9QZot/fQJBGxnqt zEbA== 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=RRe0NGj5fMYDg5NaPiNtzJkzNpGJ4BlLs6sWvTDUC4ZHHHMEAcTimfxAUEPcY8DsH6 ai4tne08SMvYSs4aYuSrRnJG3pFBNRlvYCi2RBut8v9bBrPSuBzrjGO/jSQIPJ7ZBEgy q6y67vRG+GEDjK92n55TmpZklO4ld4AgFORENBr32NUfGIzw5Jxr8hDeG9HByNqtGgqZ 4cwdIhro7FmmEVcjn25CGoZtu0rEM2SK0Apffru1empB0rdSW/GVTLBGl/7E1YMhRbqt Ux5J/1ZTs6W74i2mxjz9lOG86F3O/lgETzNCOJloKD6z9CyT8TjeinngFzvmhLiSTtzU fGjw== X-Gm-Message-State: AO0yUKUPf3Mcj1yNmlY+YmFyD+wwwZGWOggNH/UJsL1h2p2ZpPDA9n8W ncjAihmpLdxi8AyDR5W7OM9C+16ojYc= X-Google-Smtp-Source: AK7set8ioqS5tcfhmN7dxR+d/+XwKwhg11BMqUy3DWVAoFyRmzibfyW59iXFtO7u57j+ELS9eMITNg== X-Received: by 2002:a17:906:e218:b0:871:dd2:4af0 with SMTP id gf24-20020a170906e21800b008710dd24af0mr23260393ejb.26.1676305237747; Mon, 13 Feb 2023 08:20:37 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow Subject: [PATCH v4 1/9] hw/pci-host/i440fx: Inline sysbus_add_io() Date: Mon, 13 Feb 2023 17:19:56 +0100 Message-Id: <20230213162004.2797-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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::62a; envelope-from=shentey@gmail.com; helo=mail-ej1-x62a.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: 1676305431864100006 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 Sun May 5 05:31:01 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=1676305341; cv=none; d=zohomail.com; s=zohoarc; b=lDyH5A3BBKsDpYbRLf/VBvcLlTntaGjWz7cKeUavGH9k+OWxW9nM8fq82WRUp3OM0OvjqolYUol340nwEieUm5gpXta32f4VuwSF5b3R8PY7QMhSptKUPbi/Za1IgZ+Hv7rtS462+Jq/JPSihJQOqgPN2dhwpU3wMIAp/7YyRb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676305341; 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=T2wtGCMLCeD4oYLScGFj1nWSFTRG7TB079mUx9J1g2W/Jpi9iq1cZCcLRauAzG7MToQzKADDOK2a3DEsd796G3dsDVt1BG4qYp7GuWgtxtbl4BMoqxLm+D8qQlgpVVgOZz7K+qhsZc1tIYnemA2BIJM/Gyqz3dXP9LPOZtgcBgU= 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 1676305341320671.8530160190837; Mon, 13 Feb 2023 08:22:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZO-0004bZ-Ba; Mon, 13 Feb 2023 11:20:46 -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 1pRbZK-0004Yy-LA; Mon, 13 Feb 2023 11:20:42 -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 1pRbZI-0007vf-Ud; Mon, 13 Feb 2023 11:20:42 -0500 Received: by mail-ej1-x62c.google.com with SMTP id sa10so33142022ejc.9; Mon, 13 Feb 2023 08:20:40 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:38 -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=fpi81r6lO0aPQKZyDnnujb8NR5LjJPehL2ydzeCEWXtwQtHs960vXIgiP1hp2Y9XFk 6sH9vzDo2xVoWo3tVAKizXECqtTj0kjFwFP0HzkBsk0ioi3sv29w9KL/Mdvxk+M37ng5 TY2TFRm1ieRZzU5BNCcYMfsbbC/De5zCCoCqzn6eMjVGe1Z/ixf2ty2xFn+pWJDt880N smIe2a4kGVX+vVyEbSgVhtngeDQBMLWNYquVNQ30TrtuU9I/NcyLOI77rO4jb4hjaVB+ NO0cg6YBZQ7EsghMz4HiUmogDsmuKNRRCp4dvEchRqfVEt7a23fcq3BjZ/BHAWZXlHfi 24tA== 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=f+aiSFXfQG7KkW9VNbQCN62Dy8sVpkzbPuLq1ig9eFaz5BuhhgM/YVzkQ5WjNs7A5U fgpfbdUXVp3ZgKTRPRymfIvRpcmNcQM/T7fz8oEdve+pTgWWKRZhy5m4TyGJBxS3R0Mq L9G09W0DhbA9Ceh3VSv97+QeM++bWrfggFwZo4R786HxCyuRPRa7uElRduSkRgjXvG83 TN3/JCsTfoKMr7OTdeMgeV9YJOnc2xIXZ1Fxy+OPOA2lC//VouwPmjVFQ6uPh8RhyUmj lvullJAe80XbO7obtyd6LrvCgTUoLcJT+zvuXnnko4Npqc0IaqhhEWo+5O/ntIF2Pgz0 yM6g== X-Gm-Message-State: AO0yUKVZoyGSF0nU4er61sIGWpTDl+xdqmfeu1CMZV4mZdU5bdxXndon CJQmJeRkoDmT9Z4gYp9+33NhkiFb39I= X-Google-Smtp-Source: AK7set/hsnCwjIv3/vfC4uDnZQaMZzjFmuAE7AUzxF0TMMkX/cd8HPtevVB3J65hL6ldVao3e0pq6g== X-Received: by 2002:a17:906:3885:b0:884:d5a3:8725 with SMTP id q5-20020a170906388500b00884d5a38725mr25596695ejd.55.1676305238901; Mon, 13 Feb 2023 08:20:38 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow Subject: [PATCH v4 2/9] hw/pci-host/q35: Inline sysbus_add_io() Date: Mon, 13 Feb 2023 17:19:57 +0100 Message-Id: <20230213162004.2797-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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: 1676305342978100003 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 Sun May 5 05:31:01 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=1676305348; cv=none; d=zohomail.com; s=zohoarc; b=kvaRD0aSBOIUOLOFOFoQGb2Jr37cRWI3N/npdMxS9HRT0gKRJRNdCTvOXcKMUmD1AUm6IUFkUPNa0UZg88snTvGpCBPe+vfjITQN7HV0C26Q5fdrobMOES990oWYiQhtaFXI6ccB20Dyfa++n/FLNPK/XUTMYTJxQibrvCR1tDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676305348; 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=iYQUVnPGQp7zDnCWHf4RUz8mDdkouFa20J6aXdUNyBQxlXfMWPUH9wP/iSP17FkSGTAt5MBsN1/MhAzK83qAPuruhlVA7XHk4I0AZxRRJyEneYzgM9PeEglBa8B1hQOe7OR/t0iXbMgX8G+v1tICIURoEFgf5+lCJKV/mOAzS3A= 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 1676305348868252.52129251081965; Mon, 13 Feb 2023 08:22:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZO-0004bM-31; Mon, 13 Feb 2023 11:20:46 -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 1pRbZL-0004a6-Ut; Mon, 13 Feb 2023 11:20:44 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbZK-0007w3-7u; Mon, 13 Feb 2023 11:20:43 -0500 Received: by mail-ed1-x52d.google.com with SMTP id fi26so13641610edb.7; Mon, 13 Feb 2023 08:20:41 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:39 -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=ErEoLK0HSfaLC6Hru67T9svbJdBd70XiNqTEfQoY8aelwnlKdAo2zNOFzrvaZNjNl+ snLM8P9nYArNDgeEGacK4eajl3SeVb6GYEUHajQbrtyxEhnB7nz4yTnbgtIeYh1oKBcT hLLF98fLrZA1p18+yzcq1wBFbXJ5y4QrXEE+Rha827Wt9z9xJaXbMfHD5misVMu7P617 AmL+YkxIBlv7X5beSOTLIot1bLEqb7ZgdBnRxHFciCAeEaOG06CGiT7JRbxOfq9Hbte4 M2XzHa6Nx2OdBfOu43urBHS9nwm9j9cz22LcS3sEIgml9oYO/+fMyhzdQroTCVXm+MeT +MSQ== 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=1keEmtmeFV4DNB0MNKxx004fo6mgx+0JFC7FYEuqdeMX48muDgvOUsb1vFY4eJ2hsZ QUyOTtO7Vfv1QLt96zFM8LkKDHYflkeFBkql8WbiGzq7f466NoGex2Ya7OfbXy7mbWiD K5+v/QLOBDDbhJ0Vq8v5sIfcGurETjf2THPKb3S77GeNtL7f/jCcCS6A4Ia/1MzPaF4Q AGoQ39FufedruwIyhtr0b0UOKb2hg66ArEVu+D5ylsyUKS2nQpClxPvAgWS2uTgnqXef +8E3aqJTIYiDUV1V3DnRVwWaqIOpTeeSr/BWhRlC0BSdZZuu6vRS9CU4uSHCwwhWyhiW B1GA== X-Gm-Message-State: AO0yUKXlL8S5jStGpCdw7zL5fRK07CcchalD8wNWcwaqqNPFxDrhd6gM 8t8ocODqWqxIwhKVNZAShPq+/SWSVAc= X-Google-Smtp-Source: AK7set/vJ+SmM7QB3wE9GE6uXenVHYT1NwSHj3zFNaZy30E1y7rtsxc+qSn5qApMWsAn5+17rAzO8g== X-Received: by 2002:a50:ee8f:0:b0:4ab:1715:2858 with SMTP id f15-20020a50ee8f000000b004ab17152858mr7688539edr.11.1676305240166; Mon, 13 Feb 2023 08:20:40 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow Subject: [PATCH v4 3/9] hw/i386/pc_q35: Reuse machine parameter Date: Mon, 13 Feb 2023 17:19:58 +0100 Message-Id: <20230213162004.2797-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.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: 1676305351004100005 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 Sun May 5 05:31:01 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 1676306462398150.71819017112125; Mon, 13 Feb 2023 08:41:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZP-0004dI-MY; Mon, 13 Feb 2023 11:20:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRbZN-0004ar-7g; Mon, 13 Feb 2023 11:20:45 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbZL-0007we-Mz; Mon, 13 Feb 2023 11:20:44 -0500 Received: by mail-ej1-x62f.google.com with SMTP id n10so6271648ejc.4; Mon, 13 Feb 2023 08:20:42 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:40 -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=ZPzLLYIbHGcpHQbp59ZlflFTF9R7fSVi3g6fSUXRJPIxfRzjCwbmnCGST6U/30/uxQ qPRoYhhO4ca8wvBey6mmKfKJHphYEnbDe50GOgMpdzuMW2p0+QdvvkSZAL82rtO5Ol91 3m6aua+oUvHF+acwzsIjge/21MZa49XLXEO6XYJ/qr2Q0izIhPQ0ye3NRaIC1sXiqRJ0 HLKob9mlO0hnxQH/AyGc5snyjDrnh4E1NKiwShdH29bu3fdA/NBXJrw0oxL4szbs2Yfe sUYxT989Q5dkA+pbvzhNmwgTQQBUAdH2YdErJAmnMyXDwlLiGPmM9hrlEsoxw0lq2OYK RRzA== 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=zEImjUDC3ociEoxAJzwAYCftI7SttIqsKwV34zlI/m6198WY4R3s6clnhf1qk8+dZu qOO3Zf8KV6rXkI6UQ0iE0iiBm71LnIdoCTxi2h2fl6zEbFj4bhwVTTgMJSc29kKowHZa kp2qjL8tILKxHKjKS4h+0X+z6FYcPagsauV6pjVjLQhN15/WgP3zVi+L0wmspPIqs4Tc l3MAzi6WNp18wOsr8TP+TBCoc3/SJi1iZLHRhaRCRRQA4Z3l80VwmfrNeKvTLGmd5dVD V9ksCmj2vNAW+KHi95aaBvt5lBOBGtpXsrfD+u6u9Evr4H170NiZC1xmPB3Xr+R6bqXo b3yA== X-Gm-Message-State: AO0yUKXwz82uG4kiF5fPRP/vte2opDF7P7dFzD+iBQEFao5wEZjR5Jyx t5UHsGruqHb5fJoAssoKsM8vTSbel4U= X-Google-Smtp-Source: AK7set/dnANYWBb0VN3vBdDGqVBoRcpaCGJR28bqcaKs+MzGCToQ2jbW/P7M8mykg60QNxI/uEv42Q== X-Received: by 2002:a17:907:a506:b0:8af:2a62:30c9 with SMTP id vr6-20020a170907a50600b008af2a6230c9mr20503851ejc.34.1676305241404; Mon, 13 Feb 2023 08:20:41 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 4/9] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name Date: Mon, 13 Feb 2023 17:19:59 +0100 Message-Id: <20230213162004.2797-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1676306464626100003 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 Sun May 5 05:31:01 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 1676305453001364.4127361821995; Mon, 13 Feb 2023 08:24:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZQ-0004dn-E9; Mon, 13 Feb 2023 11:20:48 -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 1pRbZO-0004bu-GX; Mon, 13 Feb 2023 11:20:46 -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 1pRbZM-0007xD-RX; Mon, 13 Feb 2023 11:20:46 -0500 Received: by mail-ej1-x62e.google.com with SMTP id ml19so33358380ejb.0; Mon, 13 Feb 2023 08:20:43 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:42 -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=KrrOsalPPyenSN+6PpgseJUYt00uAJW3JzW4s8guam3GHTMCarAPwuHt8Xj8SVBace TFsH7XY5b5A4F8zUrOkM22ZsBQ3CAQYwtvv8zlzTUu4ik2G9T3B20ZQt8E/kAmWmLFxa HtHVjp0S0wEcrKMAti7syEcS0+NQpFKlWjaCFL+afb+UWTHgdp4R5ldDm++umgCjOyP8 YlacrPLkL03Ag7hmHGw1drjE/RX+qR5pr0Aga/thXtUJdja3EWVbbExQW5xlG6Ho71kZ 2lMgYVtoRcUSHCBF0Dll+jIrQYRwxaswORu9K8zayhEAthQMFo/7Z1YB6BK3QFBTQ/HM 80VQ== 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=QPG1RCYTTEtoXyfIP0ERnj3OHx9SGXnDCJNSQDS98rAPqENB4yIWc/Oj/5zrr5+BrS ZpgboVlXcEOFX4wv0HJjOuGjTkBGoXX1pl5LsFpz099DDANWkp6HYwgSULCf9u12b9kE z34d1gF62IMgCczUkirnEjQFfKJ+tl2Nn9lLFPlrgdC92ZSrKjHgzhQb8u4JLdOnGzjQ a/SvlW73oaQuBGQ+FN7eZsyAvrfQ5jVoL8bylr+40vBqlmXVHU8UW0bGfdOxKq90sWaY +/AZB6b354vnysfXzHZIn1CqqW/Gu3rbtMHdj8SqMB+U+VvzxZryncDeIgdhdJ+W7CWL 7g1Q== X-Gm-Message-State: AO0yUKWbV9q1N5ozRgi9BxPSBMso0E2eBjM2/6o71NvD6P4xRsm/Q5fi D4CkmoIv1ThI05lbP4jt4X3jNljUoec= X-Google-Smtp-Source: AK7set/m3qvuQUcycFKVIADubZwf/nc3FvFQm909JaiNgrhoXzl7o3oDjheUEi2P5Y93zipM3P/FNA== X-Received: by 2002:a17:907:7da0:b0:8aa:c038:974c with SMTP id oz32-20020a1709077da000b008aac038974cmr31897628ejc.54.1676305242622; Mon, 13 Feb 2023 08:20:42 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow Subject: [PATCH v4 5/9] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory() Date: Mon, 13 Feb 2023 17:20:00 +0100 Message-Id: <20230213162004.2797-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1676305454511100005 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 Sun May 5 05:31:01 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=1676305419; cv=none; d=zohomail.com; s=zohoarc; b=PnVPXuwiESHP6Hx4ky0PgcLqD1DkxqL8kPdi85cyULz0CMaouFc6ElMHZScWBxLqM1NfX1iQVUTGxGe8Dt0qFJV+IMWEIcs0KM+DWqp5idni2j7dy5kjbiDEliK0mitqjM7Dq8iOhbby5OWP1c824gU1CpbqutaIMdlF7g1f0lY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676305419; 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=Qb1FiuGvLBuRvXN5l6skemDDZnk2rBXyLNLNoqcFNgs=; b=T9EXSmO9+JwvWQmsXWMCrBa8w9azL+gsYaH24nrYSuKFW+ZwH2Fk0CFIWZFurwPVEVPxfE6xCFX3VgB9cBReALxQP3gYXiYna7DIi4O+fLntLbxuarjlSfFnG4HU851ZsX+OmcbDSfwhKa2J8n6MOrPO1Tc6dCfKOVGm7EJ1M/I= 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 1676305419847206.99939584244657; Mon, 13 Feb 2023 08:23:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZR-0004e5-9c; Mon, 13 Feb 2023 11:20:49 -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 1pRbZP-0004d9-Ke; Mon, 13 Feb 2023 11:20:47 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbZN-0007xn-Td; Mon, 13 Feb 2023 11:20:47 -0500 Received: by mail-ej1-x630.google.com with SMTP id n10so6271938ejc.4; Mon, 13 Feb 2023 08:20:45 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:43 -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=Qb1FiuGvLBuRvXN5l6skemDDZnk2rBXyLNLNoqcFNgs=; b=UX1zvx36kCRETYb8ikQSDOvnj5OS7620VebCL1yeSCngTvS3y+cm+CjYPK73I5fY/3 Rq57Knap6L0fhlfsdtGqXyPitGwPMbTi9tx6awGVWmHMSwf4w2NmOTncynZTxMriI+ka Rdugu5eZV+CgzooC6+jPYcX9dWAKRTqbANo5p4vTprFJTkqHsjt+x5XOwgp+y0bGsYX5 DNO2kKZRfntnqn0kJAB5zBytfQkcibReGt/x5Bpd+xdZWBz68qiYmC88Nx9PHsKSZg7Q Av2861swMsY8TfafbGm+A9CGUwYogMPIKGhPi8UYuN9Q/tqRtOkktuoBSymiUXI8Oo4e +OkA== 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=Qb1FiuGvLBuRvXN5l6skemDDZnk2rBXyLNLNoqcFNgs=; b=V9bWMOb8HNWbtfXudBQZx9wErZ6RrR0wTSW/ywbqoDgTzrgba1Xh6MuEna/UvHZNF0 C7H3ISe6GCcngpavUfCZM7uhkgtC4Ewb3y3K/OvIT9zIVCCgvLhkVoZkdbQI1qyCS0ol FWH+aIPgdSQH82Sh+3Xra1eH3Hv1rkkLvV225CQdPp6MtvP7BJqnaXZvCJ9HLPWKqaS7 HqKquqEBnCdC2Pp/Tz+WH+LldGHmF4IWu0XOUeQmMzjhCZNa2Fc+fMMQt7N8FZvffIDa Eglvu7VsawqRzJlGyZyO0CZtHghzvTtA3SH7Y0BWJNqCefcHkOW2HJb13rQotOAnOBtj n1MA== X-Gm-Message-State: AO0yUKVWHC/IQBkhuiivOt7UbEDanJJAZhnUsx7WNLUnq8VDZQrrKcu0 3rEr5k9hrFFWaIOQq1NTHSm0VrgCWVg= X-Google-Smtp-Source: AK7set++tX2zTxL9EWRYLFSOPVaTNsQakDOJz4M17SlkHmHVCYNSQmvMnH/LFReYuIggxGYyN5GcaQ== X-Received: by 2002:a17:907:72d2:b0:8af:ef00:b853 with SMTP id du18-20020a17090772d200b008afef00b853mr11980930ejc.73.1676305243740; Mon, 13 Feb 2023 08:20:43 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 6/9] hw/i386/pc: Initialize ram_memory variable directly Date: Mon, 13 Feb 2023 17:20:01 +0100 Message-Id: <20230213162004.2797-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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: 1676305421963100001 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 | 6 ++---- 4 files changed, 4 insertions(+), 9 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..455cbe11fa 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -129,7 +129,6 @@ static void pc_q35_init(MachineState *machine) MemoryRegion *system_io =3D get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; - MemoryRegion *ram_memory; GSIState *gsi_state; ISABus *isa_bus; int i; @@ -216,12 +215,11 @@ 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, - OBJECT(ram_memory), NULL); + OBJECT(machine->ram), 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, --=20 2.39.1 From nobody Sun May 5 05:31:01 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=1676306613; cv=none; d=zohomail.com; s=zohoarc; b=ZcmrACWerj7Jh+5GdI6D08pk9Trh++yghl09H3PzfKMvsLqU9r/Z91O/2YBKC6uCXIviU/wTCM/HTKWDrefReGP52GYaCQ4qzXNWv4enOVt0NQKJc9K36D56YTQ5FQKiW8aidu1GZaKTfp2kSm6DGdkyPH0rnPHnjbuIJqGg1rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676306613; 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=Sf/C8wu96e3AGJMHTR9jYdOWMQtcAUGt9XEkTJUN5LE=; b=gRQ/2y2pZXk3rog1IuyKm7qJ4WjkAsBZMGPXDER/jz76VgWQCHB89IWckHTqzwQ+jmeAVtvC/gMIluQI+eqXcDwqaWsn11Xm/KP9Kl/91/47rfkLklUmMoK4tKLx4sQ/6Cjk50iznA+cdzhly2u7iACSJ15DdToi1gei9V9ENz4= 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 1676306613893297.41630101125986; Mon, 13 Feb 2023 08:43:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZY-0004hT-Db; Mon, 13 Feb 2023 11:20:56 -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 1pRbZR-0004e6-8Z; Mon, 13 Feb 2023 11:20:49 -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 1pRbZP-0007vf-D7; Mon, 13 Feb 2023 11:20:48 -0500 Received: by mail-ej1-x62c.google.com with SMTP id sa10so33142888ejc.9; Mon, 13 Feb 2023 08:20:46 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:45 -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=Sf/C8wu96e3AGJMHTR9jYdOWMQtcAUGt9XEkTJUN5LE=; b=n6iO3jpPPZhif11AqIVl5wkooqk46jWJM8wEsOQPNFsgeZfSg9jWmW7UD1UEidkZYt FE9URyLTc26tk40FAvOIFX+V9oyn0o/VQyl91tQVH7KV8pFkHjgEERpjuy9FObstT/t6 1r5VPU9yY4A/DFtbTOAYlu+EbOiBfUD8r/k1ej5wNygr4XJN+YzMyY0kR4cAtzrg0u3j i4kAQNE9kDCzCEhWhAEFBYUs78Z2Qm36sXWGPumkbGMLx9EWgHKtW/ToyZzxL5VgTPnc pgCgCPJ9MoerWGD2ffeNZAL0HDwRGsB9rsthZn0L68HAShpUh720ZA5Mqqv5ulQiBfBM d4rA== 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=Sf/C8wu96e3AGJMHTR9jYdOWMQtcAUGt9XEkTJUN5LE=; b=5EdffMFr3/oO+GBDTxJwf/zugBk+53Y/srr4OqnXnNSK/fQnxfLWNdGBAuLoUOpMJb 4XN+81+Sksm0jpwCcXm8mqmY2sw1d0Wpe6HJc+V3BJEFqBVm7WBdx5wJSXMhGkmY/VL/ IHfq4vu4UgIdJiCpdjhDOQeAHF7XkTl7OhqbPEKZ3+7TKBoOtWEik8xkjr9iODfODfNV /RuxCz63MP1pLTwG4+B5UonpNGVwspHOifdKmFcP2caSW4rJ2YoP/PQzgtciE6DGmBHV WS3B3GIig02GXy22ijdanvA8DvHhwadDhYyRbZEUUQYcjWvoMqWyuksQVBm2TNpdXIZd r8PQ== X-Gm-Message-State: AO0yUKU5NhrzdOspxVo6HqfO9aBmROcJVCDxrMybaPYz5EUy74EsKyVE wuaTXb/qDfANFyvgSKe+vTfeBkxeIm4= X-Google-Smtp-Source: AK7set+kJbSw1XuHvRWbfKYq3XznVw8u4dKTrNpeLhsr7vAEc4PFyaytGSn1bl7fVlymPT/yp+z3Bw== X-Received: by 2002:a17:906:4e54:b0:878:545b:e540 with SMTP id g20-20020a1709064e5400b00878545be540mr26659614ejw.51.1676305245741; Mon, 13 Feb 2023 08:20:45 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 7/9] hw/pci-host/pam: Make init_pam() usage more readable Date: Mon, 13 Feb 2023 17:20:02 +0100 Message-Id: <20230213162004.2797-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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: 1676306615546100003 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 Sun May 5 05:31:01 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=1676306086; cv=none; d=zohomail.com; s=zohoarc; b=GPmBMjZ+TutQQ5UIBpypSJ8fXBVOSj9wzBG1dqb30sOERJb1kVJm0oglLkPgT47XU+MvtXDFyx5rsWIpmFimQdBd1+H6jYfMU/Q+yPrnFSZHLvu2Z5Dhnt4MmDpTiRo3yE8yU0YfrmUthb8071Y+TttRqK3g50cWub/j6xkt3ko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676306086; 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=w7TYkI/++FXvnkpoOiqybcbrgtqyZejgSKUe6dTILis=; b=cxaut2azGurwGTe+ZWOMI2tJF6VcsTPG/107xyfeqIXUZ/XfytqUQcsOmvHtcz8m4M9ugON1VqP8GciaBHc8sMEnEy14ffmVZcyDtuCcNzUNQwv3vCAt9ki8UyNSAfRc8MQvy9NvtD5rcQcJVccBlFDv++YoWIGu+pBdkeA+/Nc= 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 1676306085942740.2814008206279; Mon, 13 Feb 2023 08:34:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZe-0004rH-WC; Mon, 13 Feb 2023 11:21: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 1pRbZV-0004g4-1C; Mon, 13 Feb 2023 11:20:55 -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 1pRbZR-0007zB-6Z; Mon, 13 Feb 2023 11:20:51 -0500 Received: by mail-ej1-x629.google.com with SMTP id qb15so31139359ejc.1; Mon, 13 Feb 2023 08:20:48 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:46 -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=w7TYkI/++FXvnkpoOiqybcbrgtqyZejgSKUe6dTILis=; b=gn1XKj5yvZa9/ZuPY8Y/MwVFc4LKTBkFoT59GzJJeWtQj+KH1IOpEODqiSsexd3J+Z skdzQS1xya1JwRlVAAnsH/QkMlc2xSLsauaIjIzHQfkglXMML9tdsaqzFdRL4LNBqJJu lCJu8kHeNIYR1KR8W2m6Y6JNRDcMcut9WXV5wsg9HLBF93WssgSQdsYf5/n94jAIkYrq n5RJI0bXnP2gM1QoMfNNxmBQkO0AjgAHCr3reRl8zF+q2yvyg274zaFO3GH0E0LBsHDW dUMo3Lj/orjcYqrfYfcgu+iCMlT60SizuUmQ0yXDf4iKgGwT8q304Km2WX0/PDv+l/NC DMfg== 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=w7TYkI/++FXvnkpoOiqybcbrgtqyZejgSKUe6dTILis=; b=ofZxzBVwSdoQNtiWzXwgP5KYle4qjhSBTLHbr6+u6rUG0jnkrSN0QMfw0H3NOiubkT A3qOP7uiQz34HaG/2eiPpSLMtfY6TWkF96RvgPLkZn9TUuM7OAHvV/3mXmdFYsAwWyNM NG74IjoOG0hJ51T5BcK32iUaJSQSH1Gvs8Vgt1VcU+nWkwykcwWPx5bYSMAGpFs/uNen ZCItC5B0Vy/CbkrPAjpTaghBdIFh3QH7FemfwXCwdoc5Dk0q37FNQsLnBoxqcKadK3Qm 8xGsvFXmMX9SqrBzCYdhNzJLRFcqCFWzmYq9JmOL8c+NAOgUco+Ovpxsl2FdfcwNmwPY N9AQ== X-Gm-Message-State: AO0yUKXOegaUdEQ37V7Et+IdOCK/Tk4in0C2A2Hr48kXhRrTIR3ysAUY JbFQWjETSkUxDD2reib1MWrTSHpwwbQ= X-Google-Smtp-Source: AK7set+9nWLV0d7TJAM78x3R2IOM15F+m8bznxMMejSoZ09Vit8Gk4m5L4HagNL5oLpbusBrS9hzHA== X-Received: by 2002:a17:906:4690:b0:87b:3d29:2982 with SMTP id a16-20020a170906469000b0087b3d292982mr25083076ejr.11.1676305247225; Mon, 13 Feb 2023 08:20:47 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow Subject: [PATCH v4 8/9] hw/i386/x86: Make TYPE_X86_MACHINE the owner of smram Date: Mon, 13 Feb 2023 17:20:03 +0100 Message-Id: <20230213162004.2797-9-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1676306087808100001 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 455cbe11fa..a5ffb77ed8 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -220,6 +220,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(machine->ram), 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 Sun May 5 05:31:01 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=1676305335; cv=none; d=zohomail.com; s=zohoarc; b=K/TT8KrL5PoNtSKB0pCSF3UkfR3txBlE5NUoPUqtW/jK38ry6qfb88lzKLmGeIyIAgFTdYjKHLrL2dQJKFxIYMK70XaGSMJ/jkPeuuHcSmDxs08rBklRHtfqFluLP7pnNRSSd4HfsO/A2pd4zovKkf3NHMpoFR2knpofaff0Zvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676305335; 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=VZYBXSmn9es64NXcvy2L7VaXLyNHE3JDuEVzYy9aMjrk3/l9rAc7svm9yotKXChqj11AdfKA+8yzEKkpHskTTrjuYkNatvwC0K6vfHh0RfJ1In6RLZCuzosGn2dBsgfTnQrkJJCuDEj+xV/lzj0o60bwzx75WQd2yfYlVN6RPdU= 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 1676305335259506.2058603956091; Mon, 13 Feb 2023 08:22:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRbZe-0004og-2I; Mon, 13 Feb 2023 11:21: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 1pRbZV-0004g5-02; Mon, 13 Feb 2023 11:20:55 -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 1pRbZS-0007xD-8T; Mon, 13 Feb 2023 11:20:51 -0500 Received: by mail-ej1-x62e.google.com with SMTP id ml19so33359180ejb.0; Mon, 13 Feb 2023 08:20:49 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id 20-20020a170906025400b008841aa86484sm6979952ejl.211.2023.02.13.08.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:48 -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=ZAAnAtxK9LtuTjod/R6PQ+l+OK/prV2D3SRceGlLTNFoxupCIO6oiq4pLm5uenFcal cnbcrztFoR1Rvb5H5mZPLbtcw2zw2eVBwhnisSv2hp/EZeyOuSkP86uy43NGKrokc629 CDXONBFoxGx0YlhQnUvEVfaYmzKpneuq/jR7ItKxdk9NSE7qNLFRgo2P/QtSVG8bQXWo TMaN1VNqA5lOZKpkVP99fABfC9eqNV7XCnghyJTs6vJ02glWTNKayzqcciL5jNnJuq/S KtKnNgA/b8VdyUsgoqLowLyJu0PEFT3sYk4Vle+9jmBZoGpnwn2+aZJvQPQTJNKKjOfR 8Spg== 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=f/MMqYGk7egiBvilyl/UgXFSt4mJV9XO30el2xdi19B+2sVaGXz+MbNNxS0GN2RH9I AgCr+vBuQMT1luVnjOg4h7fI8RDnZiORhNhAYncpnqfLtSS9puZ7SLBv8kzBlLGVeGDR V/Wr5VvS28FARN72WYiMMhBtXqe/H7jm0WGpPhPlxQEB+5dnUa8PAcMim7FucQa1A6sS EPBjs6ov2NXKgS/QYQ83tVkaWc3FXmy/pDFDf1PtOFDb+q4LRFi+JqhKm+6PSkDHTTPa 8XZBdKVo9U0bEgPYS7FtqGXPA/79VJTSvDSZ4YEMvk/hn6+gHvWecyvPexPFTBj5yfOv tPng== X-Gm-Message-State: AO0yUKUBFt1QgJ7U2E2lts8KAhk1ygwi8xrJKupfCEDWoRuynniY2A96 KPS+k/2GMEvyxkh9RQl2H1vzgPZGr8I= X-Google-Smtp-Source: AK7set/iLM5msfhQ0NntqqM0xgMoWoYp+tTrRlaX749GUixJm5ndLSMTsH9hKcpaq5DjmhtMduxa7w== X-Received: by 2002:a17:906:a297:b0:8af:22b4:99d2 with SMTP id i23-20020a170906a29700b008af22b499d2mr15993196ejz.5.1676305248556; Mon, 13 Feb 2023 08:20:48 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sunil Muthuswamy , "Michael S. Tsirkin" , Marcel Apfelbaum , "Dr . David Alan Gilbert" , qemu-trivial@nongnu.org, Richard Henderson , Juan Quintela , Eduardo Habkost , Thomas Huth , Igor Mammedov , BALATON Zoltan , Ani Sinha , Laurent Vivier , Bernhard Beschow Subject: [PATCH v4 9/9] target/i386/tcg/sysemu/tcg-cpu: Avoid own opinion about smram size Date: Mon, 13 Feb 2023 17:20:04 +0100 Message-Id: <20230213162004.2797-10-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213162004.2797-1-shentey@gmail.com> References: <20230213162004.2797-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: 1676305336931100003 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