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

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


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jul 2023 15:12:55 +0200
  • 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=q0BYXk1Yk4nLEnI1bExbCgN5JYJ0yDm2Or9qYtttFtU=; b=U7+T5MsvHkkTJ2zz7WRjRftp3bV6xzWkBb0bEU2XU0uu1Pm8hMRTXRquctckEiGeT65knV08uWDGabQwq1/BzVC1m7MLYUMl1aS7s3oLF3r3fW1hVs/M74yoy6L4VktLdV/DRZA/WKHGXlI5u6QkixvHwbmhytiwBLnrD1PTJzLaFmuIkDjTwvL83/a6O4buN+abiVOZbOCdz5DFr550EfPqZWfbMlZ2OM1M8L5bplii1J/rfwOj8HjKE9zH6dDZgyQyhf6hh49a273U3ti79D05ItPY77gBAFJKJMx0tVlN9Hb6/eIGBObHee0Rh9iv1MZo4zby/kts0cRQg7lAhw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gdP+J5eNOns6j1+OWdZ2qY/7f7yVb+nzLnw4YYzoVcwdG5D/JJ6Y64YjDGMD3sBmFop6L/l/b0IdvKJEV/hLy1YkTNRiCQCFyl+YoSS7odxiASMtHZKFAHK0H4W8Nrtsp+Y3B7Ahl9+CcrNbTERXihVA6KAaeBtqif8+3JLvh1yBv9CL/3SaweN1jFmciIk789sUJvNlFHt26EkLTxM9nh/OvF7zOCTbmd80vRP+WTNg3Rx4EiGAugvbgFEMfYbxrjCkn3DZFn+Bzj0DaKktIXh/kKYaybS6k9sNk4rjXHoAOq9Gxvq+xFORjx9cqsrV6Tfc39PGB5iCk1UrTFJ/7A==
  • 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: Thu, 13 Jul 2023 13:13:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.03.2023 20:53, Elliott Mitchell wrote:
> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1410,6 +1410,7 @@ static void cf_check error_interrupt(struct 
> cpu_user_regs *regs)
>          ", Received illegal vector",
>          ", Illegal register address",
>      };
> +    const char *entries[ARRAY_SIZE(esr_fields)];
>      unsigned int v, v1;
>      int i;
>  
> @@ -1419,12 +1420,13 @@ 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[7], entries[6],
> +        entries[5], entries[4], entries[3], entries[2], entries[1], 
> entries[0]);

While pre-existing in both cases, two nits: There's a stray blank before one
of the commas, and indentation is wrong too.

Furthermore there's no reason to split the format string, especially not
ahead of the \n. Plus line wrapping for the 8 entries[] references could
also be done more evenly.

Since these are all cosmetic, I guess I'll do adjustments while committing:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

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