Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2862620pxv; Mon, 12 Jul 2021 03:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbWLAN3vwQDIvkegyzJZb45NP/sM72lpNbd5RGZSkqlxascsdyKlNxTMl4QNaAm7lYPjTL X-Received: by 2002:a92:7c10:: with SMTP id x16mr15980339ilc.192.1626087142854; Mon, 12 Jul 2021 03:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626087142; cv=none; d=google.com; s=arc-20160816; b=b1qFYbDkzpirQyi+xwVBFoa3B8EetmOSO4h6Jb9XA3+JBZ3nlJLFGCJ771pz0SeM1u 6PwJVPVJ/hdaQdjTKCaRQ+2nIPVoh9ZWRLEHTzmCMoklSE0kgqd2BkhhXn72c+t8Wjly sUUEXz0kOj7I4naDPYRAqt9E1q/+5V1WA2kGolas0d607V+L4AEC1AHmSkxC69XhsOdN xtnL8n5vZFo9PvUMDnMxAzHTnz1C2Mgby/I/1oCBueT7wYHvjvYa+F8unzlPbuMOpSpv QhxnE5VR9JwAB6rBGmPJByd+eh63kXNGC8mlQ2yklwBAuTtPmDTM8zhACt8vmffMkPWa pUlg== 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=2VTNP0oq8hM0nbOpUR3gq7YMN2qrvaRk47/xkizlDxY=; b=eo64aSn35P/fV7r+1pQqmdcDX/jHAy3eh0VMbmPlqK1ApvDh1QcTvl57mkbAPYCq8f VfXjD0CpQdEy+Wkb4X/ZYVrC06RjmGITh+cqYDwG4HNEpgHyM20UETxKbjOpw3FeiXlK ifiDPtOHONwS/Bd/1PuT/1J0+7MbkJWlI2hSu76bR5jPasVINOqKYsJlJnV2wxV8Kmpg cXX95gPQ3GPmLKUVOGIb1AbluNBIjk8sZPyDbI+47FKNpZYI8XjpNLIIL6h0Q1FMGVdc dEE2Jsv4U+5RmJ3dn15mgCkKhm9jOyllKSUI82By3eLV4aHindmFYwCfXatUc+UZ+5+7 k3Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DI9O+x9J; 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 t10si16206177ilp.101.2021.07.12.03.52.11; Mon, 12 Jul 2021 03:52:22 -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=DI9O+x9J; 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 S1357259AbhGLIRI (ORCPT + 99 others); Mon, 12 Jul 2021 04:17:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:51350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244644AbhGLHdO (ORCPT ); Mon, 12 Jul 2021 03:33:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF55A60FF1; Mon, 12 Jul 2021 07:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626075025; bh=Fyc4kmRbFFjK/m9dPgf4SN5B8TxWzKkPORGJvz+HkxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DI9O+x9J1uL2vxOLZ447cuefoSIIre8K2D6nPtJMhMke/AH211wrbbez2SuJumaua 1drhQViw7l1o2aIUNyDVfx+ESKff/I2Zy4OIpTP2wEu1S9Zr4lUSCzbKqsXnd+6hNe yR63InoO1rjZPPGuuoBCTCIHWydccXfQ/wAYhoow= 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.13 076/800] KVM: x86/mmu: Remove broken WARN that fires on 32-bit KVM w/ nested EPT Date: Mon, 12 Jul 2021 08:01:39 +0200 Message-Id: <20210712060923.824263014@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@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: Sean Christopherson commit f0d4379087d8a83f478b371ff7786e8df0cc2314 upstream. Remove a misguided WARN that attempts to detect the scenario where using a special A/D tracking flag will set reserved bits on a non-MMIO spte. The WARN triggers false positives when using EPT with 32-bit KVM because of the !64-bit clause, which is just flat out wrong. The whole A/D tracking goo is specific to EPT, and one of the big selling points of EPT is that EPT is decoupled from the host's native paging mode. Drop the WARN instead of trying to salvage the check. Keeping a check specific to A/D tracking bits would essentially regurgitate the same code that led to KVM needed the tracking bits in the first place. A better approach would be to add a generic WARN on reserved bits being set, which would naturally cover the A/D tracking bits, work for all flavors of paging, and be self-documenting to some extent. Fixes: 8a406c89532c ("KVM: x86/mmu: Rename and document A/D scheme for TDP SPTEs") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20210622175739.3610207-2-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/mmu/spte.c | 7 ------- 1 file changed, 7 deletions(-) --- a/arch/x86/kvm/mmu/spte.c +++ b/arch/x86/kvm/mmu/spte.c @@ -103,13 +103,6 @@ int make_spte(struct kvm_vcpu *vcpu, uns spte |= SPTE_TDP_AD_WRPROT_ONLY_MASK; /* - * Bits 62:52 of PAE SPTEs are reserved. WARN if said bits are set - * if PAE paging may be employed (shadow paging or any 32-bit KVM). - */ - WARN_ON_ONCE((!tdp_enabled || !IS_ENABLED(CONFIG_X86_64)) && - (spte & SPTE_TDP_AD_MASK)); - - /* * For the EPT case, shadow_present_mask is 0 if hardware * supports exec-only page table entries. In that case, * ACC_USER_MASK and shadow_user_mask are used to represent