Re: [PATCH 1/2] x86/tdx: Extract GET_INFO call from get_cc_mask()
From: Kirill A. Shutemov
Date: Mon Oct 31 2022 - 00:13:05 EST
On Sat, Oct 29, 2022 at 02:59:51AM +0300, Kirill A. Shutemov wrote:
> > Can you please take a look through this and make sure I didn't botch
> > anything:
> >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/log/?h=tdxbadve
> >
> > The end result is about 50 lines less than what was there before. Most
> > of it is comment removal but the code is simpler too.
> >
> > Acks and Tested-by's would be appreciated.
One thing that I must bring up is that it seems that there's no way to get
the panic message to user. I tried to convinced myself that it is qemu
misconfiguration on my part or some race, but no: it is just too early for
earlyprintk.
We only get earlyprintk working after parse_early_options() which happens
well after tdx_early_init().
Moving panic() after earlyprintk working is not good idea as it exposes
kernel more: by the time we already have full #VE handler.
We can move it earlier into decompresser which has different earlyprintk
implementation. Not sure if it worth this. What do you think?
"tdx: Guest detected" printed from the same tdx_early_init() is visible if
boot goes far enough to initialize console (early or not) as printk adds
the message to the buffer, but no so luck for panic().
--
Kiryl Shutsemau / Kirill A. Shutemov