From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641848959; cv=none; d=zohomail.com; s=zohoarc; b=nKq8XLK9QchT3VFRJNHHNA+VEwjlnFlQUjqpea7WSHIGx9QgaDG4XCdZVPWpgEKEepqcGaywN5DIKOFXRmNn+XddJzzf7QhHmK1/c/axowUtsHScsViWzNcPGFD7sA7RiN9JIe01mJJHchlwob2fFGWQEMUo3G2lSIT/sOToDJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641848959; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cXZrKZFQjMTDQeCPOeR9wZFV329zjuWTn3lTFMWI09E=; b=Rxw51duq5VB/elIIdsHJavyk6XwwsvUAESyCbn/A8JvZViyxEqrxp1/NSMdbrp6p5VMbc1dSh/vu+kFG3GZbtXmR4ONh/fe714ozoIEV+0RvYD5V3JFmDcvlObHWWaJvXh7csvZo2dqomxhXCUbhu9DVUHmKNEYBSjflj7YrpVU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641848959747827.4183431957889; Mon, 10 Jan 2022 13:09:19 -0800 (PST) Received: from localhost ([::1]:41390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71uo-0002Qh-5w for importer@patchew.org; Mon, 10 Jan 2022 16:09:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71qc-0007rI-Md for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:04:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:42787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71qZ-0004OF-Oi for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:04:57 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-487-SQUuazrQPWapBKOXAVSeoA-1; Mon, 10 Jan 2022 16:04:53 -0500 Received: by mail-wm1-f69.google.com with SMTP id m15-20020a7bce0f000000b003473d477618so186012wmc.8 for ; Mon, 10 Jan 2022 13:04:53 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id x8sm3900107wru.102.2022.01.10.13.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:04:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cXZrKZFQjMTDQeCPOeR9wZFV329zjuWTn3lTFMWI09E=; b=XPIMYs+Wuwqcjd1y37XaoU/R5dD5pcp36KLtWJtFVmNWZLuKUeVSh7WhOkvs0C8CIFPyUL EGq+i0GE1STJ2xjHIwCLjRG3ck3Aq/cyjRO9mg9vaNrdEffRRHGRpgD6B9J75hbwc5JLCi h4jNTsVT73OcT/wq1cCmSHui59Za8fA= X-MC-Unique: SQUuazrQPWapBKOXAVSeoA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cXZrKZFQjMTDQeCPOeR9wZFV329zjuWTn3lTFMWI09E=; b=SNpua7UOUaohfP8NbhpZNsDVwZ2Kx1Rzh4Cwa3jWG5ZYUKbq5gJGvCrsR7HJo+jbwB ULzfw3H31YiC7PjKtR0poElkqbJxlGvQ5igClJDipSNWm3fjUCD2p24MXZceeig3QmTt fFAYgFMpGbIwPFXS4hISVSh7aSbvHM1rhycCjikuaQI2P0wHGIRNSv1c+CHSJKpjEjSi qirZiDPCbPzFihemd4Y9HdvGeItuMaGSXBkBvy8vn70QvNnU7gjJ9ZhgDDQiUPRofAUr iLeYZ7AoDQk6mkycthTQ2AKYAkZr6Lkvznd22vEB8AiddqC9zo8KNQMCqApfaDrE9kQn hK6A== X-Gm-Message-State: AOAM530bgl213nEfjlb+zHqQ/uJGrpC9YAuEEfFJkPXDdRz3H9UuSmow k+wcKuB21OfgVuTNg1CSP5nIErXvlUfMoF9SZdodZmomBA4hITUuXbF3SN4kwBeZEBhJfTQFrKO oB7GFarZBTy35yiXZmnYtpZbqBy4ZPq5iAp99MrgDrZpZ2g6bVpsJgga6TRhX X-Received: by 2002:adf:f5ca:: with SMTP id k10mr1214978wrp.36.1641848692143; Mon, 10 Jan 2022 13:04:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJytdIyWLigSvfu5tEIZPGl4VgICqOcBCFKfwLvuZEV3x6waVUz/a1Sas+4hsBHRkQetpEmEHQ== X-Received: by 2002:adf:f5ca:: with SMTP id k10mr1214960wrp.36.1641848691892; Mon, 10 Jan 2022 13:04:51 -0800 (PST) Date: Mon, 10 Jan 2022 16:04:49 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 01/10] Revert "virtio-pci: add support for configure interrupt" Message-ID: <20220110210416.18779-2-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641848961811100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit d5d24d859c3957ea1674d0e102f96439cdbfe93a. Fixes: d5d24d859c ("virtio-pci: add support for configure interrupt") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.h | 4 +- hw/virtio/virtio-pci.c | 92 ++++++------------------------------------ 2 files changed, 13 insertions(+), 83 deletions(-) diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index b704acc5a8..2446dcd9ae 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -251,7 +251,5 @@ void virtio_pci_types_register(const VirtioPCIDeviceTyp= eInfo *t); * @fixed_queues. */ unsigned virtio_pci_optimal_num_queues(unsigned fixed_queues); -void virtio_pci_set_guest_notifier_fd_handler(VirtIODevice *vdev, VirtQueu= e *vq, - int n, bool assign, - bool with_irqfd); + #endif diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 98fb5493ae..7201cf3dc1 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -727,8 +727,7 @@ static int virtio_pci_get_notifier(VirtIOPCIProxy *prox= y, int queue_no, VirtQueue *vq; =20 if (queue_no =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - *n =3D virtio_config_get_guest_notifier(vdev); - *vector =3D vdev->config_vector; + return -1; } else { if (!virtio_queue_get_num(vdev, queue_no)) { return -1; @@ -803,10 +802,6 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *p= roxy, int nvqs) return ret; } =20 -static int kvm_virtio_pci_vector_config_use(VirtIOPCIProxy *proxy) -{ - return kvm_virtio_pci_vector_use_one(proxy, VIRTIO_CONFIG_IRQ_IDX); -} =20 static void kvm_virtio_pci_vector_release_one(VirtIOPCIProxy *proxy, int queue_no) @@ -844,11 +839,6 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIPro= xy *proxy, int nvqs) } } =20 -static void kvm_virtio_pci_vector_config_release(VirtIOPCIProxy *proxy) -{ - kvm_virtio_pci_vector_release_one(proxy, VIRTIO_CONFIG_IRQ_IDX); -} - static int virtio_pci_one_vector_unmask(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector, @@ -930,17 +920,9 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, un= signed vector, } vq =3D virtio_vector_next_queue(vq); } - /* unmask config intr */ - n =3D virtio_config_get_guest_notifier(vdev); - ret =3D virtio_pci_one_vector_unmask(proxy, VIRTIO_CONFIG_IRQ_IDX, vec= tor, - msg, n); - if (ret < 0) { - goto undo_config; - } + return 0; -undo_config: - n =3D virtio_config_get_guest_notifier(vdev); - virtio_pci_one_vector_mask(proxy, VIRTIO_CONFIG_IRQ_IDX, vector, n); + undo: vq =3D virtio_vector_first_queue(vdev, vector); while (vq && unmasked >=3D 0) { @@ -974,8 +956,6 @@ static void virtio_pci_vector_mask(PCIDevice *dev, unsi= gned vector) } vq =3D virtio_vector_next_queue(vq); } - n =3D virtio_config_get_guest_notifier(vdev); - virtio_pci_one_vector_mask(proxy, VIRTIO_CONFIG_IRQ_IDX, vector, n); } =20 static void virtio_pci_vector_poll(PCIDevice *dev, @@ -1007,34 +987,6 @@ static void virtio_pci_vector_poll(PCIDevice *dev, msix_set_pending(dev, vector); } } - /* poll the config intr */ - ret =3D virtio_pci_get_notifier(proxy, VIRTIO_CONFIG_IRQ_IDX, ¬ifie= r, - &vector); - if (ret < 0) { - return; - } - if (vector < vector_start || vector >=3D vector_end || - !msix_is_masked(dev, vector)) { - return; - } - if (k->guest_notifier_pending) { - if (k->guest_notifier_pending(vdev, VIRTIO_CONFIG_IRQ_IDX)) { - msix_set_pending(dev, vector); - } - } else if (event_notifier_test_and_clear(notifier)) { - msix_set_pending(dev, vector); - } -} - -void virtio_pci_set_guest_notifier_fd_handler(VirtIODevice *vdev, VirtQueu= e *vq, - int n, bool assign, - bool with_irqfd) -{ - if (n =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - virtio_config_set_guest_notifier_fd_handler(vdev, assign, with_irq= fd); - } else { - virtio_queue_set_guest_notifier_fd_handler(vq, assign, with_irqfd); - } } =20 static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assig= n, @@ -1043,25 +995,17 @@ static int virtio_pci_set_guest_notifier(DeviceState= *d, int n, bool assign, VirtIOPCIProxy *proxy =3D to_virtio_pci_proxy(d); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); - VirtQueue *vq =3D NULL; - EventNotifier *notifier =3D NULL; - - if (n =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - notifier =3D virtio_config_get_guest_notifier(vdev); - } else { - vq =3D virtio_get_queue(vdev, n); - notifier =3D virtio_queue_get_guest_notifier(vq); - } + VirtQueue *vq =3D virtio_get_queue(vdev, n); + EventNotifier *notifier =3D virtio_queue_get_guest_notifier(vq); =20 if (assign) { int r =3D event_notifier_init(notifier, 0); if (r < 0) { return r; } - virtio_pci_set_guest_notifier_fd_handler(vdev, vq, n, true, with_i= rqfd); + virtio_queue_set_guest_notifier_fd_handler(vq, true, with_irqfd); } else { - virtio_pci_set_guest_notifier_fd_handler(vdev, vq, n, false, - with_irqfd); + virtio_queue_set_guest_notifier_fd_handler(vq, false, with_irqfd); event_notifier_cleanup(notifier); } =20 @@ -1103,7 +1047,6 @@ static int virtio_pci_set_guest_notifiers(DeviceState= *d, int nvqs, bool assign) msix_unset_vector_notifiers(&proxy->pci_dev); if (proxy->vector_irqfd) { kvm_virtio_pci_vector_release(proxy, nvqs); - kvm_virtio_pci_vector_config_release(proxy); g_free(proxy->vector_irqfd); proxy->vector_irqfd =3D NULL; } @@ -1119,11 +1062,7 @@ static int virtio_pci_set_guest_notifiers(DeviceStat= e *d, int nvqs, bool assign) goto assign_error; } } - r =3D virtio_pci_set_guest_notifier(d, VIRTIO_CONFIG_IRQ_IDX, assign, - with_irqfd); - if (r < 0) { - goto config_assign_error; - } + /* Must set vector notifier after guest notifier has been assigned */ if ((with_irqfd || k->guest_notifier_mask) && assign) { if (with_irqfd) { @@ -1132,14 +1071,11 @@ static int virtio_pci_set_guest_notifiers(DeviceSta= te *d, int nvqs, bool assign) msix_nr_vectors_allocated(&proxy->pci_dev)); r =3D kvm_virtio_pci_vector_use(proxy, nvqs); if (r < 0) { - goto config_assign_error; + goto assign_error; } } - r =3D kvm_virtio_pci_vector_config_use(proxy); - if (r < 0) { - goto config_error; - } - r =3D msix_set_vector_notifiers(&proxy->pci_dev, virtio_pci_vector= _unmask, + r =3D msix_set_vector_notifiers(&proxy->pci_dev, + virtio_pci_vector_unmask, virtio_pci_vector_mask, virtio_pci_vector_poll); if (r < 0) { @@ -1154,11 +1090,7 @@ notifiers_error: assert(assign); kvm_virtio_pci_vector_release(proxy, nvqs); } -config_error: - kvm_virtio_pci_vector_config_release(proxy); -config_assign_error: - virtio_pci_set_guest_notifier(d, VIRTIO_CONFIG_IRQ_IDX, !assign, - with_irqfd); + assign_error: /* We get here on assignment failure. Recover by undoing for VQs 0 .. = n. */ assert(assign); --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641848959; cv=none; d=zohomail.com; s=zohoarc; b=YadpeIAdd7LNxGLXJdGiFGxXOEM8UoNncjyR0tKLJDP9Y3+wJfO8wKTAzoF8XEJDqS6PKFKMxwuJIa9Esc5aJ33O3g+As0WCn3av38lZqoI6Ih3Wyju43U9Z0zcNmdvqgzBqsppO1SabNNKWv3RMUmt0xsLLo740yI9idmdNj5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641848959; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BAJ+KG3jYTMVyAFjeLpjh/nWVc+IFbPXKDIrO0tfKro=; b=FziPNqrC/2hfxk3ujvt37hNKjBcNj4PLRuVASuDV+B0yy/KurVTPPwUvf4pUaXJlkuZI7SuQ1eAVm699+Qrlg5bfaH5OaRhGoEuikGOPIgs2MvW6pjvapX1BDtDR8InAYyCrVA1dYnpF+j8FUdzsRCHvKhFkhX2cpgxNffZ4xrQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641848959775868.4060303431319; Mon, 10 Jan 2022 13:09:19 -0800 (PST) Received: from localhost ([::1]:41412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71uo-0002Ra-Cl for importer@patchew.org; Mon, 10 Jan 2022 16:09:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71qf-0007rT-0C for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71qc-0004OU-6B for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:04:59 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-538-ajgu4CATONO8uRUGvqpzVQ-1; Mon, 10 Jan 2022 16:04:56 -0500 Received: by mail-wm1-f72.google.com with SMTP id j18-20020a05600c1c1200b003335872db8dso2650796wms.2 for ; Mon, 10 Jan 2022 13:04:55 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id c11sm8830698wmq.48.2022.01.10.13.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BAJ+KG3jYTMVyAFjeLpjh/nWVc+IFbPXKDIrO0tfKro=; b=HrkNWqnATLGWQAFnlLvAA6WvwCZvox8/25kOschScnKmM7jH1ZdTkQMjKwUbF1HqvjLATi lyTMV2RalDFizr+sr4NZrrwwor0bcyrrKV6BB9AwNqahTixfdNdXODEZ4eT43BeVfHg/oW xWLqHJAvn8O9Bo3tV7kguK942XkiOUA= X-MC-Unique: ajgu4CATONO8uRUGvqpzVQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BAJ+KG3jYTMVyAFjeLpjh/nWVc+IFbPXKDIrO0tfKro=; b=sK8a+K2nqQMzzoWEcOtY+ds/nHh4vAVgz0ReTOKesdn+k1y/CdFBPr8A/fD2cW7H/R aLy6D28UYAoP/qxgI7qxfouBX7NEv2ZIz2FaV2MneudY6sh7goLn6uJvOAp5kYkZsPPe wFhWC7quhz2itt3Ng+QES3hCwX2HeGqgQ+FqLGIJdO7a58V4WoOTsXCsRJN4U3a67xlR vV9wBSFH1Rsbvrdav9LbeVSeoZt8UFG7FChp7X5oVHkbtPwMvrvzQ38H5OzolnVlqvfJ PlGNrJKScMU6vYE/eYxXn9p8Zsu265LkaX4WywIwmCt6zgzngJfhvbnf50RW+93FstA6 alaA== X-Gm-Message-State: AOAM531nRRj65BEhq0o4C2Js0B0BnVubZjMFP87RZZLWXaYC1mXSxKi7 RFoilF2xwccOK8vENmf1uikUDWZJsSDD3UJMqPsSh9w0tGle+B+4X7xJ0PmXx2PMxGT6qnzBaeI TIiZpY/vzusRy5G9Q/+L+rgVhBDHg5kbPvQSEu7+/MaotJOslaY74RNzo6L6N X-Received: by 2002:a1c:c915:: with SMTP id f21mr1047903wmb.39.1641848694623; Mon, 10 Jan 2022 13:04:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzt6Y9nbLnVQlPjrvkA6VnZueCjLxH54XRIPpLs4LGFVPItDMXlVcP/BHmc7MWGdjg4qQXIyw== X-Received: by 2002:a1c:c915:: with SMTP id f21mr1047883wmb.39.1641848694380; Mon, 10 Jan 2022 13:04:54 -0800 (PST) Date: Mon, 10 Jan 2022 16:04:52 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 02/10] Revert "virtio-mmio: add support for configure interrupt" Message-ID: <20220110210416.18779-3-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641848961809100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit d48185f1a40d4e4ed2fa2873a42b2a5eb8748256. Fixes: d48185f1a4 ("virtio-mmio: add support for configure interrupt") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-mmio.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 809132018b..72da12fea5 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -673,30 +673,7 @@ static int virtio_mmio_set_guest_notifier(DeviceState = *d, int n, bool assign, =20 return 0; } -static int virtio_mmio_set_config_guest_notifier(DeviceState *d, bool assi= gn) -{ - VirtIOMMIOProxy *proxy =3D VIRTIO_MMIO(d); - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); - bool with_irqfd =3D false; - EventNotifier *notifier =3D virtio_config_get_guest_notifier(vdev); - int r =3D 0; =20 - if (assign) { - r =3D event_notifier_init(notifier, 0); - if (r < 0) { - return r; - } - virtio_config_set_guest_notifier_fd_handler(vdev, assign, with_irq= fd); - } else { - virtio_config_set_guest_notifier_fd_handler(vdev, assign, with_irq= fd); - event_notifier_cleanup(notifier); - } - if (vdc->guest_notifier_mask && vdev->use_guest_notifier_mask) { - vdc->guest_notifier_mask(vdev, VIRTIO_CONFIG_IRQ_IDX, !assign); - } - return r; -} static int virtio_mmio_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) { @@ -718,10 +695,6 @@ static int virtio_mmio_set_guest_notifiers(DeviceState= *d, int nvqs, goto assign_error; } } - r =3D virtio_mmio_set_config_guest_notifier(d, assign); - if (r < 0) { - goto assign_error; - } =20 return 0; =20 --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641849215825713.4047297183789; Mon, 10 Jan 2022 13:13:35 -0800 (PST) Received: from localhost ([::1]:50058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71yw-0008RA-Qr for importer@patchew.org; Mon, 10 Jan 2022 16:13:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71qg-0007t8-1n for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52010) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71qe-0004Ox-8T for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:01 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-NZThdcQFNgqQ9KCvpqEDKQ-1; Mon, 10 Jan 2022 16:04:58 -0500 Received: by mail-wm1-f69.google.com with SMTP id bh10-20020a05600c3d0a00b00347aa76728fso616275wmb.9 for ; Mon, 10 Jan 2022 13:04:58 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id h20sm3615355wmq.38.2022.01.10.13.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oSxj4xdPVr/3qhzeZpQDNoN8eLz690ZpLWYWK/mAKv0=; b=V0dKcCS8NSitTVbtoTwDt/1nffTF57cQ6UuEMYxFU5Pc9lUs5jQyshPgb2GRZiUmZy7XDg c76rwoojhIZ7RPEsueouPlh1Jrlpim9QIvh7A4g1ANLChAI/WynxwxaefPr9BSGpzeyfQI E7Lay23tr8PGLjorAJmc5A1dz0v6OIs= X-MC-Unique: NZThdcQFNgqQ9KCvpqEDKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oSxj4xdPVr/3qhzeZpQDNoN8eLz690ZpLWYWK/mAKv0=; b=eYTPnTXXy+BmYSzA6etAGuhvuClQhfAi1Enc5IYIi9arV161D80ZhIwMYXbufhVoTq fCPWKdwGEEM3mEhdeBixiP9GzBKPJ7a+MmSb2R8Ts/MBPp6UBSYet3LgLRPx6K0uRBLR 9Q6zQ7mnNn/Fdf4+ushYDrItt/vb2r8sG5Wu33+w0xrqKdGJ13ZVkjAAyTIi9UEQdZ2q 53elWTBwQ87/3+tPSIRKaxtYzAo5uB4YNRLXv5sf/3p5AzNTJVrqpyEDeY7chYemxiK0 FqXMpYUyJ7ReK+rmh7+Ko04dAboRK5Iu7+URGuH+opFjhsdzqs0i+oC8u43Hjd7H7aXe jhAw== X-Gm-Message-State: AOAM531jWOMlgUq9pStcfhK5IDF7dcqp+mBfu+k7Ve0p3qalCrweKBb8 1SPAPcnSUg9bubeNZEY23erbZToybAZCoOGgE++5NWiqAFUz5oKasqo+y5W03yKibfI+sMsD4Cz c6jhNsmXtmpfXyUJZujeIMyrDCe1cWr1LYeLE0mWFCNt1kiqp0aDNye64vhtX X-Received: by 2002:adf:efc2:: with SMTP id i2mr1182643wrp.89.1641848697167; Mon, 10 Jan 2022 13:04:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpGL1d4zlFDTpvBEGXWPVyV5JQpygPKJ/2Go2tX/cceK2Qf1uLZ28JMpgWxn2uzfJDePHJAQ== X-Received: by 2002:adf:efc2:: with SMTP id i2mr1182627wrp.89.1641848696907; Mon, 10 Jan 2022 13:04:56 -0800 (PST) Date: Mon, 10 Jan 2022 16:04:54 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 03/10] Revert "virtio-net: add support for configure interrupt" Message-ID: <20220110210416.18779-4-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1641849217882100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 497679d51087090d5a22fd265d1b96cf92d49d9d. Fixes: 497679d510 ("virtio-net: add support for configure interrupt") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- include/net/vhost_net.h | 2 -- hw/net/vhost_net-stub.c | 9 --------- hw/net/vhost_net.c | 9 --------- hw/net/virtio-net.c | 4 ++-- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index fc37498550..387e913e4e 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -39,8 +39,6 @@ int vhost_net_set_config(struct vhost_net *net, const uin= t8_t *data, bool vhost_net_virtqueue_pending(VHostNetState *net, int n); void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev, int idx, bool mask); -bool vhost_net_config_pending(VHostNetState *net); -void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mas= k); int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr); VHostNetState *get_vhost_net(NetClientState *nc); =20 diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c index 126ee35b70..89d71cfb8e 100644 --- a/hw/net/vhost_net-stub.c +++ b/hw/net/vhost_net-stub.c @@ -101,12 +101,3 @@ int vhost_net_set_mtu(struct vhost_net *net, uint16_t = mtu) { return 0; } - -bool vhost_net_config_pending(VHostNetState *net) -{ - return false; -} - -void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mas= k) -{ -} diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 9c9fd0a73f..30379d2ca4 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -457,15 +457,6 @@ void vhost_net_virtqueue_mask(VHostNetState *net, Virt= IODevice *dev, vhost_virtqueue_mask(&net->dev, dev, idx, mask); } =20 -bool vhost_net_config_pending(VHostNetState *net) -{ - return vhost_config_pending(&net->dev); -} - -void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mas= k) -{ - vhost_config_mask(&net->dev, dev, mask); -} VHostNetState *get_vhost_net(NetClientState *nc) { VHostNetState *vhost_net =3D 0; diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5806a50c8d..5e03c0dd14 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3169,7 +3169,7 @@ static bool virtio_net_guest_notifier_pending(VirtIOD= evice *vdev, int idx) NetClientState *nc =3D qemu_get_subqueue(n->nic, vq2q(idx)); assert(n->vhost_started); if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return vhost_net_config_pending(get_vhost_net(nc->peer)); + return false; } return vhost_net_virtqueue_pending(get_vhost_net(nc->peer), idx); } @@ -3181,9 +3181,9 @@ static void virtio_net_guest_notifier_mask(VirtIODevi= ce *vdev, int idx, NetClientState *nc =3D qemu_get_subqueue(n->nic, vq2q(idx)); assert(n->vhost_started); if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - vhost_net_config_mask(get_vhost_net(nc->peer), vdev, mask); return; } + vhost_net_virtqueue_mask(get_vhost_net(nc->peer), vdev, idx, mask); } =20 --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641848962; cv=none; d=zohomail.com; s=zohoarc; b=Bk6wIWil0X0K03IjRnfTxHubODvCq1l6eaCKqEaKtvq8JGZrso1d+O8VqYA9d2CUxBtV3HYuShVHKSaMj+j+/0BC92OaJWnAc9UevkpBfahKuTRl3wTKbIKgkp9qQSdD6CjLvqvcTm/LsiM5w51VxbJhPS3gfrF2/1eiRPNXmZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641848962; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S7MeKBH04dXFDzcPVlh6tju3tbuiIfzFckwnWtxYHv4=; b=A7wam/c0WMPdHNGp9EY4SC4zSI5XJ8TA1wg7hfQ6vHtf+5c1L7YqRWkjILJA7UZvuVLroR8V5E2SOHpjIkY/AqBrB5YpNC7HnuPvuSH6LvwD0ODB0uKWiiS/uhfNcBvDvGZCBks4qn1xKm2pk3282p5w46IDeQ4dHbVNnTyw5lE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641848962384756.5925069167773; Mon, 10 Jan 2022 13:09:22 -0800 (PST) Received: from localhost ([::1]:41772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71ur-0002fe-C2 for importer@patchew.org; Mon, 10 Jan 2022 16:09:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rR-0007wf-Mb for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71r8-0004Pg-UK for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:47 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-495-oBCHz-ZUPH-2tC-Apkr9ZA-1; Mon, 10 Jan 2022 16:05:01 -0500 Received: by mail-wm1-f71.google.com with SMTP id 20-20020a05600c22d400b00349067fe7b7so560005wmg.5 for ; Mon, 10 Jan 2022 13:05:00 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id w7sm2065492wrv.96.2022.01.10.13.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=S7MeKBH04dXFDzcPVlh6tju3tbuiIfzFckwnWtxYHv4=; b=BTg5MJvrwnIUy8YMohMIUhWnbQfp9rnATV2fb+VKZGE0OX9s0P7VNjct32vhWTzipWr1WY rt5RQ7qAoWnFvTMd9MmJIdOJt6BgEc+k9UyZm2OjuXex+9fU6BbaDtjKmtpI78keIOM/DO jAqKEpwBLnlPGRYO9ktsp146lOgK1Fg= X-MC-Unique: oBCHz-ZUPH-2tC-Apkr9ZA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S7MeKBH04dXFDzcPVlh6tju3tbuiIfzFckwnWtxYHv4=; b=G1DgR4r5H7/uWUzOh7iB9D248rMBv/jF+6ILwiKDELOHi4aDssZkk6+G6I1ZbWM69P HkCM6uyG6fdDYbADux9qn6asL0kQB+BCPJ4ktIt1JTUQ0c7UwmrvcTOUs4YUiCfWkGzU Vzead8RFLxMST4rS2Sn5MTp1AfXmzDWCyfL3gOA6LqH6Ft1vM6JjmBg7r9jwdf5K/sBF 2FLSvu1s/3Yjxc4TdeVK4ay9KjnAlJBAwampNBLtZVpUXumC4FvfLzz3AgCKTQ7K8UlI xvEEpYKwhtTlZVLRqiK4iBBf+tW+ruEZu8Yi2c8nrbK8L2VOIPwblefInDAG/c3nabyw hhbQ== X-Gm-Message-State: AOAM532hpGhySU7SJFLsdL00Oub73MEQ9zKOTRoEQ7/zLnTKAi//h256 tVw3sMnjKzBUJA9/bJnVSb8bx8K4xhoUtE8z+1kGV9itD0YsK2Uf385wGfilFEoyR+E2CWcDQ4b PgcYr+BeJmpmGTGFBL8LLjN/k32/N/yljOXsdS8ugBoASu0eyFcpnHJLwns9b X-Received: by 2002:a5d:6f06:: with SMTP id ay6mr1190417wrb.54.1641848699571; Mon, 10 Jan 2022 13:04:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTF0XfErTr6DS9DbQVXJsjN7FkhFDZAy99PsaXsddie8RjmREEk+jOGwuJdm/zgEU030soQA== X-Received: by 2002:a5d:6f06:: with SMTP id ay6mr1190406wrb.54.1641848699333; Mon, 10 Jan 2022 13:04:59 -0800 (PST) Date: Mon, 10 Jan 2022 16:04:57 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 04/10] Revert "vhost: add support for configure interrupt" Message-ID: <20220110210416.18779-5-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641848963975100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit f7220a7ce21604a4bc6260ccca4dc9068c1f27f2. Fixes: f7220a7ce2 ("vhost: add support for configure interrupt") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost.h | 4 --- hw/virtio/vhost.c | 76 --------------------------------------- 2 files changed, 80 deletions(-) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index b0f3b78987..58a73e7b7a 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -29,7 +29,6 @@ struct vhost_virtqueue { unsigned long long used_phys; unsigned used_size; EventNotifier masked_notifier; - EventNotifier masked_config_notifier; struct vhost_dev *dev; }; =20 @@ -38,7 +37,6 @@ typedef unsigned long vhost_log_chunk_t; #define VHOST_LOG_BITS (8 * sizeof(vhost_log_chunk_t)) #define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS) #define VHOST_INVALID_FEATURE_BIT (0xff) -#define VHOST_QUEUE_NUM_CONFIG_INR 0 =20 struct vhost_log { unsigned long long size; @@ -118,8 +116,6 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevic= e *vdev); void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev); int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev); void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vde= v); -bool vhost_config_pending(struct vhost_dev *hdev); -void vhost_config_mask(struct vhost_dev *hdev, VirtIODevice *vdev, bool ma= sk); =20 /* Test and clear masked event pending status. * Should be called after unmask to avoid losing events. diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index cbf3b792da..7b03efccec 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1554,67 +1554,6 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, Vi= rtIODevice *vdev, int n, } } =20 -bool vhost_config_pending(struct vhost_dev *hdev) -{ - assert(hdev->vhost_ops); - if ((hdev->started =3D=3D false) || - (hdev->vhost_ops->vhost_set_config_call =3D=3D NULL)) { - return false; - } - - EventNotifier *notifier =3D - &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier; - return event_notifier_test_and_clear(notifier); -} - -void vhost_config_mask(struct vhost_dev *hdev, VirtIODevice *vdev, bool ma= sk) -{ - int fd; - int r; - EventNotifier *notifier =3D - &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier; - EventNotifier *config_notifier =3D &vdev->config_notifier; - assert(hdev->vhost_ops); - - if ((hdev->started =3D=3D false) || - (hdev->vhost_ops->vhost_set_config_call =3D=3D NULL)) { - return; - } - if (mask) { - assert(vdev->use_guest_notifier_mask); - fd =3D event_notifier_get_fd(notifier); - } else { - fd =3D event_notifier_get_fd(config_notifier); - } - r =3D hdev->vhost_ops->vhost_set_config_call(hdev, fd); - if (r < 0) { - VHOST_OPS_DEBUG(r, "vhost_set_config_call failed"); - } -} - -static void vhost_stop_config_intr(struct vhost_dev *dev) -{ - int fd =3D -1; - assert(dev->vhost_ops); - if (dev->vhost_ops->vhost_set_config_call) { - dev->vhost_ops->vhost_set_config_call(dev, fd); - } -} - -static void vhost_start_config_intr(struct vhost_dev *dev) -{ - int r; - - assert(dev->vhost_ops); - int fd =3D event_notifier_get_fd(&dev->vdev->config_notifier); - if (dev->vhost_ops->vhost_set_config_call) { - r =3D dev->vhost_ops->vhost_set_config_call(dev, fd); - if (!r) { - event_notifier_set(&dev->vdev->config_notifier); - } - } -} - uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bit= s, uint64_t features) { @@ -1827,16 +1766,6 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODe= vice *vdev) } } =20 - r =3D event_notifier_init( - &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier, 0); - if (r < 0) { - return r; - } - event_notifier_test_and_clear( - &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); - if (!vdev->use_guest_notifier_mask) { - vhost_config_mask(hdev, vdev, true); - } if (hdev->log_enabled) { uint64_t log_base; =20 @@ -1869,7 +1798,6 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODev= ice *vdev) vhost_device_iotlb_miss(hdev, vq->used_phys, true); } } - vhost_start_config_intr(hdev); return 0; fail_log: vhost_log_put(hdev, false); @@ -1895,9 +1823,6 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODev= ice *vdev) =20 /* should only be called after backend is connected */ assert(hdev->vhost_ops); - event_notifier_test_and_clear( - &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); - event_notifier_test_and_clear(&vdev->config_notifier); =20 if (hdev->vhost_ops->vhost_dev_start) { hdev->vhost_ops->vhost_dev_start(hdev, false); @@ -1915,7 +1840,6 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODev= ice *vdev) } memory_listener_unregister(&hdev->iommu_listener); } - vhost_stop_config_intr(hdev); vhost_log_put(hdev, true); hdev->started =3D false; hdev->vdev =3D NULL; --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641849214; cv=none; d=zohomail.com; s=zohoarc; b=EGhD4EysFDeLNRQ3zH30Z4cBr2ZM8lctxC0d9LVqQY/AQHdzrDUmp6H/2tXMgYLMYk5xV3gOMfOgZm0nMXVr/9Lshw4ZVt//1x7Il7K5p5Wig4LRdD3AmTcBbCIFIECKvR43KAOmVg2EM0sRPN4JWx/7+JnQRVDe6z1Cb8wk1xI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641849214; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p5yHGm2AE8EBE8vdM8NbrUMTccOP1B1Olh98WNMySZg=; b=ldn7moLcqxb2XMF1Np69LrRH8K2fPkSbh8LrYqM5IXo0HY2Vja/3DJ8GXLF8Whq5qJh0BjqSM5d+iPvpU8VNrwokasaEkVY6GbYwZiVCbV3ypGirc/kAsc669VJx3BtOeGgNMqpnS79XqiQkgo5qPcSIo2l5PzE4rv0W9XxQPnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641849214823527.4356130366422; Mon, 10 Jan 2022 13:13:34 -0800 (PST) Received: from localhost ([::1]:50066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71yv-0008RT-Ml for importer@patchew.org; Mon, 10 Jan 2022 16:13:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rR-0007wY-LF for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71r8-0004a5-UT for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:47 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-JEQPe9cFMtm7GYMALpWPBw-1; Mon, 10 Jan 2022 16:05:03 -0500 Received: by mail-wm1-f71.google.com with SMTP id c188-20020a1c35c5000000b00346a2160ea8so2645328wma.9 for ; Mon, 10 Jan 2022 13:05:03 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id x22sm2360929wmi.13.2022.01.10.13.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p5yHGm2AE8EBE8vdM8NbrUMTccOP1B1Olh98WNMySZg=; b=YfK0K6zXRmRBEWAqNSdorezdawgz8uSrgz2HNRp1KevHaDQNuExyvtUe0OnFJnO9fV5ooX SS4cuxtoDXmOvFSMKkhfDSsIM3mDJRiDD+FeI0cQjm0o+Hsp2zNo59fDivrKuWexiSZvI6 AXs78p3VH0rgkfRjZX127dhcoU14Z7A= X-MC-Unique: JEQPe9cFMtm7GYMALpWPBw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=p5yHGm2AE8EBE8vdM8NbrUMTccOP1B1Olh98WNMySZg=; b=SPog3kWh8ggMqJLRCmJg+Od37ymJ24wBHy2VXOBbn0bO/eiaov6qJ4dKEOqGTmy/Av +ww1jsrzGnTeD1ZBDURf7Z6S0uf6sOZWG1tq6qUpilWRCD+1aI0LJNNRYpadOwWJlbl5 bSBjGZDIjEQI1UfWskKnXS6MypmTVJ3FtSk/XHujnGvZwN7Snf45WwXAsUe3ZjnzVZMw Qf78wxKsQhEG01u+wc+OjRpD9yXzQpVH25zf9yT+6AgnpAr7YeFMvgNHch0x+erVEgo4 F/LrXr672+BDh3Nkg8TZ7/RkEI418K/qduDFn1WgL5eOGadcG3Mk1Zl20FNFPkx9Bcvk IF8A== X-Gm-Message-State: AOAM530Nkf0tXjx+tw5Ae0K2v/0QoESRE8hZuB58uhkuO7z7kJn45DU7 hZYcudbazJBnsJ2yB9a8XKt5sfsLpxujEbdBbILdki8946yQ6GbnMfSJJ1mU6Z1sJ4nHMeBF23r CWnszL0994B+94f09itPIftbRjte8Engu8HdX/XaL4w49Rl/33u51KHbuPi1G X-Received: by 2002:adf:fa85:: with SMTP id h5mr1145094wrr.681.1641848701853; Mon, 10 Jan 2022 13:05:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJywsGd6pNSbbCCozJ2c8jsr3SUSjfChUVEebO9y7EwpKrwQKCE9ys5qG+upz/u74Wnm1JLbbQ== X-Received: by 2002:adf:fa85:: with SMTP id h5mr1145076wrr.681.1641848701531; Mon, 10 Jan 2022 13:05:01 -0800 (PST) Date: Mon, 10 Jan 2022 16:04:59 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 05/10] Revert "virtio: add support for configure interrupt" Message-ID: <20220110210416.18779-6-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641849215787100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 081f864f56307551f59c5e934e3f30a7290d0faa. Fixes: 081f864f56 ("virtio: add support for configure interrupt") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 4 ---- hw/virtio/virtio.c | 29 ----------------------------- 2 files changed, 33 deletions(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index d78088d872..605ea79c90 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -111,7 +111,6 @@ struct VirtIODevice bool use_guest_notifier_mask; AddressSpace *dma_as; QLIST_HEAD(, VirtQueue) *vector_queues; - EventNotifier config_notifier; }; =20 struct VirtioDeviceClass { @@ -314,14 +313,11 @@ uint16_t virtio_get_queue_index(VirtQueue *vq); EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq); void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign, bool with_irqfd); -void virtio_config_set_guest_notifier_fd_handler(VirtIODevice *vdev, - bool assign, bool with_ir= qfd); int virtio_device_start_ioeventfd(VirtIODevice *vdev); int virtio_device_grab_ioeventfd(VirtIODevice *vdev); void virtio_device_release_ioeventfd(VirtIODevice *vdev); bool virtio_device_ioeventfd_enabled(VirtIODevice *vdev); EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq); -EventNotifier *virtio_config_get_guest_notifier(VirtIODevice *vdev); void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled); void virtio_queue_host_notifier_read(EventNotifier *n); void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext = *ctx, diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 971e59a663..5d18868d7d 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3494,14 +3494,7 @@ static void virtio_queue_guest_notifier_read(EventNo= tifier *n) virtio_irq(vq); } } -static void virtio_config_guest_notifier_read(EventNotifier *n) -{ - VirtIODevice *vdev =3D container_of(n, VirtIODevice, config_notifier); =20 - if (event_notifier_test_and_clear(n)) { - virtio_notify_config(vdev); - } -} void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign, bool with_irqfd) { @@ -3518,23 +3511,6 @@ void virtio_queue_set_guest_notifier_fd_handler(Virt= Queue *vq, bool assign, } } =20 -void virtio_config_set_guest_notifier_fd_handler(VirtIODevice *vdev, - bool assign, bool with_ir= qfd) -{ - EventNotifier *n; - n =3D &vdev->config_notifier; - if (assign && !with_irqfd) { - event_notifier_set_handler(n, virtio_config_guest_notifier_read); - } else { - event_notifier_set_handler(n, NULL); - } - if (!assign) { - /* Test and clear notifier before closing it,*/ - /* in case poll callback didn't have time to run. */ - virtio_config_guest_notifier_read(n); - } -} - EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq) { return &vq->guest_notifier; @@ -3608,11 +3584,6 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQu= eue *vq) return &vq->host_notifier; } =20 -EventNotifier *virtio_config_get_guest_notifier(VirtIODevice *vdev) -{ - return &vdev->config_notifier; -} - void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled) { vq->host_notifier_enabled =3D enabled; --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641849376; cv=none; d=zohomail.com; s=zohoarc; b=dDoEZhcET2TkIymIiU8VA+XJ/wlOpZa/+yBMWMaPh0s7ze3U4ut17o8uf4uJB088UkFD0zLE6puhtrQSNA6qXvgd5pJNHznIw0jJKL+WzQ8QD7CRI8Hi4njfXJgFdB6urF/K68r4m/rp8AligF9E8cEKJGtcLazzsI+rzpbIPPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641849376; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LUvJ7tIyqBOqSen0Qaoh/iwRKNN92+aeMnfonMUuG0A=; b=kI7VSOjm4qlGC1BGNVpAS7ggVoSrOKe4o3y0ctJbHdQ9riWSUuV61YK1VVb3tPvkKRULUR/+aY407dY4ihjImJ+1CVOlhSgh99GWrA/vBNMKPSkZzXAkO1lvGTtxVD0hXkZOmVl1Tl7He0f+PVKWYMsYQgCW0JuGQWmLtPKtc10= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641849376247318.28884163381906; Mon, 10 Jan 2022 13:16:16 -0800 (PST) Received: from localhost ([::1]:58528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n721W-0005ly-Qb for importer@patchew.org; Mon, 10 Jan 2022 16:16:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71re-00085i-Up for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:06:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rP-0004aD-Ii for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:55 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-6-ax4nVYo0PPmmkQUqDpcGGw-1; Mon, 10 Jan 2022 16:05:06 -0500 Received: by mail-wm1-f69.google.com with SMTP id z13-20020a05600c0a0d00b003457d6619f8so630464wmp.1 for ; Mon, 10 Jan 2022 13:05:05 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id l13sm8516112wrs.73.2022.01.10.13.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:05:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LUvJ7tIyqBOqSen0Qaoh/iwRKNN92+aeMnfonMUuG0A=; b=PsofjzB5nN+3FwNJMWH0qXEB5jhf4zs8ahkJMr2eNdqBsbOAs482GvtIMoxnqBk7uqTTh2 NBjfPMxvk3TEjYRRc7us8LB10X+cIPpxdt8uWfbp7m+mFhOWwH5llhIq0kHqq6ynK/rzc9 WONF1ZOUzbgHVmZOdlfFuahjFVTGdvo= X-MC-Unique: ax4nVYo0PPmmkQUqDpcGGw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LUvJ7tIyqBOqSen0Qaoh/iwRKNN92+aeMnfonMUuG0A=; b=Ku6KBmTuNyu8LzD4Dzm9yvjMH2PpXfHSc+bq630utaLqLTyC27spdAcJtj5jEHT6kv AkBQh+4xIYoXZ6oe8z8cv9e37mtp5iT9WDIa1EhtvrOqpWmug6zJunCSOhxpb7Zt99/h yqRylDdhGagXybs/42JFxTKZxTrL6mw/r//Li2GIKlYceboYGOnnxCqgrtJIp5qs7yIo pIVMEVEQ5Viiei6zdbuRSzbvCfCxEC1MkDhxrteEFhPeP/Ub/20KtxKZHYpJ2H1Pul27 HIHnBkTO1WO6HeVuL/R5dy5BkigzJIWOfq85GXujtEh5UYN9QQZYgYl9FoF2f6nLy0AK Du/A== X-Gm-Message-State: AOAM531rMEelTbjpxxmg6Azx+s40ulXXrPwXnlraoJdQGPzO5tgK8qOo A1fs7PrdRsO/Ru8PUtE7kc9rdega8cMbjZOaGMJag7gQf58At+LmhI9C/xot4IQdLPMXeshGUHR EI//PrERmAMAJWlyN3A/Wpjrb4J4aqFNTdw0Hncg4Cij8hpQKO7xTnux4eD0/ X-Received: by 2002:a05:6000:2a3:: with SMTP id l3mr1098174wry.289.1641848704404; Mon, 10 Jan 2022 13:05:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJz362t6Hy6ASCRaqOMM8CBqNSGr3DFei0QvAoEylotubQ9UjXbCIuqKFviYArPV855FSV+OlA== X-Received: by 2002:a05:6000:2a3:: with SMTP id l3mr1098157wry.289.1641848704162; Mon, 10 Jan 2022 13:05:04 -0800 (PST) Date: Mon, 10 Jan 2022 16:05:01 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 06/10] Revert "vhost-vdpa: add support for config interrupt" Message-ID: <20220110210416.18779-7-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641849378552100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 634f7c89fbd78f57d00d5d6b39c0ade9df1fe27f. Fixes: 634f7c89fb ("vhost-vdpa: add support for config interrupt") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 7 ------- hw/virtio/trace-events | 1 - 2 files changed, 8 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index ac0cb575fb..04ea43704f 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -734,12 +734,6 @@ static int vhost_vdpa_set_vring_call(struct vhost_dev = *dev, trace_vhost_vdpa_set_vring_call(dev, file->index, file->fd); return vhost_vdpa_call(dev, VHOST_SET_VRING_CALL, file); } -static int vhost_vdpa_set_config_call(struct vhost_dev *dev, - int fd) -{ - trace_vhost_vdpa_set_config_call(dev, fd); - return vhost_vdpa_call(dev, VHOST_VDPA_SET_CONFIG_CALL, &fd); -} =20 static int vhost_vdpa_get_features(struct vhost_dev *dev, uint64_t *features) @@ -810,5 +804,4 @@ const VhostOps vdpa_ops =3D { .vhost_get_device_id =3D vhost_vdpa_get_device_id, .vhost_vq_get_addr =3D vhost_vdpa_vq_get_addr, .vhost_force_iommu =3D vhost_vdpa_force_iommu, - .vhost_set_config_call =3D vhost_vdpa_set_config_call, }; diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 595ce015ff..f7ad6be5fb 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -53,7 +53,6 @@ vhost_vdpa_get_features(void *dev, uint64_t features) "de= v: %p features: 0x%"PRI vhost_vdpa_set_owner(void *dev) "dev: %p" vhost_vdpa_vq_get_addr(void *dev, void *vq, uint64_t desc_user_addr, uint6= 4_t avail_user_addr, uint64_t used_user_addr) "dev: %p vq: %p desc_user_add= r: 0x%"PRIx64" avail_user_addr: 0x%"PRIx64" used_user_addr: 0x%"PRIx64 vhost_vdpa_get_iova_range(void *dev, uint64_t first, uint64_t last) "dev: = %p first: 0x%"PRIx64" last: 0x%"PRIx64 -vhost_vdpa_set_config_call(void *dev, int fd)"dev: %p fd: %d" =20 # virtio.c virtqueue_alloc_element(void *elem, size_t sz, unsigned in_num, unsigned o= ut_num) "elem %p size %zd in_num %u out_num %u" --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641849213; cv=none; d=zohomail.com; s=zohoarc; b=coKN+bq13pMdoGL440qHqU0YPsOhymnxBvriNhA9FsUO68hh5V7BaHueLnmWfnb1aICXK4Z02UIdq+f4OXfXio/63JAMJp7e4sYKW2uLzD5VcNZux07q76xMiq+imJuWtH4dcAuG4kjfObdw8inZT+pGUZFdFq2VGw8/MGfEMVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641849213; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qOwvnPS0tFGGKbP3ny4Wc98smh67WP4F4eYZ8L2rGtg=; b=fp/TlS2p/NMtH+oJB8Kz15O0Hs1y3vF2j15sWLMFknuqCjWgtGHY6Zo9JRMdJaLMDrscExosnlGN1C3Q/P4ZindbYKZpBT0qX762CUIIjll83v75e06bIbGoZ+ibs1hR5+JoFjdEFO5kfekwzoae8naAulrRfJkbuYfVuTiTdb4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164184921332382.92931225424229; Mon, 10 Jan 2022 13:13:33 -0800 (PST) Received: from localhost ([::1]:50010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71yu-0008PU-Aa for importer@patchew.org; Mon, 10 Jan 2022 16:13:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rS-0007x4-I0 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rO-0004aj-G0 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:49 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83-wwvc-r0jMmO2utYT93PFkQ-1; Mon, 10 Jan 2022 16:05:09 -0500 Received: by mail-wm1-f71.google.com with SMTP id v23-20020a05600c215700b0034566adb612so2652916wml.0 for ; Mon, 10 Jan 2022 13:05:08 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id g18sm8588183wmq.5.2022.01.10.13.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qOwvnPS0tFGGKbP3ny4Wc98smh67WP4F4eYZ8L2rGtg=; b=YWH9/z6BmhkacMAQnnF9Ez+H01phi6hBXF4Z2A4Xsk3bYMFfFPj2kpnFR9nwivpZQOILxc dbQnhojt6sb6WV5u/8lmlIbPXaI/uKgEIxJ0lbEC3kA7PDojwm/WZGFIVFWrodICi4cOno oJlU67ZPK5NchZyC7aAkBefUHWxcPb0= X-MC-Unique: wwvc-r0jMmO2utYT93PFkQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qOwvnPS0tFGGKbP3ny4Wc98smh67WP4F4eYZ8L2rGtg=; b=qUilQSeCfarnE3ajEyXLx0LeI6Q2kspAVyh9t4/p/g5MIlV0mBX65c7RZf+axDej48 bLX627BaM2+Cj5yKDsemzkXBd0JhBvPO/LJQcjlSDpnJU46O6B8gOpEHlEkNmua55cp+ 3cQSdOoORrsMdo0Sn1HrnrGBD7b3a82AQPqxIks2cSW5AWvFjSKVjYqnM1GtMqvxY9z4 NyLRvAFO4Uj1skZ0hu7U+AOwPnMj7ViZA7ta1agbpCtxV+UZPrAs3aA8Ejc3F+IP9rD1 pvj7e4BYBe6uO4SDEuwH3guxLOJoNaRF4pwsqk2+8zfJutj5k/7QHzP/NNGDI/e9b/sm leYQ== X-Gm-Message-State: AOAM5313kUnspNw55U+lMAsPLv2R3Q8S79F3EtRhAqdN29ja8skELoh/ adxBkR+w/UIpwaYm6SzVCj9q8VcIp4+/8nKhi6zif4lOJNLrsjhBQIk2/w2SlnDj2Mazp7ttx8D USqsEMaCb6uvFZfvNTsJ1piY6kbEc1EAoiriCQgCsVaQ3rnhTOX1eeMD9VAQC X-Received: by 2002:a05:600c:3b18:: with SMTP id m24mr1057127wms.4.1641848707359; Mon, 10 Jan 2022 13:05:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBmIELuNI1t093fptzwWzSFkzZC/eH1l5wlIrsMkC1tUy3LACofZCk2XFpNc5dXU9A/5OWKw== X-Received: by 2002:a05:600c:3b18:: with SMTP id m24mr1057111wms.4.1641848707088; Mon, 10 Jan 2022 13:05:07 -0800 (PST) Date: Mon, 10 Jan 2022 16:05:04 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 07/10] Revert "vhost: introduce new VhostOps vhost_set_config_call" Message-ID: <20220110210416.18779-8-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641849213748100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 88062372340d33090b7f089ed3b1a00f530a8914. Fixes: 8806237234 ("vhost: introduce new VhostOps vhost_set_config_call") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-backend.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-ba= ckend.h index ff34eb7c8a..81bf3109f8 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -126,8 +126,6 @@ typedef int (*vhost_get_device_id_op)(struct vhost_dev = *dev, uint32_t *dev_id); =20 typedef bool (*vhost_force_iommu_op)(struct vhost_dev *dev); =20 -typedef int (*vhost_set_config_call_op)(struct vhost_dev *dev, - int fd); typedef struct VhostOps { VhostBackendType backend_type; vhost_backend_init vhost_backend_init; @@ -173,7 +171,6 @@ typedef struct VhostOps { vhost_vq_get_addr_op vhost_vq_get_addr; vhost_get_device_id_op vhost_get_device_id; vhost_force_iommu_op vhost_force_iommu; - vhost_set_config_call_op vhost_set_config_call; } VhostOps; =20 int vhost_backend_update_device_iotlb(struct vhost_dev *dev, --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641849394; cv=none; d=zohomail.com; s=zohoarc; b=lxqyVKZ9MkZ5ZZZRYgmEonI5HjtJdXaA/LYYdtdUbYZ5N9auxSdrtBpKlFDOWKx0iyVodZpteZVT5pRvHab5o1lE/UwntU+qkFAuimBJEefLQwqDLyqz5vlopIy9+bKLrp4tC08m35pCse8Ra0KyN37AzzErrk3wH9erXHy89JU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641849394; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=D5J/t7Oj0lxeZr6Ei9BE4MDoWaOOBczeoWUUsRZd34U=; b=WPUlZ8o9mczQ+ldkN4FFidpelyD8GxQBukePhCJqH23f6Xp0JPKpOi0HULNbxfHrhSC3ZAdqFDzVyiMdYKy+B+ADE7ghfY+z/qySQKa7lId0B0UH1f49zIxV/wW7Pb1LcJTkJaWTWMPtX3IOoGgGMf6DLSdw1gbT5lqfPE8yMjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641849394098680.9836268466603; Mon, 10 Jan 2022 13:16:34 -0800 (PST) Received: from localhost ([::1]:59976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n721p-0006mk-2Y for importer@patchew.org; Mon, 10 Jan 2022 16:16:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rq-0008Hw-NS for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:06:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rl-0004lX-Pf for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:06:14 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-pnxJe80rNCKiN_Q47pC3cQ-1; Mon, 10 Jan 2022 16:05:52 -0500 Received: by mail-wm1-f71.google.com with SMTP id l20-20020a05600c1d1400b003458e02cea0so189869wms.7 for ; Mon, 10 Jan 2022 13:05:50 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id a3sm8318319wri.89.2022.01.10.13.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=D5J/t7Oj0lxeZr6Ei9BE4MDoWaOOBczeoWUUsRZd34U=; b=D7q6P4nRkBKVDkKtSucE5e5lO+qRT7waDtAcgVY2qwucUpWBROe2Py6BfeDsd3KSsprDJG L9ph105csRkWXJH3xj5coadlvlP9CWKEWJg3w/fRYNbQ/gn5Xl3KhbA6NxHdoZYf3gPcx0 bbd4Vq3qFvAZZWsJK5SNr6twzqsYaX8= X-MC-Unique: pnxJe80rNCKiN_Q47pC3cQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D5J/t7Oj0lxeZr6Ei9BE4MDoWaOOBczeoWUUsRZd34U=; b=LTa3enC4eOeMYpdvP03bteBJ6ad4Jf2zPKa/ULhjtY0+LjWY1DFDuzNQc+CjMxH8xx dUVcz0Gf/GWvgkeHVg3yjesNqUH+nGb2snRf8JbkOXZVY88Svk6VZKaiy2HtMh/UYS2M B7cIdiT0qDb7XYw/8ipEo/2GLm2bIxhHUR8ABSr4hXB6anyiOSf7MDFbXUft8MO0hfXJ gUU1ypOgc47rGKRkpcoLRXuE79yfYtGhBJcCGvgOTWxT/LeriPKCPqLelOkXHNcVercw /Dl63RsSPLeBSQ/QS5U3Ff6tZaW3WU8JFrJiNHm5G5I+nHQJEEuGH7QbsHXkTsscWSUF 3rpQ== X-Gm-Message-State: AOAM531tETPYoqdwFQaV54Ehk/SblR1ierjE+uPX6QXex8WJCmFugKi3 1mYFwT9OLiV0EsDFMw1FGKDgk18oPxPx2YQ6COpGH9pF+jIxSvNN+bBykTbeG5UKbrklLIbUbqd BMkSaaY4Vw0vQS9IHnuXHc0Zww0V8zwVzt+6601Th+bC8IIN3k0yiXvqQuYjp X-Received: by 2002:a05:6000:1006:: with SMTP id a6mr1179744wrx.484.1641848709874; Mon, 10 Jan 2022 13:05:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB22yrJpc3RBzUruQmyFUdbLseZuHi7AudRqfqRoJck2T2yPCWrwbQQ73SxYdKE5wBAx7+Qg== X-Received: by 2002:a05:6000:1006:: with SMTP id a6mr1179724wrx.484.1641848709607; Mon, 10 Jan 2022 13:05:09 -0800 (PST) Date: Mon, 10 Jan 2022 16:05:07 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 08/10] Revert "virtio-pci: decouple the single vector from the interrupt process" Message-ID: <20220110210416.18779-9-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641849395092100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 316011b8a74e777eb3ba03171cd701a291c28867. Fixes: 316011b8a7 ("virtio-pci: decouple the single vector from the interru= pt process") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 163 +++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 89 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 7201cf3dc1..4bdb6e5694 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -677,6 +677,7 @@ static uint32_t virtio_read_config(PCIDevice *pci_dev, } =20 static int kvm_virtio_pci_vq_vector_use(VirtIOPCIProxy *proxy, + unsigned int queue_no, unsigned int vector) { VirtIOIRQFD *irqfd =3D &proxy->vector_irqfd[vector]; @@ -739,103 +740,87 @@ static int virtio_pci_get_notifier(VirtIOPCIProxy *p= roxy, int queue_no, return 0; } =20 -static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy *proxy, int queue_= no) -{ - unsigned int vector; - int ret; - EventNotifier *n; - PCIDevice *dev =3D &proxy->pci_dev; - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); - - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - return ret; - } - if (vector >=3D msix_nr_vectors_allocated(dev)) { - return 0; - } - ret =3D kvm_virtio_pci_vq_vector_use(proxy, vector); - if (ret < 0) { - goto undo; - } - /* - * If guest supports masking, set up irqfd now. - * Otherwise, delay until unmasked in the frontend. - */ - if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); - if (ret < 0) { - kvm_virtio_pci_vq_vector_release(proxy, vector); - goto undo; - } - } - - return 0; -undo: - - vector =3D virtio_queue_vector(vdev, queue_no); - if (vector >=3D msix_nr_vectors_allocated(dev)) { - return ret; - } - if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - return ret; - } - kvm_virtio_pci_irqfd_release(proxy, n, vector); - } - return ret; -} static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) { - int queue_no; - int ret =3D 0; - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - - for (queue_no =3D 0; queue_no < nvqs; queue_no++) { - if (!virtio_queue_get_num(vdev, queue_no)) { - return -1; - } - ret =3D kvm_virtio_pci_vector_use_one(proxy, queue_no); - } - return ret; -} - - -static void kvm_virtio_pci_vector_release_one(VirtIOPCIProxy *proxy, - int queue_no) -{ - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - unsigned int vector; - EventNotifier *n; - int ret; - VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); PCIDevice *dev =3D &proxy->pci_dev; - - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - return; - } - if (vector >=3D msix_nr_vectors_allocated(dev)) { - return; - } - if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - kvm_virtio_pci_irqfd_release(proxy, n, vector); - } - kvm_virtio_pci_vq_vector_release(proxy, vector); -} - -static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) -{ - int queue_no; VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - + VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); + unsigned int vector; + int ret, queue_no; + EventNotifier *n; for (queue_no =3D 0; queue_no < nvqs; queue_no++) { if (!virtio_queue_get_num(vdev, queue_no)) { break; } - kvm_virtio_pci_vector_release_one(proxy, queue_no); + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + break; + } + if (vector >=3D msix_nr_vectors_allocated(dev)) { + continue; + } + ret =3D kvm_virtio_pci_vq_vector_use(proxy, queue_no, vector); + if (ret < 0) { + goto undo; + } + /* If guest supports masking, set up irqfd now. + * Otherwise, delay until unmasked in the frontend. + */ + if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); + if (ret < 0) { + kvm_virtio_pci_vq_vector_release(proxy, vector); + goto undo; + } + } + } + return 0; + +undo: + while (--queue_no >=3D 0) { + vector =3D virtio_queue_vector(vdev, queue_no); + if (vector >=3D msix_nr_vectors_allocated(dev)) { + continue; + } + if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + break; + } + kvm_virtio_pci_irqfd_release(proxy, n, vector); + } + kvm_virtio_pci_vq_vector_release(proxy, vector); + } + return ret; +} + +static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) +{ + PCIDevice *dev =3D &proxy->pci_dev; + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + unsigned int vector; + int queue_no; + VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); + EventNotifier *n; + int ret ; + for (queue_no =3D 0; queue_no < nvqs; queue_no++) { + if (!virtio_queue_get_num(vdev, queue_no)) { + break; + } + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + break; + } + if (vector >=3D msix_nr_vectors_allocated(dev)) { + continue; + } + /* If guest supports masking, clean up irqfd now. + * Otherwise, it was cleaned when masked in the frontend. + */ + if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + kvm_virtio_pci_irqfd_release(proxy, n, vector); + } + kvm_virtio_pci_vq_vector_release(proxy, vector); } } =20 --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641849233; cv=none; d=zohomail.com; s=zohoarc; b=Krtx1VDIMW660NprrfROPUSujE1qSD8ORcIVWDUtig6yprUJzVsf5WhZUji61k7M56KeN1DYKxFPpKt2x9i261mY11QKmrPhi3+29y1LQh17zTYdch0LdiJx2FdUXkJo4BTPM1DlStxmBGpjXeqSM+urcPXZcwM2zDJueZIc0J8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641849233; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TsMzcm1in4jhpwu/SzoIePxsdjFO4DBOR6IlDk/nH1o=; b=liBkVx0hYEeZCI8//it1cK6lOb49ph4iUcZJ1bWOMNnCYjFf00hLefQUU4fO6GtDr97H5ebsgcRdwQoQPJlZhcGMQw4UraK/sfINuDCWl9WoKCrdG+RuRGdlSsA20kovugpxnK6R9vRaBoXhI/Ouiswa//1QLdNrobdWEa4LztY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641849233181215.56849341120267; Mon, 10 Jan 2022 13:13:53 -0800 (PST) Received: from localhost ([::1]:50486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n71zE-0000Jg-4b for importer@patchew.org; Mon, 10 Jan 2022 16:13:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rf-00085l-0x for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:06:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rQ-0004an-DC for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:59 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-n7p2HwQCO3uKOwIR1kLI1Q-1; Mon, 10 Jan 2022 16:05:14 -0500 Received: by mail-wm1-f70.google.com with SMTP id j18-20020a05600c1c1200b003335872db8dso2651307wms.2 for ; Mon, 10 Jan 2022 13:05:13 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id l4sm6121218wru.74.2022.01.10.13.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TsMzcm1in4jhpwu/SzoIePxsdjFO4DBOR6IlDk/nH1o=; b=g/Z/otNJoVRHh9jCyBe2ZnPJuBFz2IRYmAlM5WP7gtZbN8LxRLbgk43Pl8qnjIcqIV9sze JYSz3NCbJHj00+jwx+pnRBmS3/wbnmY7phe0q3+Ux9byYp+Pw+c3dfntWo+TFzSeBOQlOH B+LBzFWWJJRJOTOa8Yl7dgR2DruKlD8= X-MC-Unique: n7p2HwQCO3uKOwIR1kLI1Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TsMzcm1in4jhpwu/SzoIePxsdjFO4DBOR6IlDk/nH1o=; b=c2OXIZCtveJiSj0kJt5Qfklc7tGznwoTiHIp2aMtp1O48regQiamQkbL92zOR2o4cv OdqSkEtOUuYnvd5S0iBr+icpUY6jgcgwyXeCl7z4sjwklbP9YkMpaigHRX25yqa9iKOQ I96+e9KxAgOUbX9zcIvbf1svQxxQ+NEMUlUUeuK+/Ho5QCGqPs+uSdYVp90l7JNvDoUE jqDJ7CdwhvAtpALLXmTbEI+LWWy1FLbZoh49mlO5MhBmdM97kMP5o2TFFPsJG0uqdQZw aDbPmdb3FTeW3RO92O2QLfntSqdeb90XdGFwbtIXrVa1F8yeFs5YrfsdE70t9gcvq9zj n29w== X-Gm-Message-State: AOAM530128j3TgdYLmRc9f1CJiUNCmRoN/+5qQ/llyPi/GWGBaNA9OtC N1goFqc9mHn5fDXVdKbqmsVqA+p2WPDjKsw4cixRJI6KDVT1YbhL0lRd4wGwUHybheSQrL79qMM JoY8Wy8duljPpQKbYWYtt/Box3+7T34BPJ1n0lXvt65cDJHkn+OkvjtomZJhA X-Received: by 2002:a05:600c:4f8d:: with SMTP id n13mr23328416wmq.43.1641848712611; Mon, 10 Jan 2022 13:05:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJynD6kBZXr2MfvfOsROz4ucjFd/ttseodeVIMlP0v8bYd4vTLbzcQxpeoi4HHkawx0Es4J9BA== X-Received: by 2002:a05:600c:4f8d:: with SMTP id n13mr23328394wmq.43.1641848712293; Mon, 10 Jan 2022 13:05:12 -0800 (PST) Date: Mon, 10 Jan 2022 16:05:09 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 09/10] Revert "virtio-pci: decouple notifier from interrupt process" Message-ID: <20220110210416.18779-10-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641849233654100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit e3480ef81f6fb61cc9c04e3b5be8b7e84484fc05. Fixes: e3480ef81f ("virtio-pci: decouple notifier from interrupt process") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 88 +++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 57 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 4bdb6e5694..750aa47ec1 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -704,41 +704,29 @@ static void kvm_virtio_pci_vq_vector_release(VirtIOPC= IProxy *proxy, } =20 static int kvm_virtio_pci_irqfd_use(VirtIOPCIProxy *proxy, - EventNotifier *n, + unsigned int queue_no, unsigned int vector) { VirtIOIRQFD *irqfd =3D &proxy->vector_irqfd[vector]; + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + VirtQueue *vq =3D virtio_get_queue(vdev, queue_no); + EventNotifier *n =3D virtio_queue_get_guest_notifier(vq); return kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, n, NULL, irqfd->v= irq); } =20 static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, - EventNotifier *n , + unsigned int queue_no, unsigned int vector) { + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + VirtQueue *vq =3D virtio_get_queue(vdev, queue_no); + EventNotifier *n =3D virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd =3D &proxy->vector_irqfd[vector]; int ret; =20 ret =3D kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, n, irqfd->vir= q); assert(ret =3D=3D 0); } -static int virtio_pci_get_notifier(VirtIOPCIProxy *proxy, int queue_no, - EventNotifier **n, unsigned int *vec= tor) -{ - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - VirtQueue *vq; - - if (queue_no =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return -1; - } else { - if (!virtio_queue_get_num(vdev, queue_no)) { - return -1; - } - *vector =3D virtio_queue_vector(vdev, queue_no); - vq =3D virtio_get_queue(vdev, queue_no); - *n =3D virtio_queue_get_guest_notifier(vq); - } - return 0; -} =20 static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) { @@ -747,15 +735,12 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *= proxy, int nvqs) VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); unsigned int vector; int ret, queue_no; - EventNotifier *n; + for (queue_no =3D 0; queue_no < nvqs; queue_no++) { if (!virtio_queue_get_num(vdev, queue_no)) { break; } - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - break; - } + vector =3D virtio_queue_vector(vdev, queue_no); if (vector >=3D msix_nr_vectors_allocated(dev)) { continue; } @@ -767,7 +752,7 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *pr= oxy, int nvqs) * Otherwise, delay until unmasked in the frontend. */ if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); + ret =3D kvm_virtio_pci_irqfd_use(proxy, queue_no, vector); if (ret < 0) { kvm_virtio_pci_vq_vector_release(proxy, vector); goto undo; @@ -783,11 +768,7 @@ undo: continue; } if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - break; - } - kvm_virtio_pci_irqfd_release(proxy, n, vector); + kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); } kvm_virtio_pci_vq_vector_release(proxy, vector); } @@ -801,16 +782,12 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIPr= oxy *proxy, int nvqs) unsigned int vector; int queue_no; VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); - EventNotifier *n; - int ret ; + for (queue_no =3D 0; queue_no < nvqs; queue_no++) { if (!virtio_queue_get_num(vdev, queue_no)) { break; } - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - break; - } + vector =3D virtio_queue_vector(vdev, queue_no); if (vector >=3D msix_nr_vectors_allocated(dev)) { continue; } @@ -818,20 +795,21 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIPr= oxy *proxy, int nvqs) * Otherwise, it was cleaned when masked in the frontend. */ if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - kvm_virtio_pci_irqfd_release(proxy, n, vector); + kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); } kvm_virtio_pci_vq_vector_release(proxy, vector); } } =20 -static int virtio_pci_one_vector_unmask(VirtIOPCIProxy *proxy, +static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector, - MSIMessage msg, - EventNotifier *n) + MSIMessage msg) { VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); + VirtQueue *vq =3D virtio_get_queue(vdev, queue_no); + EventNotifier *n =3D virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd; int ret =3D 0; =20 @@ -858,15 +836,14 @@ static int virtio_pci_one_vector_unmask(VirtIOPCIProx= y *proxy, event_notifier_set(n); } } else { - ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); + ret =3D kvm_virtio_pci_irqfd_use(proxy, queue_no, vector); } return ret; } =20 -static void virtio_pci_one_vector_mask(VirtIOPCIProxy *proxy, +static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *proxy, unsigned int queue_no, - unsigned int vector, - EventNotifier *n) + unsigned int vector) { VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); @@ -877,7 +854,7 @@ static void virtio_pci_one_vector_mask(VirtIOPCIProxy *= proxy, if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { k->guest_notifier_mask(vdev, queue_no, true); } else { - kvm_virtio_pci_irqfd_release(proxy, n, vector); + kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); } } =20 @@ -887,7 +864,6 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, uns= igned vector, VirtIOPCIProxy *proxy =3D container_of(dev, VirtIOPCIProxy, pci_dev); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtQueue *vq =3D virtio_vector_first_queue(vdev, vector); - EventNotifier *n; int ret, index, unmasked =3D 0; =20 while (vq) { @@ -896,8 +872,7 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, uns= igned vector, break; } if (index < proxy->nvqs_with_notifiers) { - n =3D virtio_queue_get_guest_notifier(vq); - ret =3D virtio_pci_one_vector_unmask(proxy, index, vector, msg= , n); + ret =3D virtio_pci_vq_vector_unmask(proxy, index, vector, msg); if (ret < 0) { goto undo; } @@ -913,8 +888,7 @@ undo: while (vq && unmasked >=3D 0) { index =3D virtio_get_queue_index(vq); if (index < proxy->nvqs_with_notifiers) { - n =3D virtio_queue_get_guest_notifier(vq); - virtio_pci_one_vector_mask(proxy, index, vector, n); + virtio_pci_vq_vector_mask(proxy, index, vector); --unmasked; } vq =3D virtio_vector_next_queue(vq); @@ -927,17 +901,15 @@ static void virtio_pci_vector_mask(PCIDevice *dev, un= signed vector) VirtIOPCIProxy *proxy =3D container_of(dev, VirtIOPCIProxy, pci_dev); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtQueue *vq =3D virtio_vector_first_queue(vdev, vector); - EventNotifier *n; int index; =20 while (vq) { index =3D virtio_get_queue_index(vq); - n =3D virtio_queue_get_guest_notifier(vq); if (!virtio_queue_get_num(vdev, index)) { break; } if (index < proxy->nvqs_with_notifiers) { - virtio_pci_one_vector_mask(proxy, index, vector, n); + virtio_pci_vq_vector_mask(proxy, index, vector); } vq =3D virtio_vector_next_queue(vq); } @@ -953,17 +925,19 @@ static void virtio_pci_vector_poll(PCIDevice *dev, int queue_no; unsigned int vector; EventNotifier *notifier; - int ret; + VirtQueue *vq; =20 for (queue_no =3D 0; queue_no < proxy->nvqs_with_notifiers; queue_no++= ) { - ret =3D virtio_pci_get_notifier(proxy, queue_no, ¬ifier, &vecto= r); - if (ret < 0) { + if (!virtio_queue_get_num(vdev, queue_no)) { break; } + vector =3D virtio_queue_vector(vdev, queue_no); if (vector < vector_start || vector >=3D vector_end || !msix_is_masked(dev, vector)) { continue; } + vq =3D virtio_get_queue(vdev, queue_no); + notifier =3D virtio_queue_get_guest_notifier(vq); if (k->guest_notifier_pending) { if (k->guest_notifier_pending(vdev, queue_no)) { msix_set_pending(dev, vector); --=20 MST From nobody Thu May 2 13:30:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641849377893643.6308783607614; Mon, 10 Jan 2022 13:16:17 -0800 (PST) Received: from localhost ([::1]:58694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n721Y-0005t5-Tr for importer@patchew.org; Mon, 10 Jan 2022 16:16:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rS-0007xZ-1P for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n71rO-0004cc-Fe for qemu-devel@nongnu.org; Mon, 10 Jan 2022 16:05:49 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-Y-yIvxEHPGWlkKKcRAif0w-1; Mon, 10 Jan 2022 16:05:17 -0500 Received: by mail-wm1-f70.google.com with SMTP id m9-20020a05600c4f4900b0034644da3525so627459wmq.3 for ; Mon, 10 Jan 2022 13:05:17 -0800 (PST) Received: from redhat.com ([2.55.19.241]) by smtp.gmail.com with ESMTPSA id i8sm9479297wry.108.2022.01.10.13.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 13:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641848718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nxzv/mHumtXHvST3xJXNiXoF+nDokN8B7YoVRznXcsM=; b=MLlp+ifwLSrTwYW/CAZQoXsQgCB8ExZp05/KRWDn/1Iq6PimXhhLcKbCsLebiLGm4bLe4p TSxX6pMIyXr2GJjAbZtM371JLPWDnwv9JQFT5w3HOCDat4Qi7GGqCkqPErV34ZBziTgLXw WmBRc7A66Cg6Ux89cpQX3Dbftr75tiI= X-MC-Unique: Y-yIvxEHPGWlkKKcRAif0w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nxzv/mHumtXHvST3xJXNiXoF+nDokN8B7YoVRznXcsM=; b=gVlHNcAFUmsoGG9bE+1ZoaA9cdIakY6qdP6pHD2DYd1BrEGJWcPkMhpQeOMn1/R3mp wewgPVnWSZRvm9RJELUMvkIBdqH+Y5SUeA4I2ryNcmu8bj3be/ZIAr9wgehQgDQ+aJGw 5W6p48K5QKJh/MBRg9A6s7kZtwAkeS0hKpoe8LKEqgNZ9k+QCLE+eVZKz4PJJ6oeEW/T 4QsQjS1Y51TP+m6c8/IVm4D9tcY9gz7CemMHL/Iqc7GtSE0/XGDwUfERw+vs+qI8D7wS 5FbhKPKmdpXK3pt5zGYE3aF0RsEKiP4DnwP3lZsYo47FvHV7t4ipk5IkWCKqU9IPC8wy 0olw== X-Gm-Message-State: AOAM530+k5OZ5gqvayKgYPafucGpVm4yJkB+ojiruGqCV9b7uI3AGPb8 Jpbi8mycUm4jdv0mRe2bavu53eogFTl9BStOiclYIiXsP6WZQ+jLV9uTEA72F1VB/PD8erjZDM3 2GM6H9v8KOP7TO8Yspx6tdA8yn91u5VtqKt9Sm54pzSwUzO7eJ4MDIieFvagX X-Received: by 2002:a7b:cb8a:: with SMTP id m10mr10125511wmi.165.1641848715800; Mon, 10 Jan 2022 13:05:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpx2xtjAtgUTgt4mK4qj0qfNf3QBWahwxfB5p/ovzf5MwvhMmfVBVN7bdA7y3r8WD5puL5iw== X-Received: by 2002:a7b:cb8a:: with SMTP id m10mr10125494wmi.165.1641848715608; Mon, 10 Jan 2022 13:05:15 -0800 (PST) Date: Mon, 10 Jan 2022 16:05:12 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 10/10] Revert "virtio: introduce macro IRTIO_CONFIG_IRQ_IDX" Message-ID: <20220110210416.18779-11-mst@redhat.com> References: <20220110210416.18779-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220110210416.18779-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cindy Lu , Jason Wang , "Dr. David Alan Gilbert" , virtio-fs@redhat.com, "Gonglei \(Arei\)" , Gerd Hoffmann , Stefan Hajnoczi , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1641849380553100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit bf1d85c166c19af95dbd27b1faba1d2909732323. Fixes: bf1d85c166 ("virtio: introduce macro IRTIO_CONFIG_IRQ_IDX") Cc: "Cindy Lu" Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 3 --- hw/display/vhost-user-gpu.c | 6 ------ hw/net/virtio-net.c | 10 ++-------- hw/virtio/vhost-user-fs.c | 6 ------ hw/virtio/vhost-vsock-common.c | 6 ------ hw/virtio/virtio-crypto.c | 6 ------ 6 files changed, 2 insertions(+), 35 deletions(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 605ea79c90..8bab9cfb75 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -67,9 +67,6 @@ typedef struct VirtQueueElement =20 #define VIRTIO_NO_VECTOR 0xffff =20 -/* special index value used internally for config irqs */ -#define VIRTIO_CONFIG_IRQ_IDX -1 - #define TYPE_VIRTIO_DEVICE "virtio-device" OBJECT_DECLARE_TYPE(VirtIODevice, VirtioDeviceClass, VIRTIO_DEVICE) =20 diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index d4a440e815..09818231bd 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -485,9 +485,6 @@ vhost_user_gpu_guest_notifier_pending(VirtIODevice *vde= v, int idx) { VhostUserGPU *g =3D VHOST_USER_GPU(vdev); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return false; - } return vhost_virtqueue_pending(&g->vhost->dev, idx); } =20 @@ -496,9 +493,6 @@ vhost_user_gpu_guest_notifier_mask(VirtIODevice *vdev, = int idx, bool mask) { VhostUserGPU *g =3D VHOST_USER_GPU(vdev); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return; - } vhost_virtqueue_mask(&g->vhost->dev, vdev, idx, mask); } =20 diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5e03c0dd14..cf8ab0f8af 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3168,9 +3168,6 @@ static bool virtio_net_guest_notifier_pending(VirtIOD= evice *vdev, int idx) VirtIONet *n =3D VIRTIO_NET(vdev); NetClientState *nc =3D qemu_get_subqueue(n->nic, vq2q(idx)); assert(n->vhost_started); - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return false; - } return vhost_net_virtqueue_pending(get_vhost_net(nc->peer), idx); } =20 @@ -3180,11 +3177,8 @@ static void virtio_net_guest_notifier_mask(VirtIODev= ice *vdev, int idx, VirtIONet *n =3D VIRTIO_NET(vdev); NetClientState *nc =3D qemu_get_subqueue(n->nic, vq2q(idx)); assert(n->vhost_started); - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return; - } - - vhost_net_virtqueue_mask(get_vhost_net(nc->peer), vdev, idx, mask); + vhost_net_virtqueue_mask(get_vhost_net(nc->peer), + vdev, idx, mask); } =20 static void virtio_net_set_config_size(VirtIONet *n, uint64_t host_feature= s) diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index 9b0349922e..c595957983 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -161,9 +161,6 @@ static void vuf_guest_notifier_mask(VirtIODevice *vdev,= int idx, { VHostUserFS *fs =3D VHOST_USER_FS(vdev); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return; - } vhost_virtqueue_mask(&fs->vhost_dev, vdev, idx, mask); } =20 @@ -171,9 +168,6 @@ static bool vuf_guest_notifier_pending(VirtIODevice *vd= ev, int idx) { VHostUserFS *fs =3D VHOST_USER_FS(vdev); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return false; - } return vhost_virtqueue_pending(&fs->vhost_dev, idx); } =20 diff --git a/hw/virtio/vhost-vsock-common.c b/hw/virtio/vhost-vsock-common.c index d1b9c027b6..3f3771274e 100644 --- a/hw/virtio/vhost-vsock-common.c +++ b/hw/virtio/vhost-vsock-common.c @@ -125,9 +125,6 @@ static void vhost_vsock_common_guest_notifier_mask(Virt= IODevice *vdev, int idx, { VHostVSockCommon *vvc =3D VHOST_VSOCK_COMMON(vdev); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return; - } vhost_virtqueue_mask(&vvc->vhost_dev, vdev, idx, mask); } =20 @@ -136,9 +133,6 @@ static bool vhost_vsock_common_guest_notifier_pending(V= irtIODevice *vdev, { VHostVSockCommon *vvc =3D VHOST_VSOCK_COMMON(vdev); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return false; - } return vhost_virtqueue_pending(&vvc->vhost_dev, idx); } =20 diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 1d5192f8b4..54f9bbb789 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -948,9 +948,6 @@ static void virtio_crypto_guest_notifier_mask(VirtIODev= ice *vdev, int idx, =20 assert(vcrypto->vhost_started); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return; - } cryptodev_vhost_virtqueue_mask(vdev, queue, idx, mask); } =20 @@ -961,9 +958,6 @@ static bool virtio_crypto_guest_notifier_pending(VirtIO= Device *vdev, int idx) =20 assert(vcrypto->vhost_started); =20 - if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return false; - } return cryptodev_vhost_virtqueue_pending(vdev, queue, idx); } =20 --=20 MST