Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp282141iob; Mon, 2 May 2022 19:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2u5s/0sfZyqW0HZctJUJzpodLqx+CXQPwQh08jmoeT/+Akzn7GhLJUStOwCNnR4F6spkq X-Received: by 2002:a65:654f:0:b0:378:b8f6:ebe4 with SMTP id a15-20020a65654f000000b00378b8f6ebe4mr11933799pgw.399.1651545941263; Mon, 02 May 2022 19:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651545941; cv=none; d=google.com; s=arc-20160816; b=ZIDZ7x9uznPj0wjURloCjeigf0HNUKofxLcbh2OfdnrqLaLqD1svfQw36odMJb2lOQ 18dSHbEDW1vYzwoyyV8+ixOOCNB3/WpHYfkNPtaYUOK/u+9vFNOTJFCXjMEbVy+Bs87G QUdR2+M6WHIMmIfNEaczHJ+sEQ2HgcDFhrDZlf8Qah/FxBRR3fg0cDwJBV2Z2d/jQh/a d3l8W3URv7ADURVDQcKe3VSyVqpXQzqieiwikAyONl65EwKepvspessHNYnuLwSm6b0F 0SqjZP4wE2M2KuSadbQ/dmItDyOY5vD1ZOL5kzDZic3XEsvqW/pgm9HMR2q4fJd7TGZ+ qwqg== 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=u+94xW92Vhi9FCXeepuS2o1E0GTC9cjLq/sPZZ/PkRA=; b=ODmZJCUUeKa/7isKENIZgVimWqWTH5NFBZB9Zrr0FKamgITcmIZQ4VmI3XcHtpP9Xt zOiSYvWUJyDhCRxyoo6EsJvUal6y0Y0a9GCqd+dRFKkpOn40lmGLF9hjjx998Z0dogek V3RE0g+6UM0lOJO8yYPYmQmDhDwrEWTftQ6z48PK3PcgKrklUB3l2/bjvYt2hyAuVrim 8G23oslYgdkLjgG5fRDyHzkL4O6rbJ5s6oaWDinWgKjybjGfNKgB45vsYh9c7CnQOGNY Acy/B3bwVyyYxavUO6IGfWZQluNSzE1aAblOLt3fUSfHIQAlr8Qkg21ZeVUxJwLLAwgE 0rWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TG+cNY6+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c19-20020a056a000ad300b004fab5b929fasi16405541pfl.21.2022.05.02.19.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 19:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TG+cNY6+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12F63F58; Mon, 2 May 2022 19:45:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbiECCsg (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.