Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5004742pxj; Tue, 25 May 2021 23:58:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEpbB+A5ZzVxjtVTeyohe1IvDN+pHoTWlTvbGv14S08HyJQL7Yb43a0SNt1q4GLakT/MXp X-Received: by 2002:a6b:dc06:: with SMTP id s6mr25095271ioc.130.1622012284879; Tue, 25 May 2021 23:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622012284; cv=none; d=google.com; s=arc-20160816; b=qEGh1brKhZt/27npreefUDpbI4HqbZrz93NDkD+4NvnmTwX8gmYCsiepSJh78FAx7D pw9akuz9YBvmDa7QDIycHFno5h0rYJuG1iasdRFyOupthdpQUMhOUFGLX8+6mQu48ojR OpY5zJIQ2gj/73iCkR55VKUEN+ZeGw7ds/nA5WgB4r6ozeCwHfFzFBd/1yJxrGzNldUy Sqi4b2lsrL/k7oFhBeHPR9XLINYbUfzsmnxGfqjvo9fGWcDlz20ZSt/Jqc87TUrvcwl4 LatXUyceNTENBPo8VrVRjgOcm4boOaEsX6//Y7iAhSGr7x3vcXSESrRH80nfGlrGWiBK qdZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lIYi5GnoKtr8i2F095rp7bhScVGwxvgeu7J1/N2EUAk=; b=wc4ygcYL9Yv8tU2xdCPSRpvPA+PAcc96M8dyxbJxdYxgSyBm9mppBbvBThT5Ckn/fW yf8CEzNvg9J4Gpjy8LVZU5N/7oeGGiasYkE8DReI8csxe6e4tq80VTCnv49HMK2PyfFy bDjRvOhrcCntCPQuYQxsjvbOiSwhVEtMecBm0kqhFcFjz9D0st8AtgPV5iAbeiYK5Nl9 V8ypQ+JYsVYBwBp96KLInOun55bhQxf47I/FJQgy4188O5d9bGNY07cYoR/r2VXFDjT9 H6wk+jhLTnXBZsUHbGK4dHE53GG250gvG84xtsik03ebJmlFeEISRg+EXdPt80PFRLbn EhHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TAHzx3Qb; 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 k21si19631951jad.9.2021.05.25.23.57.50; Tue, 25 May 2021 23:58:04 -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=TAHzx3Qb; 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 S232788AbhEZG4s (ORCPT + 99 others); Wed, 26 May 2021 02:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232736AbhEZG4r (ORCPT ); Wed, 26 May 2021 02:56:47 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F387C061574 for ; Tue, 25 May 2021 23:55:15 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id y202so237348pfc.6 for ; Tue, 25 May 2021 23:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lIYi5GnoKtr8i2F095rp7bhScVGwxvgeu7J1/N2EUAk=; b=TAHzx3QbIOsujqmEG+HQ52yVDfI9Y+k0TE0z6yWLam76zV1j3Bljso+qDhDs+XH04X vMTaL/pvMa2fSonYSD0hp/PfT4qIv40b2qbL3vtyLKAXdJ7bb1R7+RfnxqwlPBLx1bQF toyt/iC8s3j24OuMUxvT0hI1zIZo0wpHWZZb8ceMIbHYLNtTuXhCZhqCDvcwaXaKHGog QUS2P5UOzNYUbc0RjO+UlRVZe+zoD8rMsIFR54BfxZx1RIYCILUGaxwPYuTQavhFYJat R0K6eNIFkmhpdlV7Wru86HMY0xM0fapOvj3z1ET7dVkncGnrGbI8I4TQEJM6nxU5i/yp cp1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lIYi5GnoKtr8i2F095rp7bhScVGwxvgeu7J1/N2EUAk=; b=szcE0yknbr5Z6t7wi++xa1rDgXOI03GMQyKQ9SUCy4I+uFSbAaaxfU8j58cjmxipR/ 6P0wRvbxURfLwQ47azc3WSZKKXoAmNi+NFSzO5vLKwqMC6cI+Zt4gLPOpgXU72kzNs0u k5vSTUa5cSc5sBf27S4SMLJgv2ji1+5QIBcYw8rAAt5DVrSCGKP9ytv3u7Ey2FmVCKSY 0SlF7l6mF95qCxAutGIG7b9b2PpMCh0o5HOS7VBS4BKQBSoaBQWpNkOPVp5KH0CHOqyt 3P0fsZmVZVEwqPHdu9kWFtV5J5IN/a0moaFciF5WFJm1SuFjGV9BtDfxkvFrmYf8Wt9S OkrQ== X-Gm-Message-State: AOAM531JTCYUy7MXFp6Bcv9iqtWGlUTiZtBL6xkgmMoCuaCU867FWgkR 1+QqfhqKUHOTlmNz4S87f3EaI/bSTag2OfObVOpMPQ== X-Received: by 2002:a63:1e4f:: with SMTP id p15mr23315875pgm.40.1622012115027; Tue, 25 May 2021 23:55:15 -0700 (PDT) MIME-Version: 1.0 References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-13-seanjc@google.com> In-Reply-To: <20210424004645.3950558-13-seanjc@google.com> From: Reiji Watanabe Date: Tue, 25 May 2021 23:54:59 -0700 Message-ID: Subject: Re: [PATCH 12/43] KVM: x86: Remove defunct BSP "update" in local APIC reset To: Sean Christopherson Cc: Paolo Bonzini , 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 On Fri, Apr 23, 2021 at 5:49 PM Sean Christopherson wrote: > > Remove a BSP APIC update in kvm_lapic_reset() that is a glorified and > confusing nop. When the code was originally added, kvm_vcpu_is_bsp() > queried kvm->arch.bsp_vcpu, i.e. the intent was to set the BSP bit in the > BSP vCPU's APIC. But, stuffing the BSP bit at INIT was wrong since the > guest can change its BSP(s); this was fixed by commit 58d269d8cccc ("KVM: > x86: BSP in MSR_IA32_APICBASE is writable"). > > In other words, kvm_vcpu_is_bsp() is now purely a reflection of > vcpu->arch.apic_base.MSR_IA32_APICBASE_BSP, thus the update will always > set the current value and kvm_lapic_set_base() is effectively a nop if > the new and old values match. The RESET case, which does need to stuff > the BSP for the reset vCPU, is handled by vendor code (though this will > soon be moved to common code). > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Reiji Watanabe