From patchwork Wed Mar 30 02:05:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hao, Xudong" X-Patchwork-Id: 8692501 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9C4E29F36E for ; Wed, 30 Mar 2016 02:09:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CB2020351 for ; Wed, 30 Mar 2016 02:09:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96690201ED for ; Wed, 30 Mar 2016 02:09:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1al5W2-0006e0-Cd; Wed, 30 Mar 2016 02:05:50 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1al5W1-0006du-7L for xen-devel@lists.xen.org; Wed, 30 Mar 2016 02:05:49 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id AF/CC-04050-C743BF65; Wed, 30 Mar 2016 02:05:48 +0000 X-Env-Sender: xudong.hao@intel.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1459303546!31909898!1 X-Originating-IP: [134.134.136.24] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzkwOTcx\n X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45763 invoked from network); 30 Mar 2016 02:05:47 -0000 Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by server-3.tower-31.messagelabs.com with SMTP; 30 Mar 2016 02:05:47 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 29 Mar 2016 19:05:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,414,1455004800"; d="scan'208";a="944139688" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 29 Mar 2016 19:05:31 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 29 Mar 2016 19:05:30 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.232]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Wed, 30 Mar 2016 10:05:28 +0800 From: "Hao, Xudong" To: Wei Liu , Konrad Rzeszutek Wilk Thread-Topic: [Xen-devel] pv-grub guest booting fail with recent qemu-xen Thread-Index: AdF0UVZEPsYR9gYhR8WYhuxHn4toRgSM9jeAAIN09hAAB6iqAAA53RmAACOsReA= Date: Wed, 30 Mar 2016 02:05:28 +0000 Message-ID: References: <20160325185755.GG20741@char.us.oracle.com> <20160328132114.GD31349@char.us.oracle.com> <20160329165803.GB1024@citrix.com> In-Reply-To: <20160329165803.GB1024@citrix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTAwMDg5NWUtYzQzZi00M2Y4LThiZGItNGIzMWZjMGM2NmYzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IktnOEQyZkg2M1owV3d2Tm5jS2FIbnluUGN2aXk0UnVWd1czZ2dOTmxCbzQ9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Cc: "samuel.thibault@ens-lyon.org" , "xen-devel@lists.xen.org" , "stefano.stabellini@eu.citrix.com" Subject: Re: [Xen-devel] pv-grub guest booting fail with recent qemu-xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > -----Original Message----- > From: Wei Liu [mailto:wei.liu2@citrix.com] > Sent: Wednesday, March 30, 2016 12:58 AM > To: Konrad Rzeszutek Wilk > Cc: Hao, Xudong ; wei.liu2@citrix.com; > samuel.thibault@ens-lyon.org; stefano.stabellini@eu.citrix.com; xen- > devel@lists.xen.org > Subject: Re: [Xen-devel] pv-grub guest booting fail with recent qemu-xen > > On Mon, Mar 28, 2016 at 09:21:14AM -0400, Konrad Rzeszutek Wilk wrote: > > On Mon, Mar 28, 2016 at 02:03:35AM +0000, Hao, Xudong wrote: > > > > -----Original Message----- > > > > From: Xen-devel [mailto:xen-devel-bounces@lists.xen.org] On Behalf > > > > Of Konrad Rzeszutek Wilk > > > > Sent: Saturday, March 26, 2016 2:58 AM > > > > To: Hao, Xudong > > > > Cc: stefano.stabellini@eu.citrix.com; xen-devel@lists.xen.org > > > > Subject: Re: [Xen-devel] pv-grub guest booting fail with recent > > > > qemu-xen > > > > > > > > On Wed, Mar 02, 2016 at 07:16:40AM +0000, Hao, Xudong wrote: > > > > > Hi, > > > > > For Xen upstream master branch with commit 1949868d, After > > > > > updating qemu- > > > > xen version from fcf6ac57 to 2ce1d30e, booting a pv-grub guest will fail. > > > > pv-grub should be using qemu-traditional, not qemu-xen > Never hear this limitation. > The log message you posted in your original post doesn't seem to reveal much. > Can you have a look at relevant QEMU logs under /var/log/xen? There is not valuable qemu log, only one line: "qemu: terminating on signal 1 from pid 36642". Bisect and the bad commit of qemu-xen is: commit 2ce1d30ef2858dfed72a281872579e5a26b090dd Author: Stefano Stabellini Date: Wed Jan 6 16:32:22 2016 +0000 xenfb.c: avoid expensive loops when prod <= out_cons If the frontend sets out_cons to a value higher than out_prod, it will cause xenfb_handle_events to loop about 2^32 times. Avoid that by using better checks at the beginning of the function. upstream-commit-id: ac0487e1d2ae811cd4d035741a109a4ecfb013f1 Signed-off-by: Stefano Stabellini Reported-by: Ling Liu diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 4e2a27a..8eb3046 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -789,8 +789,9 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; - if (prod == out_cons) - return; + if (prod - out_cons >= XENFB_OUT_RING_LEN) { + return; + } xen_rmb(); /* ensure we see ring contents up to prod */ for (cons = out_cons; cons != prod; cons++) { union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);