Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5006416pxj; Wed, 26 May 2021 00:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzLusl2o2kFgfpYWnOqWxAstZhSP/MUerVVc53nPUKGNREcLCZ9gIUIhCOdjPXYmtv34rr X-Received: by 2002:a17:906:2894:: with SMTP id o20mr787241ejd.520.1622012469031; Wed, 26 May 2021 00:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622012469; cv=none; d=google.com; s=arc-20160816; b=szp/LVWt9GEnEIrydNo18vujNZijswCsqAuI2k7IYmv8BPvi6AqsuQiBXgXlUg4Tp4 O3Kylhw8DsofKsSrTHrfBG+SVqDD5u6+nLlOXLA0ZBtY5n/xPwXVwfQICBUiR7s780se sCjl7cyyZt6P00D1oYA3h1WSWhUgGrPpvKpQaaGcEKg6P8/dXAL3IevljRHqNUW0+gOA Gc8PYCiYT1ak9GKWCoeExyddOnZHYTjmM7a4II/2RK3lavv+S3j+39W74AlXx08ymuDE i+UQqKC4QKrlHaQu9WbOzqF15JeWRCILXLQeQ3BpIpzE2jYdGZ4cZtKhVnZpwWR/gkTq L2yw== 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=OghfnCYzIco1oCB8DECwfdKUj+xfk1JNRs+3JjyLdXI=; b=xg3m4sSY4Xo7qlEaOtTRsv5oSsWSeDrzvQFU/Q8iF4HLd3hhMwEQmZ5k3Qx9DqaqMo uNp7A0bFwt6WJdDmt0HouBg3mHwAqmwye5pZtyr9PakGBP08EWGJAfds+Ks55IRNcKzr z2/xtdoEAgcXUW/BF/Kx03XyYMvIvIplf+Sykb5v4Z9ciiAgTcN4Z6+gimGGcL5R3GAE oACUBpy4tz9EdPCMXczVVbeBmLbOCauqLGK/nVBzfX7jOaDIuDIwdxh8HpTTDbt+EStv 6GBWx69dsx84gjTaZraaiob101XxJKxz6akDPurxT195karO1oEJMwoJnDineFr6DJMx CNFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CCftkdps; 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 y16si18590571edc.193.2021.05.26.00.00.44; Wed, 26 May 2021 00:01: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=CCftkdps; 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 S232942AbhEZG50 (ORCPT + 99 others); Wed, 26 May 2021 02:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232678AbhEZG5X (ORCPT ); Wed, 26 May 2021 02:57:23 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D8EC061574 for ; Tue, 25 May 2021 23:55:52 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id m8-20020a17090a4148b029015fc5d36343so350528pjg.1 for ; Tue, 25 May 2021 23:55:52 -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=OghfnCYzIco1oCB8DECwfdKUj+xfk1JNRs+3JjyLdXI=; b=CCftkdps53BVXky2a9t4INCXiuBpldrwHuYcfsj9FttPg9GWoJMIbrkQPyFn2MYHIf bkw6b6zp9AUYdfjPZQroCwWoeyRlmE/2TAfr3U37E7UB8yknBqC4cvY0lHPvUlROS9UD eao02dBf+HTJvDo3JdkmS0VaouKxD1I+3c1LTjCckBYxsaLqCMVotKxMKJtEZE1izPs6 f812utp0zPSVIfJajOBZORYmQJu76xCDQYPyv06KK5Hh2/ftc1MNKSg0KycP8XdMDo6L nblUf2RnO1XQakl22pTpRPpHxuKKjUKg5PWuXVFDXzZ6OEYb0/MSMYpcVEnSnUtDzb38 pnyA== 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=OghfnCYzIco1oCB8DECwfdKUj+xfk1JNRs+3JjyLdXI=; b=op/GLI9TUPvWviIrfu20otfNcsbWBuxQZZtoUVfzLVuwcWQjw+Xa2EFnF0+GTkDB/2 wXfzj9TsTOSmbAvj/Eq7XIjrNhj+bsoPDDMBCHf3gGg5+r2entYZsbQ/qRvZr3U0jGII RM/SXOc7TKr2Ha6stbrclm8gz6hdcY09rs/wJMdexyJBo5aTdZDNEkINNeAKMlI7u77/ EDEIJi3sqc+Tu4sA+QjG1qSH5fqmnOwGVuM//lSEIyF5lS8V75XNQvcrtTu9vCiNcyix 0R/QyCaG048AQrp/h9y6/uJ1yNaLwnBmUAy6lP6fFi4aU64SyEH8gtakqI/saqXVM655 PYjg== X-Gm-Message-State: AOAM530Yfl/0sI+E0L5tIp6j6hGyjcBa6u1gJmnDqt6RO6XORZQqpIui KJfeaovb20cSkMqLVAM1kMCctvQOhB6ubbZSP0Q53g== X-Received: by 2002:a17:90a:6f06:: with SMTP id d6mr34723831pjk.216.1622012151775; Tue, 25 May 2021 23:55:51 -0700 (PDT) MIME-Version: 1.0 References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-17-seanjc@google.com> In-Reply-To: <20210424004645.3950558-17-seanjc@google.com> From: Reiji Watanabe Date: Tue, 25 May 2021 23:55:36 -0700 Message-ID: Subject: Re: [PATCH 16/43] KVM: VMX: Stuff vcpu->arch.apic_base directly at vCPU 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:50 PM Sean Christopherson wrote: > > Write vcpu->arch.apic_base directly instead of bouncing through > kvm_set_apic_base(). This is a glorified nop, and is a step towards > cleaning up the mess that is local APIC creation. > > When using an in-kernel APIC, kvm_create_lapic() explicitly sets > vcpu->arch.apic_base to MSR_IA32_APICBASE_ENABLE to avoid its own > kvm_lapic_set_base() call in kvm_lapic_reset() from triggering state > changes. That call during RESET exists purely to set apic->base_address > to the default base value. As a result, by the time VMX gets control, > the only missing piece is the BSP bit being set for the reset BSP. > > For a userspace APIC, there are no side effects to process (for the APIC). > > In both cases, the call to kvm_update_cpuid_runtime() is a nop because > the vCPU hasn't yet been exposed to userspace, i.e. there can't be any > CPUID entries. > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Reiji Watanabe