On Thu, Aug 22, 2019 at 03:29:40AM +0300, Jarkko Sakkinen wrote: > On Wed, Aug 21, 2019 at 10:24:00AM -0700, Sean Christopherson wrote: > > How does the current code not align with this approach? The core subsystem > > should tear itself down if loading the driver fails, which includes failing > > because it doesn't exist. > > I get now the real issue that you are trying to point out (did not > earlier). Still, I think your approach to fix it needs some > reconsideration. > > Something that *does not exist* can never fail. That should be dead > obvious. > > If the SGX driver does not exit and KVM does not have SGX support > compiled in, then the only logical conclusion that you can end up with > is that neither the SGX core should exist in vmlinux in the first place. > > This all summarizes to that I have to remove the INTEL_SGX_DRIVER > kconfig flag. Its existence can only be considered when there >= 2 > in-kernel users for SGX. That works too.