From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8565FC433B4 for ; Thu, 1 Apr 2021 14:27:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 92D916135A for ; Thu, 1 Apr 2021 14:27:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92D916135A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bernat.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRyId-0003Ql-Ah for qemu-devel@archiver.kernel.org; Thu, 01 Apr 2021 10:27:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRyHl-0002t1-OK for qemu-devel@nongnu.org; Thu, 01 Apr 2021 10:27:01 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRyHe-0006Rv-1H for qemu-devel@nongnu.org; Thu, 01 Apr 2021 10:27:01 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1770A5C0097; Thu, 1 Apr 2021 10:26:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 01 Apr 2021 10:26:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bernat.ch; h= from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=fm3; bh= /l40LFjC09Vzp0gGE6Jj1wvXXza7MjTGBc6TiChaxBY=; b=ANsfg2ZsdEIBvKUP pp3DAMMTN/LBfGqkJAPhZSJ7NsfKFTnyqAoFZIBoO9HijBFBgzNIPbgZh3111p+/ s0oFEU5A8BoZz0P1C1yg6tX9DaRQb/KaEXM+kzanjUjy0+aIBPjEU5tHkfmf0NF0 h6bpxilzdR9E/FdwA4WTWpmDAUCgJctgOf1IexD1127qNKIQUl40eG2jEdiql42Z Fx1mIVXhIzXAAg2J4xPEgpwlMxPasVNx84iWVBb5ixhpVwjBsmQJ8Rs6pCGSNO6V iVkWYgdUgFDH6ksVXeIkOZJrr6op6Oal7BmJvLJYA65vp6yrYFs755Y905CIcGKK Ox2uiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=/l40LFjC09Vzp0gGE6Jj1wvXXza7MjTGBc6TiChax BY=; b=exqxQir7ZA8N0zN2QNSPunguTaCI7SndZ6rzoRHPjoBvALIKeaiY64NNV XZJUowo7C7SQwx5iEjoAHh9YZZf6+G2UXvgZlXGffIh5I6Ow4crDUYwACP3woht0 vfJVzBHku8K6unuY/zp0UZzHTOGxC6+GTWhUYvVDgb4N3xRBMcOqvWNvu/RpGEnl SmCEZLkosRiMOovCT7hhmiE5KuZEwmCQUxHJM4LWQ3yRf5pphHSxHFp2fzlqMSwE Y86Q5qnm44o5w40uEfe3yVovi673/KlzazpNAiftknqYLHLjDm1nBI/UVORcHiyD EFV+bpP4HtqK3UKFPPRpPJxMWrApw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeigedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomhepgghinhgt vghnthcuuegvrhhnrghtuceovhhinhgtvghnthessggvrhhnrghtrdgthheqnecuggftrf grthhtvghrnhepudeuveeggedtveduudejgfeiffeiveduiedvjedvudefleetgfefvdfh kedtieejnecukfhppeeltddrledtrdeltddrfeehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepvhhinhgtvghnthessggvrhhnrghtrdgthh X-ME-Proxy: Received: from neo.luffy.cx (lfbn-idf1-1-1655-35.w90-90.abo.wanadoo.fr [90.90.90.35]) by mail.messagingengine.com (Postfix) with ESMTPA id 746681080054; Thu, 1 Apr 2021 10:26:52 -0400 (EDT) Received: by neo.luffy.cx (Postfix, from userid 500) id 814CCA28; Thu, 1 Apr 2021 16:26:50 +0200 (CEST) From: Vincent Bernat To: "Michael S. Tsirkin" Subject: Re: [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device for Type 41 References: <20210401082544.16522-1-vincent@bernat.ch> <20210401082544.16522-2-vincent@bernat.ch> <20210401095725-mutt-send-email-mst@kernel.org> Date: Thu, 01 Apr 2021 16:26:50 +0200 In-Reply-To: <20210401095725-mutt-send-email-mst@kernel.org> (Michael S. Tsirkin's message of "Thu, 1 Apr 2021 09:59:26 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.25; envelope-from=vincent@bernat.ch; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , "Daniel P . =?utf-8?Q?Berrang=C3=A9?=" , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" ❦ 1 avril 2021 09:59 -04, Michael S. Tsirkin: >> + /* >> + * TODO: Extract the appropriate value. Most of the >> + * time, this will be 0. >> + */ >> + t->segment_group_number = cpu_to_le16(0); >> + t->bus_number = pci_dev_bus_num(pdev); >> + t->device_number = pdev->devfn; > > Problem is, for devices behind bridges for example, bus is only > configured by guest, after pci has been enumerated. > > So I suspect this either > - needs to be limited to only work for the root bus > - needs to be re-evaluted on guest access, like we do > with ACPI Or the address can be provided by the user. I didn't want to keep that at this is error prone and there may be surprises after adding a device or after a QEMU upgrade. Otherwise, limiting to the root bus seems a fine limitation by me. How do I check that? -- Don't just echo the code with comments - make every comment count. - The Elements of Programming Style (Kernighan & Plauger)