From patchwork Thu Mar 19 07:06:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dong, Eddie" X-Patchwork-Id: 13019 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2J778fP022909 for ; Thu, 19 Mar 2009 07:07:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753769AbZCSHHH (ORCPT ); Thu, 19 Mar 2009 03:07:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753491AbZCSHHH (ORCPT ); Thu, 19 Mar 2009 03:07:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:2888 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753350AbZCSHHG (ORCPT ); Thu, 19 Mar 2009 03:07:06 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 18 Mar 2009 23:59:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,388,1233561600"; d="scan'208";a="440167980" Received: from pgsmsx603.gar.corp.intel.com ([10.221.43.87]) by fmsmga002.fm.intel.com with ESMTP; 19 Mar 2009 00:02:16 -0700 Received: from pgsmsx601.gar.corp.intel.com (10.221.43.69) by pgsmsx603.gar.corp.intel.com (10.221.43.87) with Microsoft SMTP Server (TLS) id 8.1.340.0; Thu, 19 Mar 2009 15:05:54 +0800 Received: from pdsmsx602.ccr.corp.intel.com (172.16.12.184) by pgsmsx601.gar.corp.intel.com (10.221.43.69) with Microsoft SMTP Server (TLS) id 8.1.340.0; Thu, 19 Mar 2009 15:05:54 +0800 Received: from pdsmsx503.ccr.corp.intel.com ([172.16.12.95]) by pdsmsx602.ccr.corp.intel.com ([172.16.12.184]) with mapi; Thu, 19 Mar 2009 15:05:46 +0800 From: "Dong, Eddie" To: "kvm@vger.kernel.org" , Avi Kivity CC: "Dong, Eddie" Date: Thu, 19 Mar 2009 15:06:38 +0800 Subject: Fix kernel pio emulation mistake Thread-Topic: Fix kernel pio emulation mistake Thread-Index: AcmoYT8LLVCpdtFWRACJcWW/lTbcRw== Message-ID: <9832F13BD22FB94A829F798DA4A828050196AF5598@pdsmsx503.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Kernel pio emulation return value is mistakenly checked, fortuantely it is not hit yet for normal OS bootup :( Signed-off-by: Eddie Dong commit 98d3dc8b67ba0bc7f494de3ade8f2b5cfcadaeb4 Author: root Date: Thu Mar 19 15:44:39 2009 +0800 fix a bug when kernel PIO is emulated. diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index ca91749..0edd2e7 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -1838,7 +1838,7 @@ special_insn: io_dir_in = 0; do_io: if (kvm_emulate_pio(ctxt->vcpu, NULL, io_dir_in, (c->d & ByteOp) ? 1 : c->op_bytes, - port) != 0) { + port) == 0) { c->eip = saved_eip; goto cannot_emulate; }