Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-22 Thread Herbert J. Skuhra
On Fri, May 22, 2020 at 08:57:44AM -0700, John Baldwin wrote:
> On 5/21/20 3:45 PM, Herbert J. Skuhra wrote:
> > 
> > Until now it was possible to build a kernel (amd64) without 'device
> > acpi'. After this commit it fails with this error:
> > 
> > --- kernel.full ---
> > linking kernel.full
> > ld: error: undefined symbol: acpi_pxm_set_cpu_locality
>  referenced by mp_machdep.c:269 
>  (/usr/src/sys/amd64/amd64/mp_machdep.c:269)
>    mp_machdep.o:(cpu_mp_start)
> > *** [kernel.full] Error code 1
> > 
> > Was that intended?
> 
> I know Mark has already fixed this, but can you elaborate on your use case for
> not compiling ACPI support into the kernel?

Yes, thanks!

I still use a Soekris Net6501-70 board. It shows the following errors when
ACPI is enabled:

Firmware Error (ACPI): A valid RSDP was not found (20200430/tbxfroot-369)
[...]
ACPI: Table initialisation failed: AE_NOT_FOUND
ACPI: Try disabling either ACPI or apic support.

It works fine without ACPI so I removed it. I need a custom kernel
anyway (the kernel panics without 'device atpic').

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


Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-22 Thread John Baldwin
On 5/21/20 3:45 PM, Herbert J. Skuhra wrote:
> 
> Until now it was possible to build a kernel (amd64) without 'device
> acpi'. After this commit it fails with this error:
> 
> --- kernel.full ---
> linking kernel.full
> ld: error: undefined symbol: acpi_pxm_set_cpu_locality
 referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269)
   mp_machdep.o:(cpu_mp_start)
> *** [kernel.full] Error code 1
> 
> Was that intended?

I know Mark has already fixed this, but can you elaborate on your use case for
not compiling ACPI support into the kernel?

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


Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-21 Thread Mark Johnston
On Fri, May 22, 2020 at 12:45:03AM +0200, Herbert J. Skuhra wrote:
> On Thu, 21 May 2020 17:28:35 +0200, Mark Johnston wrote:
> > 
> > Author: markj
> > Date: Thu May 21 15:28:35 2020
> > New Revision: 361334
> > URL: https://svnweb.freebsd.org/changeset/base/361334
> > 
> > Log:
> >   MFC r361033:
> >   Call acpi_pxm_set_proximity_info() slightly earlier on x86.
> > 
> > Modified:
> >   stable/12/sys/amd64/amd64/mp_machdep.c
> >   stable/12/sys/arm64/arm64/mp_machdep.c
> >   stable/12/sys/dev/acpica/acpi_pxm.c
> >   stable/12/sys/dev/acpica/acpivar.h
> >   stable/12/sys/i386/i386/mp_machdep.c
> >   stable/12/sys/x86/acpica/srat.c
> > Directory Properties:
> >   stable/12/   (props changed)
> > 
> > Modified: stable/12/sys/amd64/amd64/mp_machdep.c
> > ==
> > --- stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:18:59 2020
> > (r361333)
> > +++ stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:28:35 2020
> > (r361334)
> > @@ -265,8 +265,9 @@ cpu_mp_start(void)
> > init_ops.start_all_aps();
> >  
> > set_interrupt_apic_ids();
> > -}
> >  
> > +   acpi_pxm_set_cpu_locality();
> > +}
> >  
> >  /*
> >   * AP CPU's call this to initialize themselves.
> 
> Until now it was possible to build a kernel (amd64) without 'device
> acpi'. After this commit it fails with this error:
> 
> --- kernel.full ---
> linking kernel.full
> ld: error: undefined symbol: acpi_pxm_set_cpu_locality
> >>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269)
> >>>   mp_machdep.o:(cpu_mp_start)
> *** [kernel.full] Error code 1
> 
> Was that intended?

It was unintentional.  I committed a fix to head in r361352 and will
merge to stable/12 shortly.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-21 Thread Herbert J. Skuhra
On Thu, 21 May 2020 17:28:35 +0200, Mark Johnston wrote:
> 
> Author: markj
> Date: Thu May 21 15:28:35 2020
> New Revision: 361334
> URL: https://svnweb.freebsd.org/changeset/base/361334
> 
> Log:
>   MFC r361033:
>   Call acpi_pxm_set_proximity_info() slightly earlier on x86.
> 
> Modified:
>   stable/12/sys/amd64/amd64/mp_machdep.c
>   stable/12/sys/arm64/arm64/mp_machdep.c
>   stable/12/sys/dev/acpica/acpi_pxm.c
>   stable/12/sys/dev/acpica/acpivar.h
>   stable/12/sys/i386/i386/mp_machdep.c
>   stable/12/sys/x86/acpica/srat.c
> Directory Properties:
>   stable/12/   (props changed)
> 
> Modified: stable/12/sys/amd64/amd64/mp_machdep.c
> ==
> --- stable/12/sys/amd64/amd64/mp_machdep.cThu May 21 15:18:59 2020
> (r361333)
> +++ stable/12/sys/amd64/amd64/mp_machdep.cThu May 21 15:28:35 2020
> (r361334)
> @@ -265,8 +265,9 @@ cpu_mp_start(void)
>   init_ops.start_all_aps();
>  
>   set_interrupt_apic_ids();
> -}
>  
> + acpi_pxm_set_cpu_locality();
> +}
>  
>  /*
>   * AP CPU's call this to initialize themselves.

Until now it was possible to build a kernel (amd64) without 'device
acpi'. After this commit it fails with this error:

--- kernel.full ---
linking kernel.full
ld: error: undefined symbol: acpi_pxm_set_cpu_locality
>>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269)
>>>   mp_machdep.o:(cpu_mp_start)
*** [kernel.full] Error code 1

Was that intended?

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


svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica

2020-05-21 Thread Mark Johnston
Author: markj
Date: Thu May 21 15:28:35 2020
New Revision: 361334
URL: https://svnweb.freebsd.org/changeset/base/361334

Log:
  MFC r361033:
  Call acpi_pxm_set_proximity_info() slightly earlier on x86.

Modified:
  stable/12/sys/amd64/amd64/mp_machdep.c
  stable/12/sys/arm64/arm64/mp_machdep.c
  stable/12/sys/dev/acpica/acpi_pxm.c
  stable/12/sys/dev/acpica/acpivar.h
  stable/12/sys/i386/i386/mp_machdep.c
  stable/12/sys/x86/acpica/srat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/mp_machdep.c
==
--- stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/amd64/amd64/mp_machdep.c  Thu May 21 15:28:35 2020
(r361334)
@@ -265,8 +265,9 @@ cpu_mp_start(void)
init_ops.start_all_aps();
 
set_interrupt_apic_ids();
-}
 
+   acpi_pxm_set_cpu_locality();
+}
 
 /*
  * AP CPU's call this to initialize themselves.

Modified: stable/12/sys/arm64/arm64/mp_machdep.c
==
--- stable/12/sys/arm64/arm64/mp_machdep.c  Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/arm64/arm64/mp_machdep.c  Thu May 21 15:28:35 2020
(r361334)
@@ -595,9 +595,7 @@ cpu_init_acpi(void)
acpi_unmap_table(madt);
 
 #if MAXMEMDOM > 1
-   /* set proximity info */
acpi_pxm_set_cpu_locality();
-   acpi_pxm_free();
 #endif
 }
 #endif

Modified: stable/12/sys/dev/acpica/acpi_pxm.c
==
--- stable/12/sys/dev/acpica/acpi_pxm.c Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/dev/acpica/acpi_pxm.c Thu May 21 15:28:35 2020
(r361334)
@@ -628,7 +628,8 @@ srat_walk_table(acpi_subtable_handler *handler, void *
 }
 
 /*
- * Setup per-CPU domain IDs from information saved in 'cpus'.
+ * Set up per-CPU domain IDs from information saved in 'cpus' and tear down 
data
+ * structures allocated by acpi_pxm_init().
  */
 void
 acpi_pxm_set_cpu_locality(void)
@@ -651,6 +652,10 @@ acpi_pxm_set_cpu_locality(void)
printf("SRAT: CPU %u has memory domain %d\n", i,
pc->pc_domain);
}
+   /* XXXMJ the page is leaked. */
+   pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus);
+   srat_physaddr = 0;
+   cpus = NULL;
 }
 
 int
@@ -662,20 +667,6 @@ acpi_pxm_get_cpu_locality(int apic_id)
if (cpu == NULL)
panic("SRAT: CPU with ID %u is not known", apic_id);
return (cpu->domain);
-}
-
-/*
- * Free data structures allocated during acpi_pxm_init.
- */
-void
-acpi_pxm_free(void)
-{
-
-   if (srat_physaddr == 0)
-   return;
-   pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus);
-   srat_physaddr = 0;
-   cpus = NULL;
 }
 
 /*

Modified: stable/12/sys/dev/acpica/acpivar.h
==
--- stable/12/sys/dev/acpica/acpivar.h  Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/dev/acpica/acpivar.h  Thu May 21 15:28:35 2020
(r361334)
@@ -536,7 +536,6 @@ voidacpi_pxm_parse_tables(void);
 void   acpi_pxm_set_mem_locality(void);
 void   acpi_pxm_set_cpu_locality(void);
 intacpi_pxm_get_cpu_locality(int apic_id);
-void   acpi_pxm_free(void);
 
 /*
  * Map a PXM to a VM domain.

Modified: stable/12/sys/i386/i386/mp_machdep.c
==
--- stable/12/sys/i386/i386/mp_machdep.cThu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/i386/i386/mp_machdep.cThu May 21 15:28:35 2020
(r361334)
@@ -199,6 +199,8 @@ cpu_mp_start(void)
start_all_aps();
 
set_interrupt_apic_ids();
+
+   acpi_pxm_set_cpu_locality();
 }
 
 /*

Modified: stable/12/sys/x86/acpica/srat.c
==
--- stable/12/sys/x86/acpica/srat.c Thu May 21 15:18:59 2020
(r361333)
+++ stable/12/sys/x86/acpica/srat.c Thu May 21 15:28:35 2020
(r361334)
@@ -56,13 +56,4 @@ parse_acpi_tables(void *dummy)
 SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables,
 NULL);
 
-static void
-srat_set_cpus(void *dummy)
-{
-
-   acpi_pxm_set_cpu_locality();
-   acpi_pxm_free();
-}
-SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
-
 #endif /* MAXMEMDOM > 1 */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"