Re: [PATCH v2 2/7] x86/boot: Introduce helpers for serial I/O
From: Andy Shevchenko
Date: Thu Mar 28 2019 - 09:52:32 EST
On Thu, Mar 28, 2019 at 02:28:55PM +0100, Borislav Petkov wrote:
> On Thu, Mar 28, 2019 at 03:11:40PM +0200, Andy Shevchenko wrote:
> > Any idea how it can be done?
>
> Like this?
>
> static u8 serial_inb(unsigned long addr, int offset)
It's not a generic serial_in()...
> {
> if (early_serial_do_mmio) {
> asm volatile("movb %1,%0" : "=q" (v) : "m" (*(volatile u8 __force *)addr));
>
> return v;
> } else {
> return inb(addr + offset);
> }
> }
What about mmio32 as next step?
Do we have to "fix" earlyprintk implementation in kernel to do the same?
--
With Best Regards,
Andy Shevchenko