Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2447573rdb; Mon, 12 Feb 2024 05:26:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUdjRrqAUm15loaCV+Fi7xCWvj9MuFGdFfElVY4eNwsKcJctv7wFAo1UqW0a9I6Osf/4m1 X-Received: by 2002:a05:6a20:d497:b0:19e:a1ae:7a95 with SMTP id im23-20020a056a20d49700b0019ea1ae7a95mr5364989pzb.47.1707744367434; Mon, 12 Feb 2024 05:26:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707744367; cv=pass; d=google.com; s=arc-20160816; b=hM8l1Y0d+l5ajwhc2t3ihziuR87vJ6jrSlEvEdPMS1oDMoHObkRv/TLc4+YNGaOaZl DTEZCCZAGtd274u4ONcPxWNCHKiai0oMl6ptiWVLCh1Ci5meiiKncGF9dddq+WWMFJD4 jK8+jUI3xI8DnE1aqAPFfIETGUCeoefbDcyU2wMswjnJyRFLetHkqafHGcygXAQcpjQ7 vMrQOJyOr2p9WUDI/0Yqp37I7XVelmlm4WEwFYPyrBEJoD8kMaQwjFaG7zCtNbguhPJC ABRtQL8qwFcA8H4TINcuZlrEDPLeaxly5utqfr6bqTya4awDdBbh77a4pThi7cm58nLF nzoQ== 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=Hww63RycILkhWmUV7kV9IBG+ru1x1IcPxqyllH9PLOo=; fh=6eNPybCP3NiK2jRwofxVqiDLfU/dv8luneug1luYQ9k=; b=G69twA9/HntRHRONbvTVj3i+Qsw/TK+X7sngiSbNIIl+XN68y1eyshF0hoz99lWVA2 FFZTaqxi0ev/4gWfhCzXG/Zhd3MjsOBGrMYUVqKErMCCrlCifMhH60Qx1mf9yostVWCp +BJ4Rt0/WRCA0gcMR2rHaztfVAlI1Cqj/Q6P6fs8fcGdc8JyzgyDIJUQgC5vNZlzLOlT tSPCCeCp0PNVK/y4ZHrcroojRMBr3EkFMRGOiu0TJYDbNq/wNOhjAwXFlYwvo9e4wJzb ZrDf8AfYmDESQDYwqg/riNptK1SO6P1iZk5xvOK3UKOmsyoyGdF28LYAQA3QkwOqF+JC jqaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NtvMES3J; 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-61613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61613-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; AJvYcCWiCYZiNkt2zy+oO8vfAecuIFR9r7s+73J0iROR/UhZeyTTrG03xwiFjEkJmX7NaQo3bG5zQEfYQy6ax8yAiGVY9I58VAsSiUNbE/y6xg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n3-20020aa79843000000b006e04716e436si5007713pfq.216.2024.02.12.05.26.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 05:26:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NtvMES3J; 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-61613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61613-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 841ADB234BD for ; Mon, 12 Feb 2024 13:13:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10F9C3A1BC; Mon, 12 Feb 2024 13:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NtvMES3J" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 31DA63A1C4 for ; Mon, 12 Feb 2024 13:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743592; cv=none; b=mhvgnB4ogQy9yZmXZf322oXdikyn8p3tFzMsfPD/Hoiirm9uGYuRiPmhsBONTjiWjmyZXEBoAUfjCFGxlMR5x5uS8nzFSdQ/6V1EpvEEnwkVpVCFHW5Glt91co0bkZxchonX2IwVEpjI5lEn4iEWmcF0qvbrFNWnJ3IqcJQvEfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743592; c=relaxed/simple; bh=VGqK2EXbpd35gsVz1xmG61zXP49yz5ANJzMkWNNw1mQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j/WP8ZINL7TPsk3NHb2dXsZid60AyvdQgfArT9VAreF8IeSIQRNh3k307wbF22czMKnNotGnfZ1SVEaVIwi1iktMAM5VQFaYTV9E6VjLl4TOo00vkPRkSK4+BoIL3Yk+gKCBUJHuQ0cQwk3kzJ/tdN9QcEUioQLaaoG3scZt3vM= 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=NtvMES3J; arc=none smtp.client-ip=170.10.129.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=1707743590; 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=Hww63RycILkhWmUV7kV9IBG+ru1x1IcPxqyllH9PLOo=; b=NtvMES3JDRz+gOZrytBvubZ/ImWAIzdiNH4fUMRP702TYpgmvrexrdC22dVZ4EePkpEnII B5zYrhAqES7qIW9HOow66bXolaXz9xEjBlUXlM23LDYDtp13Wp3Roo0o6qmvqB2r4eq3BD u4KjjQ6K22BwgmcGrT/1gR5JCdT3rSw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-495-cn3LjGIWNOur0P8gVGcukw-1; Mon, 12 Feb 2024 08:13:08 -0500 X-MC-Unique: cn3LjGIWNOur0P8gVGcukw-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-33b26d4294dso1392171f8f.0 for ; Mon, 12 Feb 2024 05:13:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707743587; x=1708348387; 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=Hww63RycILkhWmUV7kV9IBG+ru1x1IcPxqyllH9PLOo=; b=ZI1wVAu19pJZ7nomD6QE8qi/uqXNEtA2VPmzRwBOJA0yslt5aTFWUC7N+5cVWMoaFS s8lK4SnyNvSjI53Ts/sAtxcYU/IA6raUY3sExDQgByrqdZCe3GK4KmOzAAikPabVImFm Hf+yX3AJPXfIw9elMfw7dmynVBhABCvmLdHc4dhgcBUero1W3Ei5CvxJMJAmql6+RYf4 XURjh27YTlAGDXpVcHyuG5GJ7+nDMSKbE9eix7xAY7jhkZu26zB43owTPWbdI2AyfIDt BlG184nluprDt8G8HmduwGjTFHqYMA2RH4cN/WxjiPk5FmPF2bl6cx9/imThGuAw9vcK wGbA== X-Gm-Message-State: AOJu0YypyP8exfqE3ZrwJe25E7yVhcTNedaPkqWmtU8LI39wDr+mHmEU kIRTOGHR7dEjKmQLZznoF45kRCEYMgVgCVK2+/9gegeISMX0mq0RHpFZ8XVGSfRXiYNLTD/IfwO zuZV8agK5KCOngOpzEG6BtgTv7RXNt4NwosER3KM0ykvPAwXze8bD9MtRcM/5Xw== X-Received: by 2002:a5d:6486:0:b0:33b:2300:9cdc with SMTP id o6-20020a5d6486000000b0033b23009cdcmr7236138wri.46.1707743587353; Mon, 12 Feb 2024 05:13:07 -0800 (PST) X-Received: by 2002:a5d:6486:0:b0:33b:2300:9cdc with SMTP id o6-20020a5d6486000000b0033b23009cdcmr7236087wri.46.1707743586951; Mon, 12 Feb 2024 05:13:06 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWWeeld+7JwdNTQDsO0jkryY+u3yAmckhW5SgRfY+5fV0ldQLhXXhSGIBvW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PBfnctsJ5+KPMRBg+dlHvtAfRzm7TXFDOfiJd+Luhuksi21pxTg2vINRJheJIiGsbdMMYI9/ACXKt7i4+gB8H8st97ckVnIGfalVW/sWoJWe88CbAu5yy0wkW3eyV1EAf4W+IBe4Y6m83uKzJWFOhK4vYhveT/wkym+/0Eelze0DHYINSgRdvq8jojh 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 x8-20020a5d6508000000b0033b1b01e4fcsm6805291wru.96.2024.02.12.05.13.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 05:13:06 -0800 (PST) Message-ID: <165363ba-d6cc-47a7-ab2a-d3a27a42f739@redhat.com> Date: Mon, 12 Feb 2024 14:13:04 +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 2/4] mm: introduce new flag to indicate wc safe Content-Language: en-US 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> <20240211174705.31992-3-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/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT7CwZgEEwEIAEICGwMGCwkIBwMCBhUIAgkKCwQW AgMBAh4BAheAAhkBFiEEG9nKrXNcTDpGDfzKTd4Q9wD/g1oFAl8Ox4kFCRKpKXgACgkQT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NPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <20240211174705.31992-3-ankita@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11.02.24 18:47, ankita@nvidia.com wrote: > From: Ankit Agrawal > > Generalizing S2 setting from DEVICE_nGnRE to NormalNc for non PCI > devices may be problematic. E.g. GICv2 vCPU interface, which is > effectively a shared peripheral, can allow a guest to affect another > guest's interrupt distribution. The issue may be solved by limiting > the relaxation to mappings that have a user VMA. Still there is > insufficient information and uncertainity in the behavior of s/uncertainity/uncertainty/ > non PCI drivers. > > Add a new flag VM_ALLOW_ANY_UNCACHED to indicate KVM that the device > is WC capable and these S2 changes can be extended to it. KVM can use > this flag to activate the code. > MM people will stumble only over this commit at some point, looking for details. It might make sense to add a bit more details on the underlying problem (user space tables vs. stage-1 vs. stage-2) and why we want to have a different mapping in user space compared to stage-1. Then, describe that the VMA flag was found to be the simplest and cleanest way to communicate this information from VFIO to KVM. > Suggested-by: Catalin Marinas > Reviewed-by: Jason Gunthorpe > Signed-off-by: Ankit Agrawal > --- > include/linux/mm.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index f5a97dec5169..59576e56c58b 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -391,6 +391,20 @@ extern unsigned int kobjsize(const void *objp); > # define VM_UFFD_MINOR VM_NONE > #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ > > +/* > + * This flag is used to connect VFIO to arch specific KVM code. It > + * indicates that the memory under this VMA is safe for use with any > + * non-cachable memory type inside KVM. Some VFIO devices, on some > + * platforms, are thought to be unsafe and can cause machine crashes > + * if KVM does not lock down the memory type. > + */ > +#ifdef CONFIG_64BIT > +#define VM_ALLOW_ANY_UNCACHED_BIT 39 > +#define VM_ALLOW_ANY_UNCACHED BIT(VM_ALLOW_ANY_UNCACHED_BIT) > +#else > +#define VM_ALLOW_ANY_UNCACHED VM_NONE > +#endif > + > /* Bits set in the VMA until the stack is in its final location */ > #define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY) > It's not perfect (very VFIO <-> KVM specific right now, VMA flags feel a bit wrong), but it certainly easier and cleaner than any alternatives I could think of. Acked-by: David Hildenbrand -- Cheers, David / dhildenb