Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3701198ybv; Mon, 10 Feb 2020 04:59:38 -0800 (PST) X-Google-Smtp-Source: APXvYqymv7H8/EQtphAzS1JWdhwldm4C0ULu7Er9C+gnMLPZR5GnYX9633o4f8LbK8Fw0IlNfyOQ X-Received: by 2002:aca:2813:: with SMTP id 19mr742388oix.76.1581339578223; Mon, 10 Feb 2020 04:59:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339578; cv=none; d=google.com; s=arc-20160816; b=ZLSyEYSZHRE4dPdF2vBkz8hYJ5xk4ytTTkIHWoYXlhQ2SRcXMp0nubHaTUkso0jrcn rsdqZ6qkodLw4f0eTwzJiFJ5FfIsNrMbK3SmSjz2L1B5MJLh9XTh5L2mCRpR0EjZ9rI2 p3UZgKWkkCzalHsku8dr1O+nas/rLbaYZiOIHrKFMzfaTn17bkWaeqN2CeyUC6OtkrPE xxo+RBvaC6d7gTW7kOrh/IE9b+eAr+TBZaxDG2VqhSN8137vbXBmczwtpIfaxODsGOt7 1QhiDrzVLqyr1jjkMhsWEJr4DKeqGy/DQKzFU1kg0vFVDBwy4gKLaTYkPcCv6B2chQQ0 x9Hg== 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=GcAUY0g9a3ISkbmPkY6inTm/OwGr/x2emFM0gm9+EE0=; b=f+Xm4hvnhUJVihOgztbCcYs+dS1P25fVX1mQ4yYGZamMhptlno3dodJRom7l/aAGcB xDUbtcAdT/+CfFM98W/4q76FVj2tNGUL8pYkvNCS1k3NKNsIEhLbNiS0w9xWWOUmKxoY E90axvDb9mzO+0UkzOBZE0ROUMVy4tIhPc+PhOG9aqwbrPx+DAGHFM4+ctX+m1Qa7ej1 P+0FxVewe3KDaKyHxZIB/rbCSPgf22E8dpZ450/pDT2LW8NAtU3PLAyrjOfvn8arGKGp RDkl7D3NMTb7unmEwc8xghHC9hMYkqg++7YK0bSiumX+F84xVEldzooi2GrTJpcgY+2E l01A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hVNg7q87; 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 x72si129641oia.194.2020.02.10.04.59.26; Mon, 10 Feb 2020 04:59:38 -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=hVNg7q87; 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 S1729957AbgBJM6t (ORCPT + 99 others); Mon, 10 Feb 2020 07:58:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:43130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729942AbgBJMlQ (ORCPT ); Mon, 10 Feb 2020 07:41:16 -0500 Received: from localhost (unknown [209.37.97.194]) (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 71AE920842; Mon, 10 Feb 2020 12:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338475; bh=Zf0d7rLzon/jbCHyJZ1Vq1tdCpb0fWLvUNMUfudIzTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hVNg7q87wyKdzfHAhL3ei3tDdbp+yTyHMv6LkyB9uzsBGOJ7Btr+IAAjzIGH7Q3j7 xIavEvsX2yOPKj/GAQnsrEC+1ZIvU0uCFJW9qLisZFNJH9QAUhqBkoXbHTgXU55hlJ gGS9QlQ9hvSzHMA9pDfdGlaQxS8Ly/YISA0wcW84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.5 243/367] KVM: x86/mmu: Apply max PA check for MMIO sptes to 32-bit KVM Date: Mon, 10 Feb 2020 04:32:36 -0800 Message-Id: <20200210122446.611458311@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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: Sean Christopherson commit e30a7d623dccdb3f880fbcad980b0cb589a1da45 upstream. Remove the bogus 64-bit only condition from the check that disables MMIO spte optimization when the system supports the max PA, i.e. doesn't have any reserved PA bits. 32-bit KVM always uses PAE paging for the shadow MMU, and per Intel's SDM: PAE paging translates 32-bit linear addresses to 52-bit physical addresses. The kernel's restrictions on max physical addresses are limits on how much memory the kernel can reasonably use, not what physical addresses are supported by hardware. Fixes: ce88decffd17 ("KVM: MMU: mmio page fault support") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/mmu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -6249,7 +6249,7 @@ static void kvm_set_mmio_spte_mask(void) * If reserved bit is not supported, clear the present bit to disable * mmio page fault. */ - if (IS_ENABLED(CONFIG_X86_64) && shadow_phys_bits == 52) + if (shadow_phys_bits == 52) mask &= ~1ull; kvm_mmu_set_mmio_spte_mask(mask, mask, ACC_WRITE_MASK | ACC_USER_MASK);