Re: EFIRT on machines with pcid after r337773

From: Oliver Pinter <oliver.pinter_at_hardenedbsd.org>
Date: Wed, 15 Aug 2018 01:38:13 +0200
Hi!

Seems like this patch fixed the boot issue on Dell e5440 with UEFI.

Once you get to MFC, please X-MFC-with the following patch:

commit dfe1112fa878c5d8fa0605d1de10c96ecc993569
Author: rlibby <rlibby_at_FreeBSD.org>
Date:   Fri Jul 21 17:11:36 2017 +0000

    __pcpu: gcc -Wredundant-decls

    Pollution from counter.h made __pcpu visible in amd64/pmap.c.  Delete
    the existing extern decl of __pcpu in amd64/pmap.c and avoid referring
    to that symbol, instead accessing the pcpu region via PCPU_SET macros.
    Also delete an unused extern decl of __pcpu from mp_x86.c.

    Reviewed by:    kib
    Approved by:    markj (mentor)
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D11666

Notes:
    svn path=/head/; revision=321335

On 8/15/18, Konstantin Belousov <kostikbel_at_gmail.com> wrote:
> 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;
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>
Received on Tue Aug 14 2018 - 21:38:15 UTC

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