Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1796703pxy; Fri, 23 Apr 2021 17:57:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC+lZLOn8khyHJQ7Eqvry6uFYy5EJVDX3tVqa8VwOBo+zMr8Jyw37hdRm4msLnHQK3k/Oy X-Received: by 2002:a05:6402:3495:: with SMTP id v21mr7539815edc.117.1619225861030; Fri, 23 Apr 2021 17:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619225861; cv=none; d=google.com; s=arc-20160816; b=IQb42BDzmFzrulehTe9GDuzhyznz7o0o+J/RIVPHzr0zZjqkCdUgjtQH6FUboWxkmT lss6yHyVfJGV/Xp5UFv6qElh77S16cPlTisHjh23dhttugH8uqH9mww6V1NDOKFrdyJc i94zws4THiZfjeCL4plMFl6qrCHgoQwgHiTJmaCdSPCQN88kPaavNWGAlPn33FQQ2qxv SDN0smXzu+n3KSWYeaGBdAfOTWrgxZDoZmETgc0sCRgxMTuw8QUmt1RT7JdaaBW8dW/T uxvCcyQoi9ynDPrHDDq4dScsF0Eny6YF4Gr6b+ITQtUMcY0ex68tdrOajlyFF2nLlpNe RoRA== 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=thJRe/zksywSokv9ZmTCndjiPPjEmBU1CAnUpNcr8ss=; b=pK6/odLnbRiX6vPahD8IJ1Z3K8GJVmA2HvwN1CiiKR4eUWYmh8PaXLU5ZZeJCBN+ah 15YTIEZEQBdZjagDW9BuclnRsPQbH4Of5uQ0wIdLvMQmJ+J+n7iwepzfK8fbs8KR2MLi jCmwQUUrB1kLjimTGeS72SRQIZt/UBavcNaeXMeazVJ1PCmtXfnobLPSQmNWfN5w92QE Ll7hK7WI9gjTGv1YPwRExYlx98OqvkGZ9gw28GqNy6UOjBH/NjqtN6QHSYLAL6Ki0Dlc YV3lHRCGhlc0jzegUekpQQx1DlkhAKaRGlxmNmEl+Z13cr+0CPotyzVPI/MhCvOWUKYx wxWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cHaqKGZ0; 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 q9si6636721ejz.674.2021.04.23.17.57.18; Fri, 23 Apr 2021 17:57:41 -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=cHaqKGZ0; 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 S244512AbhDXAyq (ORCPT + 99 others); Fri, 23 Apr 2021 20:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244461AbhDXAxN (ORCPT ); Fri, 23 Apr 2021 20:53:13 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE4DC06129D for ; Fri, 23 Apr 2021 17:48:16 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id u3-20020a2509430000b02904e7f1a30cffso26293668ybm.8 for ; Fri, 23 Apr 2021 17:48:16 -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=thJRe/zksywSokv9ZmTCndjiPPjEmBU1CAnUpNcr8ss=; b=cHaqKGZ0l7MVStxsR4rYVHgGZ2z01asm7gZWaBduBDDkFmUj6dfL07QN1zqBjxx8JT SUL5ugEMLYkbiX1iF/FZO28Z8ygEf8sZfZf6zQ8ibXrQDR8N7KCDowMJ8FPq2xPFiCt4 NesaxKfH/Io25cj+IT/bgWh0pB3AHsU5WL+SKdgozzefTt+lSUkYKQvtuySidncFgxcg c3kpQRLrvTVOokNCiHLg68EHDRDW0sETL47HTMf8bXDolpud/6dfxiTYn6MC9uhSaTYx vzADYJrJ41W3Qv7pZPuuesMxZJKguolq3gJ/TCAG1ZTzCTj40NamknX+I98ng0DOTla/ zinw== 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=thJRe/zksywSokv9ZmTCndjiPPjEmBU1CAnUpNcr8ss=; b=ACGagPJdFaC1QE5N9ZKY50SrQvVaAocKLAoqMHTh6Ov+ZyT6ftZtYpAaJVg6YnY3CQ oSHOwV4hsUetvSqf3yZEaZRz4FCYT0Cqk8jz81zrF4V0U+SrBs5EmJOLBvEowRuSRLQD frMy2joDXpZOOyN5MM5Bb5ofRawUjHeiJOqwoIKnAiisepB6WDjl0aw5rT5tuYCEE7+Z s8/hSQSj4Pi5SyP4nT3DbjXURLaDm3xIDVhrlsJjcVNbMYLkD9U7xV5n+SHXTRtumtGB lfH2Is5YYJihUQIfLxVfiJIsFa/8uL3hLiDFFwAbGVuA1MORJeGpYiFcKsTQsCo9Z37t kwow== X-Gm-Message-State: AOAM533qC2aqV2TRPNEtOO33Uc3zVae9ENsCqbxoLEveyqdFe3sdPAjv u2ZlTsdQqQmZHTydujsXBgDQrVSCuiE= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:f:10:ad52:3246:e190:f070]) (user=seanjc job=sendgmr) by 2002:a25:38cf:: with SMTP id f198mr9254733yba.21.1619225295684; Fri, 23 Apr 2021 17:48:15 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 23 Apr 2021 17:46:36 -0700 In-Reply-To: <20210424004645.3950558-1-seanjc@google.com> Message-Id: <20210424004645.3950558-35-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 34/43] KVM: VMX: Don't _explicitly_ reconfigure user return MSRs on vCPU 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 When emulating vCPU INIT, do not unconditionally refresh the list of user return MSRs that need to be loaded into hardware when running the guest. Unconditionally refreshing the list is confusing, as the vast majority of MSRs are not modified on INIT. The real motivation is to handle the case where an INIT during long mode obviates the need to load the SYSCALL MSRs, and that is handled as needed by vmx_set_efer(). Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 57cabef3ffd9..8c982e049cbb 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -4509,6 +4509,8 @@ static void init_vmcs(struct vcpu_vmx *vmx) vmx->pt_desc.guest.output_mask = 0x7F; vmcs_write64(GUEST_IA32_RTIT_CTL, 0); } + + vmx_setup_uret_msrs(vmx); } static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) @@ -4570,8 +4572,6 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) if (kvm_mpx_supported()) vmcs_write64(GUEST_BNDCFGS, 0); - vmx_setup_uret_msrs(vmx); - if (cpu_has_vmx_msr_bitmap()) vmx_update_msr_bitmap(&vmx->vcpu); -- 2.31.1.498.g6c1eba8ee3d-goog