Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1808359ybn; Thu, 26 Sep 2019 02:31:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXQ4YP9L0ZmB71gA3SAQgBrEAZagE1xCH4zZGc50gYwTYEJOcGxyLy+LUKLJ7l4QPdhlGh X-Received: by 2002:aa7:d803:: with SMTP id v3mr2472363edq.146.1569490283355; Thu, 26 Sep 2019 02:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569490283; cv=none; d=google.com; s=arc-20160816; b=g0LnN5POx/CK8TkdGp27aRTJwS7FhLO2GB7rjbrZi8WqG0Fgve6uEEPBnhwEPskgZB TcShsbil+kgKgV1NW2tDZflfn+8N2e7pI5rl6BFtUgv7tiZzwcRKUruwzbCgKTRcmgBc AicTP5d40SiYre+wzv31K3gkOfNpTKYLYRNZzuvDhjszkgLZpCQZmg9Ubuu5pCuJl9NV Dbdn+48YL9Bdwl81J9q8LDaGF2AYap8Hz0rfU6tw7A2v0m9eMVAtMdrF4RfXqS54P6xl q4GapMUpCqn0CtKFma3TTm/QThwL2Rx0Y6RrUGjUAWNtJKt9L1eGcQ/1hxRUp97gtUut REpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qlcBkJiO+UHb0p+L1iutMKgyUrD3ERbu245BiYg5vlQ=; b=cHX/PZ94cde9l7LVDUcWswoddlXyBGqDyWCdcbLO5RcqWDpLgsBk04ZjUmVpLBPDWr go24kNTX5aP/O3pcMj5qwKy+fBwd5twMu1B+La9315f24s2v4kIcsS1PrR+glEg3NY/D pnu1fu/Z7u9KTXXXJFAX21bfXaH/0it6oc5LSxofoEPSnt1h3MeQdr6Mo40OGALffJ1h PPYxyWUWu54+nYx2CnuHPl8vgm6jzmoy3PWvZCiQjW2418pPl0y4Xd8J8fpVcW9z8v/u RoItGReGAHFMpLSQs47SwpZwM9wT1unM41Ci/RJPYRwvNT+tugCAzAIqwG17nMK1qpEt c+Yw== 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 e22si731076ejm.72.2019.09.26.02.31.00; Thu, 26 Sep 2019 02:31:23 -0700 (PDT) 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 S2405447AbfIYMNe (ORCPT + 99 others); Wed, 25 Sep 2019 08:13:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405148AbfIYMNe (ORCPT ); Wed, 25 Sep 2019 08:13:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9B3F10CC208; Wed, 25 Sep 2019 12:13:33 +0000 (UTC) Received: from mail (ovpn-120-159.rdu2.redhat.com [10.10.120.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FCCF60603; Wed, 25 Sep 2019 12:13:31 +0000 (UTC) Date: Wed, 25 Sep 2019 08:13:30 -0400 From: Andrea Arcangeli To: Paolo Bonzini Cc: Vitaly Kuznetsov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Peter Xu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/17] KVM: monolithic: x86: adjust the section prefixes Message-ID: <20190925121330.GA13637@redhat.com> References: <20190920212509.2578-1-aarcange@redhat.com> <20190920212509.2578-8-aarcange@redhat.com> <2171e409-487f-6408-e037-3abc0b9aa312@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2171e409-487f-6408-e037-3abc0b9aa312@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Wed, 25 Sep 2019 12:13:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Sep 23, 2019 at 12:15:23PM +0200, Paolo Bonzini wrote: > On 20/09/19 23:24, Andrea Arcangeli wrote: > > Adjusts the section prefixes of some KVM common code function because > > with the monolithic methods the section checker can now do a more > > accurate analysis at build time and this allows to build without > > CONFIG_SECTION_MISMATCH_WARN_ONLY=n. > > > > Signed-off-by: Andrea Arcangeli > > I think it's the opposite---the checker is detecting *missing* section > prefixes, for example vmx_exit, kvm_exit, kvm_arch_hardware_unsetup etc. > could be marked __exit. I added the two missing __init. The __exit removed from unsetup is because kvm_arch_hardware_unsetup is called by kvm_init, so unless somehow kvm_init can go in the exit section and be dropped too during the final kernel link (which would prevent KVM to initialize in the first place at kernel boot), it's not feasible to call a function located in the exit section and dropped during the kernel link from there. As far as I can tell with upstream KVM if you hit the kvm_arch_hardware_unsetup function during kvm_init error path it'll crash the kernel at boot because of it. Removing __exit fixes that potential upstream crash and upstream bug. The comment header was short, I'll add more commentary to the commit header to reduce the confusion about why removing __exit is needed. Thanks, Andrea