Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1647397pxy; Mon, 2 Aug 2021 07:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU3y8hx2exYmXWOsi/m24WEVqDHlhH/UcJ2CQFjLeHzGhKOCfRrCumpb7OlOvhROg1YYSj X-Received: by 2002:a05:6638:204c:: with SMTP id t12mr14965889jaj.129.1627912954938; Mon, 02 Aug 2021 07:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912954; cv=none; d=google.com; s=arc-20160816; b=WF1P1VaMJnbEUjl1Em/WKe5E6Q0ynFRIvqkLEokwP/MAzznqwecmzG3HfW6yL2AQnb oG8J5gokNIfF9R7MXnYkjnjjKneQDLdThvZQ1CA8imO6kzxOjGBVD166wCKFaQcbQg7o 6dcPd4opGoBI5D9eR8sqdh7nfZLlhN0tYxUEeKq6/PaApJDPk018I0nXVP3/qGHIiZOR 8GLdbm/Uvr6CqSHVv0LBg4x2XNylovgm6fs9RzMapURB5r/QI28OXC7PYFpFARYYUsdb 0NnJar13nCiDrFxJMUMj/sJqlFX8dDhPVjFVrBWNM/P4osgP+ncVk8vo4PXzpM8KntkN 6JVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DB16wBghVIz1QayiR2gIVgeaIUQZuEpauXlyuXFQRSA=; b=mgqXsCyLkO4SeT4dHQuQKJrlgDUFsdXUJ/76QsImSj8vf3Z8t6QSN2w0RSavMFdCbC CpGYHyh/64iqkSGLOoYsz/Jt9VQiU7XgcWmI011M36nzTl+tgnjUBEZlSJftAAJNM9aH yWUT9jwjSu4TJPgLFswW/sbqIkyNZ1qf56Ky+gnKMJ+Q8/pGmN9+XdMDQmePOtjgaE7C hPUAWSP9kaCKaZN8RPzhAdjavxRcFRewUnoriAN7yQxI5vEcU7PF5HLdUBg9yz1ySPsp lNKe0zvsAc/1BPJhOcIX5Vva/preHQcYDdwRm/q5qYa8tGrZtqIZAxCL1zUGkL3pWy/X gBoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IzWX0oZh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k14si13275854jad.34.2021.08.02.07.02.17; Mon, 02 Aug 2021 07:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IzWX0oZh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235233AbhHBOBX (ORCPT + 99 others); Mon, 2 Aug 2021 10:01:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:40874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236201AbhHBNzI (ORCPT ); Mon, 2 Aug 2021 09:55:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7CD8F6113A; Mon, 2 Aug 2021 13:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912410; bh=3dDZ5dmtawGjk/OlF7T8uq9pZ2VyjaMssPllgWT+jjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IzWX0oZh3BKT8wfdf1IyfkY1HikVyy8K6dl/UOSvbAagj8o9fC029Go8PHkLhEDc/ Ph3OWsyXCTQNlNWyYmEHdk9JyP1fDAp7W371LWR/CO47y24bL5TkSfrXrVw334BUcP PfC2Kn1ylcMshoBwqT++CkejPzTN6eTYxC1Sxj0w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Kuznetsov , Maxim Levitsky , Oliver Upton , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.10 47/67] KVM: x86: Check the right feature bit for MSR_KVM_ASYNC_PF_ACK access Date: Mon, 2 Aug 2021 15:45:10 +0200 Message-Id: <20210802134340.635390301@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134339.023067817@linuxfoundation.org> References: <20210802134339.023067817@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov [ Upstream commit 0a31df6823232516f61f174907e444f710941dfe ] MSR_KVM_ASYNC_PF_ACK MSR is part of interrupt based asynchronous page fault interface and not the original (deprecated) KVM_FEATURE_ASYNC_PF. This is stated in Documentation/virt/kvm/msr.rst. Fixes: 66570e966dd9 ("kvm: x86: only provide PV features if enabled in guest's CPUID") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Maxim Levitsky Reviewed-by: Oliver Upton Message-Id: <20210722123018.260035-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3ad6f77ea1c4..27faa00fff71 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3205,7 +3205,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) return 1; break; case MSR_KVM_ASYNC_PF_ACK: - if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF)) + if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT)) return 1; if (data & 0x1) { vcpu->arch.apf.pageready_pending = false; @@ -3534,7 +3534,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) msr_info->data = vcpu->arch.apf.msr_int_val; break; case MSR_KVM_ASYNC_PF_ACK: - if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF)) + if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT)) return 1; msr_info->data = 0; -- 2.30.2