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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 776E1C2D0A3 for ; Tue, 3 Nov 2020 19:23:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2814B21D91 for ; Tue, 3 Nov 2020 19:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604431382; bh=q8w0vZb3DgJule6yAt+RZ1ozQ8NJbZbOTEv/VEjX4p0=; h=Subject:To:Cc:From:Date:List-ID:From; b=iu5ZO03qNPamjJBisbBPtEaj+16X2yJ1nJ9Mng8/v30VifAvWDvR4yA3JAmbBiWY7 TDsKhzNknPd0qhuRnLygxncacuzOcGYwyjqJMFDalADNXJWEAWpD5gDkGvif49ytUY UoiNNUJkgcegV01LZQPjxaH3N5DZgC6Nkt3C51SM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729102AbgKCTXB (ORCPT ); Tue, 3 Nov 2020 14:23:01 -0500 Received: from forward2-smtp.messagingengine.com ([66.111.4.226]:47869 "EHLO forward2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbgKCTXB (ORCPT ); Tue, 3 Nov 2020 14:23:01 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailforward.nyi.internal (Postfix) with ESMTP id 59B231942731; Tue, 3 Nov 2020 14:23:00 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 03 Nov 2020 14:23:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/AeCff c9z7+e7zu+YaIscVPKDQMIweOueptuE1xUpq8=; b=NVaLBNWnktLCNrLgSmOr5e XCUmJDSkM5hWPfxGJFGHRT6xadTPt10lcpuEC3ju4KLHmMvGKhKPhjsLEjtTyFnm J7XMf9C4lcA9QF1euz9dLfj0no8weRO1OAuQ0LtHOnsOWEWAy+CFvkg4qFDqVM3W sR5/0bLCt2ct1kMLAVmIfcuIcw/H5EFRxGA0+wuI27xcQ3HIbfjY3lwXhP54bhQm jKpeFZvWq2ZcBKtPx/WQEcJzbkiRtBzXQD6B1mscDPGlBkdPVEEHq+Rj9jMlKCCS /O1EUPHSGOtsMLDO7pIjynTavnugRW2ZboIcHccNZv9i9MzCgB5hZJGQOvfYM7+w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtfedguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucggtffrrghtthgvrhhnpeelleelvdegfeelledtteegudegfffghfduffduud ekgeefleegieegkeejhfelveenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhp peekfedrkeeirdejgedrieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 921433280115; Tue, 3 Nov 2020 14:22:59 -0500 (EST) Subject: FAILED: patch "[PATCH] KVM: arm64: Force PTE mapping on fault resulting in a device" failed to apply to 5.4-stable tree To: sashukla@nvidia.com, gshan@redhat.com, maz@kernel.org Cc: From: Date: Tue, 03 Nov 2020 20:22:58 +0100 Message-ID: <160443137851161@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 91a2c34b7d6fadc9c5d9433c620ea4c32ee7cae8 Mon Sep 17 00:00:00 2001 From: Santosh Shukla Date: Mon, 26 Oct 2020 16:54:07 +0530 Subject: [PATCH] KVM: arm64: Force PTE mapping on fault resulting in a device mapping VFIO allows a device driver to resolve a fault by mapping a MMIO range. This can be subsequently result in user_mem_abort() to try and compute a huge mapping based on the MMIO pfn, which is a sure recipe for things to go wrong. Instead, force a PTE mapping when the pfn faulted in has a device mapping. Fixes: 6d674e28f642 ("KVM: arm/arm64: Properly handle faulting of device mappings") Suggested-by: Marc Zyngier Signed-off-by: Santosh Shukla [maz: rewritten commit message] Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1603711447-11998-2-git-send-email-sashukla@nvidia.com diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index e431d2d8e368..c7c6df6309d5 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -851,6 +851,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, if (kvm_is_device_pfn(pfn)) { device = true; + force_pte = true; } else if (logging_active && !write_fault) { /* * Only actually map the page as writable if this was a write