From patchwork Sat Sep 16 16:24:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Abdul Haleem X-Patchwork-Id: 814524 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xvd1K28cfz9t2M for ; Sun, 17 Sep 2017 02:25:57 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xvd1K1HbgzDrq1 for ; Sun, 17 Sep 2017 02:25:57 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=abdhalee@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xvczv1WVbzDrhL for ; Sun, 17 Sep 2017 02:24:41 +1000 (AEST) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8GGOB26085986 for ; Sat, 16 Sep 2017 12:24:39 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2d0ybcs7kd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 16 Sep 2017 12:24:37 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 16 Sep 2017 12:24:36 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 16 Sep 2017 12:24:34 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8GGOYdJ41746438; Sat, 16 Sep 2017 16:24:34 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1ABB4124044; Sat, 16 Sep 2017 12:21:51 -0400 (EDT) Received: from [9.79.252.67] (unknown [9.79.252.67]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id BA253124035; Sat, 16 Sep 2017 12:21:47 -0400 (EDT) Subject: [mainline][bisected 36ae3c0] Build fail at virt/kvm/eventfd.c:568 From: Abdul Haleem To: linuxppc-dev Date: Sat, 16 Sep 2017 21:54:29 +0530 X-Mailer: Evolution 3.10.4-0ubuntu1 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17091616-0052-0000-0000-00000262686B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007754; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000229; SDB=6.00917905; UDB=6.00461042; IPR=6.00698133; BA=6.00005592; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017181; XFM=3.00000015; UTC=2017-09-16 16:24:36 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091616-0053-0000-0000-000052070DE3 Message-Id: <1505579069.9665.22.camel@abdul.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-16_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709160245 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sachinp , Paolo Bonzini , mpe , "Jan H. =?ISO-8859-1?Q?Sch=F6nherr?=" , linux-kernel Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi, Today's mainline kernel failed to build on powerpc with below error arch/powerpc/kvm/../../../virt/kvm/eventfd.c: In function ‘kvm_irqfd’: arch/powerpc/kvm/../../../virt/kvm/eventfd.c:568:19: error: ‘KVM_MAX_IRQ_ROUTES’ undeclared (first use in this function) if (args->gsi >= KVM_MAX_IRQ_ROUTES) ^ arch/powerpc/kvm/../../../virt/kvm/eventfd.c:568:19: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [arch/powerpc/kvm/../../../virt/kvm/eventfd.o] Error 1 Machine Type: Power 8 KVM Host kernel: 4.13.0 gcc : 5.1.1 config: attached. Possible bad commit is : commit 36ae3c0a36b7456432fedce38ae2f7bd3e01a563 Author: Jan H. Schönherr Date: Thu Sep 7 19:02:48 2017 +0100 KVM: Don't accept obviously wrong gsi values via KVM_IRQFD We cannot add routes for gsi values >= KVM_MAX_IRQ_ROUTES -- see kvm_set_irq_routing(). Hence, there is no sense in accepting them via KVM_IRQFD. Prevent them from entering the system in the first place. Signed-off-by: Jan H. Schönherr Signed-off-by: Paolo Bonzini return kvm_irqfd_deassign(kvm, args); diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index f2ac53a..c608ab4 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -565,6 +565,8 @@ kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) { if (args->flags & ~(KVM_IRQFD_FLAG_DEASSIGN | KVM_IRQFD_FLAG_RESAMPLE)) return -EINVAL; + if (args->gsi >= KVM_MAX_IRQ_ROUTES) + return -EINVAL; if (args->flags & KVM_IRQFD_FLAG_DEASSIGN)