From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] kvm test: Add 32-bit task switch micro-test Date: Wed, 14 Apr 2010 21:55:15 +0200 Message-ID: <4BC61DA3.1010807@web.de> References: <4BC5CD5E.6000608@siemens.com> <20100414172241.GE18132@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF8F39D5E1B4285E59CAB8B11" Cc: Avi Kivity , Marcelo Tosatti , kvm To: Gleb Natapov Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:50082 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756654Ab0DNTzz (ORCPT ); Wed, 14 Apr 2010 15:55:55 -0400 In-Reply-To: <20100414172241.GE18132@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF8F39D5E1B4285E59CAB8B11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Gleb Natapov wrote: > On Wed, Apr 14, 2010 at 04:12:46PM +0200, Jan Kiszka wrote: >> Gleb, you might want to have a look at this test. When using it with m= y >> 2.6.34 queue (or below or with QEMU), I get the following, expected >> output: >> >> fault at 8:4002ef, prev task 18, error code 1234 >> post fault >> >> When using it with master + my error-code patch, I get this: >> >> fault at 8:4002ef, prev task 18, error code 1234 >> >> post fault >> >> I.e. there is blank line, a repeated 0x0a character after returning fr= om >> the fault handler. I'm suspecting that IO string rework triggers this.= >> Instrumentation of the testdev showed that the spurious puts() was >> emitted over the instruction that the fault handler returns to. Any >> ideas? >> > Yes, handle_task_switch() needlessly exits to userspace without setting= > exit reason, so last exit reason is reused (in your test case this is i= o write). > This patch should fix the problem: >=20 >=20 > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index bffd049..d080840 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -4740,7 +4740,7 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 ts= s_selector, int reason) > if (ret =3D=3D X86EMUL_CONTINUE) > kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags); > =20 > - return (ret !=3D X86EMUL_CONTINUE); > + return (ret =3D=3D X86EMUL_CONTINUE); > } > EXPORT_SYMBOL_GPL(kvm_task_switch); > =20 Yep, makes sense and works for me as well. Jan --------------enigF8F39D5E1B4285E59CAB8B11 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkvGHaMACgkQitSsb3rl5xRv9wCdEDHxayy7CsB8N5psSIQII7+B GqsAoOCQC0LhTJMIdPAiaoHBx799zJyD =xUb8 -----END PGP SIGNATURE----- --------------enigF8F39D5E1B4285E59CAB8B11--