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

Re: [PATCH 3/5] x86/crash: Drop manual hooking of exception_table[]


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 22 Nov 2021 09:57:24 +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=gbs47Slrz91ow+m3n6nh5ZKNT8/8EVP0eOUPNRmnsP0=; b=mECpqijHeaYkA5Uoz2Mjzt27oOwprG5K+G32T2PdnTNN0UO09HwPcGg/PponbTRMGQKWSO0PVyq6TStUgaeUcPgmo3SiDUNd4GbI7nNP5jYFGFD7Cyl7CecqINr4RIMH/SyPC89xLh7lis+xuwVqJEdWGOV60B/ichWYjNrsI7VmU310WEWGPkmqLAJY1ZOW0Nc0kmJ7lDAeFfNLq7qePKkLqJ65tUZJ3AXHdbQDfUb2Ab+fFdi9KPaUOVEDibirK49D2MyFXm+82APcHAcD2hLYdhP3lgTYYMuDNm8pU/exx7SMZZyNnomRk0YDXLBrMmeIyUSww97JSR/5iH657g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GSFfjdKasNSkkxCxyD4ywsp7Xqq500I6Ck8F399jYnKTtYOHCcZ0SpwCfkeliG8K67ZMdCxRcYe0irFDKxflG7oYtJhu5n5+pOtVMo2aS5UE6fkGNzXqkkKPMqk8rlm682PerwQJJsceAW2AT3fC7jAj0ZeEKiBaI0yA8gsF9rTAXh9gftjP3kswRpKnQ3/hZpYfVmuCR3oc1gG/DQNkygxyNvtxNN+EJ+FiDYIgZ+vADG4Opj8eqFoQn47aMSHe8hRXGumbxzf4s/QT59mqwFuPCD0Re7N37zNvZw0m3gf8/d6VwBpJ+/4+fZtxe4FDGxctZT3ZJmAAyZczgIjsgw==
  • 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 08:57:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.11.2021 19:21, Andrew Cooper wrote:
> NMI hooking in the crash path has undergone several revisions since its
> introduction.  What we have now is not sufficiently different from the regular
> nmi_callback() mechanism to warrant special casing.
> 
> Use set_nmi_callback() directly, and do away with patching a read-only data
> structure via a read-write alias.  This also means that the
> vmx_vmexit_handler() can and should call do_nmi() directly, rather than
> indirecting through the exception table to pick up the crash path hook.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one remark / concern:

> --- a/xen/arch/x86/crash.c
> +++ b/xen/arch/x86/crash.c
> @@ -36,10 +36,8 @@ static unsigned int crashing_cpu;
>  static DEFINE_PER_CPU_READ_MOSTLY(bool, crash_save_done);
>  
>  /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. 
> */
> -static void noreturn do_nmi_crash(const struct cpu_user_regs *regs)
> +static int noreturn do_nmi_crash(const struct cpu_user_regs *regs, int cpu)
>  {
> -    unsigned int cpu = smp_processor_id();
> -
>      stac();
>  
>      /* nmi_shootdown_cpus() should ensure that this assertion is correct. */

Looks like this is the first instance of a noreturn function returning non-void.
Are you sufficiently certain that (older) compilers won't complain about missing
return statements (with a value)?

Jan




 


Rackspace

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