From patchwork Mon Jul 6 03:05:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 34178 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 n6635lIj015047 for ; Mon, 6 Jul 2009 03:05:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbZGFDFi (ORCPT ); Sun, 5 Jul 2009 23:05:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752110AbZGFDFi (ORCPT ); Sun, 5 Jul 2009 23:05:38 -0400 Received: from mga01.intel.com ([192.55.52.88]:53502 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752104AbZGFDFi (ORCPT ); Sun, 5 Jul 2009 23:05:38 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 05 Jul 2009 19:51:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,353,1243839600"; d="scan'208";a="472190927" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.29]) by fmsmga002.fm.intel.com with ESMTP; 05 Jul 2009 19:59:03 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1MNeWR-000716-7v; Mon, 06 Jul 2009 11:05:39 +0800 From: Sheng Yang To: Avi Kivity Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH] KVM: Fix apic_mmio_write return for unaligned write Date: Mon, 6 Jul 2009 11:05:39 +0800 Message-Id: <1246849539-26953-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.6.0.4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Some in-famous OS do unaligned writing for APIC MMIO, and the return value has been missed in recent change, then the OS hangs. (it's curious that the compilation warning have been ignored...) Signed-off-by: Sheng Yang --- arch/x86/kvm/lapic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 6f559d6..ccafe0d 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -831,7 +831,7 @@ static int apic_mmio_write(struct kvm_io_device *this, if (len != 4 || (offset & 0xf)) { /* Don't shout loud, $infamous_os would cause only noise. */ apic_debug("apic write: bad size=%d %lx\n", len, (long)address); - return; + return 0; } val = *(u32*)data;