Re: EFIRT on machines with pcid after r337773

From: Harry Schmalzbauer <freebsd_at_omnilan.de>
Date: Wed, 15 Aug 2018 12:32:05 +0200
Am 15.08.2018 um 00:17 schrieb Konstantin Belousov:
> If you use UEFI boot, have EFIRT compiled in kernel (the case of
> GENERIC) or pre-loaded as module, and efirt is not disabled by a tunable,
> and the machine resets during kernel initialization, try this.
>
> diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
> index d5d795ab502..c9334eab916 100644
> --- a/sys/amd64/amd64/pmap.c
> +++ b/sys/amd64/amd64/pmap.c
> _at__at_ -1188,7 +1188,7 _at__at_ pmap_bootstrap(vm_paddr_t *firstaddr)
>   			kernel_pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN;
>   			kernel_pmap->pm_pcids[i].pm_gen = 1;
>   		}
> -		PCPU_SET(pcid_next, PMAP_PCID_KERN + 1);
> +		PCPU_SET(pcid_next, PMAP_PCID_KERN + 2);
>   		PCPU_SET(pcid_gen, 1);
>   		/*
>   		 * pcpu area for APs is zeroed during AP startup.
> _at__at_ -2651,8 +2651,8 _at__at_ pmap_pinit0(pmap_t pmap)
>   	bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
>   	pmap->pm_flags = pmap_flags;
>   	CPU_FOREACH(i) {
> -		pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE;
> -		pmap->pm_pcids[i].pm_gen = 0;
> +		pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN + 1;
> +		pmap->pm_pcids[i].pm_gen = 1;
>   		if (!pti) {
>   			__pcpu[i].pc_kcr3 = PMAP_NO_CR3;
>   			__pcpu[i].pc_ucr3 = PMAP_NO_CR3;

Thanks a lot!

Just wanted to confirm this fixed booting _without_ "efi.rt.disabled=1" 
for me:

---<<BOOT>>---
Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
         The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-FP0_ALPHA1 #0 r337804M: Wed Aug 15 12:14:43 CEST 2018
hes_at_preed.egn.mo1.omnilan.net:/usr/local/share/deploy-tools/obj/HEAD-HWLYNX/usr/local/share/deploy-tools/HEAD/src/amd64.amd64/
sys/HWLYNX.titan amd64
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on 
LLVM 6.0.1)
WARNING: WITNESS option enabled, expect reduced performance.
VT(efifb): resolution 1600x1200
link_elf_obj: symbol critical_enter undefined
KLD file vboxdrv.ko - could not finalize loading
info: [drm] Initialized drm 1.1.0 20060810
CPU: Intel(R) Core(TM) i3-4330 CPU _at_ 3.50GHz (3491.98-MHz K8-class CPU)
   Origin="GenuineIntel"  Id=0x306c3  Family=0x6  Model=0x3c Stepping=3
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,S
S,HTT,TM,PBE>
Features2=0x7fdafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,
TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
   AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
   AMD Features2=0x21<LAHF,ABM>
   Structured Extended 
Features=0x27ab<FSGSBASE,TSCADJ,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,NFPUSG>
   Structured Extended Features3=0xc000000<IBPB,STIBP>
   XSAVE Features=0x1<XSAVEOPT>
   VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
   TSC: P-state invariant, performance statistics
real memory  = 17179869184 (16384 MB)
avail memory = 16288931840 (15534 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <INTEL  DH87MC  >
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 hardware threads
random: unblocking device.
ioapic0 <Version 2.0> irqs 0-23 on motherboard
Launching APs: 1 3 2
Timecounter "TSC-low" frequency 1745992496 Hz quality 1000
Cuse v0.1.35 _at_ /dev/cuse
random: entropy device external interface
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
kbd1 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff80b6f400, 0) error 19
nexus0
efirtc0: <EFI Realtime Clock> on motherboard
efirtc0: registered as a time-of-day clock, resolution 1.000000s

Curious what this means:
smbios0: SMBIOS checksum failed.
Has always been there on this LynxPoint/Haswell machine...

thanks,

-harry
Received on Wed Aug 15 2018 - 08:32:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:17 UTC