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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CD13C4167B for ; Thu, 7 Dec 2023 14:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HKGztagdbHcNdcKcN+4cRzo48VXu6XThTprwRtmFY4A=; b=spnuIal6IzUEcs e8Q52rSZ5ACPDfyJpfe9I+EZ4OH6lSHTJaY6t3GCs31XmsFEwIQWuC0K2/Hc0UHfgd05T9DIt+o51 8LPGbosKmlP9IDUsySabsHONEYwjtqE1FpYura7bzBif+i4kL36nF5ZvgPRg17N+n3yAd1zniDwBz k3lGVrUnygQclf1dW1iWpIAGIcIjtbwMiDEnWiLGAn7ZlLm3juH69M2sC1CjoS+zWBTdyZajcypMB wGlHBAGro4I7RKFZUuoBx7jHshrEE8VBtJu2Aqm9boEUxejHIrZjhGEEHlMZkAvRPDnawhBY9MUg/ kCS6jFdPGxg3fZgAsd5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBFhp-00D4Pa-0F; Thu, 07 Dec 2023 14:50:25 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBFhk-00D4Oc-38 for linux-arm-kernel@lists.infradead.org; Thu, 07 Dec 2023 14:50:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 2E486CE20F4; Thu, 7 Dec 2023 14:50:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE229C433C7; Thu, 7 Dec 2023 14:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701960618; bh=ROv4DFKKEEpLSUSHwElpbfywORQ7vxKS7FhooWQWgrQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bqx8dsk+Za2R5f1hFZYmCEE/Sr6KkS6eFsETYaOgAs8HGf8d4qq0Db067rEyGEyhs oBhIWAEOUkPpkMYxba0uDwXDsBqalS3CV0N0bMyvX+9yLhvnmeqlbrj8HK7AK00xjU J06J/tliIegHCiPwoyM/37M/haAxsZg5BfKgfpJkLku6PDZOcSIeVs2yMGerEpGy2D Afyghp+yZNbYb1q/itNfMTs13tWtBoFyYOeVHYpWe34GFO4w+ChTNfpEHeDcqgf5mG qCTiHuyaQbJEtAhT2mD0YT5DtG/hKn56Nt7WlSXRter5DFhQEhUE8sp5Svvkj81rcT 9vsdOFnxtKoDw== Date: Thu, 7 Dec 2023 15:50:09 +0100 From: Lorenzo Pieralisi To: Jason Gunthorpe Cc: Catalin Marinas , Marc Zyngier , ankita@nvidia.com, Shameerali Kolothum Thodi , oliver.upton@linux.dev, suzuki.poulose@arm.com, yuzenghui@huawei.com, will@kernel.org, ardb@kernel.org, akpm@linux-foundation.org, gshan@redhat.com, aniketa@nvidia.com, cjia@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com, vsethi@nvidia.com, acurrid@nvidia.com, apopple@nvidia.com, jhubbard@nvidia.com, danw@nvidia.com, mochs@nvidia.com, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/1] KVM: arm64: allow the VM to select DEVICE_* and NORMAL_NC for IO memory Message-ID: References: <20231205194822.GL2692119@nvidia.com> <20231206150556.GQ2692119@nvidia.com> <20231206153809.GS2692119@nvidia.com> <20231206164802.GT2692119@nvidia.com> <20231207133825.GI2692119@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231207133825.GI2692119@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231207_065021_351624_1B15247D X-CRM114-Status: GOOD ( 24.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 07, 2023 at 09:38:25AM -0400, Jason Gunthorpe wrote: > On Thu, Dec 07, 2023 at 11:13:52AM +0100, Lorenzo Pieralisi wrote: > > > > What about the other way around - would we have a prefetchable BAR that > > > > has portions which are unprefetchable? > > > > > > I would say possibly. > > > > > > Prefetch is a dead concept in PCIe, it was obsoleted in PCI-X about 20 > > > years ago. No PCIe system has ever done prefetch. > > > > > > There is a strong incentive to mark BAR's as prefetchable because it > > > allows 64 bit addressing in configurations with bridges. > > > > If by strong incentive you mean the "Additional guidance on the > > Prefetchable Bit in Memory Space BARs" in the PCI express specifications, > > I think it has been removed from the spec and the criteria that had to be > > met to implement it were basically impossible to fulfill on ARM systems, > > it did not make any sense in the first place. > > No, I mean many systems don't have room to accommodate large 32 bit > BARs and the only real way to make stuff work is to have a 64 bit BAR > by setting prefetchable. That's what the implementation note I mentioned referred to ;) > Given mis-marking a read-side-effect region as prefetchable has no > actual consequence on PCI-E I would not be surprised to learn people > have done this. PCIe specs 6.1, 7.5.1.2.1 "Base Address Registers" "A function is permitted to mark a range as prefetchable if there are no side effects on reads..." I don't think that an OS should use the prefetchable flag to infer anything (even though we do at the moment -> sysfs mappings, I know that the prefetchable concept is being scrapped from the PCI specs altogether for a reason), I don't see though how we can say that's a SW bug at present given what I quoted above. I'd agree that it is best not to use that flag for new code we are adding (because it will be deprecated soon). Thanks, Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel