Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp685680ybv; Thu, 13 Feb 2020 07:45:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwIYPvK98t8yTZS4btrZrKiv5Gq4kkDmRkTQKwmCFYnUJ6TjHHicfiVeEr8saQa9JYXXxJx X-Received: by 2002:a05:6808:98e:: with SMTP id a14mr3180672oic.8.1581608714748; Thu, 13 Feb 2020 07:45:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608714; cv=none; d=google.com; s=arc-20160816; b=UQ0H701dQZHxkniEbUEYWTZGAsSGl+3xeUem/XckPuO/yv/AMPf2wYYA2p4cSVomOU UezSfinp9NtyElz5Rv0pR/RAw2CJSo1WvefZQz6+s0ihCATGgILfyzbciwcwDUPmuEOO 3whehXxn/Y7S9jYBACQ2AebjY6xJEX37UBtzXPM6pI7jtZ/2An0jLcNNwE7Squ6OCEnN h0Qrs0ql1vj17ugOLK7VZhUwTqzcUclyteFp2DRG3SLtb3PGMlwEAKsDVC807xqEzuLm U7o5MZJpQBauzBUS/JqHMixgKy9rICTCQF6bvubLUTyTcu4b5u5uRLzM4+DHgdA89fyS v5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3olrHTWlgz0KJJzIGJik2p796N+CK1sdqyqJcc5qLlg=; b=MRdm7I47V2CsgzbAJdTFNvD4im0mHBwOOqWmQ1f0ZyvbJB6b9Qmyb2AlIze2bhVJvm EbSDtMDd8ZaDSj1BlEIrfEX3krpMcMtQlwzXgEbrARl6P242x3NseDkxrUbqaFcydwzi OvNXQxySoWvHYYeMBhGWqp9AASStSlDNNJ6a23/JJLZ9I52FX+wO12+BOp4/mweR/8JX pHYNVezTr5R4ZRXtbLHW+rqsDS2dZGZLjg9oxyDwGaEuwLqBgbEfaZH4pXlh/sWz2dZq Xxyb7qUy+i9HOVPpnRVtQvYt+1Noz7cP/akyoLkCvHOi9sk70pZENi0jyBiFQLBsXcnp XPNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TXBX8N/S"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si1260876oti.22.2020.02.13.07.45.01; Thu, 13 Feb 2020 07:45:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TXBX8N/S"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729794AbgBMPpA (ORCPT + 99 others); Thu, 13 Feb 2020 10:45:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:51352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729437AbgBMP1e (ORCPT ); Thu, 13 Feb 2020 10:27:34 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6566E20661; Thu, 13 Feb 2020 15:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607654; bh=WuqV254a5onX5HPGKhHxntSjp5QurUQnAHBFMgCKLuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TXBX8N/S92zrhlKvcsOrjzB7GY3CpPBdgsLWV28huGjhwcfiR8vfWsY2aTE/wlPlb ShnA2X9uduY5bTz/Ua064FHqLGHyKWmlZP8zUvAbGCj9a5/tfK74diVAvDJhIrLxOi bsPiCLsRtO3Q2CGjhU2V3PJDS1ZQ4FXx/PTd0KhM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gavin Shan , Marc Zyngier Subject: [PATCH 5.4 68/96] KVM: arm/arm64: Fix young bit from mmu notifier Date: Thu, 13 Feb 2020 07:21:15 -0800 Message-Id: <20200213151904.946853903@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gavin Shan commit cf2d23e0bac9f6b5cd1cba8898f5f05ead40e530 upstream. kvm_test_age_hva() is called upon mmu_notifier_test_young(), but wrong address range has been passed to handle_hva_to_gpa(). With the wrong address range, no young bits will be checked in handle_hva_to_gpa(). It means zero is always returned from mmu_notifier_test_young(). This fixes the issue by passing correct address range to the underly function handle_hva_to_gpa(), so that the hardware young (access) bit will be visited. Fixes: 35307b9a5f7e ("arm/arm64: KVM: Implement Stage-2 page aging") Signed-off-by: Gavin Shan Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200121055659.19560-1-gshan@redhat.com Signed-off-by: Greg Kroah-Hartman --- virt/kvm/arm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -2147,7 +2147,8 @@ int kvm_test_age_hva(struct kvm *kvm, un if (!kvm->arch.pgd) return 0; trace_kvm_test_age_hva(hva); - return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL); + return handle_hva_to_gpa(kvm, hva, hva + PAGE_SIZE, + kvm_test_age_hva_handler, NULL); } void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu)