From patchwork Fri Jan 27 16:47:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77C8EC61DA4 for ; Fri, 27 Jan 2023 16:48:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRt7-0002Kj-6Z; Fri, 27 Jan 2023 11:47:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLRt1-0002Hd-Nr; Fri, 27 Jan 2023 11:47:35 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRsz-0005eC-GG; Fri, 27 Jan 2023 11:47:35 -0500 Received: by mail-ed1-x531.google.com with SMTP id x10so5235634edd.10; Fri, 27 Jan 2023 08:47:32 -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=wBSkQW9/N2/BoX+ctneP3uHks26t/IksUJUykB7eF44=; b=d+P7dx9HlGM04wP5hMW09kzs5VoL+E62W9l31IfXC5pRQDYTfmeaqaYCM0BTtD/bQ9 Zl/BK66YZKWQhR8z7IfucE9opXgtEyP50RtLE4tuMQgc8VyXtX+gT/F0rcDONCQr7rvT tZiWUjKLxduXdX6taw1fcNcIbAl+9MM6+qjAUwQwYacXslZLd72SlHhBx5F34uqTCHRz i7K3cbBfLois6L3B4RSqwX9e1bT8ISIVg83IgF+06KtdXgax4W/1g0LPryjAhE+RS0oX SdTDtMymRqiOgX9Dc51hURj/pmlUC2J0NXv356eYjXbh2yYci2XFHHBt+atjzHobL7ld qIrw== 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=wBSkQW9/N2/BoX+ctneP3uHks26t/IksUJUykB7eF44=; b=2L65m07sv/MSUnDlDNBP+vHPL936SuiS3AnKI240BhPzFtlJkp2dUDrcIxDFvN2ZX0 gcISPO+YTPO9FwlzNgC+yBt4J2EOowDPnGy6WO9/rrUGrWSOaO3clJjuXEzfzHesKLvb Tbsm177vKq7/bBt72axUIXkDtf0znp6HxW5yEFpRExwjAg5xxDlGvGiQRRo5ZfS3CaHH BiTtJ21CHcrJn+u1cZNIOaCIutyAobFeYbw9/DhvFKIugZBy3wtStPiHdSJMl0iDbwDC wLAHaUyem2AM07rlj6rtifguW2MA2B1juo1Dv+YxTEMYtLIHv7p+Ez+UAomri+GGqYJe n34Q== X-Gm-Message-State: AFqh2kqDo7bPg17P9y/a+zmhJ6OuFQ94jM8LUMBastE9RRFka2s6o7te H4KaUbN45V1HDh37ugkWgPRQxt21b8VmqQ== X-Google-Smtp-Source: AMrXdXthDcYsgM3ZHY2iJlfuD84EVs5unJZ02dZhkVRjdWpr55MR1iTtJ8LtO9Oeee4Q0nHUqD5sIw== X-Received: by 2002:a05:6402:100b:b0:462:6e5e:329a with SMTP id c11-20020a056402100b00b004626e5e329amr43130789edu.8.1674838051492; Fri, 27 Jan 2023 08:47:31 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:30 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 1/7] hw/pci-host/i440fx: Inline sysbus_add_io() Date: Fri, 27 Jan 2023 17:47:12 +0100 Message-Id: <20230127164718.98156-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Rather than using get_system_io() as the parent memory region, use s->bus->address_space_io which is set up as an alias in the pc machine. Signed-off-by: Bernhard Beschow --- 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 = PCI_HOST_BRIDGE(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - 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); - 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); /* register i440fx 0xcf8 port as coalesced pio */ From patchwork Fri Jan 27 16:47:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1E8EC54EAA for ; Fri, 27 Jan 2023 16:49:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRtI-0002Vf-Ud; Fri, 27 Jan 2023 11:47:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLRtE-0002Mn-4B; Fri, 27 Jan 2023 11:47:48 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRtB-0005gP-7q; Fri, 27 Jan 2023 11:47:47 -0500 Received: by mail-wr1-x42e.google.com with SMTP id m7so5500819wru.8; Fri, 27 Jan 2023 08:47:44 -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=bwu9CwvqoSJic4qxTpKXLN2ZSVp5972X16Wu4OAdM2A=; b=HYavrvzEXAjwzfXGkvtOik1RETm75ljLQhvBRKNWiZAMsT73z6e+kJeDOCGYRRWbJE NR85lxJ4q9Ak5byGuLGiZiurv6QWw7W7w3/tNuop914Y3wNHlr2Nwst1aSFedmN+0kDC 8lCrFQT+sP01/OS/W2jdHY1EuePnGPeg2G+G2l2ZICWRb4FtFOtEjGveOe+mA2RoBA3T Z521cYfMd0bWWxAl0eqhrhACrUVc4wD/TCG9vLoRc3Apvm3S5kwYUUafy4fE3iiQxmoh W8MjBs8CiEqr1pfSLjro/Up8l5jj5VgtQ89giRQLDHYC2C3xbi3nhuuwz/KgdxEaoxY3 f+rA== 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=bwu9CwvqoSJic4qxTpKXLN2ZSVp5972X16Wu4OAdM2A=; b=HFTWlfNj53MGnONKPUVuqmbb/wOYh4vf0qsrCbHB4Jk3ZO7eS7kOrGoGMaR8cRJQ2O cpBVcwvZ7VfN26kkJGPfxyRM5hvgJcvOsp7neoKXd2W82JKuuvWknsjlEd2HHUaVq+rV 3X3HcPu3KsX+ZdgnvR0knf55q/AR0V43UALArcieeroohElR44bDlWEy4FO+Ii4oWz+e jqng2/1gtnDI6wLYP+lZFrKL1zxsN4QPag0JDz2PsVoFYgVEuXDVhYUlF2X5cvn0uGPS /VR1vo0eOzNioL9cdRd769oac4PbWo0HiUwYE8nYxhTjbcmoqSg2SL2opTs90u3trtIB rB/w== X-Gm-Message-State: AFqh2krY43pb/VCzjHxwjSzimCxVK6mg8qPHsgG4uKNjubAKeHp7luMn a+n6GVLZtD/Kwv6qW4Gu0/fvfmQ7hWldVw== X-Google-Smtp-Source: AMrXdXsYPf5V39fxV4giZLUKNF5G6Rg2Ev+YPu89tYbfjcm46Ng41XZaFF1h7BdOEsvxaJ2HlKqzig== X-Received: by 2002:a05:6402:49:b0:49e:33ce:144d with SMTP id f9-20020a056402004900b0049e33ce144dmr97233015edu.37.1674838052615; Fri, 27 Jan 2023 08:47:32 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:32 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 2/7] hw/pci-host/q35: Inline sysbus_add_io() Date: Fri, 27 Jan 2023 17:47:13 +0100 Message-Id: <20230127164718.98156-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=shentey@gmail.com; helo=mail-wr1-x42e.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Rather than using get_system_io() as the parent memory region, use s->mch.address_space_io which is set up as an alias in the q35 machine. Signed-off-by: Bernhard Beschow --- 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 = Q35_HOST_DEVICE(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - 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_mem); sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, 4); - 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_mem); sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4); /* register q35 0xcf8 port as coalesced pio */ From patchwork Fri Jan 27 16:47:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F148C54EAA for ; Fri, 27 Jan 2023 16:48:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRtD-0002MI-KJ; Fri, 27 Jan 2023 11:47: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 1pLRt3-0002Hz-RL; Fri, 27 Jan 2023 11:47:38 -0500 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRt1-0005eR-RX; Fri, 27 Jan 2023 11:47:37 -0500 Received: by mail-ed1-x52c.google.com with SMTP id v10so5240258edi.8; Fri, 27 Jan 2023 08:47:35 -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=fYw6G42pi8UOWyOtpdnzKOJ0Zg1+A+c32gMwSKzPG4g=; b=hAnWUr9jcQ0CS+8Zgz7+DppjLIX8+lmCikfzCosa4IE+n/eBLEO4koTZSFSLdvLjYm AJBblYqDHU+3497ZPXtAhJGGbk561eazBoefIuoUgdv03oRgUYh/0JkHAetXmrzdj17U zviVxfIhiKNBNhYiJ6s7jcr4iliEy0ZwBKiHD1BsXPs9LJt57YUJ+MD0RGk7inH0K+7Y TrkZ5RsIQZeKBOrnOaEY9R3iy03cka08gq8W/+7C4+ynOOX9NDZIbWqGRqLOE9druODT ZQzgm7pWJNbNj13ASfj0b9iYSbHt40wdHIMpyGzjn41j0J0K3TU8gJyabLe5ahrtnJNM moYw== 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=fYw6G42pi8UOWyOtpdnzKOJ0Zg1+A+c32gMwSKzPG4g=; b=pQhlhZAYcBs+y7ffFGl1fGh7dG39FAif4N0nqokvSFRyE9/tNxYOOJhglkTioPa+m+ ttb6cvaL9gKzYxuEGlWG3og/xBVEJopDd40IJC7ynckwZQvV0D+f6MPNfRPpigDUBLwU iHRZlxIXGxa5onPDzxzYJhmdK4mhENRp5WDQWME1sOwwr6gTbDRidBacfJTsGV+9HFJU igBipcVFhfcbGD63Xn+zHU+hniG4GJLXPU4RDw/urD0Ky8s6Ti/FUu9M5ql0B4zEQ6zE VkQSUuDGDU9d2qb21Xd8k/PD0kcltAguQqEwtAfSvAIxP5DY4Va/sM0oI262n4W0flqs 8hFQ== X-Gm-Message-State: AFqh2kqx/pLv5Zo0Wi4oJpYdG9SqeNlkyEHI++KODHYU27k/1nTHyIPh aE2wW1mJI2SMQL5es117N4Y0f64bDRx6WQ== X-Google-Smtp-Source: AMrXdXt4xaHDEGF2xKtORnWWZHR2Foi3ZVyAvbxwAr1RkdQ95odcznrL2UUdSm2Fx30QhqGqFcYCxw== X-Received: by 2002:a05:6402:1484:b0:49e:9d82:49d6 with SMTP id e4-20020a056402148400b0049e9d8249d6mr29687857edv.10.1674838053875; Fri, 27 Jan 2023 08:47:33 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:33 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 3/7] hw/i386/ich9: Rename Q35_MASK to ICH9_MASK Date: Fri, 27 Jan 2023 17:47:14 +0100 Message-Id: <20230127164718.98156-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=shentey@gmail.com; helo=mail-ed1-x52c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The Q35_MASK macro is already defined by TYPE_Q35_HOST_DEVICE, so let TYPE_ICH9_LPC_DEVICE have its own one to prevent potential name collisions. Signed-off-by: Bernhard Beschow --- include/hw/i386/ich9.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 222781e8b9..36e0ccd16a 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -75,7 +75,7 @@ struct ICH9LPCState { qemu_irq gsi[GSI_NUM_PINS]; }; -#define Q35_MASK(bit, ms_bit, ls_bit) \ +#define ICH9_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) /* ICH9: Chipset Configuration Registers */ @@ -137,13 +137,13 @@ struct ICH9LPCState { #define ICH9_LPC_NB_PIRQS 8 /* PCI A-H */ #define ICH9_LPC_PMBASE 0x40 -#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK Q35_MASK(32, 15, 7) +#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK ICH9_MASK(32, 15, 7) #define ICH9_LPC_PMBASE_RTE 0x1 #define ICH9_LPC_PMBASE_DEFAULT 0x1 #define ICH9_LPC_ACPI_CTRL 0x44 #define ICH9_LPC_ACPI_CTRL_ACPI_EN 0x80 -#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK Q35_MASK(8, 2, 0) +#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK ICH9_MASK(8, 2, 0) #define ICH9_LPC_ACPI_CTRL_9 0x0 #define ICH9_LPC_ACPI_CTRL_10 0x1 #define ICH9_LPC_ACPI_CTRL_11 0x2 @@ -162,7 +162,7 @@ struct ICH9LPCState { #define ICH9_LPC_PIRQH_ROUT 0x6b #define ICH9_LPC_PIRQ_ROUT_IRQEN 0x80 -#define ICH9_LPC_PIRQ_ROUT_MASK Q35_MASK(8, 3, 0) +#define ICH9_LPC_PIRQ_ROUT_MASK ICH9_MASK(8, 3, 0) #define ICH9_LPC_PIRQ_ROUT_DEFAULT 0x80 #define ICH9_LPC_GEN_PMCON_1 0xa0 @@ -172,7 +172,7 @@ struct ICH9LPCState { #define ICH9_LPC_GEN_PMCON_LOCK 0xa6 #define ICH9_LPC_RCBA 0xf0 -#define ICH9_LPC_RCBA_BA_MASK Q35_MASK(32, 31, 14) +#define ICH9_LPC_RCBA_BA_MASK ICH9_MASK(32, 31, 14) #define ICH9_LPC_RCBA_EN 0x1 #define ICH9_LPC_RCBA_DEFAULT 0x0 From patchwork Fri Jan 27 16:47:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14226C38142 for ; Fri, 27 Jan 2023 16:49:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRtD-0002M6-IQ; Fri, 27 Jan 2023 11:47: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 1pLRt4-0002IC-EA; Fri, 27 Jan 2023 11:47:38 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRt2-0005ed-RA; Fri, 27 Jan 2023 11:47:38 -0500 Received: by mail-ed1-x536.google.com with SMTP id cw4so123794edb.13; Fri, 27 Jan 2023 08:47:35 -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=OJhCvhIhhKBnccqOEN+LTzcwGaza/ypgRY72rsH65ww=; b=V7KbksY5OYO6zNCWK76b0mR+BF1yecjrADVJLUl9g7nglH92AAAcxaaECT5928Oi1S 123f7vS9KFHxt+rQ/rvZDDXC2VkTZo1zrhENG2vOaBmgZTx++7XbZaC+YUwOjTag4xAj iaRC7tMZ9E/cT0UYnWijiFy5p93LZLonn4PMG/Ezoi8TfpPFQvnyMqG/1fwDk5Cty8Lu F25BC571oUyxIV9tmc2uvEGPbOtEbgyRbbQY5hxfRW7vm2WJb7Y1RtUTHDyR7PiAQuQJ w0IxhiHwGGaUzMfw+4HUfAqW2BIAfGe8s8HiLeV5wmJ2BgKy2lBMoShgcE+DdK/CTUsa zJtg== 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=OJhCvhIhhKBnccqOEN+LTzcwGaza/ypgRY72rsH65ww=; b=xWKs9leWkpZ90GyWgq1Q4FEeMNaZJk4z/cCCWr/qAdYdKdxgsU7Dg7uXZjrxEn/r/6 i7cBBXaWuCfjf8kcNYKlrUqTXcKGE39qg7jwD+Zsk9QErHJUElLGxoWr1nB7Pm6iCugM 49zkhrZcMMzmPrd4DuE3EPGdwhB6XbMHquJAcZxgpc0rALKfxecSQMa9bFTlMewyIwKz v7liSQm9lrdG81SK3cBHTCv/zeyMft1xXSJ/LFqJvKoeIvz7Q2OU3hS+j+FXq93W/J0G JFGnxMW5sTmFizSNmQg7E5gafVqIfs7IGLRSi5orqzU+BFlohL+NilSoS/R93FF682AY GXDQ== X-Gm-Message-State: AFqh2kqZ3g8boZoaBr4/1Rsph6TvGWsaohdqn9450/AftsB7bVNakLNq D8IN126p5djBtqu/3QC2/esrSyCODAteuA== X-Google-Smtp-Source: AMrXdXtKTej3q6ioYljEqJxvfGPJIsFxr91d++Sp0xrTErcpCsEGqgx6zk/dn69fjW45JCWCY/4OmA== X-Received: by 2002:a05:6402:2b92:b0:45a:7d2:9b35 with SMTP id fj18-20020a0564022b9200b0045a07d29b35mr42341259edb.0.1674838054747; Fri, 27 Jan 2023 08:47:34 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:34 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 4/7] hw/i386/pc_q35: Resolve redundant q35_host variable Date: Fri, 27 Jan 2023 17:47:15 +0100 Message-Id: <20230127164718.98156-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=shentey@gmail.com; helo=mail-ed1-x536.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The variable is redundant to "phb" and is never used by its real type. Signed-off-by: Bernhard Beschow --- hw/i386/pc_q35.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 83c57c6eb1..dc94ce1081 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -118,7 +118,6 @@ static void pc_q35_init(MachineState *machine) PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms = X86_MACHINE(machine); - Q35PCIHost *q35_host; PCIHostState *phb; PCIBus *host_bus; PCIDevice *lpc; @@ -206,10 +205,10 @@ static void pc_q35_init(MachineState *machine) } /* create pci host bus */ - q35_host = Q35_HOST_DEVICE(qdev_new(TYPE_Q35_HOST_DEVICE)); + phb = PCI_HOST_BRIDGE(qdev_new(TYPE_Q35_HOST_DEVICE)); if (pcmc->pci_enabled) { - pci_hole64_size = object_property_get_uint(OBJECT(q35_host), + pci_hole64_size = object_property_get_uint(OBJECT(phb), PCI_HOST_PROP_PCI_HOLE64_SIZE, &error_abort); } @@ -218,22 +217,21 @@ static void pc_q35_init(MachineState *machine) pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory, pci_hole64_size); - object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host)); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, + object_property_add_child(OBJECT(machine), "q35", OBJECT(phb)); + object_property_set_link(OBJECT(phb), MCH_HOST_PROP_RAM_MEM, OBJECT(ram_memory), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, + object_property_set_link(OBJECT(phb), MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM, + object_property_set_link(OBJECT(phb), MCH_HOST_PROP_SYSTEM_MEM, OBJECT(get_system_memory()), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_IO_MEM, + object_property_set_link(OBJECT(phb), MCH_HOST_PROP_IO_MEM, OBJECT(system_io), NULL); - object_property_set_int(OBJECT(q35_host), PCI_HOST_BELOW_4G_MEM_SIZE, + object_property_set_int(OBJECT(phb), PCI_HOST_BELOW_4G_MEM_SIZE, x86ms->below_4g_mem_size, NULL); - object_property_set_int(OBJECT(q35_host), PCI_HOST_ABOVE_4G_MEM_SIZE, + object_property_set_int(OBJECT(phb), PCI_HOST_ABOVE_4G_MEM_SIZE, x86ms->above_4g_mem_size, NULL); /* pci */ - sysbus_realize_and_unref(SYS_BUS_DEVICE(q35_host), &error_fatal); - phb = PCI_HOST_BRIDGE(q35_host); + sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal); host_bus = phb->bus; /* create ISA bus */ lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV, From patchwork Fri Jan 27 16:47:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119036 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D437C54EAA for ; Fri, 27 Jan 2023 16:49:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRtG-0002Qx-Ph; Fri, 27 Jan 2023 11:47:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLRt4-0002Jh-R3; Fri, 27 Jan 2023 11:47:38 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRt3-0005eC-61; Fri, 27 Jan 2023 11:47:38 -0500 Received: by mail-ed1-x531.google.com with SMTP id x10so5235838edd.10; Fri, 27 Jan 2023 08:47:36 -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=XRQJvU+ym4k6vuRjsbWIQuA8Cz7gpqd3a0L4wd5ZgL4=; b=S8vA4zsHhXUOtISPi/x8xOTgn53BpJHQ1cN/C93OqJ8zdkA/67ZVdlHag4GMTuY6vO iBYZgx2r36NodJhbqyWCU66uAN9qaLFB3bpBlJeUiV97Qd0FlVSNsxnoU/vJcYxFHQI3 4SJew7r4cznYwozHod/kKGend1oL5VQjNn9VWnV0yJiM2ZJEz69nfznZjrKK+XxJ/ge8 cxApXQg7lG1FHvuBG3iwUGk6wcBp79pTzQE/m4AsT5whQLS+xdBW8gfXpfZ1hVTtppmg W5CQPAWBQeFsOa2p1NivwddKZ0G4VWpvhMFi4IZTkmliJenjTYHSoxNTF3sbOJBBCG3U 1Qcw== 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=XRQJvU+ym4k6vuRjsbWIQuA8Cz7gpqd3a0L4wd5ZgL4=; b=2ygvOTmyBwyhyvsXBBlo8ZYMefDpPN9zvOq0ABfMz5xc5JqzYO6TQ+RnY4i6okeVoZ lDAzEV59iB2y7RUsKp23wzLkmGFW3jevk+qwNDbJEbZPa44pTwIpx0J2nzu+CTQd5fLA 4N+c3k2ynxy3ymXKFFfKn4+E6iaRzde1QyWBHo7yudFarhH2I10wGI4ba3Rrm84noUrz yPZYwkMpBzRHBmvQxewqk8cwBjE/0RQ16VLW6g/KZIvx2I2PHAxx/VaOoPVknOhioS/p JL7KJ1k9qs+0DJOey4zpTxdS903k3U9fd4DNijjGYqTyKpBfZaiUB32ueEd0YXDEYjk1 ogWw== X-Gm-Message-State: AFqh2krQAuiDyA2mmD9EP+79/M4VH8E4M+lPaiwwkZZJpeuB+xmgMQZq CHrlL8Tqvn97fi0vrHIZc7d0S2RamTXyXw== X-Google-Smtp-Source: AMrXdXuci6C4+kFVxm9TSFNST0oJL285+AIeaRczPfrRy81RZF3Ti51H3Mj72aIPBjLF1wccRVIHQg== X-Received: by 2002:a05:6402:28cb:b0:49e:db43:1722 with SMTP id ef11-20020a05640228cb00b0049edb431722mr26958367edb.18.1674838056009; Fri, 27 Jan 2023 08:47:36 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:35 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 5/7] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name Date: Fri, 27 Jan 2023 17:47:16 +0100 Message-Id: <20230127164718.98156-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org No need to repeat the descriptions. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- 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 = 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 dc94ce1081..a97846ab9b 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -198,7 +198,7 @@ static void pc_q35_init(MachineState *machine) 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); From patchwork Fri Jan 27 16:47:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D36B9C38142 for ; Fri, 27 Jan 2023 16:49:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRtE-0002NM-Uc; Fri, 27 Jan 2023 11:47:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLRt6-0002Kz-Nq; Fri, 27 Jan 2023 11:47:41 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRt5-0005fL-4B; Fri, 27 Jan 2023 11:47:40 -0500 Received: by mail-ed1-x534.google.com with SMTP id n6so2608282edo.9; Fri, 27 Jan 2023 08:47: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=qQLYhAFF4ygzxvntMyjp9iGgiLluMw3q8mDqHiv7CTQ=; b=qHyWiHS/Jx28ZO4drM2kjjHrw5y64xVQ7BUV2wzbBKXXkANu65TFeLxBaAARLFNoKQ 3cTzpfRb7bgyFxLS+eASlBeuLEsxk2VX5SR1Qikuxwa5X1DWTC0DXwBukLjrNbUnX5jL 5VkWc6bMp2GSbhtzBYDoeR5MRVzVo9Yw9WpyJVgyODwgIO5v7nB/IQlXheWe2zqVe3vh CbLTeJqgwC8SPSrJ0qOB6DxJjyLiZDY4+mkiR9Mc+x+A79iKxv47DDlyc/1oiaReVk0V lyUCzoe/DTkxAStzNm6AAOxu1MollCaFN+nlIdtiOgHnAZkl+LRHkzW671Um8WCxJFaY nrMg== 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=qQLYhAFF4ygzxvntMyjp9iGgiLluMw3q8mDqHiv7CTQ=; b=gQm++H/l7RmdmwC49OZ8yLG3H5XV/vAmRz5EVFm1kc7XislNWg7H5c3dP9P3//9u4b +KUCCbZS8Kd+aHX3IjlYH6wBX9Fte3B8B+DI5iwEBKLdF/uvIsSvIW8spNGEefbYp+QE xvPETEYPZkGwxfz8VnicyT+60THQORlTVU2gvwH6oeB44zQQISMgj4DT2d+jXwiKyW8G X/bH4V80iXhYKNS1JNYObsolnMPa7jV6SFSWBniiy6D9Ce82Hu0Rn7QE177mo7QxcGjE yWl4Pja7DKFlorvJFwfTNNEnmY7qrIlFd4smrmoUZZUByyrbR0bsWNIVUdEmdLZoqDRx PRXg== X-Gm-Message-State: AFqh2koZKcVhBWDuBZ4hMwADZYHQIwOuT5iSkFVWAT+yjMt76fqkUZ9S G3cUVkkza+6pC0r21wSWmhbQqZtEM3/IUA== X-Google-Smtp-Source: AMrXdXu/V9W2wsKwVOx1xN8Ydfy16lGud8QYvFSnhw0VxfXVZlgUxQfDBknwT9kijeV7epZ5l0E7RA== X-Received: by 2002:a05:6402:4496:b0:49e:ca5:244a with SMTP id er22-20020a056402449600b0049e0ca5244amr45909191edb.1.1674838056988; Fri, 27 Jan 2023 08:47:36 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:36 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 6/7] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory() Date: Fri, 27 Jan 2023 17:47:17 +0100 Message-Id: <20230127164718.98156-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow --- 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 = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); } else { pci_bus = NULL; - isa_bus = isa_bus_new(NULL, get_system_memory(), system_io, + isa_bus = isa_bus_new(NULL, system_memory, system_io, &error_abort); i8257_dma_init(isa_bus, 0); pcms->hpet_enabled = false; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a97846ab9b..b97979bebb 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -124,6 +124,7 @@ static void pc_q35_init(MachineState *machine) DeviceState *lpc_dev; BusState *idebus[MAX_SATA_PORTS]; ISADevice *rtc_state; + MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; @@ -191,7 +192,7 @@ static void pc_q35_init(MachineState *machine) rom_memory = pci_memory; } else { pci_memory = NULL; - rom_memory = get_system_memory(); + rom_memory = system_memory; } pc_guest_info_init(pcms); @@ -214,7 +215,7 @@ static void pc_q35_init(MachineState *machine) } /* 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); object_property_add_child(OBJECT(machine), "q35", OBJECT(phb)); @@ -223,7 +224,7 @@ static void pc_q35_init(MachineState *machine) object_property_set_link(OBJECT(phb), MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory), NULL); object_property_set_link(OBJECT(phb), MCH_HOST_PROP_SYSTEM_MEM, - OBJECT(get_system_memory()), NULL); + OBJECT(system_memory), NULL); object_property_set_link(OBJECT(phb), MCH_HOST_PROP_IO_MEM, OBJECT(system_io), NULL); object_property_set_int(OBJECT(phb), PCI_HOST_BELOW_4G_MEM_SIZE, From patchwork Fri Jan 27 16:47:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13119034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48A3EC38142 for ; Fri, 27 Jan 2023 16:49:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLRtI-0002UI-JL; Fri, 27 Jan 2023 11:47:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLRt8-0002LB-AX; Fri, 27 Jan 2023 11:47:42 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLRt6-0005fw-NL; Fri, 27 Jan 2023 11:47:42 -0500 Received: by mail-ed1-x52f.google.com with SMTP id v13so5229725eda.11; Fri, 27 Jan 2023 08:47: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=112PDGr5auDan/9COjqqcqMviFQFRU5C3+pSLlcp7zA=; b=F7G7Jl3C4S+6NW3bxYUGIlTPbrVqNbzSuDMFUBPBdzT8uM7/wBHSkOA7rvD7lgKgW0 DLKDcQBOOlW7E/M/+d3kIQYgTamIqo6oIep5qkZNKUgRBKCndY/Uo0pI9d4GManTEyr6 KPqkqFyBENwrnjOJaR09OfrI75/+p1520bvMnsmKox26M6eDOjmBB/OCEP8rJEUJAzMj f7kBlc3+/zrs7bC6w8OqOzrald92foB9bc9+tgIC1Rz+8Nf8YrQSJNwoXqKLTCiLufni JSxR0WgELhIh/xWHBBSLsm6tQpYD01SF25uNU/Zf9iZP0zV3i58cmicn9hgNhCtln8S1 4kAg== 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=112PDGr5auDan/9COjqqcqMviFQFRU5C3+pSLlcp7zA=; b=qXb4eYoD5SXmuMRmlbKymhox+Mplg/ZcmtfBHn2XgLQNXbtb83okrgi7YVNBcautPl QsXlS+xfYpYDwjT4zsURFkbZiN7BCCFoFYe6Xa+JeujxG+rX0A3gDgfvyiDwf1Txt0gE xs/YYQzBK10nGsB0EbJe69sbpBoiFGPeDXgaGH2JfRG1UtQhCF8208O/vrtLS1SaPcHP rVK5rnKEhQ6Fcdq1GODYDjIfFxAV/bPO3f/qyrjHj2/0Ha10c34ATcfgYDCQeXc6oH9V zVV9y+0EX6n5HZOLKa8obYk8VI9uefEjjk/2AQsZpU8EiNIDbKWqucH1cGtrXX8DZtlG vQbw== X-Gm-Message-State: AO0yUKXZZG8q9m7tWaKL8t2q3n/iiXpjDO4xZdFWfVPyTMuZOJ2NLO/s IWjssQcL68gkAEdn/w7mWJxvyTR9gbRNJA== X-Google-Smtp-Source: AK7set+VvLglDl4w91OVszSnkxMDijq/PB+1708r+fNpuHVwuidcXb4N1JnNNIqJLoFRTNrlj4nc4w== X-Received: by 2002:aa7:d855:0:b0:4a0:8f89:337a with SMTP id f21-20020aa7d855000000b004a08f89337amr12763837eds.11.1674838058767; Fri, 27 Jan 2023 08:47:38 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id m15-20020a056402050f00b0049ef70a2894sm2574414edv.38.2023.01.27.08.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:47:38 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH 7/7] hw/i386/pc: Initialize ram_memory variable directly Date: Fri, 27 Jan 2023 17:47:18 +0100 Message-Id: <20230127164718.98156-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127164718.98156-1-shentey@gmail.com> References: <20230127164718.98156-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=shentey@gmail.com; helo=mail-ed1-x52f.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Going through pc_memory_init() seems quite complicated for a simple assignment. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- 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 88a120bc23..5331b9a5c5 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -163,7 +163,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, uint64_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 it, * done for backwards compatibility with older qemus. */ - *ram_memory = machine->ram; ram_below_4g = 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 = machine->ram; if (!pcms->max_ram_below_4g) { pcms->max_ram_below_4g = 0xe0000000; /* default: 3.5G */ } @@ -205,8 +206,7 @@ static void pc_init1(MachineState *machine, /* 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 != NULL) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index b97979bebb..8559924eb4 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -128,7 +128,7 @@ static void pc_q35_init(MachineState *machine) MemoryRegion *system_io = get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; - MemoryRegion *ram_memory; + MemoryRegion *ram_memory = machine->ram; GSIState *gsi_state; ISABus *isa_bus; int i; @@ -215,8 +215,7 @@ static void pc_q35_init(MachineState *machine) } /* 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); object_property_add_child(OBJECT(machine), "q35", OBJECT(phb)); object_property_set_link(OBJECT(phb), MCH_HOST_PROP_RAM_MEM,