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 2E2AEC4829E for ; Mon, 12 Feb 2024 20:24:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA1F56B0083; Mon, 12 Feb 2024 15:24:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B81796B0093; Mon, 12 Feb 2024 15:24:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FBF16B0092; Mon, 12 Feb 2024 15:24:50 -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 905DC6B007D for ; Mon, 12 Feb 2024 15:24:50 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 66DCA80359 for ; Mon, 12 Feb 2024 20:24:50 +0000 (UTC) X-FDA: 81784280340.07.1ECB97C Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by imf29.hostedemail.com (Postfix) with ESMTP id 74C2A120019 for ; Mon, 12 Feb 2024 20:24:48 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=huo7uteC; spf=pass (imf29.hostedemail.com: domain of oliver.upton@linux.dev designates 95.215.58.182 as permitted sender) smtp.mailfrom=oliver.upton@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707769488; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=i4xg3mWKHsd+1fYsNi4Rtxp1tHHU5nJ+XHR6qN8at3A=; b=UlMgCvYnJgGrfLIjq3UDf2qHEwbwgrfDAkatlCHvB5FvzNBMqmdX8VHPjUK32q2inY0ORw xQ9s4nLfzWHcDIwmgfO9Dlk8IYONUWET1M+XkGnVJGtcGoMgmPvktfcsicU6jG2gLMBzoj JtvxnYcqHLJdaf6i3Uh5ulpNpbsM+9w= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=huo7uteC; spf=pass (imf29.hostedemail.com: domain of oliver.upton@linux.dev designates 95.215.58.182 as permitted sender) smtp.mailfrom=oliver.upton@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707769488; a=rsa-sha256; cv=none; b=MgdYeOgagKZF6RBdSXkYrUkyXsoi6oCubH69QoJq7wNy8yzGUkkjjE8KvWqOl7LYe/Wf89 YgIXFrIYSvAo+SXmfkOtmf4GFu2UMajFEqo1kXYXVW8Y+TODGRGkXYLZvm/QQw0Q2KTfXS pWpEg83l62DQKCoe8kliuD1a4nqSJhQ= 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> 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 X-Rspamd-Queue-Id: 74C2A120019 X-Rspam-User: X-Stat-Signature: w8cmumbtm6u4pbqogeytdfr78si53mk4 X-Rspamd-Server: rspam01 X-HE-Tag: 1707769488-90326 X-HE-Meta: U2FsdGVkX1/WKnds7uz26tZFaURHzqex4PpMfhJRfg07ywtqx9EIJOz8lZyWuKKsbSwc3tBSUQaJ6cAMyIslSh+eNGSn6DxNipO8feGsguptvwHowzsKbCy1L9An0+MEI7UNLiM94EzYBlMGb/T5nhy2Ex0wZCljAlVcBXhBxsG0xWmEUVesHz2Ino34cuUTMg7TvAv1CLyRm8HT4eT88QEnW3no4vTAW66nNXyhgtUCv0TZ/pXevkFlHksOZrhm5tH/Qse0khWDf7N786XIDUR/V2SPKBuEbVUU2gpy5/ccT0++Jkq7w68lzRLkItchmwA2unSktvH9r3bB75xAR7XXr2mDM0iLP5bB4e6TcrArdH3MjwrEA2/O7dMunSiWhoMaIaeTrlLuxJx78rHK4zNkualxca9rKj9pKSCLPMgC2ZKqVxhNnreuUsKB/mA8ydvuTIyXIPPznntJAssDKsX5y/Yrr9TE15BUMp8Xt+mXaEevAhzX/zDpW1cehoD0gf6jkVYeakkgGtG3B58nEBG7EayFMNqX1NawQ3D3hAW23GH9iyPWvZjkKbhgFcUyUaQS1KPM6+FVoMLoYMwPQpM2MwZi4QKHj4+6wgWpbVOHeBprreIZuZp6c3ZVIfN//updfn8xXOmmf9xCPHOXu7HYObZ7Cwer/nBD/6mqzqpU2B8qxHL5LGhEjwvVpJEsugoDuKDscYJZVGjtH7ZYaFdum40MaDmh7dfvSsMSQpwnMTQ9pZwY/bb+3MY9SNrOdILwZVcRd2qNGJWkPbCDru6karNA4FcgpNtYzj/GLC09X7tD6TOJUk83WtEWZ0hgeJcUNU7pb2WgfCVVS+zryo6VPJT1ym5QqGDxOODKspWMFeQkneMNKlmsIIwpblO430wb8p96AaIeZ/UuVtLJScOwjyquA+NprajOtFCx1M6S3au7WbOiy/FmNGsDSt2sJU6ragvHt4SlwI5nfwK L+SGq8M9 O8QCrCeU+pF5F594uEheNX3wEt1j0rY2lHoHFRGd77eU1gN+ebIIzEsvW81g5M4l7rmuitMwUMbGAT3ibK/USY+YPMI5xVbm+hTWFtVx15gG416uLhW16XgsWDoliS4fCsu9/uLqJJRwRQV0v3HMrFcVJB2YRD7lUXcG4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 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