Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp350435rdg; Thu, 12 Oct 2023 07:29:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWh5xe0BXuK5GVoFVuj9TFrteqnHKhd5jhMx31glhReXWfh7Jr/YLKEeiYEyEvciPRNJao X-Received: by 2002:a17:902:d716:b0:1c7:37e2:13e5 with SMTP id w22-20020a170902d71600b001c737e213e5mr20831163ply.21.1697120981110; Thu, 12 Oct 2023 07:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697120981; cv=none; d=google.com; s=arc-20160816; b=RPa5wXgH/t2sAt0fFfA/NkMdDowmLSUEhhpil4trP/fsxeOv5hq9JWyrSU0NtwhbRX wwK3dqJf6SHg5iW3MqMYepEA8W4tUmSQ3cJSYDRO6oXDFaVqAFgV+dwFT4s35BTtYrt3 gPXiB64XbGZeZ9EINQmdp668r5bDdnDt2WNmuApQqgbtzgw4aJoOupcwaHY9yVzQYGhY Nt8Dx9wCrkOCkBykKUKRSVuZc1k45Cnoh5cCf63zYcyKxIqzlekdFknbO/F5RU/5pVJe jX1r4tRcS/pZj5t0hYZTxgZdKQ9RwE7Ad9HCEfLF7Z0tbLHgDBbejeWgOkRBFs+V0VMK Y3tA== 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:dkim-signature; bh=6yb12itbl3CvKRye/7uF/6/ycHXbwIlD4ehaOWxaGc0=; fh=ZavoEYKrGMDbLHPMQzcwCa7B7Zv/rvczJi/LuvnLfPg=; b=YvGnDJ8mADh1MtrW0Z2aKR3PbLbwS5TR+km6nym3ugn8Nya7e5NNkKfT0ziA0fM+FR VhiPWr3CrZZo15EySeF7pjeHwZXPhYECy5BL/c/p0bPxhHaK+wB1YDZPSnbVfUjTLfnY dv6vjbKMupZvj0q8Eh4iyfZyZjWWvO9pn/xlGqahthIUJatbVkVr6taQbbnhjTDld+Bv ISYCZR613T26Vk4Ed6SMGjNQ0pBIp1UILEndb9Ch4xrDjfzalfDfTPKzmlZWiMWTiBR1 CVv5Pdd7niN9gc0lFdM8+afVbTVlxla7JhxDDAQZirPsvelfq3dKpJjceRjFlhIagLQx zHIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l7brKmqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j14-20020a170903024e00b001b84335fb90si2477100plh.286.2023.10.12.07.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 07:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l7brKmqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0AD70821693C; Thu, 12 Oct 2023 07:29:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343998AbjJLO3h (ORCPT + 99 others); Thu, 12 Oct 2023 10:29:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233710AbjJLO3g (ORCPT ); Thu, 12 Oct 2023 10:29:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B95EA9 for ; Thu, 12 Oct 2023 07:29:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD3C9C433C8; Thu, 12 Oct 2023 14:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697120974; bh=g4zyIMr785IdKOmshRe8BPkyHz7FSyWBu6onVRShE/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l7brKmqwuiCDHBI3q/3t8RCzt3QRcl9RdNkDp1eCzK+g5zfMjntqQzq5q6iKL26+m UMQ5piRnIaYeirKMnmJMQO1FPrmbkMRGkhVsNphxgtcOkKV55xQhZ5PuIhYcinwLf0 EhTGo+DNP4miSscxWPYC4UdGj9TSHe8DQ0V1rwwwk9/L+WBSJTa6rqolOpgQubPzVE sfZwfnll7r8W8rSamseuS7WZwN+jeAWq7v02owwtSVh1zXnbp+7I7ZFdPvuZbF4rw3 xpaDaaehGO7SPsbmVsUtAlJg+EpBj1QOXiRxnKuQThwvq5FVa2UUXlnsPfnz4kTp5g Tkqmzy5gtvj3Q== Date: Thu, 12 Oct 2023 16:29:26 +0200 From: Lorenzo Pieralisi To: Jason Gunthorpe Cc: Will Deacon , Catalin Marinas , ankita@nvidia.com, maz@kernel.org, oliver.upton@linux.dev, 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, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/2] KVM: arm64: allow the VM to select DEVICE_* and NORMAL_NC for IO memory Message-ID: References: <20230907181459.18145-3-ankita@nvidia.com> <20231012123541.GB11824@willie-the-truck> <20231012132045.GI3952@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012132045.GI3952@nvidia.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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]); Thu, 12 Oct 2023 07:29:40 -0700 (PDT) On Thu, Oct 12, 2023 at 10:20:45AM -0300, Jason Gunthorpe wrote: > On Thu, Oct 12, 2023 at 01:35:41PM +0100, Will Deacon wrote: > > > > Failures containability is a property of the platform > > > and is independent from the memory type used for MMIO > > > device memory mappings (ie DEVICE_nGnRE memory type is > > > even more problematic than NormalNC in terms of containability > > > since eg aborts triggered on loads cannot be made synchronous, > > > which make them harder to contain); this means that, > > > regardless of the combined stage1+stage2 mappings a > > > platform is safe if and only if device transactions cannot trigger > > > uncontained failures; reworded, the default KVM device > > > stage 2 memory attributes play no role in making device > > > assignment safer for a given platform and therefore can > > > be relaxed. > > > > > > For all these reasons, relax the KVM stage 2 device > > > memory attributes from DEVICE_nGnRE to NormalNC. > > > > The reasoning above suggests to me that this should probably just be > > Normal cacheable, as that is what actually allows the guest to control > > the attributes. So what is the rationale behind stopping at Normal-NC? > > I agree it would be very nice if the all the memory in the guest could > just be cachable and the guest could select everything. > > However, I think Lorenzo over stated the argument. > > The off-list discussion was focused on NormalNC for MMIO only. Nobody > raised the idea that cachable was safe from uncontained errors for > MMIO. True, it should be made clearer ie "independent from the non-cacheable/uncacheable memory type...", please update the log accordingly, forgive me the confusion I raised. Lorenzo > I'm looking through the conversations and I wouldn't jump to > concluding that "cachable MMIO" is safe from uncontained failures. > > Catalin has already raised a number of conerns in the other patch > about making actual "designed to be cachable memory" into KVM > cachable. > > Regards, > Jason