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 X-Spam-Level: X-Spam-Status: No, score=-1.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D6CFA3721 for ; Wed, 16 Oct 2019 01:52:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60DEE2086A for ; Wed, 16 Oct 2019 01:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733222AbfJPBwn (ORCPT ); Tue, 15 Oct 2019 21:52:43 -0400 Received: from mga05.intel.com ([192.55.52.43]:21397 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728338AbfJPBwm (ORCPT ); Tue, 15 Oct 2019 21:52:42 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2019 18:52:42 -0700 X-IronPort-AV: E=Sophos;i="5.67,302,1566889200"; d="scan'208";a="186007667" Received: from unknown (HELO [10.239.13.123]) ([10.239.13.123]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 15 Oct 2019 18:52:40 -0700 Subject: Re: [PATCH] KVM: X86: Make fpu allocation a common function To: Paolo Bonzini , Vitaly Kuznetsov Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Sean Christopherson , Jim Mattson References: <20191014162247.61461-1-xiaoyao.li@intel.com> <87y2xn462e.fsf@vitty.brq.redhat.com> From: Xiaoyao Li Message-ID: <6cc430c1-5729-c2d3-df11-3bf1ec1272f8@intel.com> Date: Wed, 16 Oct 2019 09:52:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/15/2019 5:28 PM, Paolo Bonzini wrote: > On 14/10/19 18:58, Vitaly Kuznetsov wrote: >> Xiaoyao Li writes: >> >>> They are duplicated codes to create vcpu.arch.{user,guest}_fpu in VMX >>> and SVM. Make them common functions. >>> >>> No functional change intended. >> Would it rather make sense to move this code to >> kvm_arch_vcpu_create()/kvm_arch_vcpu_destroy() instead? >> > > user_fpu could be made percpu too... That would save a bit of memory > for each vCPU. I'm holding on Xiaoyao's patch because a lot of the code > he's touching would go away then. Sorry, I don't get clear your attitude. Do you mean the generic common function is not so better that I'd better to implement the percpu solution? > Paolo >