Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1795944pxy; Fri, 23 Apr 2021 17:56:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbrslXy2/zl7SM2CVybIpASNE1unaGAYeDCCcCOZsl89zD+SFRUiuZnPZJ+izBOSOxpnbt X-Received: by 2002:a17:907:760a:: with SMTP id jx10mr7165167ejc.126.1619225769211; Fri, 23 Apr 2021 17:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619225769; cv=none; d=google.com; s=arc-20160816; b=KVssEHviy70mA6y6mvSoEnGGg9T8JtiT7sVpeikXBUTW2LrKt2ASjmSEUktCYPHttf rVGFpZ4PUlr3NkieLMJhQiy7qMDF1pLwUYs1ytNyx8orZO4a1HplixVYiA1shk2LEeJD wTG8Q9q4skGmm66+Hi7UjVlQZj1HMlUrkdrcGKIwv1i7pqwtvGxPXJvhrXv7eE/LKAj/ BW8O1FJ+w6Ezs5XPeFJNg6//nIQyBxnSoUKxrh/HVlIgp+utx+jhdhj4bU1c6Y8ms6Tw hujJGciV3PFn+d2w4/e+5Rwzy3gcXBx2NRMYPxGYwtsrH3FUtCFKM/grh+XWyRuUmCeb URKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:reply-to:dkim-signature; bh=BcYmgJLXkQJJcYxDhmV+A4GdpBicTf4J3kxojsPseyo=; b=NsTKtMsAZAO/FYzDjLa4tbW8XbKmbeIdClkg8KsxR1ntSNMY8RylZe8eldFj8QGael n0He21K96987n+6fl1lzz5ZfAHxy70UVe5nCrnZUdqfqdCvVnURQeTPtavvVO4l03TQD TFGesrwj+jNG7aacBUvUWJTkkcuz+ZX+F+gPKleGtWBZ/oMJbOMR+7j6r0+MWFR/unxY I33b1fDRMqKZtm6KcTwgkHVXkcCvA2Lbfvk3uDTLmkvwX7WTbionP8ju7KuPBhNKU0W6 OcDbeCula6zkiGb3hFSOlnpZQJytBq4jJrhLhTOYufBWAk1z8/buACWBRai1EMLSckgQ PPmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CkSStvVO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o4si6562687ejh.725.2021.04.23.17.55.46; Fri, 23 Apr 2021 17:56:09 -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=@google.com header.s=20161025 header.b=CkSStvVO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244270AbhDXAzZ (ORCPT + 99 others); Fri, 23 Apr 2021 20:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244246AbhDXAxt (ORCPT ); Fri, 23 Apr 2021 20:53:49 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9B1C06138B for ; Fri, 23 Apr 2021 17:48:20 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id u3-20020a2509430000b02904e7f1a30cffso26293771ybm.8 for ; Fri, 23 Apr 2021 17:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=BcYmgJLXkQJJcYxDhmV+A4GdpBicTf4J3kxojsPseyo=; b=CkSStvVOFxviRKV+zeGALhdHXccSceIl2sr98P3tZy650GVaj0sQy5ieQPo/t2KLJo 5v1FpyJ0OMXg6VXwre4dIh5nrK3KgRXukeHn6zm8sZEoSK2ByrWKFN/dUvy/Jbs+Spvu jMCGW1jwHMYaxR0heiH7N5RQMqKqzu0gTxikWQqbpEbYmWM7SzxHYstdrFYD79txgbwj dxxn0jTwkmjRFnYyub1TsVNZP8oGXmYQxYyQbUn5kNzrWsj+xpX/Tmzcvde1twUk9DCr x/IV3jz3b5CVtNgXRaLSyCRdP7CQWi0xst3mfobqRB1r4PbibfTNL5JSF3GTgH04Upoo 93zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=BcYmgJLXkQJJcYxDhmV+A4GdpBicTf4J3kxojsPseyo=; b=DC1dAqQ7iB7S4WKeaPnPr0n4SkktSzsOxoeshNpszDFm8hL4ywXf6ZW+rFs/hRpNZV g05ffYaMTx2cNAHZc1smT6ogI/IvK7/TBG761tveCUZTqabOHTeH0DnDTLTKze7HlGjI MDrqwJPED6owMoT3QyWwUPl/FM8MP4DXAtrRVsrvkZiPI4wVt6v0DQVDKEQVDhGkZ+1C vJzdmkfMvRlmksh1S3MBqeJIdOcpkJS4Ur++FBFtSZw8OXPgnY9CIHtQMiqLc4e4LJV3 GyGF/qYcoBEfAjccVh9kE+MZp284U5yr6pe7eacVvdfAlwF6mZsytxQowXFsVv3/ZGVY +h0g== X-Gm-Message-State: AOAM532p5Wf221AJ5puBx44ioyMwSVBswANGugEf1ZGWWy+bGAYvNcl4 KTiNpNJlekmpZcUIP9jedX8ia93VLsk= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:f:10:ad52:3246:e190:f070]) (user=seanjc job=sendgmr) by 2002:a05:6902:687:: with SMTP id i7mr8699935ybt.310.1619225299999; Fri, 23 Apr 2021 17:48:19 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 23 Apr 2021 17:46:38 -0700 In-Reply-To: <20210424004645.3950558-1-seanjc@google.com> Message-Id: <20210424004645.3950558-37-seanjc@google.com> Mime-Version: 1.0 References: <20210424004645.3950558-1-seanjc@google.com> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog Subject: [PATCH 36/43] KVM: VMX: Remove obsolete MSR bitmap refresh at vCPU RESET/INIT From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove an unnecessary MSR bitmap refresh during vCPU RESET/INIT. In both cases, the MSR bitmap already has the desired values and state. At RESET, the vCPU is guaranteed to be running with x2APIC disabled, the x2APIC MSRs are guaranteed to be intercepted due to the MSR bitmap being initialized to all ones by alloc_loaded_vmcs(), and vmx->msr_bitmap_mode is guaranteed to be zero, i.e. reflecting x2APIC disabled. At INIT, the APIC_BASE MSR is not modified, thus there can't be any change in x2APIC state. Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/vmx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index d8afca144e11..acfb87f30979 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -4569,9 +4569,6 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) if (kvm_mpx_supported()) vmcs_write64(GUEST_BNDCFGS, 0); - if (cpu_has_vmx_msr_bitmap()) - vmx_update_msr_bitmap(&vmx->vcpu); - vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); /* 22.2.1 */ if (cpu_has_vmx_tpr_shadow() && !init_event) { -- 2.31.1.498.g6c1eba8ee3d-goog