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

Re: [PATCH] x86/traps: Make nmi_show_execution_state() more useful


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 15 Aug 2022 09:07:39 +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=D59zYW9NaXZzVvOXNAOE/Y5qnIokwt4rxRWE8/pVPCM=; b=AIzLpdE+bcv6vSpDjqjfTWjuGbqWE5zvI0YUnIO0NkJRPhLVvEMloFRjbJ0kd5PYrhw1aVFoW6OIRL7vFaK9SF/ISe/282zO/reFKGl5imVHjgQBmeLbuqcbiKdeWzC7fq+Dx683fz3a7gYUDQhZo4wm78DusdjZe5vuVHCMGyfC6JMBM/6YFOQeQKtp9MtRN6Hrktn+en9URpIutRn6rfoyRUSJdmauSBwDZHQEn/hmuz3tQ0Y3qmR7rCYnTQv2sgsl5mRAnjc2O2U+e6YbJ+UK+xrnNpkvTRoCPL9kYFgEr8T+SuW4kgjaa6AQSe+N+ZdwBpISmEjgdmc0R0x5fw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n9n9oaVAanqlO2iCqQ8S2o9BM444WMRgA8DOfoczO8CwvszaI1/cFYDNiccWnr190uYscmM0rP72A/fJaGTTewRrCSBnqoMG3uSWPzsrdHLt5csrkwvezs4PWoyXW/mv+EoMewzYm1eufini1IstkYUEhV5o6s3sciCJryWmbKZXlwV4VyWnCQax/NDTrd7TT1pLvV3BSWLIMSZkA2B0vT5+MOJYSSLB29o2RpoZYu2nyMLTHRnUXlmStn0l6lS7k1NC2oWn9Hl/Xf50RYPM7UkEPlzoxSbG0r7puEza3Pu/k/IMwnYHb93gIlBhvge6uxCgk1yPPIknks67M/DWgg==
  • 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, 15 Aug 2022 07:07:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.08.2022 19:33, Andrew Cooper wrote:
>  * Always emit current.  It's critically important.

I agree it may be relevant, yet I'm not convinced of "critically". But
anyway.

> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -768,8 +768,14 @@ static int cf_check nmi_show_execution_state(
>      if ( opt_show_all )
>          show_execution_state(regs);
>      else
> -        printk(XENLOG_ERR "CPU%d @ %04x:%08lx (%pS)\n", cpu, regs->cs,
> -               regs->rip, guest_mode(regs) ? NULL : _p(regs->rip));
> +    {
> +        if ( guest_mode(regs) )
> +            printk(XENLOG_ERR "CPU%d\t%pv\t%04x:%p in guest\n",
> +                   cpu, current, regs->cs, _p(regs->rip));
> +        else
> +            printk(XENLOG_ERR "CPU%d\t%pv\t%04x:%p in Xen: %pS\n",
> +                   cpu, current, regs->cs, _p(regs->rip), _p(regs->rip));
> +    }

Could I talk you into avoiding the extra level of indentation, by using
"else if" in the middle? Preferably done that way:
Reviewed-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®.