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 CA7B1C433EF for ; Tue, 3 May 2022 02:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbiECCsg (ORCPT ); Mon, 2 May 2022 22:48:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbiECCse (ORCPT ); Mon, 2 May 2022 22:48:34 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65624369FB; Mon, 2 May 2022 19:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651545904; x=1683081904; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=/bNB+zpgktSurx6RJChgfpna9Tyajeuzw4/vl6QYpPw=; b=TG+cNY6+i7y/I06nmNHCGPOefEvbtG/Dap6aT0FrKhvuCFLE+T1ueAL1 ZljzBvHbDFBOCthr/WPlRBk3ICZTVAKw7XeoLlQSYZIcuJA3N9goWsU+6 DDgg2ItbmS573ylI+wTXPXrIJt7ENnweIGw9XHN43O9eNCe5oQzFAIhbl S3FQSwJoONK63FbVHPBuGhrRZHCh6hUC7WwAGRtrik170E402ckTeXvG8 THQP39Vtbqm+wXkAfufjhczHM6SJVx10Yn5auWHMxqcatefTh9pqFCuC8 o2nmMAAQcPz9iNPZ5LuRCEQUsbIcY+7RgZcnMFDVDWAd2rUQ9F6kCjtg+ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10335"; a="292568132" X-IronPort-AV: E=Sophos;i="5.91,193,1647327600"; d="scan'208";a="292568132" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2022 19:45:04 -0700 X-IronPort-AV: E=Sophos;i="5.91,193,1647327600"; d="scan'208";a="584008817" Received: from zengguan-mobl1.ccr.corp.intel.com (HELO [10.252.188.134]) ([10.252.188.134]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2022 19:44:58 -0700 Message-ID: Date: Tue, 3 May 2022 10:44:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v9 9/9] KVM: VMX: enable IPI virtualization Content-Language: en-US To: Paolo Bonzini , "Christopherson,, Sean" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , "kvm@vger.kernel.org" , Dave Hansen , "Luck, Tony" , Kan Liang , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Kim Phillips , Jarkko Sakkinen , Jethro Beekman , "Huang, Kai" Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "Hu, Robert" , "Gao, Chao" References: <20220419154510.11938-1-guang.zeng@intel.com> From: Zeng Guang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 5/3/2022 12:16 AM, Paolo Bonzini wrote: > 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 Thanks. It's much accurate and better to describe the functionality of this API. I will change it.