Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp886647pxb; Wed, 27 Oct 2021 14:29:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhfd1CT+nURSLW7WZZe8dzmRHaOxwdFY2OBGpLvQDlXt4qxEog06Or8zTLZT2QYzCwH5mr X-Received: by 2002:a63:3348:: with SMTP id z69mr177146pgz.177.1635370152862; Wed, 27 Oct 2021 14:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370152; cv=none; d=google.com; s=arc-20160816; b=LpeU0C8XaL1vE7Lo9ZeN4U0YV8BbZ1QEzF7MG2136ERbZ8SnZ9S+LAjeUZFypJlymF 0M730hvhgVgHXEMaKYhj+4NxH5S0ct3RS6OiBpbRr54xJ3vJRLNbefxd4gFmLmREsbRQ Al+6oisAuhu+QK/Y+2oeLrWrv3ohqT/UE88ghnV/8k0nUJRGuEVbWS1yZKXnOKcGcY1U obLUAHusVNk81W/5UtQa7GdL2C81fLYtqq0hvpgjWg/w8ywUugZZRrVD3hu3alI//8im hEFSeldcskVmvoS0zVMRcGfC8FGqzBeX3gPepVlQGr3bmC/8vMxousswtXODKKVxRKKp ycdA== 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=YJ1AvjILyDHE6A0xH65m+vjqkknvkqBvDuAHk95niU8=; b=NVNwRCYq4fL9fehr/MwZWeHzgwPZp4bJ6/cxFPr/cEQyVVgIsCwYO8q+imtmfMS0HN lvwbsTo1b7mzmbPHHci52DBlq9Kt8ND+bpeliYHldIUt4g+t8/L50P9YKIzIAhoTCv/R /3p3x0JZrfaRKGw0QB/ymo3mqerYVF6K9qvgm+SJwrnBzq6HZCnrl9Tp9sg0Sf0soSqI 8SbuwGzJKha9ORz6JuFEOLeQ5kKdIUFd39F4rhjhvG+dyyKP4nGNuD/oK7WwPtjMnAxw x0IBu86FB8SjM3pUDG0a8KDq9MlePG+gRnTK78ONBHdIZxl1um3x8sKc/wZZSamwipaF euvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NNZezK5I; 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 n13si1686351plh.370.2021.10.27.14.29.00; Wed, 27 Oct 2021 14:29:12 -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=NNZezK5I; 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 S236531AbhJ0QRQ (ORCPT + 97 others); Wed, 27 Oct 2021 12:17:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24371 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbhJ0QRP (ORCPT ); Wed, 27 Oct 2021 12:17:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635351289; 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=YJ1AvjILyDHE6A0xH65m+vjqkknvkqBvDuAHk95niU8=; b=NNZezK5I92wtIcPstDA/xymm972gQZ9WtIC5LNxfA9/cKxuo+jbIJpAKxG+WhoLmdVV01i NfPQgaZ9mJOfSB0HBcNLWZgEKlOhbZu9FMixihVNRp0ciu5gnbRZwRTQfUaUFD0slfDuBp DgWNhhGjuOT8NzyXPJVCkv+W8CekUrs= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-B302cc1FNk-CVBhEuZppYA-1; Wed, 27 Oct 2021 12:14:48 -0400 X-MC-Unique: B302cc1FNk-CVBhEuZppYA-1 Received: by mail-ed1-f69.google.com with SMTP id t1-20020a056402524100b003dd9a419eb5so2827623edd.4 for ; Wed, 27 Oct 2021 09:14:48 -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=YJ1AvjILyDHE6A0xH65m+vjqkknvkqBvDuAHk95niU8=; b=UKtHBy8HvwRGirPeFHgWJG7HEucI/0j5mXKAwLVVEQOpDrWoYzrqD6RQ82JwGK4uNX d3z5BYq6jaFoFCKuuYxQY4fYl5uY690hxAKu/hZ2gzWZFcqecbB4e7MFwcBU8RtvErZp upgzvBlE45bKSYcsuvyOGsBQE+ESbppcBDI3GTIrrzF7m4kgRVzPLgQxjHIQudmsR8RM MRMxr2xlRNdEYOu3zTuSKjVGDCKY2ubklOh3rOpOThllGD+vBCallIlHEuMXgo5dSsL8 G3hspbBohulxVaGO+PWZMIbMHh7OJEQunz/xMEKbZJWjmurJmVdQaQdd6L9cbj0EkQoK qDwg== X-Gm-Message-State: AOAM530N6FRE0maZjntNeLIaQvJ99KFb+qCEAIut+lK/01WuDjxzpuS2 vhpzCbJtgPhYlxlzM4QykthLU+dyM4pZXSXhQJaPIgbqpQuA4q3Nw5/s8KPQR4XpXHiWswQbsZp Pj2SZtRkT2pHYjy16/a/5W73i X-Received: by 2002:a17:907:16a7:: with SMTP id hc39mr22891310ejc.214.1635351287165; Wed, 27 Oct 2021 09:14:47 -0700 (PDT) X-Received: by 2002:a17:907:16a7:: with SMTP id hc39mr22891269ejc.214.1635351286915; Wed, 27 Oct 2021 09:14:46 -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 sb30sm195562ejc.45.2021.10.27.09.14.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Oct 2021 09:14:46 -0700 (PDT) Message-ID: Date: Wed, 27 Oct 2021 18:14:44 +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 35/43] KVM: SVM: Signal AVIC doorbell iff vCPU is in guest mode 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-36-seanjc@google.com> <0333be2a-76d8-657a-6c82-3bb5c9ff2e3b@redhat.com> <185502d7-861e-fa5c-b225-419710fe77ed@redhat.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 27/10/21 18:08, Sean Christopherson wrote: >> Right, so should we drop the "if (running)" check in this patch, at the same >> time as it's adding the IN_GUEST_MODE check? > LOL, I think we have a Three^WTwo Stooges routine going on. This patch does > remove avic_vcpu_is_running() and replaces it with the vcpu->mode check. Or am > I completely misunderstanding what your referring to? > > - if (avic_vcpu_is_running(vcpu)) { > + /* > + * Signal the doorbell to tell hardware to inject the IRQ if the vCPU > + * is in the guest. If the vCPU is not in the guest, hardware will > + * automatically process AVIC interrupts at VMRUN. > + */ > + if (vcpu->mode == IN_GUEST_MODE) { > int cpu = READ_ONCE(vcpu->cpu); Nevermind, I confused svm_deliver_avic_intr with avic_kick_target_vcpus, which anyway you are handling in patch 36. Paolo