Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2438030rdb; Mon, 12 Feb 2024 05:08:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMb3ujv09bw8Xfw9HoGG5o+WA1h61eXlJZ/1PDp51jbMN4Ndo2cCDOBnd/UJZlrOdodXwA X-Received: by 2002:aa7:d893:0:b0:560:c951:57ba with SMTP id u19-20020aa7d893000000b00560c95157bamr4957320edq.26.1707743296488; Mon, 12 Feb 2024 05:08:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707743296; cv=pass; d=google.com; s=arc-20160816; b=aVz8e17btzDtULRM4Vtw0EOnwzVJ/r7xHGCE/xYIToIZhnDFP73GiCvFzrEQ2K1rN6 PN7W5u/wyvNDoAo4j68jXotYGHKUWNOB65g0JSQBD/IuZJxMoyrmWB5L3GfSZHzd+Xee xu06sevJFYud60c5fH6UEbiZgLswRZmnBXVWQo+k6beli6N7AgcrhlY5mqjXh1W67wG0 XDVhl4FQsFSXF7L3w5f3+QflpkPlvgs66RBBhQqRrhGYP1iKrc1T6kYiORZM9Qldizv1 qffOQayscHuLze4eOiMV6M8HqR0RdSPXKmwU0GHdiebdAuod4UE19uo62gvUfyzZtd5b nqdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=WDWwBBM+E91ZU6bnMPP22WeGEpsgO4NhaElCMSoXp58=; fh=Vyz+NqZRd0kmkN8sZCpZhUYAzFeZ5Gt2g3nAM8QeExk=; b=I7lWNDJA7xc+C8bhcTFYPwu+wbW8gz9hInPFdKEX5D08a186YBaug1W8Ii1nNQYzOr 4xurGsxBHTtMH5hv6BN56RsbFoaEijKOCbXhXoT0EGpIzXic59PckWwv754LJwrTSLQE P+8OQ6fbKDWhhwI+68BGnBccRntFB/XCkZXJ67V7QZv/Nh+P2+XcW3M0Ek+0pFj6J0Lc jujFtxLpacGiMw4+bqKOzF09v3I16eRJ/zHlYfmk/62EJAp01o2qz9jFD6oPNL4uX1hS qKygG1EZ6Y38o/cnwbFTn+r0/ZH+QvUHYuZepvwC4iOFwbwKTnTaGpUswza/4fX+dPUU GCkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="cuAxuW/P"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-61599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCVDn/623/r4WrO8Bk4iLLA1B5DUeCRvkDIzVd8UJFTRttFPEpyxngni+JZX+Ucf++aNelYmv28vbk6TDHCktdEB6smwAnbwXwJsg6Unnw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id en20-20020a056402529400b0055f8efcea96si2750106edb.499.2024.02.12.05.08.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 05:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="cuAxuW/P"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-61599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B618F1F277EA for ; Mon, 12 Feb 2024 13:06:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4D283A1C8; Mon, 12 Feb 2024 13:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cuAxuW/P" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E21EE3A1AA for ; Mon, 12 Feb 2024 13:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743203; cv=none; b=M4kExIy0yPWmeQZXL1zDjGtwjN0xhXSfxwVOrpkGvpUSZWOKyCKWliyxb4gQilx1Diw1sfEPACqP2CjHJmXlm0ED9/w77qlheVMzy9BjZ/F+CBkXpPjbmfH/cUORTSEs++PJqd0xtHZYu/BzUAgBuX06ROayv3UP9/XEGQVUebA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743203; c=relaxed/simple; bh=wqNsTaiLJuLcjH0ji/72VXkl0tYbQK9jEQcZxwyUXn8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ACCSUKGjOxdfRmahbiE+B20u3JBGgO8gU4n5XNaE/CsPPrj89rP+NrgnnfUnIK+cCLMc2OdgcV49FWs3PnhspFKxaFlMO9Psc3zLrF/Lvl5vjYpfd4pyxPUJeDVYUn5SNkc4fuzAtf7HMt6cW5WZHPxCfMkX9/TZkk9+N/FLq8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cuAxuW/P; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707743201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=WDWwBBM+E91ZU6bnMPP22WeGEpsgO4NhaElCMSoXp58=; b=cuAxuW/PQ8xTSovhZZZRBs5fZsi9BwZ5NTRI/6csyNi/NDp7RrPPoeJ/Tz3A2XADm/9L4/ ar1/um0uN74Uf6cgr/YXZ0XY463aqPkXv5KZtZh1vCjP17rRqVYJyqhf5EMd3dT5DMCGwH zzlZHImXkCgI/Pxdm/Lw/EDIM+y9FeA= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-lzUhPn9FMESLa7Ue2roa6A-1; Mon, 12 Feb 2024 08:06:39 -0500 X-MC-Unique: lzUhPn9FMESLa7Ue2roa6A-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-51162d43c64so1612468e87.1 for ; Mon, 12 Feb 2024 05:06:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707743198; x=1708347998; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WDWwBBM+E91ZU6bnMPP22WeGEpsgO4NhaElCMSoXp58=; b=gpd5o5saR9Wu1vNHQnPvwbOk5Nd2VnVV5FkRQZXZNMINC9LmEKBBbQg0LVVoeUZ67W Jfr4dPxD98OhlsRq4s9OISZZL8moQC3jMz70BlXsz3Wea2mM/M9vOIy2uQzqfqMrcnWw oYqo8k70XGr4YQeGzqETQEw64u4OOpNbalKuvwjUM/zEKi/OFGQmP3nUO7mWZEKgVpQd DhwV6gzbyG0b8aty6DNNE/Gfu10THAVzXZAqeocSZoeDPCmA6Lu5RLoa8Bt/ay7dOfed 5k5Ff12CoqeC5mUzigwO3Zf1WywBPLFBbSunfLYdtOf1/KRJSINS9N9GNLeDJMDzAfrF CddA== X-Gm-Message-State: AOJu0YxLADa6h42qpJANrbyPF2AfnJQAKU+hQ9vj4o7gwmdcI7aYg60k v+M4yqbF74X4BWrdQYqWeZc45rLB0XE/c//e0vT3lgF5WKGi1Q3fiaMNaHFjMMlfmVQeoinud/5 KTe7rW5/VdSr3wTioWoUXWV6+xkMHlQjlKB695aGg0o+QRjTfwFjXxsNkiu3liA== X-Received: by 2002:ac2:484e:0:b0:511:82b5:b484 with SMTP id 14-20020ac2484e000000b0051182b5b484mr3671300lfy.64.1707743198002; Mon, 12 Feb 2024 05:06:38 -0800 (PST) X-Received: by 2002:ac2:484e:0:b0:511:82b5:b484 with SMTP id 14-20020ac2484e000000b0051182b5b484mr3671254lfy.64.1707743197527; Mon, 12 Feb 2024 05:06:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVXC8dM/g488xbOderX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m15OdeIheJPcqNj4x3yAtrIXcwl46Vd/Aqxy+tOLzx02FdOiPiqrALlh8gN7c0CuQBdNU9MMrQMTMC8BDjUbgK+3Q+HIdsVgFFmYhvzdlFUrv7NaWu0yT4hafOLsnnEQoZonKGeQjZsZsvCT457uNFhuE8WfZD0/rKQwSKH6k9FVEUxWmVNC3Zzuz+PpwBigCJCDwsn+yD2q1eiAmUgSmfQ== Received: from ?IPV6:2003:cb:c730:2200:7229:83b1:524e:283a? (p200300cbc7302200722983b1524e283a.dip0.t-ipconnect.de. [2003:cb:c730:2200:7229:83b1:524e:283a]) by smtp.gmail.com with ESMTPSA id k14-20020a056000004e00b0033afc81fc00sm6714883wrx.41.2024.02.12.05.06.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 05:06:37 -0800 (PST) Message-ID: <30493284-53f6-4172-a9e1-cb9052acced4@redhat.com> Date: Mon, 12 Feb 2024 14:06:35 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 0/4] kvm: arm64: allow the VM to select DEVICE_* and NORMAL_NC for IO memory Content-Language: en-US To: Jason Gunthorpe Cc: ankita@nvidia.com, maz@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, reinette.chatre@intel.com, surenb@google.com, stefanha@redhat.com, brauner@kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, alex.williamson@redhat.com, kevin.tian@intel.com, yi.l.liu@intel.com, ardb@kernel.org, akpm@linux-foundation.org, andreyknvl@gmail.com, wangjinchao@xfusion.com, gshan@redhat.com, shahuang@redhat.com, ricarkol@google.com, linux-mm@kvack.org, lpieralisi@kernel.org, rananta@google.com, ryan.roberts@arm.com, linus.walleij@linaro.org, bhe@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, kvmarm@lists.linux.dev, mochs@nvidia.com, zhiw@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240211174705.31992-1-ankita@nvidia.com> <20240212125654.GV10476@nvidia.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT7CwZgEEwEIAEICGwMGCwkIBwMCBhUIAgkKCwQW AgMBAh4BAheAAhkBFiEEG9nK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Ie90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <20240212125654.GV10476@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Jason, Thanks for all the details (some might be valuable to document in more detail, but I'm not that experienced with all of the mapping types on arm64, so it might "just be me"). > It is worse that some hand wavey "side effect". If you map memory with > NORMAL_NC (ie for write combining) then writel() doesn't work > correctly at all. > > The memory must be mapped according to which kernel APIs the actual > driver in the VM will use. writel() vs __iowrite64_copy(). > >> We can trigger both cases right now inside VMs, where we want the device >> driver to actually make the decision. > > Yes > >> (2) For a VM, that device driver lives inside the VM, for DPDK and friends, >> it lives in user space. They have this information. > > Yes > >> We only focus here on optimizing (fixing?) the mapping for VMs, DPDK is out >> of the picture. > > DPDK will be solved through some VFIO ioctl, we know how to do it, > just nobody has cared enough to do it. Good! > >> So we want to allow the VM to achieve a WC/NC mapping by using a >> relaxed (NC) mapping in stage-1. Whatever is set in stage-2 wins. > > Yes > >> >> (3) vfio knows whether using WC (and NC?) could be problematic, and must >> forbid it, if that is the case. There are cases where we could otherwise >> cause harm (bring down the host?). We must keep mapping the memory as >> DEVICE_nGnRE when in doubt. > > Yes, there is an unspecific fear that on ARM platforms using NORMAL_NC > in the wrong way can trigger a catastrophic error and kill the > host. There is no way to know if the platform has this bug, so the > agreement was to be conservative and only allow it for vfio-pci, based > on some specific details of how PCI has to be implemented and ARM > guidance on PCI integration.. > >> Now, what the new mmap() flag does is tell the world "using the wrong >> mapping type cannot bring down the host", and KVM uses that to use a >> different mapping type (NC) in stage-1 as setup by vfio in the user space >> page tables. > > The inverse meaning, we assume VMAs with the flag can bring down the > host, but yes. Got it, will have a closer look at the patch soon. > >> I was trying to find ways of avoiding a mmap() flag and was hoping that we >> could just use a PTE bit that does not have semantics in VM_PFNMAP mappings. >> Unfortunately, arm64 does not support uffd-wp, which I had in mind, so it's >> not that easy. > > Seems like a waste of a valuable PTE bit to me. It would rather have been "it's already unused there, so let's reuse it". But there was no such low-hanging gruit. > >> Further, I was wondering if there would be a way to let DPDK similarly >> benefit, because it looks like we are happily ignoring that (I was told they >> apply some hacks to work around that). > > dpdk doesn't need the VMA bit, we know how to solve it with vfio > ioctls, it is very straightforward. dpdk just does a ioctl & mmap and > VFIO will create a vma with pgprote_writecombine(). Completely > trivial, the only nasty bit is fitting this into the VFIO uAPI. That's what I thought. > >> (a) User space tells VFIO which parts of a BAR it would like to have mapped >> differently. For QEMU, this would mean, requesting a NC mapping for the >> whole BAR. For DPDK, it could mean requesting different types for parts of a >> BAR. > > We don't want to have have the memory mapped as NC in qemu. As I said > above if it is mapped NC then writel() doesn't work. We can't have > conflicting mappings that go toward NC when the right answer is > DEVICE. I was wondering who would trigger that, but as I read below it could be MMIO emulation. > > writel() on NC will malfunction. > > __iowrite64_copy() on DEVICE will be functionally correct but slower. > > The S2 mapping that KVM creates is special because it doesn't actually > map it once the VM kernel gets started. The VM kernel always supplies > a S1 table that sets the correct type. > > So if qemu has DEVICE, the S2 has NC and the VM's S1 has DEVICE then > the mapping is realiably made to be DEVICE. The hidden S2 doesn't > cause a problem. > >> That would mean, that we would map NC already in QEMU. I wonder if that >> could be a problem with read speculation, even if QEMU never really accesses >> that mmap'ed region. > > Also correct. > > Further, qemu may need to do emulation for MMIO in various cases and > the qemu logic for this requires a DEVICE mapping or the emulation > will malfunction. > > Using NC in qemu is off the table. Good, thanks for the details, all makes sense to me. -- Cheers, David / dhildenb