2019-09-10 19:08:26

by Mike Travis

[permalink] [raw]
Subject: [PATCH 4/8] x86/platform/uv: Setup UV functions for Hubless UV Systems

Add more support for UV systems that do not contain a UV Hub (AKA
"hubless"). This update adds support for additional functions required:

Use PCH NMI handler instead of a UV Hub NMI handler.

Initialize the UV BIOS callback interface used to support specific
UV functions.

Signed-off-by: Mike Travis <[email protected]>
Reviewed-by: Steve Wahl <[email protected]>
Reviewed-by: Dimitri Sivanich <[email protected]>
---
arch/x86/kernel/apic/x2apic_uv_x.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)

--- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c
+++ linux/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1457,6 +1457,20 @@ static void __init build_socket_tables(v
}
}

+/* Initialize UV hubless systems */
+static __init int uv_system_init_hubless(void)
+{
+ int rc;
+
+ /* Setup PCH NMI handler */
+ uv_nmi_setup_hubless();
+
+ /* Init kernel/BIOS interface */
+ rc = uv_bios_init();
+
+ return rc;
+}
+
static void __init uv_system_init_hub(void)
{
struct uv_hub_info_s hub_info = {0};
@@ -1596,8 +1610,8 @@ static void __init uv_system_init_hub(vo
}

/*
- * There is a small amount of UV specific code needed to initialize a
- * UV system that does not have a "UV HUB" (referred to as "hubless").
+ * There is a different code path needed to initialize a UV system that does
+ * not have a "UV HUB" (referred to as "hubless").
*/
void __init uv_system_init(void)
{
@@ -1607,7 +1621,7 @@ void __init uv_system_init(void)
if (is_uv_system())
uv_system_init_hub();
else
- uv_nmi_setup_hubless();
+ uv_system_init_hubless();
}

apic_driver(apic_x2apic_uv_x);

--


2019-09-11 06:11:30

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 4/8] x86/platform/uv: Setup UV functions for Hubless UV Systems


* Mike Travis <[email protected]> wrote:

> +/* Initialize UV hubless systems */
> +static __init int uv_system_init_hubless(void)
> +{
> + int rc;
> +
> + /* Setup PCH NMI handler */
> + uv_nmi_setup_hubless();
> +
> + /* Init kernel/BIOS interface */
> + rc = uv_bios_init();
> +
> + return rc;
> +}

Am I the only one who immediately sees the trivial C transformation
through which this function could lose a local variable and become 4
lines shorter?

And this function got two Reviewed-by tags...

Thanks,

Ingo

2019-09-11 22:28:11

by Mike Travis

[permalink] [raw]
Subject: Re: [PATCH 4/8] x86/platform/uv: Setup UV functions for Hubless UV Systems



On 9/10/2019 11:07 PM, Ingo Molnar wrote:
>
> * Mike Travis <[email protected]> wrote:
>
>> +/* Initialize UV hubless systems */
>> +static __init int uv_system_init_hubless(void)
>> +{
>> + int rc;
>> +
>> + /* Setup PCH NMI handler */
>> + uv_nmi_setup_hubless();
>> +
>> + /* Init kernel/BIOS interface */
>> + rc = uv_bios_init();
>> +
>> + return rc;
>> +}

This looks like an excessive cleanup error by me. The original was:

> +static __init int uv_system_init_hubless(void)
> +{
> + int rc;
> +
> + /* Setup PCH NMI handler */
> + uv_nmi_setup_hubless();
> +
> + /* Init kernel/BIOS interface */
> + rc = uv_bios_init();
> +
> + /* Create user access node if UVsystab available */
> + if (rc >= 0)
> + uv_setup_proc_files(1);
> +
> + return rc;
> +}
> +

Hubbed UV's do not have a non-UV BIOS, but hubless systems in theory
can. So uv_bios_init can fail on hubless systems if it has some other
BIOS (unlikely but possible). So I removed too much in this cleanup.
I'll send another patch set to puts this back.

Thanks,
Mike

>
> Am I the only one who immediately sees the trivial C transformation
> through which this function could lose a local variable and become 4
> lines shorter?
>
> And this function got two Reviewed-by tags...
>
> Thanks,
>
> Ingo
>

2019-09-11 22:29:57

by Mike Travis

[permalink] [raw]
Subject: Re: [PATCH 4/8] x86/platform/uv: Setup UV functions for Hubless UV Systems



On 9/11/2019 1:44 PM, Mike Travis wrote:
>
>
> On 9/10/2019 11:07 PM, Ingo Molnar wrote:
>>
>> * Mike Travis <[email protected]> wrote:
>>
>>> +/* Initialize UV hubless systems */
>>> +static __init int uv_system_init_hubless(void)
>>> +{
>>> +??? int rc;
>>> +
>>> +??? /* Setup PCH NMI handler */
>>> +??? uv_nmi_setup_hubless();
>>> +
>>> +??? /* Init kernel/BIOS interface */
>>> +??? rc = uv_bios_init();
>>> +
>>> +??? return rc;
>>> +}
>
> This looks like an excessive cleanup error by me.? The original was:
>
>> +static __init int uv_system_init_hubless(void)
>> +{
>> +?????? int rc;
>> +
>> +?????? /* Setup PCH NMI handler */
>> +?????? uv_nmi_setup_hubless();
>> +
>> +?????? /* Init kernel/BIOS interface */
>> +?????? rc = uv_bios_init();
>> +
>> +?????? /* Create user access node if UVsystab available */
>> +?????? if (rc >= 0)
>> +?????????????? uv_setup_proc_files(1);
>> +
>> +?????? return rc;
>> +}
>> +
>
> Hubbed UV's do not have a non-UV BIOS, but hubless systems in theory
> can.?? So uv_bios_init can fail on hubless systems if it has some other
> BIOS (unlikely but possible).? So I removed too much in this cleanup.
> I'll send another patch set that puts this back.

I discovered the problem... In a rearrangement of the patches this
change does happen but in a later patch [5/8]:

/* Initialize UV hubless systems */
static __init int uv_system_init_hubless(void)
{
@@ -1468,6 +1555,10 @@ static __init int uv_system_init_hubless
/* Init kernel/BIOS interface */
rc = uv_bios_init();

+ /* Create user access node if UVsystab available */
+ if (rc >= 0)
+ uv_setup_proc_files(1);
+
return rc;
}

The mistake you saw [in patch 3/8] is very short lived... Hopefully no
need for another patch set?

>
> Thanks,
> Mike
>
>>
>> Am I the only one who immediately sees the trivial C transformation
>> through which this function could lose a local variable and become 4
>> lines shorter?
>>
>> And this function got two Reviewed-by tags...
>>
>> Thanks,
>>
>> ????Ingo
>>

2019-10-07 14:53:52

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: x86/platform] x86/platform/uv: Setup UV functions for Hubless UV Systems

The following commit has been merged into the x86/platform branch of tip:

Commit-ID: 2bcf26528787d92333ed0dfd6abc9835b8e97eab
Gitweb: https://git.kernel.org/tip/2bcf26528787d92333ed0dfd6abc9835b8e97eab
Author: Mike Travis <[email protected]>
AuthorDate: Tue, 10 Sep 2019 09:58:43 -05:00
Committer: Ingo Molnar <[email protected]>
CommitterDate: Mon, 07 Oct 2019 13:42:10 +02:00

x86/platform/uv: Setup UV functions for Hubless UV Systems

Add more support for UV systems that do not contain a UV Hub (AKA
"hubless"). This update adds support for additional functions required:

Use PCH NMI handler instead of a UV Hub NMI handler.

Initialize the UV BIOS callback interface used to support specific
UV functions.

Signed-off-by: Mike Travis <[email protected]>
Reviewed-by: Steve Wahl <[email protected]>
Reviewed-by: Dimitri Sivanich <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Hedi Berriche <[email protected]>
Cc: Justin Ernst <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/apic/x2apic_uv_x.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 43fad61..14554a3 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1457,6 +1457,20 @@ static void __init build_socket_tables(void)
}
}

+/* Initialize UV hubless systems */
+static __init int uv_system_init_hubless(void)
+{
+ int rc;
+
+ /* Setup PCH NMI handler */
+ uv_nmi_setup_hubless();
+
+ /* Init kernel/BIOS interface */
+ rc = uv_bios_init();
+
+ return rc;
+}
+
static void __init uv_system_init_hub(void)
{
struct uv_hub_info_s hub_info = {0};
@@ -1596,8 +1610,8 @@ static void __init uv_system_init_hub(void)
}

/*
- * There is a small amount of UV specific code needed to initialize a
- * UV system that does not have a "UV HUB" (referred to as "hubless").
+ * There is a different code path needed to initialize a UV system that does
+ * not have a "UV HUB" (referred to as "hubless").
*/
void __init uv_system_init(void)
{
@@ -1607,7 +1621,7 @@ void __init uv_system_init(void)
if (is_uv_system())
uv_system_init_hub();
else
- uv_nmi_setup_hubless();
+ uv_system_init_hubless();
}

apic_driver(apic_x2apic_uv_x);