Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2796744pxu; Mon, 14 Dec 2020 11:05:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJydFfEMamQVZrtkMgCUwJJO59EmYoI3c7/qNYb0didlGFK0+TkCDtaNjqwEKbhhHQsigN7M X-Received: by 2002:aa7:d7d2:: with SMTP id e18mr26918446eds.256.1607972720972; Mon, 14 Dec 2020 11:05:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607972720; cv=none; d=google.com; s=arc-20160816; b=vIM+uCq9yUxd9msxQRqx/7L5/VZZdBmAgAL7sOcSGqBOjjCEtBw2ffkclizLbiuMfs 3q3EqJ6Y1NWD1LM8ELVX0pW4wE0ndpJRJxpBVx4t4oFwV6hqvDu7u+liLVpf9wkPGUp/ g/s5TyEmBfgIzxgHtyziTH/ynyFpE75M6P7RSek+y/mw+OUL0rg7xEWaJWDVb219PeXC Ehrw3tCLE2H1qdq3COUzt8ef+kWA6FdCn9fMg6ZdKkNaass9vboyG8oMwWY3lZL3wXM+ tCV2xtOlK1qCRiDVL1qXlRFWiAWqdyAXNLUk7tkQRnxFP4oYryxy46dWWE6Y7JLoGXSV PhPA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+NmuioRXdPzhZhBnp7tfLVLDUjPrKAJC+sD5oIOuUZ8=; b=M9NIM3SJfjoCWgbnFSvTlc+ugDdoOVmkoZBUwGlVsH72ulJtxTrOC9Ue8+9Rp4i85C DRp4OimBlvs/3nHMGMWmaPoAapO3F8gyOlsvWy1rxKi9LYg4e86vM7/A/KxCd52NL1sd CEbLCwl5PYIGkrIWie6SMsUC3wLhEESaVZd9ZINQRqHCDl5dCrO0iIzdqZk355qaveP3 n05AJsN/BVmlyBrs1hynOJY5vHzmGdzdckxrnM9YNlSEskeXRZKOGieutODO3pXbRG8m qp4QO/XPP0OKiLtQkqoqtx3311/9sEss6jL0EKS/73B0tv+YwUAMs+u7RirMyUvvhZDP Y40Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fNmgFvRO; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh9si11596428ejb.507.2020.12.14.11.04.55; Mon, 14 Dec 2020 11:05:20 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=fNmgFvRO; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408873AbgLNShX (ORCPT + 99 others); Mon, 14 Dec 2020 13:37:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22169 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440911AbgLNSeZ (ORCPT ); Mon, 14 Dec 2020 13:34:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607970777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+NmuioRXdPzhZhBnp7tfLVLDUjPrKAJC+sD5oIOuUZ8=; b=fNmgFvROeTtNFNVNmrQhwFWjxsV/6dQ4nmlC5ggptqB+gUJPhCypiHQ+Um4abBSQIqgFpG 5cAQzymFa8rdvu0n94pVO/BjV6KFNQII563qVBvXO2+YF3hZEI+YzUSj3sOfFwCnTImbH8 UhK1ixB0BHMlbiZfIUZJtFgdXkyhTS4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-210-mS9S5NL_NwCzwSqmJfjVqg-1; Mon, 14 Dec 2020 13:32:53 -0500 X-MC-Unique: mS9S5NL_NwCzwSqmJfjVqg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7BDA1007315; Mon, 14 Dec 2020 18:32:52 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20C841042A7C; Mon, 14 Dec 2020 18:32:52 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Sean Christopherson , Alexander Graf , Tom Lendacky Subject: [PATCH 1/3] KVM: x86: remove bogus #GP injection Date: Mon, 14 Dec 2020 13:32:48 -0500 Message-Id: <20201214183250.1034541-2-pbonzini@redhat.com> In-Reply-To: <20201214183250.1034541-1-pbonzini@redhat.com> References: <20201214183250.1034541-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to inject a #GP from kvm_mtrr_set_msr, kvm_emulate_wrmsr will handle it. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/mtrr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/kvm/mtrr.c b/arch/x86/kvm/mtrr.c index 7f0059aa30e1..f472fdb6ae7e 100644 --- a/arch/x86/kvm/mtrr.c +++ b/arch/x86/kvm/mtrr.c @@ -84,12 +84,8 @@ bool kvm_mtrr_valid(struct kvm_vcpu *vcpu, u32 msr, u64 data) } else /* MTRR mask */ mask |= 0x7ff; - if (data & mask) { - kvm_inject_gp(vcpu, 0); - return false; - } - return true; + return (data & mask) == 0; } EXPORT_SYMBOL_GPL(kvm_mtrr_valid); -- 2.26.2