From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ard Biesheuvel Subject: Re: [PATCH 11/11] efi/x86: earlyprintk - Fix infinite loop on some screen widths Date: Fri, 30 Nov 2018 09:32:23 +0100 Message-ID: References: <20181129171230.18699-1-ard.biesheuvel@linaro.org> <20181129171230.18699-12-ard.biesheuvel@linaro.org> <20181130080544.GC16084@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20181130080544.GC16084@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar Cc: linux-efi , Thomas Gleixner , Linux Kernel Mailing List , Andy Lutomirski , Arend Van Spriel , Bhupesh Sharma , Borislav Petkov , Dave Hansen , Eric Snowberg , Hans de Goede , Joe Perches , Jon Hunter , Julien Thierry , Marc Zyngier , Nathan Chancellor , Peter Zijlstra , "Prakhya, Sai Praneeth" , Sedat Dilek , YiFei Zhu List-Id: linux-efi@vger.kernel.org On Fri, 30 Nov 2018 at 09:05, Ingo Molnar wrote: > > > * Ard Biesheuvel wrote: > > > From: YiFei Zhu > > > > An affected screen resolution is 1366 x 768, which width is not > > divisible by 8, the default font width. On such screens, when longer > > lines are earlyprintk'ed, overflow-to-next-line can never trigger, > > due to the left-most x-coordinate of the next character always less > > than the screen width. Earlyprintk will infinite loop in trying to > > print the rest of the string but unable to, due to the line being > > full. > > > > This patch makes the trigger consider the right-most x-coordinate, > > instead of left-most, as the value to compare against the screen > > width threshold. > > > > Signed-off-by: YiFei Zhu > > Signed-off-by: Ard Biesheuvel > > --- > > arch/x86/platform/efi/early_printk.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/x86/platform/efi/early_printk.c b/arch/x86/platform/efi/early_printk.c > > index 7476b3b097e1..7138bc7a265c 100644 > > --- a/arch/x86/platform/efi/early_printk.c > > +++ b/arch/x86/platform/efi/early_printk.c > > @@ -183,7 +183,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num) > > num--; > > } > > > > - if (efi_x >= si->lfb_width) { > > + if (efi_x + font->width > si->lfb_width) { > > efi_x = 0; > > efi_y += font->height; > > } > > Any objections to marking this for -stable and queueing it up in > efi/urgent as well? > No that is fine.