From nobody Thu Nov 6 08:30:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537827613900530.9283347957252; Mon, 24 Sep 2018 15:20:13 -0700 (PDT) Received: from localhost ([::1]:49027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4ZD5-0005NH-Js for importer@patchew.org; Mon, 24 Sep 2018 18:20:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4ZBF-0003qw-Gu for qemu-devel@nongnu.org; Mon, 24 Sep 2018 18:18:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4Z7B-0004fz-5P for qemu-devel@nongnu.org; Mon, 24 Sep 2018 18:14:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4Z7A-0004fY-SM for qemu-devel@nongnu.org; Mon, 24 Sep 2018 18:14:01 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C667315009E; Mon, 24 Sep 2018 22:14:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-139.rdu2.redhat.com [10.10.120.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B2D12010D0D; Mon, 24 Sep 2018 22:13:58 +0000 (UTC) From: Laszlo Ersek To: qemu-devel@nongnu.org Date: Tue, 25 Sep 2018 00:13:45 +0200 Message-Id: <20180924221346.16733-2-lersek@redhat.com> In-Reply-To: <20180924221346.16733-1-lersek@redhat.com> References: <20180924221346.16733-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 24 Sep 2018 22:14:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] hw/pci-host/x86: extract get_pci_hole64_start_value() helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Expose the calculated "hole64 start" GPAs as plain uint64_t values, extracting the internals of the current property getters. This patch doesn't change behavior. Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Marcel Apfelbaum Signed-off-by: Laszlo Ersek Reviewed-by: Marcel Apfelbaum --- hw/pci-host/piix.c | 15 +++++++++++---- hw/pci-host/q35.c | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 0e608347c1f0..0df91e002076 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -249,9 +249,7 @@ static void i440fx_pcihost_get_pci_hole_end(Object *obj= , Visitor *v, * the 64bit PCI hole will start after "over 4G RAM" and the * reserved space for memory hotplug if any. */ -static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, - const char *name, - void *opaque, Error **errp) +static uint64_t i440fx_pcihost_get_pci_hole64_start_value(Object *obj) { PCIHostState *h =3D PCI_HOST_BRIDGE(obj); I440FXState *s =3D I440FX_PCI_HOST_BRIDGE(obj); @@ -263,7 +261,16 @@ static void i440fx_pcihost_get_pci_hole64_start(Object= *obj, Visitor *v, if (!value && s->pci_hole64_fix) { value =3D pc_pci_hole64_start(); } - visit_type_uint64(v, name, &value, errp); + return value; +} + +static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, + const char *name, + void *opaque, Error **errp) +{ + uint64_t hole64_start =3D i440fx_pcihost_get_pci_hole64_start_value(ob= j); + + visit_type_uint64(v, name, &hole64_start, errp); } =20 /* diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 02f95765880a..8acf942b5e65 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -109,9 +109,7 @@ static void q35_host_get_pci_hole_end(Object *obj, Visi= tor *v, * the 64bit PCI hole will start after "over 4G RAM" and the * reserved space for memory hotplug if any. */ -static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static uint64_t q35_host_get_pci_hole64_start_value(Object *obj) { PCIHostState *h =3D PCI_HOST_BRIDGE(obj); Q35PCIHost *s =3D Q35_HOST_DEVICE(obj); @@ -123,7 +121,16 @@ static void q35_host_get_pci_hole64_start(Object *obj,= Visitor *v, if (!value && s->pci_hole64_fix) { value =3D pc_pci_hole64_start(); } - visit_type_uint64(v, name, &value, errp); + return value; +} + +static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + uint64_t hole64_start =3D q35_host_get_pci_hole64_start_value(obj); + + visit_type_uint64(v, name, &hole64_start, errp); } =20 /* --=20 2.14.1.3.gb7cf6e02401b