Re: Post r337773 EFIRT-boot-panic still happening with r337838 [Was: Re: svn commit: r337838 - head/sys/amd64/amd64]

2018-09-01 Thread Harry Schmalzbauer

Am 01.09.2018 um 21:01 schrieb Konstantin Belousov:

On Sat, Sep 01, 2018 at 08:16:15PM +0200, Harry Schmalzbauer wrote:

I'm testing ALPHA4 on a Ivy bridge machine, without recent firmware
update, so no PCID.

I have no idea what is the connection between firware updates and PCID.
Ivy CPUs do have the PCID feature.


Sorry, I confused it with INVPCID which is nonsense too.
IBPB was firmware related, but this is completely different to this EFIRT...
Ignore please.




This fix doesn't cover that hardware.
Setting efi.rt.disabled=1 in loader.conf makes it bootable.

Without this tweak, the following panic happens:
Fatal trap 12: Page fault while in kernel mode
:
cpuid = 5; apic id = 05
:
fault code: supervisor read data, page not present.
:

Try https://reviews.freebsd.org/D16972


Panic vanished, boots fine with D16972-47525, nothing more checked.

Thanks a lot,

-harry

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: Post r337773 EFIRT-boot-panic still happening with r337838 [Was: Re: svn commit: r337838 - head/sys/amd64/amd64]

2018-09-01 Thread Konstantin Belousov
On Sat, Sep 01, 2018 at 08:16:15PM +0200, Harry Schmalzbauer wrote:
> I'm testing ALPHA4 on a Ivy bridge machine, without recent firmware 
> update, so no PCID.
I have no idea what is the connection between firware updates and PCID.
Ivy CPUs do have the PCID feature.

> This fix doesn't cover that hardware.
> Setting efi.rt.disabled=1 in loader.conf makes it bootable.
> 
> Without this tweak, the following panic happens:
> Fatal trap 12: Page fault while in kernel mode
> :
> cpuid = 5; apic id = 05
> :
> fault code: supervisor read data, page not present.
> :
Try https://reviews.freebsd.org/D16972
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Post r337773 EFIRT-boot-panic still happening with r337838 [Was: Re: svn commit: r337838 - head/sys/amd64/amd64]

2018-09-01 Thread Harry Schmalzbauer

Am 15.08.2018 um 14:48 schrieb Konstantin Belousov:

Author: kib
Date: Wed Aug 15 12:48:49 2018
New Revision: 337838
URL: https://svnweb.freebsd.org/changeset/base/337838

Log:
   Fix early EFIRT on PCID machines after r337773.
   
   Ensure that the valid PCID state is created for proc0 pmap, since it

   might be used by efirt enter() before first context switch on the BSP.
   
   Sponsored by:	The FreeBSD Foundation

   MFC after:   6 days

Modified:
   head/sys/amd64/amd64/pmap.c


Hello,

I'm testing ALPHA4 on a Ivy bridge machine, without recent firmware 
update, so no PCID.

This fix doesn't cover that hardware.
Setting efi.rt.disabled=1 in loader.conf makes it bootable.

Without this tweak, the following panic happens:
Fatal trap 12: Page fault while in kernel mode
:
cpuid = 5; apic id = 05
:
fault code: supervisor read data, page not present.
:
Stopped at 0xbed7143d calll *ll+0x27(%rax)

Unfortunately keyboard doesn't work and no serial connection easily 
possible.
But I'll be able to connect a serail console if more info is 
needed/useful, please tell me!


-harry

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337838 - head/sys/amd64/amd64

2018-08-15 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 15 12:48:49 2018
New Revision: 337838
URL: https://svnweb.freebsd.org/changeset/base/337838

Log:
  Fix early EFIRT on PCID machines after r337773.
  
  Ensure that the valid PCID state is created for proc0 pmap, since it
  might be used by efirt enter() before first context switch on the BSP.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:6 days

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Aug 15 12:12:21 2018(r337837)
+++ head/sys/amd64/amd64/pmap.c Wed Aug 15 12:48:49 2018(r337838)
@@ -1188,8 +1188,16 @@ 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);
+
+   /*
+* PMAP_PCID_KERN + 1 is used for initialization of
+* proc0 pmap.  The pmap' pcid state might be used by
+* EFIRT entry before first context switch, so it
+* needs to be valid.
+*/
+   PCPU_SET(pcid_next, PMAP_PCID_KERN + 2);
PCPU_SET(pcid_gen, 1);
+
/*
 * pcpu area for APs is zeroed during AP startup.
 * pc_pcid_next and pc_pcid_gen are initialized by AP
@@ -2651,8 +2659,8 @@ 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;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"