qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: David Hildenbrand <david@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Subject: Re: [PATCH 2/3] hw/misc: Add mmio-debug-exit device
Date: Tue, 12 Jul 2022 12:30:04 +0200	[thread overview]
Message-ID: <555fadfa834be75e117e69f2d3892dab9d937f5d.camel@linux.ibm.com> (raw)
In-Reply-To: <2dfdce60-6c8b-4874-a901-01e1ea37d976@redhat.com>

On Tue, 2022-07-12 at 12:08 +0200, David Hildenbrand wrote:
> On 12.07.22 11:52, Ilya Leoshkevich wrote:
> > On Tue, 2022-07-12 at 10:42 +0530, Richard Henderson wrote:
> > > On 7/12/22 00:26, Ilya Leoshkevich wrote:
> > > > System tests on x86 use isa-debug-exit device in order to
> > > > signal
> > > > success or failure to the test runner. Unfortunately it's not
> > > > easily
> > > > usable on other architectures, since a guest needs to access
> > > > address_space_io, which may not be as straightforward as on
> > > > x86.
> > > > Also, it requires adding ISA bus, which an architecture might
> > > > not
> > > > otherwise need.
> > > > 
> > > > Introduce mmio-debug-exit device, which has the same semantics,
> > > > but
> > > > is
> > > > triggered by writes to memory.
> > > > 
> > > > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > > 
> > > You shouldn't need this for s390x, as there are already (at
> > > least)
> > > two other paths to 
> > > qemu_system_shutdown_request.
> > > 
> > > E.g. SIGP, which has a stop option.
> > > 
> > > 
> > > r~
> > > 
> > 
> > I would normally use lpswe + disabled wait, but this always gives
> > me
> > exit status code 0, which doesn't allow easily distinguishing
> > between
> > success and failure.
> > 
> > Code-wise SIGP seems to do roughly the same thing, and a quick
> > experiment with:
> > 
> >     lgfi %r4,-1
> >     lgfi %r5,-1
> >     larl %r6,_cpuaddr
> >     stap 0(%r6)
> >     lh %r6,0(%r6)
> >     nilh %r6,0
> >     sigp %r4,%r6,5
> > _cpuaddr: .short 0
> > 
> > confirmed that we get exit status code 0 as well.
> 
> disabled wait should trigger a qemu_system_guest_panicked().
> 
> But "panic_action == PANIC_ACTION_SHUTDOWN" seems to only make
> qemu_main_loop() return with main_loop_should_exit() == true.
> 
> main/qemu_main will always return 0.
> 
> We could return != 0 on guest panic, but not sure if that could break
> existing scripts. We'd need a new QEMU toggle for that most probably
> ...
> 

I wonder if a device is a cleaner way to solve this? It may be used on
all architectures, so there is no need to invent per-architecture way
to exit with a specific code. Maybe we can even replace Intel's
debugexit with it.


  reply	other threads:[~2022-07-12 10:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 18:56 [PATCH 0/3] accel/tcg: Fix unaligned stores to s390x low-address-protected lowcore Ilya Leoshkevich
2022-07-11 18:56 ` [PATCH 1/3] " Ilya Leoshkevich
2022-07-12  5:12   ` Richard Henderson
2022-07-12  7:14   ` David Hildenbrand
2022-07-11 18:56 ` [PATCH 2/3] hw/misc: Add mmio-debug-exit device Ilya Leoshkevich
2022-07-12  5:12   ` Richard Henderson
2022-07-12  9:52     ` Ilya Leoshkevich
2022-07-12 10:08       ` David Hildenbrand
2022-07-12 10:08       ` David Hildenbrand
2022-07-12 10:30         ` Ilya Leoshkevich [this message]
2022-07-11 18:56 ` [PATCH 3/3] tests/tcg/s390x: Test unaligned accesses to lowcore Ilya Leoshkevich

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=555fadfa834be75e117e69f2d3892dab9d937f5d.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).