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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3919BC4829B for ; Mon, 12 Feb 2024 10:26:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B44B36B0074; Mon, 12 Feb 2024 05:26:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF4F56B0075; Mon, 12 Feb 2024 05:26:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 947336B0078; Mon, 12 Feb 2024 05:26:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7E6C26B0074 for ; Mon, 12 Feb 2024 05:26:21 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 550C48027D for ; Mon, 12 Feb 2024 10:26:21 +0000 (UTC) X-FDA: 81782772162.16.9DC4C0E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id EC4EB1C0008 for ; Mon, 12 Feb 2024 10:26:18 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OTMBsINB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707733579; h=from:from:sender: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:dkim-signature; bh=ajsmGt1bfpvDAI9sBo5jj02X8v7xaTXyEQzhR5XLbDM=; b=mBCf93vVf/INs5BJzoWa4GhsxAcTDB6HYvpj5KiR7MEgh2W69q2DL2PqYvT4ab0eE7KJV6 4t3BIEb6w+J6H/2LZ9hkRQX4uE+VQfXI3dXotE7iE8Yh3HfRcugoIIiVJhjK55nasSa5nA ZX85y9RS1wrypEYUoxNiOaygAOo6t9k= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OTMBsINB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707733579; a=rsa-sha256; cv=none; b=7m2YFNUbmRzG9xf7jWkB+ZeX/X7E/+H594HP78uYCFMZcJnLDqANvzKPrYykGhYTHc7ENI rBxDs7U2xrRPSqxgcqA3MFO6juvy561Skoss4lWbCVdiYYzemGzPzupV6gdDNFZKpZvd5n oPFBwmTkZK9iIUnBL2PbDoMgJdEWk2c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707733578; 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=ajsmGt1bfpvDAI9sBo5jj02X8v7xaTXyEQzhR5XLbDM=; b=OTMBsINBLrFPqQKATio2oh/1l6r3vThQwAckepCxcxqtJz+sghG1pCYTDf1XDZRLNH5mEi K3/ZbRCoNUbyJ8FHjrw3UowgF12EkfNGBTqjKT/wSvHueRCibaevKroAS5gh1SAFPNmMVy wL7rCI6pEZpDtB5siF8VAcNUFx2rN6k= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-SGpj9BwaPFWvmrOAr_DWyQ-1; Mon, 12 Feb 2024 05:26:16 -0500 X-MC-Unique: SGpj9BwaPFWvmrOAr_DWyQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40fe0858c05so18677355e9.1 for ; Mon, 12 Feb 2024 02:26:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707733576; x=1708338376; 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=ajsmGt1bfpvDAI9sBo5jj02X8v7xaTXyEQzhR5XLbDM=; b=pZiOmPudCXatF/EDNdLG77UtcBMAafcQ9J1EuOH1FurqxISZRRjvpaNdWZkyhrMRf7 H7sDjv+AKt7Ug3iiXGpX8k9PAlj8KW/nFyrtdC2IgyieFQqZBNggdwJudQczpbEfO+Kc JFLRwX3xNcLCj7JnFw33KzdFE54W9NTfg9H9ytmCG/dlD3KtDz4Nv3cC+F2KCAe0xmLG 2Oanr0hjvVsWsD2zLbDhrZN3vzmXrTwBbZTtu9tEoviulF7p6sdN7Z0qyjB/JxCSEHJY T14Aua/T4ANLYbIJzIeqDxfij/dtPw0su2BjwfGomLSgYFZiiNfU2jHddPFVJiFyrbM1 Srmg== X-Forwarded-Encrypted: i=1; AJvYcCWLvvDm+y/EcMW1jdFtTI0c45esQ+0CGzAofLr+hgDAM7XW2jF6317l9ZWsGJPCuJs4yVy6rH6PsLQ9EKvezlFs928= X-Gm-Message-State: AOJu0YzE1im2hYEmwu3mzycjX/TQGjQN2+9FekfXnfCeXXus7tvF0pj0 JjIaHYX+BJSNsxUdQwEBir9QV2tMwyNhmLxDBTDo2IPxg5lja44J5P5r0Dsn+Er/eQBDGC9+LA9 HYo1li2qgeQeO1C6hHS/cA9ECkTuYUdLn1Y4NT0bVWq2UyLKh X-Received: by 2002:a05:600c:1547:b0:410:c25d:38fe with SMTP id f7-20020a05600c154700b00410c25d38femr2340036wmg.28.1707733575641; Mon, 12 Feb 2024 02:26:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVD8DZA+W7q7BMDIBUU3MF2lO2KU7zAmuFrQYrgoMoZ6HW+m5qw6f8vnK6rVyl/q9ES5E3Nw== X-Received: by 2002:a05:600c:1547:b0:410:c25d:38fe with SMTP id f7-20020a05600c154700b00410c25d38femr2339995wmg.28.1707733575193; Mon, 12 Feb 2024 02:26:15 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX4gsbNkHRRqRmeaCnsyMXIotsiVg8FOGx+3lUiGBeU2q6YxqcVLPBsdJFC8G3G2qx1rxh00i5dYr6fj9YEK5zqrZuEpcfxmAxQ46gy8Q+B5E+a2GU0I+OFu0+r5kBSTuRBs20wyCgi1LXiZsn/6SmSOSkpZnhRgnllKfy+urzdhuQpFVA/BIjiShdbJhzo0Drtt3wH86j1Pp8RRXRc0UfHPxM71eiSbr3EY7+nlLAhXR2m8V6BZwKJrmTzilX3Afw/L1UJKjv0VOEt4MyqSE8hljrUMPmcryJBkGs51sHWaTCe5l0jjNnLTSUum3K+FI2BqPsqzctt4sl6FW0YfccXpvYOec6FoYlFflT1Ami3jWtwsxkXFTizPQEpoVZWEg1OASFtA830BpZB6qkw12j738pUTct/V82ZOliICzx1gvAhvrLbjtCE37RN6cLs6XZG5xhB03QMbAPcQArwZs6dUKvBL0bCZabxbVKcaGTIs4t34vn4CRpm/SzixoJcOAKXBduyQ1g8yWRI2QdBSzX6GtjgeQUSHRG19NyhIxvFZ/nzeIy6SecPDCZvxKSA+QXXkt68bHZfTl6beajEC3uB+qACmihudYp2FnvSmCHnUqqeu5HIWXl36JkzkrbLEVFxfYg/T3t5q809awy4nrDie2Gusi70eaFwofZOnZpkl4Y+lxGeb+BwsO7P6YZ2O0iCdfVBBdZzPaCdZjWqc/9us17tLXRS+0t3j3Wp3wapgsSNtPRMUsxn7Dxinv4xPajMWKnWLXwC6CRzDs+Lg4VMPYifyloEsPS2cMK/e2CKVzz+7rLwA00bblUPoHiGCIEHYV9JD3mYH7MVZfGHq6alr+hetrPnk92soENAxNlHW9+ISYQdGLK53Pjqn4MuIbyrmGz8J4bgl7WfsA3I3Mlqi8nw+Ex80BTB2byg7ZUG5OmSjXNLFOR9XlGCqB Vtys50br 4TO+Fs2wkaz0wz6ozhv9kHVheahIztFhA0uQQdrFTtkwuMV/nusxIMhuCnWZ/wLvoB0tDTEjhL2C0gIE+ENdCLK4P1zj0EY0PFGwDy30/vTgAcQf/ANyNt9xevrA3hPwSG0LDkYmiSkDXYwXhPTCZWm05Z0wposEib542tAOOoIiK7GubvwMLSN9fa7ByIMVPe9GIlaqbhC5PYOhB1dziPivbXlPwuUECUZT8dd57WK00Fl+HmH1IQJ/wFYugJNT59S5QPSopt+6PvFsgpcwevf57u3BE577aB55MKZrwfsA9OMNL6+Vp1Bd3C0jW14ajFbflLWD8k2BV5 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 js26-20020a05600c565a00b0040fe3147babsm8164556wmb.0.2024.02.12.02.26.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 02:26:14 -0800 (PST) Message-ID: Date: Mon, 12 Feb 2024 11:26:12 +0100 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 To: ankita@nvidia.com, jgg@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 Cc: 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> 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/pT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3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <20240211174705.31992-1-ankita@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: EC4EB1C0008 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 9zzdt5pjdphdke9yiwpx598mm61s868a X-HE-Tag: 1707733578-400996 X-HE-Meta: U2FsdGVkX18+HADoqLtYI9+IUxRASQU5W4fYpNyiLyYkwX95YBoBXD3w37r3oE4H6bW/trz2bIRuOsvtOa8VYYEmqSTScogwL9EOLR39ZO2977bI/D/VTvPOrVPJNZBzCCzSpVQrPoFNG8SxCdYTGaJNOHUrRhejq8+WI8PdcYJoV+pCHup4kuK/vqCfjDzfMxNWtrpFKMaJmiGV68eP9qPG8u09FYmAnaSw9mdrf/W2KFeuDJ3y6bXUbSE14oOq+55+sY8DFAFPy+tdzT9L7LaOWGKKaW/N8woeX6KIr8OapkYy4LzdiDEYgUzL9mBo7MoyLmJK6+WA7SFUF2PhvT/q+Oknr50eWS+FOrhy1hqFUaL/8UpNj5Op4WRN1pExIJjfEPMPPHW07pgUKX/SdzrQCGvv6Fhf4d6LKd3be6P+Y1iCfuQSGrvE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, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 11.02.24 18:47, ankita@nvidia.com wrote: > From: Ankit Agrawal > Hi, > Currently, KVM for ARM64 maps at stage 2 memory that is considered device > with DEVICE_nGnRE memory attributes; this setting overrides (per > ARM architecture [1]) any device MMIO mapping present at stage 1, > resulting in a set-up whereby a guest operating system cannot > determine device MMIO mapping memory attributes on its own but > it is always overridden by the KVM stage 2 default. > > This set-up does not allow guest operating systems to select device > memory attributes independently from KVM stage-2 mappings > (refer to [1], "Combining stage 1 and stage 2 memory type attributes"), > which turns out to be an issue in that guest operating systems > (e.g. Linux) may request to map devices MMIO regions with memory > attributes that guarantee better performance (e.g. gathering > attribute - that for some devices can generate larger PCIe memory > writes TLPs) and specific operations (e.g. unaligned transactions) > such as the NormalNC memory type. > > The default device stage 2 mapping was chosen in KVM for ARM64 since > it was considered safer (i.e. it would not allow guests to trigger > uncontained failures ultimately crashing the machine) but this > turned out to be asynchronous (SError) defeating the purpose. > > For these reasons, relax the KVM stage 2 device memory attributes > from DEVICE_nGnRE to Normal-NC. > > Generalizing to other devices may be problematic, however. E.g. > GICv2 VCPU interface, which is effectively a shared peripheral, can > allow a guest to affect another guest's interrupt distribution. Hence > limit the change to VFIO PCI as caution. This is achieved by > making the VFIO PCI core module set a flag that is tested by KVM > to activate the code. This could be extended to other devices in > the future once that is deemed safe. I still have to digest some of the stuff I learned about this issue, please bear with me :) (1) PCI BARs might contain mixtures of RAM and MMIO, the exact locations/semantics within a BAR are only really known to the actual device driver. We must not unconditionally map PFNs "the wrong way", because it can have undesired side effects. Side effects might include read-speculation, that can be very problematic with MMIO regions. The safe way (for the host) is DEVICE_nGnRE. But that is actually problematic for performance (where we want WC?) and unaligned accesses (where we want NC?). We can trigger both cases right now inside VMs, where we want the device driver to actually make the decision. (2) For a VM, that device driver lives inside the VM, for DPDK and friends, it lives in user space. They have this information. We only focus here on optimizing (fixing?) the mapping for VMs, DPDK is out of the picture. 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. (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. 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. 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. 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). In essence, user space knows how it will consume that memory: QEMU wants to mmap() it only to get it into stage-1 and not access it via the user page tables. DPDK wants to mmap() it to actually access it from user space. So I am curious, is the following problematic, and why: (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. (b) VFIO decides if it is safe to use a relaxed mapping. If in doubt, it falls back to existing (legacy) handling -- DEVICE_nGnRE. (c) KVM simply uses the existing mapping type instead of diverging from the one in the user space mapping. 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. Something like that would of course require user space changes. Handling it without such changes (ignoring DPDK of course) would require some information exchange between KVM and vfio, like the mmap flag proposed. -- Cheers, David / dhildenb