Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1093462rdb; Wed, 6 Dec 2023 08:23:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTuoy44dT4ChGCZkEixqg2m/0aIPTBouesoTRha31TD1R8DJ+wnxWArXW9mHmW1lO81SHv X-Received: by 2002:a05:6a20:7350:b0:18f:c339:3fd9 with SMTP id v16-20020a056a20735000b0018fc3393fd9mr675597pzc.73.1701879826846; Wed, 06 Dec 2023 08:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701879826; cv=none; d=google.com; s=arc-20160816; b=YKDjVmf6UVQwXBDRciCTs7CyZ4GUpi06iMMYwOz17fI/V4Xfca0zXiW/WrQ3wX/Nss vXjtSrkzN+IIazANmr0P4zxENpJ8eBFjnIF0OCkrOQN/xB82reK3PGun8oXBkDHfzGUH aZnYm2KPtDyaXOb1qtNpeDAes+Ler0EXZudx82N8r1DF9/F3ciP3qLI5ZC53H3Z5XtM8 UqoC/iYrkCUXh455xKvoukCsCXOZKRdYysQBgbhBYLpUcYb0fclHfyzNYITO+Qa6tnU3 5md9V2xKcLKOUiFePn5i56E9yk+GIXH66rLREVbOVnegORxJPkgVYC85s6ZYn3NVsYDo PdOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=9S4Kdd3iwnd7jFZiYa4hJbH022WopXSk8L8vZx0TDhg=; fh=dXgAxBb+VwwXSjxEG+5b7zD6RCDA/87fp2PLkuwfj0k=; b=OV4U7lFCcFgaiKtuMvX6FBQxEUKvN+ArCGRAcx9vPgqoBcSTxfsIaB4VwppoIF4pFA E4IgPnQ13G58QYnREBO4qs7zy+M5DYRatt/S21vXsNcHf/WC0tY/hFeme/8k50NSy/mi 6/sIKIw3gAUJmTvbN5asIDZGzLiJUA7hbG3T5H5+FFbdMb0XA2xKUkdGJUAQpXgWvP8s bb0iFqMoVP7ixpfOBBtFYAmBOkwXoi4X7Gb09nIbI/C9jpF41mwkSiTw4nxPU+QzJDyX TUH17ylI6zqVXWZua8YVk3ypuuGuGBCe04PLdZNmvmUf9Dq22D7e+crqL83loHAsFlCF 5tcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id j4-20020a654304000000b005c67bf38064si126049pgq.354.2023.12.06.08.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 08:23:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 21523833F8F8; Wed, 6 Dec 2023 08:23:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379267AbjLFQX0 (ORCPT + 99 others); Wed, 6 Dec 2023 11:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379155AbjLFQXZ (ORCPT ); Wed, 6 Dec 2023 11:23:25 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E97C12F for ; Wed, 6 Dec 2023 08:23:32 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4457C433C8; Wed, 6 Dec 2023 16:23:27 +0000 (UTC) Date: Wed, 6 Dec 2023 16:23:25 +0000 From: Catalin Marinas To: Jason Gunthorpe Cc: Lorenzo Pieralisi , 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: <20231205130517.GD2692119@nvidia.com> <20231205164318.GG2692119@nvidia.com> <20231205194822.GL2692119@nvidia.com> <20231206150556.GQ2692119@nvidia.com> <20231206153809.GS2692119@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231206153809.GS2692119@nvidia.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 06 Dec 2023 08:23:44 -0800 (PST) On Wed, Dec 06, 2023 at 11:38:09AM -0400, Jason Gunthorpe wrote: > On Wed, Dec 06, 2023 at 04:18:05PM +0100, Lorenzo Pieralisi wrote: > > On Wed, Dec 06, 2023 at 11:05:56AM -0400, Jason Gunthorpe wrote: > > > On Wed, Dec 06, 2023 at 02:49:02PM +0000, Catalin Marinas wrote: > > > > BTW, on those Mellanox devices that require different attributes within > > > > a BAR, do they have a problem with speculative reads causing > > > > side-effects? > > > > > > Yes. We definitely have had that problem in the past on older > > > devices. VFIO must map the BAR using pgprot_device/noncached() into > > > the VMM, no other choice is functionally OK. > > > > Were those BARs tagged as prefetchable or non-prefetchable ? I assume the > > latter but please let me know if I am guessing wrong. > > I don't know it was quite old HW. Probably. > > Just because a BAR is not marked as prefetchable doesn't mean that the > device can't use NORMAL_NC on subsets of it. What about the other way around - would we have a prefetchable BAR that has portions which are unprefetchable? -- Catalin