Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2673689rdb; Mon, 12 Feb 2024 12:25:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKZTxkatENmLJh42+uH6r0kHEarydV+BoKEYuKyuezWdLPgkwdx9P2CkBLhqbguBPtYMd8+0EiGnOKYhjeoP1k968Jtp5pOtgG/9WmVQ== X-Google-Smtp-Source: AGHT+IFymr2peSE1WIZDKe3GFTjjydHG1mhnyCOChpxUNOONmuZJFKJRXq7AM4h0utkX+QK1P+sD X-Received: by 2002:a17:902:cecb:b0:1d9:90d6:bed3 with SMTP id d11-20020a170902cecb00b001d990d6bed3mr10296527plg.43.1707769523161; Mon, 12 Feb 2024 12:25:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707769523; cv=pass; d=google.com; s=arc-20160816; b=dQ+IaCGVFLGo5KlJfejcF/S9d5Oiyo6FYuzICL4+DjEG8MzlxLOPjkkpSjnHhoTH+g AdxjVzb+Z3gtvLQkUDJWi/se1tIXZy+DBdYr0zPHD8cvk/BrP5T5aGr4CwgCLF+K0+P6 AD/DWk/bltZddUo2w8qnKUoUWI380oifri0e74H8oFROZbhX+vRcIYwvJLJfJKussF17 bXFZe664svLCEYF23AZXYW4hxkdD+YYT9ZroC21wkKXaISxmOSuF1bFxkV2tMID9Xzc5 CDhMYIx3L+PulhmdMd1IKtEI4BK5vWFBhReLPhiU8fqPT+uR6xGEkFtdfGUe55Kmwwbe lmWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=i4xg3mWKHsd+1fYsNi4Rtxp1tHHU5nJ+XHR6qN8at3A=; fh=3t8L+4bbIrNpMdfrElwysBVvxKIZr1rMskcXauiDMVg=; b=bmImnhUO781ZwmNGO7KupUcCMTXVDss1F/1XU7d5LT9UdBMZmQ4prWOVT4yaRCcVpB CayHRhSqT6h0ldUYWD8JEZVyg4xG21HtkWYNrWSWl7P/NiJb7xmbaHOmYZJ7tSqCD58f 2QppOzmyHU/MB3g7SswYTiJawpsz+c5kn2kVEh9d/iszJsOyFK38ZbyVSTyILN0hqZvz dNXj8WJbLde1CnFXpAZe58DL7vkRvjO72CAaR/VC2bZV2it7n1ghrS4yobbjWqeJA0dH ndkvjt3va1N+GOaBsE+EkYn1CcKEtqvugomvq8wNq6Gs6tufVQ2sZ90vKopwyajQMpZK h17w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=huo7uteC; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-62331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=2; AJvYcCXRaxfUM1mAq0PW9BaS/BPyHzVTmMBCuQpOtrWf/Xw7B7U0VdlxBlgad8EJpOiGkhFfkY/1MtVjr6pejOqvdiTYoD7MbeE99tBx2+T8Ow== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e12-20020a170902b78c00b001d9ec0d7560si711684pls.28.2024.02.12.12.25.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:25:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=huo7uteC; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-62331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 09C5A283C9A for ; Mon, 12 Feb 2024 20:25:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBF34487B0; Mon, 12 Feb 2024 20:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="huo7uteC" Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 50B2B482C5 for ; Mon, 12 Feb 2024 20:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707769490; cv=none; b=q+O2zuwO9bNoqqziMH3Nvi5B9lUeehHEKfYlNXhJDzX8iDSIH1xNRlIv0OB589NqKEZf99mqz6aLVSJrafX/XriIkHlZ7DHlm7qlYAlYGIJGCci/q5RNySpQb9EMBwLypE0PBRV9FZwDcR9vJH9gGmsylyutjzq4194Xsa64qt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707769490; c=relaxed/simple; bh=EW1iwgQRXKT66+pbcKRYd+o9vCcGD15QbpagYfyY78A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y8AwQ8IgEFRRR7tYcyYRWlPSYXDnBfHdfVgAvpVXBZ4ZzPGsbvBbXe6f5kFlqk1RAMJWeSfIWF3pBQBE8VT6A1/59Ncaj/JG6bzWBqZ5MOHSKE6HQku9eF3lCaYkCKiMKlegl93ERGsTqHw62RYJEQjZUuQwlI3xKYqtw7HvN5U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=huo7uteC; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 12 Feb 2024 20:24:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707769486; 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: in-reply-to:in-reply-to:references:references; bh=i4xg3mWKHsd+1fYsNi4Rtxp1tHHU5nJ+XHR6qN8at3A=; b=huo7uteCfELHBo8TMxLabpBxYmnmzdwnN/sLcsP79jePf7Mc8c3/ILRzwhsJOrGHEPkbR0 Lfz4a2Uc0mYAV80Yt4bS38aTzrhDI9TTjC4BCAus3jHCiReJKZ0qQEjMGD5T2Uq1fuQlKc MJLrzegOaL66bjag9WKDbaF9pWlQRPY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: ankita@nvidia.com Cc: jgg@nvidia.com, maz@kernel.org, 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, david@redhat.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 Subject: Re: [PATCH v7 0/4] kvm: arm64: allow the VM to select DEVICE_* and NORMAL_NC for IO memory Message-ID: References: <20240211174705.31992-1-ankita@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240211174705.31992-1-ankita@nvidia.com> X-Migadu-Flow: FLOW_OUT On Sun, Feb 11, 2024 at 11:17:01PM +0530, ankita@nvidia.com wrote: > From: Ankit Agrawal > > 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. Hi Ankit, Thanks for being responsive in respinning the series according to the feedback. I think we're pretty close here, but it'd be good to address the comment / changelog feedback as well. Can you respin this once more? Hopefully we can get this stuff soaking in -next thereafter. -- Thanks, Oliver