All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [PATCH 07/13] cpu: Move common code to cpu-common
Date: Wed, 9 Feb 2022 09:29:35 +1100	[thread overview]
Message-ID: <b7861183-7aa4-d0bd-ec1e-ab662fc15683@linaro.org> (raw)
In-Reply-To: <20220208152243.16452-8-f4bug@amsat.org>

On 2/9/22 02:22, Philippe Mathieu-Daudé wrote:
> -void cpu_abort(CPUState *cpu, const char *fmt, ...)
> -{
> -    va_list ap;
> -    va_list ap2;
> -
> -    va_start(ap, fmt);
> -    va_copy(ap2, ap);
> -    fprintf(stderr, "qemu: fatal: ");
> -    vfprintf(stderr, fmt, ap);
> -    fprintf(stderr, "\n");
> -    cpu_dump_state(cpu, stderr, CPU_DUMP_FPU | CPU_DUMP_CCOP);
> -    if (qemu_log_separate()) {
> -        FILE *logfile = qemu_log_lock();
> -        qemu_log("qemu: fatal: ");
> -        qemu_log_vprintf(fmt, ap2);
> -        qemu_log("\n");
> -        log_cpu_state(cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP);
> -        qemu_log_flush();
> -        qemu_log_unlock(logfile);
> -        qemu_log_close();
> -    }
> -    va_end(ap2);
> -    va_end(ap);
> -    replay_finish();
> -#if defined(CONFIG_USER_ONLY)
> -    {
> -        struct sigaction act;
> -        sigfillset(&act.sa_mask);
> -        act.sa_handler = SIG_DFL;
> -        act.sa_flags = 0;
> -        sigaction(SIGABRT, &act, NULL);
> -    }
> -#endif
> -    abort();
> -}

This ifdef won't work moved to cpus-common.c.

Coincidentally, Alex and I were a bit stumped early this morning about a 
g_assert_not_reached() failing to kill a plugin example, and I had totally forgotten about 
this.

We should probably rearrange user-only to *not* trap SIGABRT in general; only SIGABRT that 
can be raised by the guest.  Perhaps the signal number should be remapped in the guest, to 
one of the host rt signals?  Then if the signal makes its way to the SIG_DFL handler, we 
remap to a host abort().


r~


  reply	other threads:[~2022-02-08 22:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 15:22 [PATCH 00/13] exec: Move translation declarations to 'translate-all.h' Philippe Mathieu-Daudé via
2022-02-08 15:22 ` [PATCH 01/13] meson: Display libfdt as disabled when system emulation is disabled Philippe Mathieu-Daudé via
2022-02-08 16:15   ` Paolo Bonzini
2022-02-08 15:22 ` [PATCH 02/13] exec/cpu_ldst: Include 'cpu.h' to get target_ulong definition Philippe Mathieu-Daudé via
2022-02-08 22:10   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 03/13] accel: Elide kvm_update_guest_debug by checking kvm_supports_guest_debug Philippe Mathieu-Daudé via
2022-02-08 22:16   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 04/13] target/i386/cpu: Ensure accelerators set CPU addressble physical bits Philippe Mathieu-Daudé via
2022-02-08 22:16   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 05/13] target/i386/tcg/sysemu: Include missing 'exec/exec-all.h' header Philippe Mathieu-Daudé via
2022-02-08 22:17   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 06/13] cpu: Add missing 'exec/exec-all.h' and ''exec/exec-all.h'' headers Philippe Mathieu-Daudé via
2022-02-08 22:17   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 07/13] cpu: Move common code to cpu-common Philippe Mathieu-Daudé via
2022-02-08 22:29   ` Richard Henderson [this message]
2022-02-08 15:22 ` [PATCH 08/13] target: Include missing 'cpu.h' Philippe Mathieu-Daudé via
2022-02-08 22:31   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 09/13] target: Use forward declared type instead of structure type Philippe Mathieu-Daudé via
2022-02-08 22:31   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 10/13] target: Use CPUArchState as interface to target-specific CPU state Philippe Mathieu-Daudé via
2022-02-08 22:40   ` Richard Henderson
2022-02-09 21:47     ` Philippe Mathieu-Daudé via
2022-02-08 15:22 ` [PATCH 11/13] exec/cpu_ldst: Restrict TCG-specific code Philippe Mathieu-Daudé via
2022-02-08 22:43   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 12/13] exec/cpu-all: Restrict cpu_copy() to user emulation Philippe Mathieu-Daudé via
2022-02-08 22:47   ` Richard Henderson
2022-02-08 15:22 ` [PATCH 13/13] exec: Move translation declarations to 'translate-all.h' Philippe Mathieu-Daudé via
2022-02-08 23:00   ` Richard Henderson
2022-02-09 21:50     ` Philippe Mathieu-Daudé via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7861183-7aa4-d0bd-ec1e-ab662fc15683@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.