Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4051482pxv; Tue, 13 Jul 2021 09:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySMI/hgUd81APHEx+i+fMxJL6RUQWXCxep+8NBOO1NErT22BlGA7X96KtaY7EoH5DMeAN3 X-Received: by 2002:a17:907:9720:: with SMTP id jg32mr6651714ejc.108.1626194226949; Tue, 13 Jul 2021 09:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626194226; cv=none; d=google.com; s=arc-20160816; b=AC/PzVdpYElM6k8X709X8UHarGwsW94CJwhcB9KrGGmclyKQw9NZ1rG6sIksC/9HoC FX5KEUFdogeNo8Hxq4wAzs+qHmxKVDrTv/qMzv/yUwrsp3j7Z7jIm8bgqU0ZoHp5B9D0 hjBQ4lxCE4/COdJVpo3xdeexPU4I3l0ZDwlkHUk5FwJiZGTT4XIg3nJYWnePpePWTeRy 34fhnT7fRKLVEJ9KNeGbqUF4T1Xv88yDsKUfOKOcNX5bJM1NUu1NvhmIS855o1OnxQ37 A+0sFcAeag4LkPmfz8fasLhqTZeo5C8DYIH8Q8rs7iOf5+S8FBVp1jA3msqYposaNo87 8Kag== 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=VLNuKyQvTwa0Rm4aLkj5S4FZy5CA1rkSDtpmTBtHVoc=; b=j7W9c/fkKheLdmPTwThFOhD3QXqRbifr6o9wr8LPHEatbiVTESlzfGGyd7lzeAeFAJ 16Aaz+EM72OFhq5Y9OgTHQL0cyZUnRDbHRG9ZcgaeawFFPs1UmoxhQADjU0IQtRVSh+z fQi5YgzB/lVnZcTs3+pbhU275b+SWS7L9nnYJ31A9AHcSLMpV5QN9+V9mGQvIpzFKBvq T0L91rrXo4oGpOECfwZT+ncA5gwlAiqhuZfwdGFVDe/DSkqmpBp8hEqE7mnd7NtiA829 5l5qVnf6rVWUdcZ9+cNBykilc0yxhdrb7ffe1hDj/jF+Qrta0TqvrKjxqXrYyhcMxK8R Xvnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oyR1MaMm; 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 az1si8576934ejc.273.2021.07.13.09.36.44; Tue, 13 Jul 2021 09:37:06 -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=oyR1MaMm; 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 S235208AbhGMQh0 (ORCPT + 99 others); Tue, 13 Jul 2021 12:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234702AbhGMQhK (ORCPT ); Tue, 13 Jul 2021 12:37:10 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B51C9C0613A6 for ; Tue, 13 Jul 2021 09:34:12 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id u8-20020a0562141c08b02902e82df307f0so5101437qvc.4 for ; Tue, 13 Jul 2021 09:34:12 -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=VLNuKyQvTwa0Rm4aLkj5S4FZy5CA1rkSDtpmTBtHVoc=; b=oyR1MaMm7QYmjSg9mz0Rnv0KDk7T4VF7Pt6iLuMNec+Tfcf0IzGyVlEyBqbSQEeMSG 2MGXJFQ8F2EUCdTEqyaLc+rw0gcDJLIOCwp7z9/ZrM/Gbg3V+GRrXOV76VpTnGOsgMJA 2JTX5Qnv/hDtrnydyoMMrjvdxDgJQjzV4pesC2rNnm7dXyVj6xId94m9ZTCHKUeF5Rp/ lhkxyPPRy3e4NhlSyG35GE5cR5oiT4gKg+E8pCxVUNWHR/9Ua4jjD4HRqRgnlY+wRxgU 2gsJb0pCB9IMDhynM+wJjeOdGklqzO69wysuwhhAB+g7BeyzLicvq54M3YR+fp+l/I9P f/kw== 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=VLNuKyQvTwa0Rm4aLkj5S4FZy5CA1rkSDtpmTBtHVoc=; b=jrkT3RLaZyKtFlVXYBQSvIxx+0r0x3skdzsRv2WX7OhUqL76toYZH96xNl6IVTZl17 kUK146i/CJr90HWeg8Ty+2ovvWXmryPwEIfD5zL4RaxV3Nn7j1JCUM9emA2ku6EjOmp8 ryrbceMoNiV4PVXaJzetR5BzEGk0/gmvnOFpATr7ysp98qofQzxfuVDVJhSWv+WPoFCb V2CcUmv2fukXUUG145uha1x3jYcskpUfrrYWkgN0euCgccU5d176tSx5eSkbC8vfu912 +syJWdDZ6uFS8GtJqfPOmiD9GOLJICgYEQPQJwGb52CHC/lk2NwBhFfpYPh6Tj7JcOJA 09vQ== X-Gm-Message-State: AOAM530hTzicJN+kj9xzBmRr8CGuh+YY39Qo0AdJeFNuBRgtt2seEPLn Tl1TIgPLHNc7jUkhPTSMVytThxiCekE= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:90:200:825e:11a1:364b:8109]) (user=seanjc job=sendgmr) by 2002:ad4:57ac:: with SMTP id g12mr5843456qvx.32.1626194051878; Tue, 13 Jul 2021 09:34:11 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 13 Jul 2021 09:32:58 -0700 In-Reply-To: <20210713163324.627647-1-seanjc@google.com> Message-Id: <20210713163324.627647-21-seanjc@google.com> Mime-Version: 1.0 References: <20210713163324.627647-1-seanjc@google.com> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog Subject: [PATCH v2 20/46] KVM: SVM: Don't bother writing vmcb->save.rip 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, Reiji Watanabe Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop unnecessary initialization of vmcb->save.rip during vCPU RESET/INIT, as svm_vcpu_run() unconditionally propagates VCPU_REGS_RIP to save.rip. No true functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Sean Christopherson --- arch/x86/kvm/svm/svm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 268580713938..0101646e42e0 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1266,8 +1266,7 @@ static void init_vmcb(struct kvm_vcpu *vcpu) svm_set_efer(vcpu, 0); save->dr6 = 0xffff0ff0; kvm_set_rflags(vcpu, X86_EFLAGS_FIXED); - save->rip = 0x0000fff0; - vcpu->arch.regs[VCPU_REGS_RIP] = save->rip; + vcpu->arch.regs[VCPU_REGS_RIP] = 0x0000fff0; /* * svm_set_cr0() sets PG and WP and clears NW and CD on save->cr0. -- 2.32.0.93.g670b81a890-goog