[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <16a6ec0afd8.10d96b0bf79755.8849251462286427289@zoho.com>
Date: Tue, 30 Apr 2019 22:58:02 +0800
From: Perr Zhang <strongbox8@...o.com>
To: "Peter Zijlstra" <peterz@...radead.org>
Cc: "pbonzini" <pbonzini@...hat.com>, "rkrcmar" <rkrcmar@...hat.com>,
"tglx" <tglx@...utronix.de>, "stable" <stable@...r.kernel.org>,
"mingo" <mingo@...hat.com>, "x86" <x86@...nel.org>,
"kvm" <kvm@...r.kernel.org>,
"linux-kernel" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: x86: revert the order of calls in kvm_fast_pio()
---- On Tue, 30 Apr 2019 22:32:01 +0800 Peter Zijlstra <peterz@...radead.org> wrote ----
> On Tue, Apr 30, 2019 at 10:24:23PM +0800, Perr Zhang wrote:
> > In commit 45def77ebf79, the order of function calls in kvm_fast_pio()
> > was changed. This causes that the vm(XP,and also XP's iso img) failed
> > to boot. This doesn't happen with win10 or ubuntu.
> >
> > After revert the order, the vm(XP) succeedes to boot. In addition, the
> > change of calls's order of kvm_fast_pio() in commit 45def77ebf79 has no
> > obvious reason.
>
> This Changelog fails to explain why the order is important and equally
> fails to inform the future reader of that code. So this very same thing
> will happen again in 6 months time or thereabout.
I'm not familiar with KVM, don't know the particular reason.
>
> > Fixes: 45def77ebf79 ("KVM: x86: update %rip after emulating IO")
> > Cc: <stable@...r.kernel.org>
> > Signed-off-by: Perr Zhang <strongbox8@...o.com>
> > ---
> > arch/x86/kvm/x86.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index a0d1fc80ac5a..248753cb94a1 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -6610,13 +6610,12 @@ static int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size,
> >
> > int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in)
> > {
> > - int ret;
> > + int ret = kvm_skip_emulated_instruction(vcpu);
> >
> > if (in)
> > - ret = kvm_fast_pio_in(vcpu, size, port);
> > + return kvm_fast_pio_in(vcpu, size, port) && ret;
> > else
> > - ret = kvm_fast_pio_out(vcpu, size, port);
> > - return ret && kvm_skip_emulated_instruction(vcpu);
> > + return kvm_fast_pio_out(vcpu, size, port) && ret;
> > }
> > EXPORT_SYMBOL_GPL(kvm_fast_pio);
> >
> > --
> > 2.21.0
> >
> >
> >
>
Powered by blists - more mailing lists