Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp585560ybx; Tue, 5 Nov 2019 02:19:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwLN43oW8ejiR1U5/ySkXVIwLp/uFPa3L1QssSaBVMHQMlT/bVHUaPydFqCFt8+xeYLH03q X-Received: by 2002:a17:906:194a:: with SMTP id b10mr917964eje.123.1572949181725; Tue, 05 Nov 2019 02:19:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572949181; cv=none; d=google.com; s=arc-20160816; b=qjJVb7x01w2BZ7XT9AEQcC+kVPWySf0HQxfdm2NhFvHEKrE2qnHDNKuSszc3xmVoR0 vlLp26X12hOK2WZW4ifQJSVjBeCxrblSSExil44aF9Z7UVJh/TrjkfAayVvEQ5Hcn9pe hYE0e8FFzs+M3buFVMpb9QsTp8g8dFyHwN8XK94DIEM4nNjhnNQ/+0xrlXlf1tyvlHtz 8RGZNoeU+4Te9Rr3IijimOSs73kWvFBrmGhzaLpq3XnpM3IUGEgmz0hzOiewAEqU20rf xF2+2SSWIx6suupXCgZ6A+6OGwfRn+dPWOTdSZ4vitTRDxvskAkzZALzlOujlZHwx6s5 K+qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=6YtyP3d7GKpXhJ6iYMKzsdpoIP+eq3/ULbzl9sQyXQs=; b=ceVF8RGU/RzHDqXIdwHrP5h8fYBZFbkzoqyQNuDgNzhxFRuUJOR0ciQg00pqY1dRVs zM1BKWhmSX1arSHHOhkvHsJA53wEuHtCS2+rkyM2dLjr1Z4j3QFf9BuMgUGDDFSQGyCx wxj+xI/UfwicihdP1IfQYDpr8bhwox+iB8u5m4fY717GMXkfuttYo6/QmxTUkm1/wBEg lNsR4J4Km3sLPub26xSjwwWQSkOFaJwKja0SICWqgYFHtj4Zlb94yWt/JbEciJqUdLci bpXvVBh20qG8GD0olAjCgKqFjEZH5+8oyh5NVAcdhp91QczK0gHZ18R5Xg+qSsfXANFG Z+NQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ec22si12649197ejb.232.2019.11.05.02.19.17; Tue, 05 Nov 2019 02:19:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388446AbfKEKQt (ORCPT + 99 others); Tue, 5 Nov 2019 05:16:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54662 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388252AbfKEKQt (ORCPT ); Tue, 5 Nov 2019 05:16:49 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CAFA85365 for ; Tue, 5 Nov 2019 10:16:48 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id l3so3626646wrx.21 for ; Tue, 05 Nov 2019 02:16:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6YtyP3d7GKpXhJ6iYMKzsdpoIP+eq3/ULbzl9sQyXQs=; b=nq1RtvZui1Elq00nusWoSbrHGUHJcxz4swVlkWMPPhfbXNzgOk9l4Pl8FL1OqK7JOT l1T88yBofU/Rlmc/4E3UZG096dT/laxOEFJ3CBahz2ZFi54RlbiSQZNG4gBMohzt8KJX N2dO1gO30qLwZ3j8gyjGYJJyRimwld/c1iMGTEUZYJz9BpeDMhxDrxxyYZ5+kt72hTde 7Pzqijl94ldKv/8JWzhcxiuliEES5cbt4EweErW3MqzqV3Bk9tMuaQZa9Sl1h9wmNOwU 1qs07aH8kyekJ7mLFo2F4gj+wF+HgI/9Hatkj3D3PfvdLOc04Uvv5oKa294EyH9HHMud zFQQ== X-Gm-Message-State: APjAAAWnmIdb/cye2+tUn3oOtaYHtr1UcSV5nAWl8z1B04vGwoIFGLSz G6wouXUoPTA+Vil0PTgJQEdD1mTddmMtcqR0RnKrKH9hD266jPu34fLxdkcTuG91PRT6dQKAtqs TCvitkBC9KwZwUXEzOmEsgTJX X-Received: by 2002:a7b:c444:: with SMTP id l4mr3340048wmi.21.1572949006662; Tue, 05 Nov 2019 02:16:46 -0800 (PST) X-Received: by 2002:a7b:c444:: with SMTP id l4mr3340025wmi.21.1572949006357; Tue, 05 Nov 2019 02:16:46 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:4051:461:136e:3f74? ([2001:b07:6468:f312:4051:461:136e:3f74]) by smtp.gmail.com with ESMTPSA id s13sm18919608wmc.28.2019.11.05.02.16.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 02:16:45 -0800 (PST) Subject: Re: [PATCH 07/13] KVM: monolithic: x86: remove __init section prefix from kvm_x86_cpu_has_kvm_support To: Andrea Arcangeli , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vitaly Kuznetsov , Sean Christopherson References: <20191104230001.27774-1-aarcange@redhat.com> <20191104230001.27774-8-aarcange@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <232b6fcf-c441-7d85-00a4-43187e3393a6@redhat.com> Date: Tue, 5 Nov 2019 11:16:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191104230001.27774-8-aarcange@redhat.com> Content-Type: text/plain; charset=utf-8 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 04/11/19 23:59, Andrea Arcangeli wrote: > Adjusts the section prefixes of some KVM x86 code function because > with the monolithic KVM model the section checker can now do a more > accurate static analysis at build time. This also allows to build > without CONFIG_SECTION_MISMATCH_WARN_ONLY=n. > > The __init needs to be removed on vmx despite it's only svm calling it > from kvm_x86_hardware_enable which is eventually called by > hardware_enable_nolock() or there's a (potentially false positive) > warning (false positive because this function isn't called in the vmx > case). If this isn't needed the right cleanup isn't to put it in the > __init section, but to drop it. As long as it's defined in vmx as a > kvm_x86 operation, it's expectable that might eventually be called at > runtime while hot plugging new CPUs. > > Signed-off-by: Andrea Arcangeli > --- > arch/x86/include/asm/kvm_host.h | 4 ++-- > arch/x86/kvm/vmx/vmx.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 2b03ec80f6d7..2ddc61fdcd09 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -998,7 +998,7 @@ struct kvm_lapic_irq { > bool msi_redir_hint; > }; > > -extern __init int kvm_x86_cpu_has_kvm_support(void); > +extern int kvm_x86_cpu_has_kvm_support(void); > extern __init int kvm_x86_disabled_by_bios(void); > extern int kvm_x86_hardware_enable(void); > extern void kvm_x86_hardware_disable(void); > @@ -1190,7 +1190,7 @@ extern bool kvm_x86_apic_init_signal_blocked(struct kvm_vcpu *vcpu); > extern int kvm_x86_enable_direct_tlbflush(struct kvm_vcpu *vcpu); > > struct kvm_x86_ops { > - int (*cpu_has_kvm_support)(void); /* __init */ > + int (*cpu_has_kvm_support)(void); > int (*disabled_by_bios)(void); /* __init */ > int (*hardware_enable)(void); > void (*hardware_disable)(void); > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index e406707381a4..87e5d7276ea4 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -2178,7 +2178,7 @@ void kvm_x86_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg) > } > } > > -__init int kvm_x86_cpu_has_kvm_support(void) > +int kvm_x86_cpu_has_kvm_support(void) > { > return cpu_has_vmx(); > } > I think we should eliminate all the complications in cpu_has_svm(), so that svm_hardware_enable can use it. I'll post a patch. Paolo