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

Re: [PATCH v3 1/3] x86/APIC: include full string with error_interrupt() error messages


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jul 2023 15:08:56 +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=cRGt5nOPXknVEwGQlNXG3ZB3qCaI9fOSOZb+oc2CknQ=; b=ghu0LQPwrfRKrYy24FeoaiIqzrPV3WQ/eR23RTihHY3zpPMex788ppZFknCcLNbZib06K1BVcbps0zQ971G7MiiHw7PskIeyA5b7rjzhUDmO4ac4YVz4HduJKEw4O+WU05t8q5A39OoPD7yv7pmpj0gG8afKzQPts1gJw6JFnFyVaFbZI26ZQncdRolkTx3qCVYThIUAVEyPnvi6GEUIbhYMbeXsp6gORxIiH0bS1VCcr3DjhcO+LD56zjR9ezpAAQvbLatnN8XHD16SV3NtTLD7cWq14F67d03Q5F2uuc6j7hXVyR6hJyqM2NHG+m8zHFMZR0try4sWhOFkdstb7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EgMW0twK4Kmt7AK5PYyrDX5/Js0krtQ5U55SKrpY3p0WjKoVLnP8oeYbxdHxbsyLLu5Ivicsvk2VdSu5rH/zpNhOCAloJrUfbJk+/Nh6OwHRJkSxKnGImRfs5siZtFu13i3q6sp1xpixyXaKjYj3E0LE86wAc8HJMgJ7tmH+o1WwoQ9/fddbI6DOTrUsGSNF4au0TA/R2nl9P1VXzV4XR95NNVXXfXYmaalFlXaVt50pEDFxSLpfcci5IrNZH4glL3EcTnWhWguuLwsOoQWARS3SROHcMByzwJrDfdd6f3XWfgoorbTIEodXEFmOKLJeWTm3wR4zaU5OT43NG3XAdA==
  • 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:09:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.03.2023 20:45, Elliott Mitchell wrote:
> Rather than adding ", " with each printf(), simply include them in the
> string initially.  This allows converting to strlcat() or other methods
> which strictly concatenate, rather than formatting.
> 
> Signed-off-by: Elliott Mitchell <ehem+xen@xxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Nevertheless I wonder ...

> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1401,14 +1401,14 @@ static void cf_check spurious_interrupt(struct 
> cpu_user_regs *regs)
>  static void cf_check error_interrupt(struct cpu_user_regs *regs)
>  {
>      static const char *const esr_fields[] = {
> -        "Send CS error",
> -        "Receive CS error",
> -        "Send accept error",
> -        "Receive accept error",
> -        "Redirectable IPI",
> -        "Send illegal vector",
> -        "Received illegal vector",
> -        "Illegal register address",
> +        ", Send CS error",
> +        ", Receive CS error",
> +        ", Send accept error",
> +        ", Receive accept error",
> +        ", Redirectable IPI",
> +        ", Send illegal vector",
> +        ", Received illegal vector",
> +        ", Illegal register address",
>      };
>      unsigned int v, v1;
>      int i;
> @@ -1423,7 +1423,7 @@ static void cf_check error_interrupt(struct 
> cpu_user_regs *regs)
>              smp_processor_id(), v , v1);
>      for ( i = 7; i >= 0; --i )
>          if ( v1 & (1 << i) )
> -            printk(", %s", esr_fields[i]);
> +            printk("%s", esr_fields[i]);

... whether the extra level of indirection (by using %s) is then still
necessary: There are no % characters in any of the individual strings.
Then again iirc this goes away anyway in the next patch ...

Jan



 


Rackspace

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