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

Re: [PATCH 5/5] x86/traps: Clean up diagnostics


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 22 Nov 2021 10:08:20 +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=taq/4FP63TvSgH0rGUpj6q6EkDRJb4mcJNZVC5nj74I=; b=TNvulYEEJVTjd3O/A7ezuHcreml5YXR3kn3Ul1hyG13EiWxetT88UQHOxloVdGHwEz2QHRDBZqUX15t49SFDyDGw2EkmQnWRLvaF031Ts/ZJFWSVs+wAQ+fkBnSdPoWnmfo2R0sAJ+IGjcdK+uyO8jofI0uuy4w/pJZnd5sBcyTCIOS+XeLKuH5VLLOfQ8/xwP0UPhHaf8khr5lbcWkNTXZUOAsGO7PMLa39UapCcyP0aEMvxEfQrGFeyPX8Rue8EH3jQWYEu5EUU0RkN1XsTK40nbBIX3XWCx0NnVyWrhedSYqsb15tHIJWJmN8b/cG2FdiRJ+I28lW3xWifGlzPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WK75p3sLiVB5ysrEn2PCpph9AQz3sxQx1DfcI4Defrg1Si6HGNnTLjDjl8+slB+dCP3HkJsm0ycZJvGOUKmxZfVXsgWWMLQxDttD1qKFqiXDJVWqEGq8Pu8aMrWCJMa7ImUA+eAnoYz9kfdWva/Zru9WWER5DROLgvdULkIhGxiSbpAWOQuoKhWX7p6Ct+UlZbbBc60z98EH2JRZeSz7b1+bNJNWiX2tC6R8sGWJ9klhxh/FSeem/Jr1Q2p3HHx5FF3Zj3ENE2Qg9nANd9UZ/30cfMyaRczU4rHnLgpQzIiq/FyxpgZK6wGkI9MtBC0dLO//ZAkPYQwj3Mp7fMrR7w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 22 Nov 2021 09:08:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.11.2021 19:21, Andrew Cooper wrote:
> do{_reserved,}_trap() should use fatal_trap() rather than opencoding part of

Nit: That's do{_unhandled,}_trap() now.

> it.  This lets the remote stack trace logic work in more fatal error
> conditions.
> 
> With do_trap() converted, there is only one single user of trapstr()
> remaining.  Tweak the formatting in pv_inject_event(), and remove trapstr()
> entirely.
> 
> Take the opportunity of exporting vec_name() to improve the diagnostics in
> stub_selftest().
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit with one further aspect to consider:

> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -759,21 +759,7 @@ static int nmi_show_execution_state(const struct 
> cpu_user_regs *regs, int cpu)
>      return 1;
>  }
>  
> -const char *trapstr(unsigned int trapnr)
> -{
> -    static const char * const strings[] = {
> -        "divide error", "debug", "nmi", "bkpt", "overflow", "bounds",
> -        "invalid opcode", "device not available", "double fault",
> -        "coprocessor segment", "invalid tss", "segment not found",
> -        "stack error", "general protection fault", "page fault",
> -        "spurious interrupt", "coprocessor error", "alignment check",
> -        "machine check", "simd error", "virtualisation exception"
> -    };
> -
> -    return trapnr < ARRAY_SIZE(strings) ? strings[trapnr] : "???";
> -}
> -
> -static const char *vec_name(unsigned int vec)
> +const char *vec_name(unsigned int vec)

Is this perhaps too ambiguous a name for a non-static function? exn_vec_name()
at least, maybe?

Jan




 


Rackspace

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