lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZBOx4b1yUpnxu/I1@google.com>
Date:   Fri, 17 Mar 2023 00:18:41 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Shameerali Kolothum Thodi <shameerali.kolothum.thodi@...wei.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "gshan@...hat.com" <gshan@...hat.com>,
        "maz@...nel.org" <maz@...nel.org>
Subject: Re: [PATCH] KVM: Add the missing stub function for kvm_dirty_ring_check_request()

On Thu, Mar 16, 2023, Shameerali Kolothum Thodi wrote:
> > From: Sean Christopherson [mailto:seanjc@...gle.com]
> > On Thu, Mar 16, 2023, Shameerali Kolothum Thodi wrote:
> > > > From: Sean Christopherson [mailto:seanjc@...gle.com] On Thu, Mar 16,
> > > > 2023, Shameer Kolothum wrote:
> > > > > The stub for !CONFIG_HAVE_KVM_DIRTY_RING case is missing.
> > > >
> > > > No stub is needed.  kvm_dirty_ring_check_request() isn't called from
> > > > common code, and should not (and isn't unless I'm missing something)
> > > > be called from arch code unless CONFIG_HAVE_KVM_DIRTY_RING=y.
> > > >
> > > > x86 and arm64 are the only users, and they both select
> > > > HAVE_KVM_DIRTY_RING unconditionally when KVM is enabled.
> > >
> > > Yes, it is at present not called from anywhere other than x86 and arm64.
> > > But I still think since it is a common helper, better to have a stub.
> > 
> > Why?  It buys us nothing other than dead code, and even worse it could let
> > a bug that would otherwise be caught during build time escape to run time.
> 
> Agree, it buys nothing now:) It just came up while I was playing with a custom
> build without HAVE_KVM_DIRTY_RING. Since all other functions there has a stub
> just thought it would make it easier for future common usage. We could very well
> leave it till that comes up as well.

Stubs are typically only added when they are strictly necessary.  Providing a stub
would make things "easier" in the sense that it could theoretically avoid a build
error, but as above, in many cases we _want_ build errors when new code behaves
in a way that diverges from what's expected/established.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ