On Thu, May 28, 2020 at 05:19:19PM +0900, YASUOKA Masahiko wrote: > On Thu, 28 May 2020 17:01:48 +0900 (JST) > YASUOKA Masahiko <yasu...@openbsd.org> wrote: > > Hi, > > > > I'd like to conclude this issue. > > > > On Fri, 21 Feb 2020 14:09:07 +0900 (JST) > > YASUOKA Masahiko <yasu...@openbsd.org> wrote: > >> I am testing a new hardware, HPE DL20 Gen10. > >> > >> When efiboot starts the kernel, the video display becomes distorted > >> and never recovered until CPU reset. > >> > >> Our kernel tries to initialized console twice, first trial is done > >> before getting boot info and second trial is done after getting boot > >> info. Since EFI framebuffer needs "boot info", it is initialized on > >> second trial. > >> > >> On HPE DL20 Gen10, probing vga is succeeded on first trial, the kernel > >> selects vga for the console, but actually it is broken. On usual > >> machines which boot with EFI, the problem doesn't happen since they > >> have no vga. > > > > If we have a way to detect whether the machine has VGA. ACPI > > FADT_NO_VGA was a candidate. But that bit is cleard both on my "HPE > > DL20 Gen10" and Andrew Daugherity's Dell PowerEdge R230. Also the > > problem newly posted at misc@ (*) might be the same problem. > > Above paragraph may be unclear. Let me update it by the following > paragraph. > > If we have a way to detect whether the machine has VGA, we thought we > can select VGA or EFI framebuffer safely. ACPI FADT_NO_VGA was a > candidate. But the bit is cleared both on my "HPE DL20 Gen10" and > Andrew Daugherity's Dell PowerEdge R230. Also the problem newly > posted at misc@ (*) might be the same problem.
I agree this approach of waiting for bootargs before probing for a console is the best way to handle this at the moment unless someone can come up with a way to stop vga matching. I have tested this without problems on bios boot serial console bios boot vga/inteldrm console efi boot efifb/amdgpu console ok jsg@ > > > (*) https://marc.info/?l=openbsd-misc&m=159064773219779&w=2 > > > > I think having the diff folowing is the best for this momemnt. > > The diff does: > > > > - move cninit() after parsing bootinfo > > - give up the debug message which can be enabled if BOOTINFO_DEBUG is > > defined > > > > ok? > > > > Index: sys/arch/amd64/amd64/machdep.c > > =================================================================== > > RCS file: /disk/cvs/openbsd/src/sys/arch/amd64/amd64/machdep.c,v > > retrieving revision 1.264 > > diff -u -p -r1.264 machdep.c > > --- sys/arch/amd64/amd64/machdep.c 16 May 2020 14:44:44 -0000 1.264 > > +++ sys/arch/amd64/amd64/machdep.c 28 May 2020 07:40:14 -0000 > > @@ -1395,11 +1395,6 @@ init_x86_64(paddr_t first_avail) > > i8254_startclock(); > > > > /* > > - * Attach the glass console early in case we need to display a panic. > > - */ > > - cninit(); > > - > > - /* > > * Initialize PAGE_SIZE-dependent variables. > > */ > > uvm_setpagesize(); > > @@ -1421,6 +1416,8 @@ init_x86_64(paddr_t first_avail) > > } else > > panic("invalid /boot"); > > > > + cninit(); > > + > > /* > > * Memory on the AMD64 port is described by three different things. > > * > > @@ -1927,12 +1924,6 @@ getbootinfo(char *bootinfo, int bootinfo > > bios_ddb_t *bios_ddb; > > bios_bootduid_t *bios_bootduid; > > bios_bootsr_t *bios_bootsr; > > - int docninit = 0; > > - > > -#undef BOOTINFO_DEBUG > > -#ifdef BOOTINFO_DEBUG > > - printf("bootargv:"); > > -#endif > > > > for (q = (bootarg32_t *)bootinfo; > > (q->ba_type != BOOTARG_END) && > > @@ -1942,24 +1933,15 @@ getbootinfo(char *bootinfo, int bootinfo > > switch (q->ba_type) { > > case BOOTARG_MEMMAP: > > bios_memmap = (bios_memmap_t *)q->ba_arg; > > -#ifdef BOOTINFO_DEBUG > > - printf(" memmap %p", bios_memmap); > > -#endif > > break; > > case BOOTARG_DISKINFO: > > bios_diskinfo = (bios_diskinfo_t *)q->ba_arg; > > -#ifdef BOOTINFO_DEBUG > > - printf(" diskinfo %p", bios_diskinfo); > > -#endif > > break; > > case BOOTARG_APMINFO: > > /* generated by i386 boot loader */ > > break; > > case BOOTARG_CKSUMLEN: > > bios_cksumlen = *(u_int32_t *)q->ba_arg; > > -#ifdef BOOTINFO_DEBUG > > - printf(" cksumlen %d", bios_cksumlen); > > -#endif > > break; > > case BOOTARG_PCIINFO: > > /* generated by i386 boot loader */ > > @@ -1983,15 +1965,8 @@ getbootinfo(char *bootinfo, int bootinfo > > comconsaddr = consaddr; > > comconsrate = cdp->conspeed; > > comconsiot = X86_BUS_SPACE_IO; > > - > > - /* Probe the serial port this time. */ > > - docninit++; > > } > > #endif > > -#ifdef BOOTINFO_DEBUG > > - printf(" console 0x%x:%d", > > - cdp->consdev, cdp->conspeed); > > -#endif > > } > > break; > > case BOOTARG_BOOTMAC: > > @@ -2023,8 +1998,6 @@ getbootinfo(char *bootinfo, int bootinfo > > > > case BOOTARG_EFIINFO: > > bios_efiinfo = (bios_efiinfo_t *)q->ba_arg; > > - if (bios_efiinfo->fb_addr != 0) > > - docninit++; > > break; > > > > case BOOTARG_UCODE: > > @@ -2032,18 +2005,9 @@ getbootinfo(char *bootinfo, int bootinfo > > break; > > > > default: > > -#ifdef BOOTINFO_DEBUG > > - printf(" unsupported arg (%d) %p", q->ba_type, > > - q->ba_arg); > > -#endif > > break; > > } > > } > > - if (docninit > 0) > > - cninit(); > > -#ifdef BOOTINFO_DEBUG > > - printf("\n"); > > -#endif > > } > > > > int > >