From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42AD4C433F5 for ; Mon, 2 May 2022 16:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386257AbiEBQUN (ORCPT ); Mon, 2 May 2022 12:20:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386250AbiEBQUH (ORCPT ); Mon, 2 May 2022 12:20:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6D6BAE0AD for ; Mon, 2 May 2022 09:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651508197; 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=rsSALeBOA7ZWPCcmJgm1/wGrXg4q+JRs+W7rdBh5ql0=; b=ddC85xIe6EyqknPGRq3GtNS4EXuI15HxsJdpEO0Tl5onc3PSWV58fjxh9JHjYSDOHF1hVw NxwOlAb+slnI8T04sYUzBU1TlxbmKXf/9ALAOD0aoaN4606cGwnZvz0q45bGsl0v4QyfKt EDH3AlW6m3HF3wuoQWaEowMNEoXCNJU= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-dH9-QEFyMpmXPjuTvrU91Q-1; Mon, 02 May 2022 12:16:36 -0400 X-MC-Unique: dH9-QEFyMpmXPjuTvrU91Q-1 Received: by mail-ej1-f70.google.com with SMTP id jg5-20020a170907970500b006f42a861bb9so1609980ejc.11 for ; Mon, 02 May 2022 09:16:36 -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=rsSALeBOA7ZWPCcmJgm1/wGrXg4q+JRs+W7rdBh5ql0=; b=dUnfqrJ45UFO21IdwvfnpuOoDOdi/N2JDdIUG7iqAxXSxrNV31DqcAA5jbVAA9Qu9D IKy/kPXYLIXBbll+QLQ7Na2pkNCOKBuvJCWmvgh3a1iUm8d94TBbQc5/7WN0vk9ZjvgI dGFBw9L9OF742fX+omtgWclFK7dLgHhn04Fd9LevPIGqHAEzgeAf+YOMXngKWJpfHz6I kYV2mKqCoB38SzT6GFlMMOKfYRv6JAs3zpLhMnNgBRguzPeirtGrMPhjn9hrsJwQxYPW m5F0ki7xYSe7S1OxVs1Ip1Rg4JhDWKhWoU2T2wyU6kTCKAmFrdB0ODLD8zWwvKwku0im vtaA== X-Gm-Message-State: AOAM530z+ygCG4xKdEtueQScRiFlxB3gGPHNT1pOKC8pdKJZfEYn1c0f 2xUVbFNts2mwei7gtcHF7mWCf5Z2NMEsUpVScZpjVrvqJ6vVwW1RtvqOsmVDd34hJkgk4sKITVN NeS0tO98dXPtWW+PeykNDBoU0 X-Received: by 2002:a17:907:7243:b0:6f4:1ce5:4ac4 with SMTP id ds3-20020a170907724300b006f41ce54ac4mr10031089ejc.198.1651508195310; Mon, 02 May 2022 09:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU+EeBkU27lcZBl76YkQuPJxEcLDXD3icDKAgpvTHo8/6jVVf/8/GP3t2VfXVkZob1OASV3A== X-Received: by 2002:a17:907:7243:b0:6f4:1ce5:4ac4 with SMTP id ds3-20020a170907724300b006f41ce54ac4mr10031056ejc.198.1651508195058; Mon, 02 May 2022 09:16:35 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id j12-20020a50ed0c000000b0042617ba63d4sm6834162eds.94.2022.05.02.09.16.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 May 2022 09:16:34 -0700 (PDT) Message-ID: Date: Mon, 2 May 2022 18:16:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v9 9/9] KVM: VMX: enable IPI virtualization Content-Language: en-US To: Zeng Guang , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, Dave Hansen , Tony Luck , Kan Liang , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Kim Phillips , Jarkko Sakkinen , Jethro Beekman , Kai Huang Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Robert Hu , Gao Chao References: <20220419154510.11938-1-guang.zeng@intel.com> From: Paolo Bonzini In-Reply-To: <20220419154510.11938-1-guang.zeng@intel.com> 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 4/19/22 17:45, Zeng Guang wrote: > +static bool vmx_can_use_pi_wakeup(struct kvm_vcpu *vcpu) > +{ > + /* > + * If a blocked vCPU can be the target of posted interrupts, > + * switching notification vector is needed so that kernel can > + * be informed when an interrupt is posted and get the chance > + * to wake up the blocked vCPU. For now, using posted interrupt > + * for vCPU wakeup when IPI virtualization or VT-d PI can be > + * enabled. > + */ > + return vmx_can_use_ipiv(vcpu) || vmx_can_use_vtd_pi(vcpu->kvm); > +} Slightly more accurate name and comment: static bool vmx_needs_pi_wakeup(struct kvm_vcpu *vcpu) { /* * The default posted interrupt vector does nothing when * invoked outside guest mode. Return whether a blocked vCPU * can be the target of posted interrupts, as is the case when * using either IPI virtualization or VT-d PI, so that the * notification vector is switched to the one that calls * back to the pi_wakeup_handler() function. */ return vmx_can_use_ipiv(vcpu) || vmx_can_use_vtd_pi(vcpu->kvm); } Paolo