From patchwork Tue Feb 12 14:06:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10807997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E041B746 for ; Tue, 12 Feb 2019 14:06:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF3DA2040D for ; Tue, 12 Feb 2019 14:06:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C274528435; Tue, 12 Feb 2019 14:06:43 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D62B2040D for ; Tue, 12 Feb 2019 14:06:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729991AbfBLOGm (ORCPT ); Tue, 12 Feb 2019 09:06:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48978 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727428AbfBLOGl (ORCPT ); Tue, 12 Feb 2019 09:06:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C74FC4902D; Tue, 12 Feb 2019 14:06:40 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-63.brq.redhat.com [10.40.204.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D03215D736; Tue, 12 Feb 2019 14:06:37 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Changpeng Liu , Peter Xu , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Richard Henderson , Eduardo Habkost , kvm@vger.kernel.org (open list:X86) Subject: [PATCH 1/3] Revert "contrib/vhost-user-blk: fix the compilation issue" Date: Tue, 12 Feb 2019 15:06:19 +0100 Message-Id: <20190212140621.17009-2-philmd@redhat.com> In-Reply-To: <20190212140621.17009-1-philmd@redhat.com> References: <20190212140621.17009-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 12 Feb 2019 14:06:41 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit a56de056c91f8 squashed the following two unrelated commits at once: - "contrib/vhost-user-blk: fix the compilation issue" (Message-Id: 1547615970-23545-2-git-send-email-changpeng.liu@intel.com) - "i386/kvm: ignore masked irqs when update msi routes" (Message-Id: 20190116030815.27273-5-peterx@redhat.com) While the git history remains bisectable, having a commit that changes MSI/MSIX code but describes it as "fix vhost-user-blk compilation" is rather confusing. Revert the offending commit to properly apply both patches separately. Reported-by: Peter Xu Fixes: a56de056c91f8 Signed-off-by: Philippe Mathieu-Daudé --- contrib/vhost-user-blk/vhost-user-blk.c | 6 +----- target/i386/kvm.c | 14 +++----------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c index 43583f2659..5c2092e13a 100644 --- a/contrib/vhost-user-blk/vhost-user-blk.c +++ b/contrib/vhost-user-blk/vhost-user-blk.c @@ -20,10 +20,6 @@ #include "contrib/libvhost-user/libvhost-user-glib.h" #include "contrib/libvhost-user/libvhost-user.h" -#if defined(__linux__) -#include -#include -#endif struct virtio_blk_inhdr { unsigned char status; @@ -525,7 +521,7 @@ vub_get_blocksize(int fd) #if defined(__linux__) && defined(BLKSSZGET) if (ioctl(fd, BLKSSZGET, &blocksize) == 0) { - return blocksize; + return blocklen; } #endif diff --git a/target/i386/kvm.c b/target/i386/kvm.c index beae1b99da..9af4542fb8 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3894,7 +3894,7 @@ static QLIST_HEAD(, MSIRouteEntry) msi_route_list = \ static void kvm_update_msi_routes_all(void *private, bool global, uint32_t index, uint32_t mask) { - int cnt = 0, vector; + int cnt = 0; MSIRouteEntry *entry; MSIMessage msg; PCIDevice *dev; @@ -3902,19 +3902,11 @@ static void kvm_update_msi_routes_all(void *private, bool global, /* TODO: explicit route update */ QLIST_FOREACH(entry, &msi_route_list, list) { cnt++; - vector = entry->vector; dev = entry->dev; - if (msix_enabled(dev) && !msix_is_masked(dev, vector)) { - msg = msix_get_message(dev, vector); - } else if (msi_enabled(dev) && !msi_is_masked(dev, vector)) { - msg = msi_get_message(dev, vector); - } else { - /* - * Either MSI/MSIX is disabled for the device, or the - * specific message was masked out. Skip this one. - */ + if (!msix_enabled(dev) && !msi_enabled(dev)) { continue; } + msg = pci_get_msi_message(dev, entry->vector); kvm_irqchip_update_msi_route(kvm_state, entry->virq, msg, dev); } kvm_irqchip_commit_routes(kvm_state);