[PATCHv8,17/17] ACPI: tables: Print MULTIPROC_WAKEUP when MADT is parsed

Message ID 20240227212452.3228893-18-kirill.shutemov@linux.intel.com
State New
Headers
Series x86/tdx: Add kexec support |

Commit Message

Kirill A. Shutemov Feb. 27, 2024, 9:24 p.m. UTC
  When MADT is parsed, print MULTIPROC_WAKEUP information:

ACPI: MP Wakeup (version[1], mailbox[0x7fffd000], reset[0x7fffe068])

This debug information will be very helpful during bring up.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
---
 drivers/acpi/tables.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Comments

Kirill A. Shutemov Feb. 28, 2024, 3:22 p.m. UTC | #1
On Wed, Feb 28, 2024 at 11:08:38AM +1300, Huang, Kai wrote:
> 
> 
> On 28/02/2024 10:24 am, Kirill A. Shutemov wrote:
> > When MADT is parsed, print MULTIPROC_WAKEUP information:
> > 
> > ACPI: MP Wakeup (version[1], mailbox[0x7fffd000], reset[0x7fffe068])
> > 
> > This debug information will be very helpful during bring up.
> > 
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > Reviewed-by: Baoquan He <bhe@redhat.com>
> > ---
> >   drivers/acpi/tables.c | 14 ++++++++++++++
> >   1 file changed, 14 insertions(+)
> > 
> > diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> > index b07f7d091d13..c59a3617bca7 100644
> > --- a/drivers/acpi/tables.c
> > +++ b/drivers/acpi/tables.c
> > @@ -198,6 +198,20 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
> >   		}
> >   		break;
> > +	case ACPI_MADT_TYPE_MULTIPROC_WAKEUP:
> > +		{
> > +			struct acpi_madt_multiproc_wakeup *p =
> > +				(struct acpi_madt_multiproc_wakeup *)header;
> > +			u64 reset_vector = 0;
> > +
> > +			if (p->version >= ACPI_MADT_MP_WAKEUP_VERSION_V1)
> > +				reset_vector = p->reset_vector;
> > +
> > +			pr_debug("MP Wakeup (version[%d], mailbox[%#llx], reset[%#llx])\n",
> > +				 p->version, p->mailbox_address, reset_vector);
> > +		}
> > +		break;
> > +
> 
> Hmm.. I hate to say, but maybe it is better to put this patch at some early
> place in this series w/o mailbox version and reset_vector, and add
> incremental changes where mailbox/reset_vector is introduced in this series.
> 
> The advantage is in this way someone can just backport this patch to the old
> kernel if they care -- this should be part of commit f39642d0dbacd
> ("x86/acpi/x86/boot: Add multiprocessor wake-up support") anyway.

It is not subject for backporting. It is just a cosmetics fix (or debug
facility). Any new MADT type would generate a warning. Nothing wrong with
it.
  
Kai Huang Feb. 28, 2024, 9:19 p.m. UTC | #2
On 29/02/2024 4:22 am, Kirill A. Shutemov wrote:
> On Wed, Feb 28, 2024 at 11:08:38AM +1300, Huang, Kai wrote:
>>
>>
>> On 28/02/2024 10:24 am, Kirill A. Shutemov wrote:
>>> When MADT is parsed, print MULTIPROC_WAKEUP information:
>>>
>>> ACPI: MP Wakeup (version[1], mailbox[0x7fffd000], reset[0x7fffe068])
>>>
>>> This debug information will be very helpful during bring up.
>>>
>>> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>>> Reviewed-by: Baoquan He <bhe@redhat.com>
>>> ---
>>>    drivers/acpi/tables.c | 14 ++++++++++++++
>>>    1 file changed, 14 insertions(+)
>>>
>>> diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
>>> index b07f7d091d13..c59a3617bca7 100644
>>> --- a/drivers/acpi/tables.c
>>> +++ b/drivers/acpi/tables.c
>>> @@ -198,6 +198,20 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
>>>    		}
>>>    		break;
>>> +	case ACPI_MADT_TYPE_MULTIPROC_WAKEUP:
>>> +		{
>>> +			struct acpi_madt_multiproc_wakeup *p =
>>> +				(struct acpi_madt_multiproc_wakeup *)header;
>>> +			u64 reset_vector = 0;
>>> +
>>> +			if (p->version >= ACPI_MADT_MP_WAKEUP_VERSION_V1)
>>> +				reset_vector = p->reset_vector;
>>> +
>>> +			pr_debug("MP Wakeup (version[%d], mailbox[%#llx], reset[%#llx])\n",
>>> +				 p->version, p->mailbox_address, reset_vector);
>>> +		}
>>> +		break;
>>> +
>>
>> Hmm.. I hate to say, but maybe it is better to put this patch at some early
>> place in this series w/o mailbox version and reset_vector, and add
>> incremental changes where mailbox/reset_vector is introduced in this series.
>>
>> The advantage is in this way someone can just backport this patch to the old
>> kernel if they care -- this should be part of commit f39642d0dbacd
>> ("x86/acpi/x86/boot: Add multiprocessor wake-up support") anyway.
> 
> It is not subject for backporting. It is just a cosmetics fix (or debug
> facility). Any new MADT type would generate a warning. Nothing wrong with
> it.
> 

OK fine to me.  Thanks.
  

Patch

diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index b07f7d091d13..c59a3617bca7 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -198,6 +198,20 @@  void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 		}
 		break;
 
+	case ACPI_MADT_TYPE_MULTIPROC_WAKEUP:
+		{
+			struct acpi_madt_multiproc_wakeup *p =
+				(struct acpi_madt_multiproc_wakeup *)header;
+			u64 reset_vector = 0;
+
+			if (p->version >= ACPI_MADT_MP_WAKEUP_VERSION_V1)
+				reset_vector = p->reset_vector;
+
+			pr_debug("MP Wakeup (version[%d], mailbox[%#llx], reset[%#llx])\n",
+				 p->version, p->mailbox_address, reset_vector);
+		}
+		break;
+
 	case ACPI_MADT_TYPE_CORE_PIC:
 		{
 			struct acpi_madt_core_pic *p = (struct acpi_madt_core_pic *)header;