{"id":808524,"url":"http://patchwork.ozlabs.org/api/1.0/patches/808524/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<1504239778-29893-3-git-send-email-zyimin@linux.vnet.ibm.com>","date":"2017-09-01T04:22:57","name":"[v2,2/3] s390x/pci: fixup ind_offset of msix routing entry","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"15cf6144f8b977c90a57f9b0e1485faef6daea7f","submitter":{"id":66807,"url":"http://patchwork.ozlabs.org/api/1.0/people/66807/?format=json","name":"Yi Min Zhao","email":"zyimin@linux.vnet.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1504239778-29893-3-git-send-email-zyimin@linux.vnet.ibm.com/mbox/","series":[{"id":947,"url":"http://patchwork.ozlabs.org/api/1.0/series/947/?format=json","date":"2017-09-01T04:22:55","name":"three zpci patches","version":2,"mbox":"http://patchwork.ozlabs.org/series/947/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/808524/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xk5kL6vqLz9s0g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 14:24:58 +1000 (AEST)","from localhost ([::1]:45110 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dndVp-0004cW-2s\n\tfor incoming@patchwork.ozlabs.org; Fri, 01 Sep 2017 00:24:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:34715)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <zyimin@linux.vnet.ibm.com>) id 1dndUL-000427-QZ\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 00:23:29 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <zyimin@linux.vnet.ibm.com>) id 1dndUH-0001gk-S3\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 00:23:25 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52982)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <zyimin@linux.vnet.ibm.com>)\n\tid 1dndUH-0001gK-JZ\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 00:23:21 -0400","from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv814LhfV059011\n\tfor <qemu-devel@nongnu.org>; Fri, 1 Sep 2017 00:23:19 -0400","from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cpvm6vyfe-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Fri, 01 Sep 2017 00:23:18 -0400","from localhost\n\tby e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <zyimin@linux.vnet.ibm.com>;\n\tFri, 1 Sep 2017 14:23:16 +1000","from d23relay06.au.ibm.com (202.81.31.225)\n\tby e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 1 Sep 2017 14:23:14 +1000","from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151])\n\tby d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv814NDUm38797522\n\tfor <qemu-devel@nongnu.org>; Fri, 1 Sep 2017 14:23:13 +1000","from d23av06.au.ibm.com (localhost [127.0.0.1])\n\tby d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv814NDKc001287\n\tfor <qemu-devel@nongnu.org>; Fri, 1 Sep 2017 14:23:13 +1000","from r35lp25.boeblingen.de.ibm.com (r35lp25.boeblingen.de.ibm.com\n\t[9.152.111.25])\n\tby d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv814N2UD001078; Fri, 1 Sep 2017 14:23:10 +1000"],"From":"Yi Min Zhao <zyimin@linux.vnet.ibm.com>","To":"qemu-devel@nongnu.org","Date":"Fri,  1 Sep 2017 06:22:57 +0200","X-Mailer":"git-send-email 2.3.0","In-Reply-To":"<1504239778-29893-1-git-send-email-zyimin@linux.vnet.ibm.com>","References":"<1504239778-29893-1-git-send-email-zyimin@linux.vnet.ibm.com>","X-TM-AS-MML":"disable","x-cbid":"17090104-0048-0000-0000-0000025A7400","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17090104-0049-0000-0000-0000480EC5C6","Message-Id":"<1504239778-29893-3-git-send-email-zyimin@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-31_09:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709010063","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.156.1","Subject":"[Qemu-devel] [PATCH v2 2/3] s390x/pci: fixup ind_offset of msix\n\trouting entry","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"pasic@linux.vnet.ibm.com, zyimin@linux.vnet.ibm.com,\n\trichard.henderson@linaro.org, cohuck@redhat.com,\n\tpmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"The guest uses the mpcifc instruction to register the aibvo of a zpci\ndevice, which is the starting offset of indicators in the indicator\narea and thus remains constant. Each msix vector is an offset from the\naibvo. When we map a msix route to an adapter route, we should not\nmodify the starting offset, but instead add the vector to the starting\noffset to get the absolute offset in the specific route.\n\nSigned-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>\n---\n target/s390x/kvm.c | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)","diff":"diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c\nindex 3d490c5e4b..21ce06966c 100644\n--- a/target/s390x/kvm.c\n+++ b/target/s390x/kvm.c\n@@ -2545,14 +2545,12 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,\n         return -ENODEV;\n     }\n \n-    pbdev->routes.adapter.ind_offset = vec;\n-\n     route->type = KVM_IRQ_ROUTING_S390_ADAPTER;\n     route->flags = 0;\n     route->u.adapter.summary_addr = pbdev->routes.adapter.summary_addr;\n     route->u.adapter.ind_addr = pbdev->routes.adapter.ind_addr;\n     route->u.adapter.summary_offset = pbdev->routes.adapter.summary_offset;\n-    route->u.adapter.ind_offset = pbdev->routes.adapter.ind_offset;\n+    route->u.adapter.ind_offset = pbdev->routes.adapter.ind_offset + vec;\n     route->u.adapter.adapter_id = pbdev->routes.adapter.adapter_id;\n     return 0;\n }\n","prefixes":["v2","2/3"]}