qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: KONRAD Frederic <frederic.konrad@adacore.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Alistair Francis <alistair.francis@xilinx.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.10 2/2] xilinx-spips: add a migration blocker when using mmio_execution
Date: Tue, 1 Aug 2017 11:30:15 +0200	[thread overview]
Message-ID: <20170801093015.GA4859@toto> (raw)
In-Reply-To: <086e70d6-d5c1-2879-874f-ea1804c6ab38@adacore.com>

On Tue, Aug 01, 2017 at 11:13:56AM +0200, KONRAD Frederic wrote:
> 
> 
> On 08/01/2017 11:00 AM, Peter Maydell wrote:
> >On 1 August 2017 at 09:10, KONRAD Frederic <frederic.konrad@adacore.com> wrote:
> >>This adds a migration blocker when mmio_execution has been used.
> >>
> >>Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
> >>---
> >>  hw/ssi/xilinx_spips.c | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >>diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
> >>index e833028..d46491f 100644
> >>--- a/hw/ssi/xilinx_spips.c
> >>+++ b/hw/ssi/xilinx_spips.c
> >>@@ -31,6 +31,8 @@
> >>  #include "hw/ssi/ssi.h"
> >>  #include "qemu/bitops.h"
> >>  #include "hw/ssi/xilinx_spips.h"
> >>+#include "qapi/error.h"
> >>+#include "migration/blocker.h"
> >>
> >>  #ifndef XILINX_SPIPS_ERR_DEBUG
> >>  #define XILINX_SPIPS_ERR_DEBUG 0
> >>@@ -139,6 +141,7 @@ typedef struct {
> >>
> >>      uint8_t lqspi_buf[LQSPI_CACHE_SIZE];
> >>      hwaddr lqspi_cached_addr;
> >>+    Error *migration_blocker;
> >>  } XilinxQSPIPS;
> >>
> >>  typedef struct XilinxSPIPSClass {
> >>@@ -603,6 +606,14 @@ static void *lqspi_request_mmio_ptr(void *opaque, hwaddr addr, unsigned *size,
> >>      XilinxQSPIPS *q = opaque;
> >>      hwaddr offset_within_the_region = addr & ~(LQSPI_CACHE_SIZE - 1);
> >>
> >>+    /* mmio_execution breaks migration better aborting than having strange
> >>+     * bugs.
> >>+     */
> >>+    if (!q->migration_blocker) {
> >>+        error_setg(&q->migration_blocker, "booting from SPI breaks migration");
> >>+        migrate_add_blocker(q->migration_blocker, &error_fatal);
> >>+    }
> >>+
> >
> >This doesn't handle the case when migration is already in progress
> >and this function is called (which will cause migrate_add_blocker
> >to fail).
> 
> Maybe I can make the request_ptr to fail if migration is in
> progress.. But is that safe or do I risk a race.
>

Hi Fred,

At this stage, perhaps we should just register the blocker when this dev realizes.

If a request_ptr comes in during migration, the VM will fail either way...

Cheers,
Edgar

  reply	other threads:[~2017-08-01  9:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01  8:10 [Qemu-devel] [PATCH for-2.10 0/2] mmio-execution and migration KONRAD Frederic
2017-08-01  8:10 ` [Qemu-devel] [PATCH for-2.10 1/2] mmio-execution: warn the potential developer about migration KONRAD Frederic
2017-08-01  8:10 ` [Qemu-devel] [PATCH for-2.10 2/2] xilinx-spips: add a migration blocker when using mmio_execution KONRAD Frederic
2017-08-01  9:00   ` Peter Maydell
2017-08-01  9:13     ` KONRAD Frederic
2017-08-01  9:30       ` Edgar E. Iglesias [this message]
2017-08-01  9:35         ` KONRAD Frederic
2017-08-01  9:41           ` Peter Maydell
2017-08-10  9:11             ` Peter Maydell
2017-08-10  9:22               ` Edgar E. Iglesias
2017-08-10  9:28                 ` KONRAD Frederic

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=20170801093015.GA4859@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=alistair.francis@xilinx.com \
    --cc=dgilbert@redhat.com \
    --cc=frederic.konrad@adacore.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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).