Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp22190pxb; Fri, 17 Sep 2021 17:33:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwwpVU3UtwYPHTgjRNsrU5NCxlBadSpPnudoxr75lJDICC/hrsM/MKlITM7lgprJknqC9P X-Received: by 2002:aa7:d895:: with SMTP id u21mr15640761edq.300.1631925223523; Fri, 17 Sep 2021 17:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631925223; cv=none; d=google.com; s=arc-20160816; b=GwgKQOC9AutOFnJL0dEMN8vPY2+gyeFq49Ny111FYzapSBpwV3hTtcYLOciUF4rKFh ZWQdIGDxn5LG1mkAX9WYIdhEJQ6bd3AL6N9fdToRkuVdlN0QlneHj69FvcAx8i8B8RfP S3lzSgZ4yWWYa4mOmleQ0jLu/W3rExkd0MT1ZFoiWnwNAdoabtqHCctPchPRZeOFOV4y 7Vi0OsTDjtaDnecY9uNx3283ItLqvBYpCNONe5TxfUc3v0b7bV4AzOnLXrLDUo7OO+Ic 1/0uMjDJ0FpWu1v38lsFLYXPoA9MSAi+18h7fsVaxZ/UfpHi+X/HSMJQigwNtbbomSAJ Sp3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3t7X0QASK5v1HEVLBdSk16IXY8GQmhjthJVq7OarzdE=; b=kwEXjufn8fhzxVfWkVOoUwN0om2/b2KUdc2v869OUtaA4MbRpEPYBijYUCKT3yKpLA nF6/lCuvEYHJdkxVcuIkKhgjRNaxXqhYxt53v2G84XIFs0ERY055X+Uvrb+X5Uhtvxol 0ygNpCuLtoA5HtXzMRdMkL1BzdRKQRJ+sfVusgmN5FA2bONL0FuSmtuTBiLk82Qegt29 m0wqpXk2TFLZijbBGm7s9VfmnR4kOAnUjHo3oBQTyZcQubjoRI97BnSAX1o3naEV1FES YXBN+dFf6Q3Sc5vTrAghh96MzG0vxXw9vCbiiGeLV8YH7i79y3UVOIbvlpY9MAGIrkYV 9aUQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si10124237ejo.259.2021.09.17.17.33.20; Fri, 17 Sep 2021 17:33:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243084AbhIQQLj (ORCPT + 99 others); Fri, 17 Sep 2021 12:11:39 -0400 Received: from mga01.intel.com ([192.55.52.88]:9698 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242637AbhIQQLh (ORCPT ); Fri, 17 Sep 2021 12:11:37 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10110"; a="245224085" X-IronPort-AV: E=Sophos;i="5.85,301,1624345200"; d="scan'208";a="245224085" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2021 09:10:13 -0700 X-IronPort-AV: E=Sophos;i="5.85,301,1624345200"; d="scan'208";a="546477010" Received: from zengguan-mobl.ccr.corp.intel.com (HELO [10.254.208.219]) ([10.254.208.219]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2021 09:10:08 -0700 Subject: Re: [PATCH v4 6/6] KVM: VMX: enable IPI virtualization To: Sean Christopherson Cc: Paolo Bonzini , 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" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "Hu, Robert" , "Gao, Chao" References: <20210809032925.3548-1-guang.zeng@intel.com> <20210809032925.3548-7-guang.zeng@intel.com> From: Zeng Guang Message-ID: Date: Sat, 18 Sep 2021 00:10:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/11/2021 7:55 AM, Sean Christopherson wrote: > On Fri, Sep 10, 2021, Sean Christopherson wrote: >> On Mon, Aug 09, 2021, Zeng Guang wrote: >>> + if (!pages) >>> + return -ENOMEM; >>> + >>> + to_kvm_vmx(kvm)->pid_table = (void *)page_address(pages); >>> + to_kvm_vmx(kvm)->pid_last_index = KVM_MAX_VCPU_ID; >> I don't see the point of pid_last_index if we're hardcoding it to KVM_MAX_VCPU_ID. >> If I understand the ucode pseudocode, there's no performance hit in the happy >> case, i.e. it only guards against out-of-bounds accesses. >> >> And I wonder if we want to fail the build if this grows beyond an order-1 >> allocation, e.g. >> >> BUILD_BUG_ON(PID_TABLE_ORDER > 1); >> >> Allocating two pages per VM isn't terrible, but 4+ starts to get painful when >> considering the fact that most VMs aren't going to need more than one page. For >> now I agree the simplicity of not dynamically growing the table is worth burning >> a page. > Ugh, Paolo has queued a series which bumps KVM_MAX_VCPU_ID to 4096[*]. That makes > this an order-3 allocation, which is quite painful. One thought would be to let > userspace declare the max vCPU it wants to create, not sure if that would work for > xAPIC though. > > [*] https://lkml.kernel.org/r/1111efc8-b32f-bd50-2c0f-4c6f506b544b@redhat.com Thus we keep current design as no change.