All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <don.slutz@gmail.com>
To: xen-devel@lists.xen.org, Paul Durrant <paul.durrant@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Migration bug added by commit 2df1aa01bef7366798248ac6d03cfb42048b003d
Date: Sat, 27 Jun 2015 17:02:13 -0400	[thread overview]
Message-ID: <558F0F55.7030908@Gmail.com> (raw)

commit 2df1aa01bef7366798248ac6d03cfb42048b003d
Author: Paul Durrant <paul.durrant@citrix.com>
Date:   Tue Jun 23 18:07:49 2015 +0200

     x86/hvm: remove hvm_io_pending() check in hvmemul_do_io()

...
-            rc = X86EMUL_RETRY;
-            if ( !hvm_send_assist_req(s, &p) )
+            rc = hvm_send_assist_req(s, &p);
+            if ( rc != X86EMUL_RETRY )
...
      if ( unlikely(!vcpu_start_shutdown_deferral(curr)) )
-        return 0; /* implicitly bins the i/o operation */
+        return X86EMUL_OKAY;

So now X86EMUL_OKAY is returned from hvmemul_do_io() during shutdown.

 From Jan Beulich about this:


  Re: [Xen-devel] [PATCH 3/5] hvmemul_do_io: If the send to the ioreq
  server failed do not retry.
  <https://www.mail-archive.com/search?l=xen-devel@lists.xen.org&q=subject:%22Re%5C%3A+%5C%5BXen%5C-devel%5C%5D+%5C%5BPATCH+3%5C%2F5%5C%5D+hvmemul_do_io%5C%3A+If+the+send+to+the+ioreq+server+failed+do+not+retry.%22&o=newest>


Jan Beulich 
<https://www.mail-archive.com/search?l=xen-devel@lists.xen.org&q=from:%22Jan+Beulich%22> 
Fri, 30 Jan 2015 02:24:55 -0800 
<https://www.mail-archive.com/search?l=xen-devel@lists.xen.org&q=date:20150130> 


>>> On 30.01.15 at 01:52, <dsl...@verizon.com> wrote:
> I.E. do just what no backing DM does.


_If_ this is correct, the if() modified here should be folded with the
one a few lines up. But looking at the description of the commit that
introduced this (bac0999325 "x86 hvm: Do not incorrectly retire an
instruction emulation...", almost immediately modified by f20f3c8ece
"x86 hvm: On failed hvm_send_assist_req(), io emulation...") I doubt
this is really what we want, or at the very least your change
description should explain what was wrong with the original commit.

Jan



going up the call stack:

in handle_pio when hvmemul_do_pio_buffer() returns X86EMUL_OKAY, it 
returns 1.

    svm_vmexit_handler 2578 if ( handle_pio(port, bytes, dir) )
or
    vmx_vmexit_handler 3178 if ( handle_pio(port, bytes, dir) )

both update the IP in this case which is wrong during shutdown.

So I think:

             rc = hvm_send_assist_req(s, &p);
             if ( rc != X86EMUL_RETRY )
                  vio->io_state = HVMIO_none;

needs to change to:

                 rc = hvm_send_assist_req(s, &p);
                 if ( rc != X86EMUL_RETRY )
                 {
                     vio->io_state = HVMIO_none;
                     if ( rc == X86EMUL_OKAY )
                         rc = X86EMUL_RETRY;
                 }


    -Don Slutz

             reply	other threads:[~2015-06-27 21:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-27 21:02 Don Slutz [this message]
2015-06-29  9:41 ` Migration bug added by commit 2df1aa01bef7366798248ac6d03cfb42048b003d Paul Durrant
2015-06-29 12:53   ` Paul Durrant
2015-06-29 14:03     ` Paul Durrant
2015-06-29 15:14       ` Don Slutz
2015-06-29 15:18         ` Paul Durrant
2015-07-06 10:03         ` Jan Beulich
2015-07-06 10:08           ` Paul Durrant
2015-07-06 10:14             ` Jan Beulich
2015-07-06 10:16               ` Paul Durrant

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=558F0F55.7030908@Gmail.com \
    --to=don.slutz@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=paul.durrant@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.