From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A1941CEEB6 for ; Mon, 13 Jan 2025 23:29:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736810968; cv=none; b=ahZ4tGs/+lheDDXFSzJ9DS+ZSZRH48S7cOU7JzZfpmOCWuKYez3Rm28Zj8FzZJrY8gPJ1Fx9ZgOgHYHkOHI/5k+nKH0FfLDPqWin5h7tpyU1SC9COSQFBi3lHbPYJUhBwFHWF7xGG7LA1NZwRCsAeUUbJd1U+ObVZFjEET9xDtI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736810968; c=relaxed/simple; bh=AYgvKjxUUMQocZwtApGtSj7HO+lGgOyrLK+q7G5z7Fs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=D2KRg4yFSmYLRXexhegMIxHadSAufWLmyC86DPh5LDrwjwLtEQQU+kAGvbXXsgfQAqI12Bk5h/hQkZO8utCuD5iftSUP6iZMyttCUPYLo/Fej8k1FVVFsOcSHcpkUFj5A3F50kAYhjMizCzVRy+a3rRetRfC+Cmjxrb66IAZcac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y1KfpmFD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y1KfpmFD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4AB5C4CEE2; Mon, 13 Jan 2025 23:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736810968; bh=AYgvKjxUUMQocZwtApGtSj7HO+lGgOyrLK+q7G5z7Fs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Y1KfpmFD1JgQ52ESL70pewXErRFdGFRomAb+pZFVELWj2LfL9Msq/2+bDJM/YLNFZ BU62SVewks/Oi1WbmzmMHGXpsiCJK08ishrNbJeBiWJeGV+GhTtWdVWCtkB95SwKau qtamJHT0B79ISmPKJSSi/kTgTNcB9bnqX2ojMa9xAuT+31s0Z/41VJ9BZq4G3CU1tb hsGeIbhrK3YJJpo9SjhvzJ7EmlcnbLVRwLhVxVEy/sTdBD8PuoDYaxKIUjH7YCQHtc 8/51xEwNPZgI8cXIA5l6dHTNShxGCjYtuH2tnDo8nlQJUxq54kdFbEzz0CyZ4GHSz9 1J8ZNfHF02kqQ== Date: Mon, 13 Jan 2025 17:29:26 -0600 From: Bjorn Helgaas To: Roger Pau =?utf-8?B?TW9ubsOp?= Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko Subject: Re: [PATCH 1/3] xen/pci: do not register devices outside of PCI segment scope Message-ID: <20250113232926.GA442589@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jan 13, 2025 at 11:18:57AM +0100, Roger Pau Monné wrote: > On Fri, Jan 10, 2025 at 04:21:29PM -0600, Bjorn Helgaas wrote: > > On Fri, Jan 10, 2025 at 03:01:48PM +0100, Roger Pau Monne wrote: > > > The PCI segment value is limited to 16 bits, however there are buses like VMD > > > that fake being part of the PCI topology by adding segment with a number > > > outside the scope of the PCI firmware specification range (>= 0x10000). The > > > MCFG ACPI Table "PCI Segment Group Number" field is defined as having a 16 bit > > > width. > > > > > > Attempting to register or manage those devices with Xen would result in errors > > > at best, or overlaps with existing devices living on the truncated equivalent > > > segment values. > > > > The ACPI _SEG method (ACPI r6.5, sec 6.5.6) and the corresponding > > value in the MCFG table (PCI Firmware r3.3, sec 4.1.2) are clearly > > 16-bit values. > > > > But otherwise, the segment value is pretty much an arbitrary software > > value, and the kernel works fine with the larger domain values from > > vmd_find_free_domain(), so this isn't quite enough to explain what the > > issue with Xen is. > > > > Does Xen truncate the domain to 16 bits or use it to look up something > > in ACPI? > > In the interface between Xen and Linux the segment field is 16 bit > width, so with the current interface is not possible to reference > devices that are past the 0xffff segment. I think this specific reason (and maybe even struct physdev_pci_device_add) would be more useful than the ACPI _SEG and MCFG things, which are not as directly connected here. Bjorn