public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Zhi Wang <zhi.wang.linux@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-kernel@vger.kernel.org,
	Vineeth Pillai <viremana@linux.microsoft.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: SVM: hyper-v: placate modpost section mismatch error
Date: Thu, 23 Feb 2023 21:20:02 +0000	[thread overview]
Message-ID: <Y/fYgvfifh5EJcwD@google.com> (raw)
In-Reply-To: <20230223231127.000045e2@gmail.com>

On Thu, Feb 23, 2023, Zhi Wang wrote:
> On Wed, 22 Feb 2023 19:32:53 +0100
> Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> Maybe we can use __always_inline? I just noticed this thread today by chance.

Using __always_inline will "fix" the problem, but it's not necessary in this case,
and in some ways it's less correct.  The noinstr case you linked is different
because the helpers in question can (and are) be used in noinstr and regular
sections, i.e. shouldn't be tagged noinstr.  In this case, svm_hv_hardware_setup()
must be called from __init functions, i.e. doesn't need to be unopinionated.

And FWIW, svm_hv_hardware_setup() really doesn't need to be inlined.

> https://lore.kernel.org/all/20210624095147.880513802@infradead.org/
> 
> > On 2/22/23 17:46, Sean Christopherson wrote:
> > >    Tag svm_hv_hardware_setup() with __init to fix a modpost warning as the
> > >    non-stub implementation accesses __initdata (svm_x86_ops), i.e. would
> > >    generate a use-after-free if svm_hv_hardware_setup() were actually invoked
> > >    post-init.  The helper is only called from svm_hardware_setup(), which is
> > >    also __init, i.e. other than the modpost warning, lack of __init is benign.
> > 
> > Done.  It's caused by the compiler deciding not to inline the function, 
> > probably.
> > 
> > Also Cc'ed stable.
> > 
> > Paolo
> > 
> 

  reply	other threads:[~2023-02-23 21:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 16:25 [PATCH v2] KVM: SVM: hyper-v: placate modpost section mismatch error Randy Dunlap
2023-02-22 16:46 ` Sean Christopherson
2023-02-22 18:32   ` Paolo Bonzini
2023-02-23 21:11     ` Zhi Wang
2023-02-23 21:20       ` Sean Christopherson [this message]
2023-02-22 17:27 ` Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/fYgvfifh5EJcwD@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=viremana@linux.microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=zhi.wang.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox