Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp606190pxb; Mon, 25 Oct 2021 14:50:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMfz4Gf8Lqe4Ks/e0fr71/zvECN6PcRCBC3hwRWxYt+EakcVJagou6zwWRMmAasjrF/tU6 X-Received: by 2002:a17:902:7781:b0:13d:c9fe:6184 with SMTP id o1-20020a170902778100b0013dc9fe6184mr18386783pll.25.1635198603503; Mon, 25 Oct 2021 14:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635198603; cv=none; d=google.com; s=arc-20160816; b=IQnnrui/Y10vHVUUy48wI6ZeJ84FFtRroV46tOeCV0OpQX8XNmn+Drw6EvHoCd+cLU ns4fogebabaJo7LxaOZRbUct6na9q6BzjeRtgUWGJIBC4X6jSRXLw2naXtzIk/AZvXXw KbehsWlUPGqxP7F6W3wp38HHPlbKFI3r13Ns3q4didjDqnpXW8evyOr09rXX//YmsuCb C/+h+Zp8dfCWJMWMC0LW5hqPoc6oYE0C6T7Mb3vVPyRpnF4iYEKB2uI979SEhocO8rfm RliVuFWzLEDW2aNRJ2/Aml/bvn7uWsQA9xoZI75IePvunm81RJu0y+y6aWkZ7LTEOQn3 dAow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MCI+8dQa/U6UbsL5gbfoLfO4WAaUcQYsMls2gbgANLc=; b=lyhFKxUn8qEuPdmv93+1Y3svJBcUgQieMrDZqR3Kn0D5ocmywX7DfW+z2o+L5BnAhR uJI1N3jCXodfiZYi+wrz1ptI8EmKmuatAJiYcAsXuq7cn69ddlU7Cxypxq/dSL+N8zVS xhDCNh9LHuMkkjyPMnVesQJB4qWWkFdYDZG46j3gSQ1yiNOfMwDW7z1b19b+wD12TpJu gXtmIx4u9knOq39qXQbUrQVcu1iXH8lonTfT6Ih6xOjDJLJt9vJcv+fqYY9kDOZaNmiF jKBX/k/uGSCHxBsS2NI3+/OB/LoxmDb8/ggX58moacIGUJmawEE4FuUYD508LtEUXmDc eqJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d5fBTafV; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si30144440pgu.584.2021.10.25.14.49.49; Mon, 25 Oct 2021 14:50:03 -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=@redhat.com header.s=mimecast20190719 header.b=d5fBTafV; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233472AbhJYQAL (ORCPT + 99 others); Mon, 25 Oct 2021 12:00:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49517 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233195AbhJYQAH (ORCPT ); Mon, 25 Oct 2021 12:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635177465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MCI+8dQa/U6UbsL5gbfoLfO4WAaUcQYsMls2gbgANLc=; b=d5fBTafVsle7rlJGdQNqsXio/F72LOo2tQDiG5d8pnwkxANT5JCfW5IUfmH6YSz68+2OF2 lAqa8X9kupvqCKBQnpBdImbNZ51Ze4GOgRx9pIDgn+blDJGJf+IJq2SdetOZO6PUGA7yLL C/y2qcIGdg5S5spV4/4PRPahunXd4rs= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-sgqWgnQXM6epBBJQwQ_sWQ-1; Mon, 25 Oct 2021 11:57:43 -0400 X-MC-Unique: sgqWgnQXM6epBBJQwQ_sWQ-1 Received: by mail-wm1-f71.google.com with SMTP id k126-20020a1ca184000000b003231d0e329bso3668024wme.4 for ; Mon, 25 Oct 2021 08:57:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=MCI+8dQa/U6UbsL5gbfoLfO4WAaUcQYsMls2gbgANLc=; b=huFKzQqlQr4tYQZfhg+HUX7tdf31lhtyuJMmDPgsoeOPgj1oCuDqGge5h8tFiq1Km3 +5ivcmaIiMSqu52RoKzuTVTwgMtAHPS2q+z+STCAc3v0m3F8GI4PZpETviO7gVucRlRJ qEACJbx0dQnd/+77LqgWxmjkicmtLZMPZnxMn+fYkzUNF1RhYpwrjbqD4uXZSv2iSi/D BUcyXZ6FiRZEXPS6DStfot/H9g7ugLEwZnJ/T7yG8a3PLeJpd4SnYCGuXrWAJE231G7x MNd2imuzqYSmk8/g23dneRa3F6DJRibTIMzm7uFfULsIMMLrRYL1GZYdRuNVRFhmCC3M D8Ww== X-Gm-Message-State: AOAM53310mkNDdxfpexXW0C7b/fbTMokbCH0PVERB1YeRHZsiucdca7F +b3X6hJr5+K9C6MbzmvWehniQE8dWyeFGuD90qn2vm4L0d+fdvJtlyWMDXVg9tJdr1Kdvj7ufLU oLGvBCk3NWzPFDHuMAPy5KiW4 X-Received: by 2002:a1c:ac86:: with SMTP id v128mr20601939wme.3.1635177462566; Mon, 25 Oct 2021 08:57:42 -0700 (PDT) X-Received: by 2002:a1c:ac86:: with SMTP id v128mr20601909wme.3.1635177462345; Mon, 25 Oct 2021 08:57:42 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id q18sm19326723wmc.7.2021.10.25.08.57.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Oct 2021 08:57:41 -0700 (PDT) Message-ID: Date: Mon, 25 Oct 2021 17:57:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v2 37/43] KVM: SVM: Unconditionally mark AVIC as running on vCPU load (with APICv) Content-Language: en-US To: Sean Christopherson Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang References: <20211009021236.4122790-1-seanjc@google.com> <20211009021236.4122790-38-seanjc@google.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/10/21 17:48, Sean Christopherson wrote: > On Mon, Oct 25, 2021, Paolo Bonzini wrote: >> On 09/10/21 04:12, Sean Christopherson wrote: >>> + /* TODO: Document why the unblocking path checks for updates. */ >> >> Is that a riddle or what? :) > > Yes? I haven't been able to figure out why the unblocking path explicitly > checks and handles an APICv update. > Challenge accepted. In the original code, it was because without it avic_vcpu_load would do nothing, and nothing would update the IS_RUNNING flag. It shouldn't be necessary anymore since commit df7e4827c549 ("KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC", 2021-08-20), where svm_refresh_apicv_exec_ctrl takes care of the avic_vcpu_load on the next VMRUN. Paolo