Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp502851rdb; Tue, 5 Dec 2023 11:07:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaF0094KSk9YefB6NOe8jIoFCJAZlRefNPS7NUF5PUgskhA+uGfjeJKSzM+QYYyoDt0bQU X-Received: by 2002:a05:6a00:1404:b0:6ce:2731:79f0 with SMTP id l4-20020a056a00140400b006ce273179f0mr1473608pfu.38.1701803221249; Tue, 05 Dec 2023 11:07:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701803221; cv=none; d=google.com; s=arc-20160816; b=B2iKScOE6xoNHwI9jGrCnXgrjqM9DBkDOBuNYk9dVDGEwfzFwOinrMKQNtkgUKGLoS piknrf80LqAJdL6zwbeiZlXZL0a0pd6LHI0VhTqjg6yTfB//XMzM/pX3lre3D1Dut9qt y1H7eCye8uWdWTjnmcdN9l5D/FqUnzyfmCfy9+e1agqqOAyboHuZZXA5uyL4epoi9hvH 5lRslLtnwley3FZHBcp7wudNexrIieuUsebyNfyI8npMnARFWLu1ZEgiWBoYbOUI99SZ u81qVKU1YEVVK6h8qjSjLGeEo5R/m1C5jeg2f3PdNo+qOaaSxqaI4ga16+Dv0JAip1wV U91w== 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=6ZLpNTvDIgNXs3LdhoSpe5Z6/I7o5nG7ZgWt4ERcFq8=; fh=+LuCcWRqhPQZProGK7ifgVBzlEPxI0vSfsAgIXPTXgM=; b=0K5Od/l8Jm+Q4w+vjWK41Tg3O6MY59jUuj0qrsmCQTyvPoK/OS6QKENX7piCt8C4Oy xbwwcs+4gw4gHZcrYBTJQgfxp0BJLOuoBW2y00uWMCgWZJjJjQa6hc5kdEvy1TSvOSDa w+wkPbD9E8ZUAmpkfVqLh47X33Fx3FjPeRB+Bdydq6QXwiltJDiyiqArTPwO2NR0RNfY +GmwERg3QpHmzVnp3cOr9NowOrFK2OSsIFqrBYLV22qgRRkObb7L5hHqKOHx2ebTNe1Q rYMB79Dzcu35EkoPtEQGdKHNl2/5YjW+QqPmu0DZOtWW9Scn4JNEzoO171od40q0tsVe kvNg== 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:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y6-20020a056a00180600b006cc23e358bcsi554093pfa.1.2023.12.05.11.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 11:07:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 2C0D58030985; Tue, 5 Dec 2023 11:06:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbjLETGj (ORCPT + 99 others); Tue, 5 Dec 2023 14:06:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231736AbjLESko (ORCPT ); Tue, 5 Dec 2023 13:40:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 037B61A1 for ; Tue, 5 Dec 2023 10:40:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FAB3C433C7; Tue, 5 Dec 2023 18:40:45 +0000 (UTC) Date: Tue, 5 Dec 2023 18:40:42 +0000 From: Catalin Marinas To: Marc Zyngier Cc: Jason Gunthorpe , 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, lpieralisi@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: <20231205033015.10044-1-ankita@nvidia.com> <86fs0hatt3.wl-maz@kernel.org> <20231205130517.GD2692119@nvidia.com> <20231205164318.GG2692119@nvidia.com> <86bkb4bn2v.wl-maz@kernel.org> <86a5qobkt8.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86a5qobkt8.wl-maz@kernel.org> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 11:06:49 -0800 (PST) On Tue, Dec 05, 2023 at 05:50:27PM +0000, Marc Zyngier wrote: > On Tue, 05 Dec 2023 17:33:01 +0000, > Catalin Marinas wrote: > > Ideally we should do this for vfio only but we don't have an easy > > way to convey this to KVM. > > But if we want to limit this to PCIe, we'll have to find out. The > initial proposal (a long while ago) had a flag conveying some > information, and I'd definitely feel more confident having something > like that. We can add a VM_PCI_IO in the high vma flags to be set by vfio_pci_core_mmap(), though it limits it to 64-bit architectures. KVM knows this is PCI and relaxes things a bit. It's not generic though if we need this later for something else. A question for Lorenzo: do these BARs appear in iomem_resource? We could search that up instead of a flag, something like the page_is_ram() helper. -- Catalin