Re: [PATCH 2/2] [RFC] arm64: Add dependencies to vendor-specific errata
From: Mark Rutland
Date: Thu Apr 16 2020 - 11:57:19 EST
On Thu, Apr 16, 2020 at 05:38:07PM +0200, Geert Uytterhoeven wrote:
> On Thu, Apr 16, 2020 at 2:56 PM Mark Rutland <mark.rutland@xxxxxxx> wrote:
> > On Thu, Apr 16, 2020 at 01:56:58PM +0200, Geert Uytterhoeven wrote:
> > > Currently the user is asked about enabling support for each and every
> > > vendor-specific erratum, even when support for the specific platform is
> > > not enabled.
> > >
> > > Fix this by adding platform dependencies to the config options
> > > controlling support for vendor-specific errata.
> > I'm not su1re that it makes sense to do this in general, becaose the
> > ARCH_* platform symbols are about plactform/SoC support (e.g. pinctrl
> > drivers), and these are (mostly) CPU-local and/or VM-visible.
> >
> > I think that it makes sense for those to be independent because:
> > * It prevents building a minimal VM image with all (non-virtualized)
> > platform support disabled, but all possible (VM-visible) errata
> > options enabled. I do that occassionally for testing/analysis, and I
> > can imagine this is useful for those building images that are only
> > intended to be used in VMs.
>
> Oh, you also want to build a "generic" guest kernel, with all ARCH_*
> symbols disabled.
Yup! As above I do this today for building test kernels I run on a
number of different hosts, and I'm aware of other use-cases (e.g. WSL2
or docker for mac) where you may want to do this to minimize the core
kernel either for size or security reasons.
> Let's hope a maleficent user cannot disable errata mitigations in the
> guest kernel and break the host ;-)
Indeed ;)
For cases where a malicious guest could cause harm we've added
workarounds in KVM, so unless we've missed something that shouldn't be
the case.
Otherwise, a guest missing these is just shooting itself in the foot.
> And perhaps you do want to enable some platform-specific drivers for
> VFIO pass-through? Hence having ARCH_* dependencies on those drivers
> means they cannot be enabled :-( Hmm...
IIRC platform device passthrough requires an corresponding VFIO platform
driver in the host to handle reset and so on, but it does seem a shame
to not allow the user to select a driver if they really want it.
I guess there might be platform-specific PCIe drivers too, which might
work with VFIO regardless.
Thanks,
Mark.