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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 CA615C43446 for ; Tue, 14 Jul 2020 19:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB8D32240B for ; Tue, 14 Jul 2020 19:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594753599; bh=9UytBGID80b0f2L62wiWfV0joIQ/oSf+EzEK7kofbTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0WRbb7rRlHMX/SdeQxmBwVfzt954QMLkkBWdncIwCB/j4f5TC5nzVDd3eUKn8op1Y JUjrvKWWn9Y0WkPD+vIuJ1E9pv60JRGqED6qpP/m+Jud6Sklq8xhGTsT9PQwZ158oV brlZjarIKutXAV+pWiaKfclABDPJmRTCVDSzJXfc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730208AbgGNSxR (ORCPT ); Tue, 14 Jul 2020 14:53:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:50256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729918AbgGNSxQ (ORCPT ); Tue, 14 Jul 2020 14:53:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 8F9D322BF5; Tue, 14 Jul 2020 18:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594752796; bh=9UytBGID80b0f2L62wiWfV0joIQ/oSf+EzEK7kofbTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=08kMqTELKXyghSuTWyAYfd3jbK1OyrDmx/w+NlxsPfdCy03WhHjVxLVaLPErnxs4k SKCQcwTESZqgp2RKg3U7waUBoEKUGe4nd60eKhcjHAKY0Twv2Pwk+yq0WuSgU9u3av oLK5NBzlHniwe/NdwzECV9sAk7dUdUGLEjYexii8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nadav Amit , Paolo Bonzini Subject: [PATCH 5.4 083/109] KVM: x86: bit 8 of non-leaf PDPEs is not reserved Date: Tue, 14 Jul 2020 20:44:26 +0200 Message-Id: <20200714184109.526812261@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714184105.507384017@linuxfoundation.org> References: <20200714184105.507384017@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paolo Bonzini commit 5ecad245de2ae23dc4e2dbece92f8ccfbaed2fa7 upstream. Bit 8 would be the "global" bit, which does not quite make sense for non-leaf page table entries. Intel ignores it; AMD ignores it in PDEs and PDPEs, but reserves it in PML4Es. Probably, earlier versions of the AMD manual documented it as reserved in PDPEs as well, and that behavior made it into KVM as well as kvm-unit-tests; fix it. Cc: stable@vger.kernel.org Reported-by: Nadav Amit Fixes: a0c0feb57992 ("KVM: x86: reserve bit 8 of non-leaf PDPEs and PML4Es in 64-bit mode on AMD", 2014-09-03) Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -4580,7 +4580,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu nonleaf_bit8_rsvd | rsvd_bits(7, 7) | rsvd_bits(maxphyaddr, 51); rsvd_check->rsvd_bits_mask[0][2] = exb_bit_rsvd | - nonleaf_bit8_rsvd | gbpages_bit_rsvd | + gbpages_bit_rsvd | rsvd_bits(maxphyaddr, 51); rsvd_check->rsvd_bits_mask[0][1] = exb_bit_rsvd | rsvd_bits(maxphyaddr, 51);