From patchwork Mon Aug 29 09:14:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Feng" X-Patchwork-Id: 9303353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E37B86077C for ; Mon, 29 Aug 2016 09:45:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D28E2284AD for ; Mon, 29 Aug 2016 09:45:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5C9A286EE; Mon, 29 Aug 2016 09:45:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 9788B284AD for ; Mon, 29 Aug 2016 09:45:15 +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 1beJ6B-0005mD-Dh; Mon, 29 Aug 2016 09:43:23 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1beJ69-0005m0-Cz for xen-devel@lists.xen.org; Mon, 29 Aug 2016 09:43:21 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 58/47-12874-8B304C75; Mon, 29 Aug 2016 09:43:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRWlGSWpSXmKPExsXS1taRoruD+Ui 4wf25AhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8a7j/2sBcdZK478D2hgXMLSxcjJISRQIbH0 wkV2EFtCgFfiyLIZrF2MHEC2r0Tz5zqIknqJk8enMILYbAKKEgcvHmIFsUUEpCWufb4MFmcWM JaY9vE/G0irsICyRNMGWZAwi4CqxJLeS2DlvAIOEo3zvzJBbJKT2LD7P+MERu4FjAyrGDWKU4 vKUot0jQ30kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzEC/VrPwMC4g3HCKr9DjJI cTEqivCV3DocL8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuANYjoSLiRYlJqeWpGWmQMMMJi0BAeP kghvHUiat7ggMbc4Mx0idYpRl2PBj9trmYRY8vLzUqXEeVlAigRAijJK8+BGwIL9EqOslDAvI wMDgxBPQWpRbmYJqvwrRnEORiVhXi+QKTyZeSVwm14BHcEEdEQByP28xSWJCCmpBsbYF9mfj3 LeOyl71NT9XocEh0XnJ8aTs+72d05Zyf/gzC257msfPj6PMjPzYG5Ib5JRN3uevjDk4lozycX p/Abtj97XJd7ZfWb740sPrl7afeWC8bobN1YV1/xtMjVYrCZkvTw26HJ71AWZRV473xvK9d/f /djIIybuQm/ZKhWH808SVcpOCVkrsRRnJBpqMRcVJwIAzpUU2nECAAA= X-Env-Sender: feng.wu@intel.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1472463797!20346304!1 X-Originating-IP: [134.134.136.100] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34082 invoked from network); 29 Aug 2016 09:43:19 -0000 Received: from mga07.intel.com (HELO mga07.intel.com) (134.134.136.100) by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 29 Aug 2016 09:43:19 -0000 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 29 Aug 2016 02:43:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,596,1464678000"; d="scan'208";a="2222325" Received: from feng-bdw-de-pi.bj.intel.com ([10.238.154.74]) by orsmga005.jf.intel.com with ESMTP; 29 Aug 2016 02:43:15 -0700 From: Feng Wu To: xen-devel@lists.xen.org Date: Mon, 29 Aug 2016 17:14:32 +0800 Message-Id: <1472462072-3734-1-git-send-email-feng.wu@intel.com> X-Mailer: git-send-email 2.1.0 Cc: Feng Wu , jbeulich@suse.com Subject: [Xen-devel] [PATCH] Fix a BUG_ON issue 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The 'idx' can equal to the max number of vCPUs, fix it. Signed-off-by: Feng Wu --- xen/drivers/passthrough/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 9e6b46c..66577b6 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -243,7 +243,7 @@ static struct vcpu *vector_hashing_dest(const struct domain *d, for ( i = 0; i <= mod; i++ ) { idx = find_next_bit(dest_vcpu_bitmap, d->max_vcpus, idx) + 1; - BUG_ON(idx >= d->max_vcpus); + BUG_ON(idx > d->max_vcpus); } dest = d->vcpu[idx - 1];