From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.153 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796402329; b=kTmsbS64ai1JwaQ1KMKZ3e0PPStub1dW/pUF8w9CZtCcYoTX9UskG6S68awIQdxuu5cF BRHA2KcOpO7yQL2QFyZl2RNbnS1HyFJq7yN1IiOzjCZACqualPLiOH/hFiUZE/1XN91Ts Xfn5GUMmSmKQz3jSy/ZmxCUnTm2pI1wYIXbWaPA094gmSBQYLHzzMpngmohAVl6c6kDk/ TWw3fnCAAGh5lc/1eBe+6cN35oXRu/f2DoiUqB97dAbj/1vT4yw0bf67tYNNHpM8VQzT0 40unlTy+qxh/Odijvn2cPR6GjVfrBi5QGh13Re3GaWhCLpOwCEJXAXIW1NWwC0NwapA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796402329; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: X-Mailer:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=rPs4nyhhfSnmGqp//gcZk3XatUnxrv2C8fRT+3pRn7c=; b=KG+paTe/wjFZPF5tA8czxIYDqsBswBI/R/IvyMHqGATz7PRXU+riYa0Jc3tugQXjyhdN P0bGWS7UR1OCviR4gU/Ktw/a1qIXxer2FrWZg4OCEbaKujJXUZpHJrxd0bX7IFo5dEoGO mExTD4j6sT97IkN6rWd/fopeqCOBIWspep4IOJHSWksIOrm2xeUgIYU37jgRd3SuuB16q QS4BTfC9Vhn7WrdxK6EoYwQ6Ah4J8w8SbwsZLZaJf9RaauI31NRgJeyU+HpMUlC0rWm+C /Si71Nrvz8DTtniFceBycf6IIlboJ6BpgU8qzNM+mwrNYUZJXgHRGEwQGT8mvwazTpw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass header.d=shazbot.org header.i=@shazbot.org header.a=rsa-sha256 header.s=fm3 header.b=gG+G3O9Q; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=tweSCvVY; arc=none smtp.remote-ip=202.12.124.153 Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 788C0606A322 for ; Fri, 4 Dec 2026 16:38:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 788C0606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=shazbot.org header.i=@shazbot.org header.a=rsa-sha256 header.s=fm3 header.b=gG+G3O9Q; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=tweSCvVY Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id DCC277A0119 for ; Fri, 4 Dec 2026 11:38:47 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Fri, 04 Dec 2026 11:38:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1796402327; x=1796488727; bh=rPs4nyhhfSnmGqp//gcZk3XatUnxrv2C8fRT+3pRn7c=; b= gG+G3O9Qh5LOycs+iD9CNXUPxDOyaLKFOla/yjIS4BwbZr/ErWczPaay/aWa5UTW ibb7O+w+kDOB7LQxKKS0ysPyeOrwxTzb0ztFKRCOpffoZTFF+Qcr7KrHNH0Yj90y QnIe5UGFmdRDv+nyi270Y7dNuoxQtMbq38jCKgvk8Y5mbjrYmunC0y5zvPfHnOIg gTboIo1TEcYYy5fLvzDEQAxxa9IAAivzFiCc9JZ0/wFwrZH8e81JO2Vl2NO9iSHj PgbWT0vTdoxR8td03mKm7moA2eZY+w6AdpFAZSLviPuUOvbgX+RjjK7EIPd9lmVT GqoF8u9LFHG+jlJcYUtqkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1796402327; x= 1796488727; bh=rPs4nyhhfSnmGqp//gcZk3XatUnxrv2C8fRT+3pRn7c=; b=t weSCvVY5MGi+gD405fDJXXTD04B4hz2MiZ3jPYFyLvvPTW1bb7cx50zXKZkq3I+z lGvpqqfR+G6TKPIN5NNEC/f6mumx9QgSQLig3Dekn68ZaQCjV4VT0kiS6Qi05qZv 2Lilij6AUodVaqwQdWOSdMqH9YWvraRU3D1MJNopgZvHG7VsdnUyIZOtrUO0PycU XCWIxKve8HSNOXph7H4sBRvqmsih7cBRgAxlsKpRdWAnOEAiOEt0+ZG2ePZXs5ku OORkR2Z0IkiGb7jNWhixHjDhp9MZGbcbkN5Y0OKPX37wOiIdT89MCYE6gzPgoRQ4 i3ZBvj75HP7rLEGEUGM0A== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=shazbot.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796402327; d=shazbot.org; mf=PGFsZXhAc2hhemJvdC5vcmc+; rt=PGt2bUB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:AX7G+qooUqFZ7ggpG9BRzkMOSTbuSnTzOPMIEcy+bF4FbT6 nD2eiBf5g1yG7ak0bfqDrl2IlVEE+XzuFF/cwVLkdMEV/V+WXjrg3QOJcr/7buDD mHDgIiYPtssxaaFs79F4yVmveZIj4hWr23G38AOooATVYiiZ2DumRL3e1NUxNLWi /YQLBc0d8AfRzZKoMK00NsLi3vxLCoLCFBSqXWHa5ccR/kbQuo9mDgRRGcCcM2RG yiYx/0X6G1JBpWgWjp/hg+bOMJIBl04UIp+AwlQzTDJXkWnn+VwlS800CNCX1bxz d7BrUS++NWUELZwm5umioFW88SWVctJley1ciZw==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:VzQpxDEi8wREVG8p9Sc4AlzHsDJqQOOuX9Uqc/LrwAE=:T61zr66qEjywhpeSIwVJg7eKbjLDAhc3hoLIZnNSA6o=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFw/C6EtJ8tLglVc31arjJhoOJGvJEBLBVMM+k1yERS47Cx7Ta4aPv8NydJzqRf8b umuSCiPRB26Z+3vTxkzho5YpYDCb2/VUurg2ezFLJ68kVYL2ObBa06ODr1O0mkjxTxkW+M VgAul9LIIesvN17YqrhVvnzO4hgbrBJjQuntfYox7XKDJfhj5oJlj0t9y0jFPWyoeKf8Mr 2FcJCwr/0zXhtRvAuCDwqdDU5XV/2jtvAIYiFNwcjfd8+70zWysM+xFaDi29ngEolWf9i2 QWbUPMuzrcCX2NnLxrYcuap4KqtywOG0CYO0ILEWfrDLq0Wyen+HECLGzkCCuJSMN0RSD7 JpBUCAlta6kP0GXxjec9eLlNv79xBagbFT7jxuzUtA2SCjfcEmzmdTaRTtyK2S58jZ3mtl 9XW1TgSD9BiaO2dMrXcLdyNyR2aq6I4S7agQAqcUGRrI/50DZc4FMIyj7RtDawL1fEWtXe MRUmGCb4EvVApatuMt1980Kof9v3DKh/OjthSnr4JKD6uCYs2g7/kOMqojUuu4PVy3Ojm1 2Oa82x4yAxbwCqSaUqQZYoTL+u/ZML85Sl6lVZ+toJ5iTm2a17RWcR3vMMpbKyca/XGUAE YXQKZO4d9U6aGNuQdOrRMydUfEF+no7/d3X4qtuwr0lBFvrZ2fgQ7/UHhCug X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Dec 2026 11:38:46 -0500 (EST) Date: Fri, 4 Dec 2026 09:38:44 -0700 From: Alex Williamson To: "Michael S. Tsirkin" Cc: kvm@vger.kernel.org, alex@shazbot.org Subject: Re: [PATCH v7] vfio/pci: expose ACPI _ROM through a device region Message-ID: <20261204093844.101c3a52@shazbot.org> In-Reply-To: <20261204102624-mutt-send-email-mst@kernel.org> References: <20261204080333.58dfbe2c@shazbot.org> <20261204102624-mutt-send-email-mst@kernel.org> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 4 Dec 2026 10:41:06 -0500 "Michael S. Tsirkin" wrote: > On Fri, Dec 04, 2026 at 08:03:33AM -0700, Alex Williamson wrote: > > On Fri, 4 Dec 2026 06:19:54 -0500 > > "Michael S. Tsirkin" wrote: > > > > > Some GPUs provide their option ROM through the ACPI _ROM method. > > > According to the spec, _ROM, if present, must supercede the > > > PCI ROM BAR, but VFIO currently provides no means to access its > > > contents. > > > > > > Let's report it through a new VFIO_REGION_TYPE_ACPI subtype: > > > VFIO_REGION_SUBTYPE_ACPI_ROM. > > > > > > Note that _ROM size is not provided by the firmware and has to be parsed > > > from the image. Let's leave this to userspace. > > > > Nak. This doesn't align with existing semantics that define other zero > > sized regions as not present. It also makes it non-deterministic which > > region a user is trying to access based on offset. The fixed region > > spacing is implementation, not API. The API is to use region offset > > and size from the region-info ioctl. We'll eventually be more densely > > packing regions to account for BARs and device memory that exceed the > > current 40 bit segmentation. Thanks, > > > > Alex > > Well exactly. And _ROM is not in device memory at all. It's offset is > wholly artificial. Isn't it? So wouldn't packing a zero sized one be > easier, going forward? > > I don't insist, I can code up the parser, just making sure you are sure > this is what you want. Maybe there's a gap that isn't clear; all regions are offsets into the device fd. All region offsets are arbitrary. We provide introspection via the region-info ioctl. The "push the problem to the user" solution here only works when each region is sufficiently large and evenly segmented that we can use fixed bits in the offset to determine the region handler. Aside from breaking existing semantics of regions with zero size, this breaks down when we want to densely pack regions and we need to know how much space each region requires to lay out the offset to region handler mappings. Therefore, we eventually need to do the same ROM image sizing internally, and an interim solution like this requires that the algorithm is compatible with whatever results the user got from their own algorithm previously. I don't want to support that. The ROM image walk internally to generate a cached size is really the same approach I've been endorsing since my v1 reply. Thanks, Alex