From nobody Sat Nov 23 23:03:02 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1730754402; cv=none; d=zohomail.com; s=zohoarc; b=Ckah3z3RhIOE+MyIfooLVPbZ1F7bPN9OIQZoExvo/PriaDj4sZETSjrEp3vJMe7TySRez0MI/8hof+HB1/aNPQ4mY/9nuhf5N7j5EAYdc5XZ7xJaZCfjrkxkIfwxoQ5SxRCNi7XLuh3bAJ7vWygJkJIaVdsfoi9Xp72chFSDb3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730754402; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Twycu9LeMPLWhT+3APHxCe65PWhI42c5Tsx7A0KoeC8=; b=KxhF8H4v9ZVmMPeqVHvcwSpkVcFSPzF3C6FhaW0M65ALPS2F8lAEOIOQNe8umXStq46fRVG59ISJwUXBiKrCdR2zm0Ns1w9FR4DjIyNhS3Ja4MqzYDOmLqU3NGpiQuY02xY824o5G14LW6OxYDnqcR9o0cjpGzMToAGtyJdxoO0= 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+importer=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 1730754402705526.2297954508809; Mon, 4 Nov 2024 13:06:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t84H8-0003Z8-RU; Mon, 04 Nov 2024 16:06:14 -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 1t84H7-0003Y1-9i for qemu-devel@nongnu.org; Mon, 04 Nov 2024 16:06:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t84H5-0005If-O7 for qemu-devel@nongnu.org; Mon, 04 Nov 2024 16:06:13 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-382-hlx8OxVRMRKV95QxZyl2qg-1; Mon, 04 Nov 2024 16:06:08 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4315dd8fe7fso39429795e9.3 for ; Mon, 04 Nov 2024 13:06:08 -0800 (PST) Received: from redhat.com ([2.52.14.134]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e7f33sm194127935e9.6.2024.11.04.13.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730754371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Twycu9LeMPLWhT+3APHxCe65PWhI42c5Tsx7A0KoeC8=; b=UMgXrgY47RJzOBmpbkERTNfPip8HZokK4K3ACD9mdfxYgonb613yq3pyMmABI4rvvRDNC6 bUSQH+mvEGh0oUbYZI6nKpz6b10lQ8EymrjlwnkGuVDiPWgYykyZQfKdwkO0JHn2e5xC5N m5Ye4RY13SWEYcStFGVkWLftEGXGvak= X-MC-Unique: hlx8OxVRMRKV95QxZyl2qg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754366; x=1731359166; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Twycu9LeMPLWhT+3APHxCe65PWhI42c5Tsx7A0KoeC8=; b=qTm7HFLRLF4nBh8WHInEwU+S2D5xIGfOe9VfCXYsFw8eo8l5ZwDRLEPOgjrYEbxK4A qaB8kPGyiOZeJ8yJfQqCjYr/wI/bPWKo0jt1lKyZciG4Cfpp3qygdr5REmrIjZDsKHcc tnx0AhzaCGkqOsPHN/6MYUvYkA+6uQwDt0X6amWOCR0vH5gXAsEAOa/7SkAMGIlZVm4N 4KBMqNrShnGbXzwtfAw4UdsoTCHT1fIMEkFMnr/fZlm8fMhRs8NIdXakQU8oZh2pw24u VU69Qg3SKw+2HUtcz/cemBXwK8mrKYb3wuDbTqTntIMVqyM/d9iF1XHwqKcwB6khC+Rf lWKQ== X-Gm-Message-State: AOJu0YxPtHjamBJLYF93NYznKNz9TneqZG2USbkCp9G3CqjwpEY0u/f+ V3koeti7XCABusGjK32/nwL+ndvQGfbSLBSNyZhvTdWCY2ntI+EoryxV1o6zpM27uJ/Ue63LJn9 Y4py2Bxu0DhfKVfC2j3LHfMBvygknB0nPXKjmNtldlRVhDi++W6f/B3WHa1CdEIRryCvhXVMxR7 LK32LCW34fgMCp43Xpfe22np+Vrq+Ahw== X-Received: by 2002:a05:6000:18ac:b0:37d:4f69:c9b with SMTP id ffacd0b85a97d-381c7a6ddd1mr15096079f8f.35.1730754366464; Mon, 04 Nov 2024 13:06:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IG403upuUw1/pSjERuBZvmBUJAi7cqFgpVdvOeZ8KP70NsIm3W+Y1VjgoyBaw8iAjV1LRramQ== X-Received: by 2002:a05:6000:18ac:b0:37d:4f69:c9b with SMTP id ffacd0b85a97d-381c7a6ddd1mr15096056f8f.35.1730754366056; Mon, 04 Nov 2024 13:06:06 -0800 (PST) Date: Mon, 4 Nov 2024 16:06:02 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Igor Mammedov , "Huang, Ying" , Marcel Apfelbaum Subject: [PULL 09/65] hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS Message-ID: <97b9cb066e5f10845b4bc4d2ec657deb1e73f910.1730754238.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.34, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1730754403070116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron Enable ACPI table creation for PCI Expander Bridges to be independent of PCI internals. Note that the UID is currently the PCI bus number. This is motivated by the forthcoming ACPI Generic Port SRAT entries which can be made completely independent of PCI internals. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Reviewed-by: Igor Mammedov Signed-off-by: Jonathan Cameron Message-Id: <20240916171017.1841767-8-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci-bridge/pci_expander_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index dfaea6cbf4..3d52ea5867 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -85,12 +85,25 @@ static uint16_t pxb_bus_numa_node(PCIBus *bus) return pxb->numa_node; } =20 +static void prop_pxb_uid_get(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + uint32_t uid =3D pci_bus_num(PCI_BUS(obj)); + + visit_type_uint32(v, name, &uid, errp); +} + static void pxb_bus_class_init(ObjectClass *class, void *data) { PCIBusClass *pbc =3D PCI_BUS_CLASS(class); =20 pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; + + object_class_property_add(class, "acpi_uid", "uint32", + prop_pxb_uid_get, NULL, NULL, NULL); + object_class_property_set_description(class, "acpi_uid", + "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); } =20 static const TypeInfo pxb_bus_info =3D { --=20 MST