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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 937E5CA9ED3 for ; Mon, 4 Nov 2019 23:00:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65CFD2080F for ; Mon, 4 Nov 2019 23:00:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SQs++U6Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730238AbfKDXAZ (ORCPT ); Mon, 4 Nov 2019 18:00:25 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52479 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387449AbfKDXAU (ORCPT ); Mon, 4 Nov 2019 18:00:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572908419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MPSLE44CrTdmlpvXHFayzgdX5FlkhhVbp9gFdKUYL+k=; b=SQs++U6QZjBp+3irouLEZIWS9rkj/2HUxBwPr/75BDx7PDD2NHZgwhGVQ2TvMR/UKqKLFU q/MVv97J1WdQCk8xkfbMaLNxjag8lurIldBcvmbqG1HuWJQ/m8Sc+Ed4iqgUnLNdCENOjb jbeNlzjV0XcQp8qtKcEhYdsCSgenF30= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-240-b5UzRDpCM4imlDSRq6tXOg-1; Mon, 04 Nov 2019 18:00:09 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8221B1005500; Mon, 4 Nov 2019 23:00:08 +0000 (UTC) Received: from mail (ovpn-121-157.rdu2.redhat.com [10.10.121.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B31C4A0E; Mon, 4 Nov 2019 23:00:08 +0000 (UTC) From: Andrea Arcangeli To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paolo Bonzini , Vitaly Kuznetsov , Sean Christopherson Subject: [PATCH 07/13] KVM: monolithic: x86: remove __init section prefix from kvm_x86_cpu_has_kvm_support Date: Mon, 4 Nov 2019 17:59:55 -0500 Message-Id: <20191104230001.27774-8-aarcange@redhat.com> In-Reply-To: <20191104230001.27774-1-aarcange@redhat.com> References: <20191104230001.27774-1-aarcange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: b5UzRDpCM4imlDSRq6tXOg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=3Dn. 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_hos= t.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 { =09bool msi_redir_hint; }; =20 -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 k= vm_vcpu *vcpu); extern int kvm_x86_enable_direct_tlbflush(struct kvm_vcpu *vcpu); =20 struct kvm_x86_ops { -=09int (*cpu_has_kvm_support)(void); /* __init */ +=09int (*cpu_has_kvm_support)(void); =09int (*disabled_by_bios)(void); /* __init */ =09int (*hardware_enable)(void); =09void (*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 kv= m_reg reg) =09} } =20 -__init int kvm_x86_cpu_has_kvm_support(void) +int kvm_x86_cpu_has_kvm_support(void) { =09return cpu_has_vmx(); }