[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] x86/APIC: modify error_interrupt() to output using single printk()


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 20 Mar 2023 16:39:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hR9n7oQ6webP7Wzvmt7oADorvrNzqo0kEmiYBKy4PTw=; b=PVraYNrAqtUbXCxM160uRKMBwJpCaZiAXAg78Z6vwfH+VSQ8SmOgCz5VDAITqJNt+8rdDjttpR+kQVjdF6BRKH4Z9juof9dt8Gsrl8TamMLjEB7S7Khb3CVjEEJ0aucD7bEyVKID61XYCGWbucgHkHob5lNXpkbLhpHoH6bWn6Kxqgk+et794l4j3TcPR6VEuP7rK48ExTwsIgHvYqqBPxXa088Sz6r2QeImReK1zB7ndLgAyiqEbh3BzxNSILn8rCw4mCaQgbQDCAklTJ9/ubwH+KtcIJjA1nYvM3bM7qemOQYnC9b6B2iHb8y5KwnDMZe5EIhflHuzNvMFVLjctQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbvZsAizaTIMn5F+/JKvT5yW5n5aMhoaL24RCwzBURxINMNyVN6mehKCMAN4ZV5CBbgYJoInZsoIPjiVvJ6rq2cpLNTYQ4vdeFRm3zY79t4Nk82CjZumWHughsD2aAkQ7Kn17eV1uhCBPEU2zekcpW+qPwMq/wy8MQaPTUjCckZ9t03QGXUgrzFg+7VfwtMyuHslzgp6YOzZnbWztqs0J9PFvaHWKGfDvI+z/LjQUWLH8cjcS7MSE1RoVvUXLUZxXUiy9OKSjQCU47gYPHN6X7Jue4R3x6O0gD6SyDt8lTK6hbKerWKF+ib7lcZWOXsSzvDv1u5I0oZOtg6Xx00JJw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 20 Mar 2023 15:39:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.03.2023 15:29, Elliott Mitchell wrote:
> On Mon, Mar 20, 2023 at 09:56:54AM +0100, Jan Beulich wrote:
>> On 17.03.2023 20:53, Elliott Mitchell wrote:
>>> This takes care of the issue of APIC errors tending to occur on multiple
>>> cores at one.  In turn this tends to causes the error messages to be
>>
>> Nit: "at once"?
> 
> https://en.wiktionary.org/wiki/at_once
> 
> Adverb #2, synonym of "simultaneously".

And that's what you mean, I think? Not being a native speaker, I have no
idea what "at one" is meaning here.

>>> @@ -1419,12 +1420,12 @@ static void cf_check error_interrupt(struct 
>>> cpu_user_regs *regs)
>>>      v1 = apic_read(APIC_ESR);
>>>      ack_APIC_irq();
>>>  
>>> -    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)",
>>> -            smp_processor_id(), v , v1);
>>>      for ( i = 7; i >= 0; --i )
>>> -        if ( v1 & (1 << i) )
>>> -            printk("%s", esr_fields[i]);
>>> -    printk("\n");
>>> +        entries[i] = v1 & (1 << i) ? esr_fields[i] : "";
>>> +    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)"
>>> +            "%s%s%s%s%s%s%s%s" "\n",
>>> +            smp_processor_id(), v , v1, entries[0], entries[1], entries[2],
>>> +            entries[3], entries[4], entries[5], entries[6], entries[7]);
>>
>> Two style nits: Indentation wants fixing here (it was wrong in the original
>> code already), and the stray blank between v and the comma also wants
>> dropping at this occasion.
> 
> There are several minor issues here which may be best handled during
> commit as they're very small items about how precisely you want this to
> look.
> 
> First, I later realized I goofed the argument order.  In order to match
> the original implementation, it needs to be entries[7] ... entries[0]
> (could though be the low-order bits should be reported first).

I'm not really concerned of the order. A change of order wants
mentioning in the description though.

> Second, the order of the for loop no longer matters.  Using
> ARRAY_SIZE(esr_fields) and increment should now be more maintainable
> (this would also allow i to be unsigned).

Indeed. But that would better done in a separate patch then anyway.

> Third, I'm simply unsure how you would prefer to format the printk().

About any way matching style guidelines is okay. There are two more
things to mention though (sorry for not noticing earlier): We aim at
keeping the entire format string on one line, for grep-ability. And
there's no need (and in fact no reason) to split the sequence of %s
from the \n. To summarize:

    printk(XENLOG_DEBUG
           "APIC error on CPU%u: %02x(%02x)%s%s%s%s%s%s%s%s\n",

(unless of course it all fits on one line, which it looks like it
does).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.