From nobody Fri May 3 05:42:18 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 1630791458821646.9147111084174; Sat, 4 Sep 2021 14:37:38 -0700 (PDT) Received: from localhost ([::1]:34214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdM0-0006DO-Un for importer@patchew.org; Sat, 04 Sep 2021 17:37:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKX-0003SC-LY for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKU-0000hO-PV for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:04 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-68-vTcFsIg2Od6oMKrd22CNyQ-1; Sat, 04 Sep 2021 17:36:00 -0400 Received: by mail-ed1-f69.google.com with SMTP id u2-20020aa7d982000000b003cda80fa659so249728eds.14 for ; Sat, 04 Sep 2021 14:36:00 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id x11sm1886064edq.58.2021.09.04.14.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791361; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cOPDJe6kQs7eQAFLJvd9ZjC5/cIbGay8VQyjGzL94Tc=; b=Jxa+IAN0ZQdq9NlSlr4GPtN2xM6V95Vnf3c0n+6BCjPm95iJZyyCvZ96gen9DuwXPwnH47 7xIeS+WXMDCOPypTw4qPwK/4TqQRMh37yqxlKr9Yh84ieyaQXEHlDdk6335wgQl0I84+do prKFrUx/bgDZ0+AhV84HssfKW7E5j/I= X-MC-Unique: vTcFsIg2Od6oMKrd22CNyQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=cOPDJe6kQs7eQAFLJvd9ZjC5/cIbGay8VQyjGzL94Tc=; b=e7ykGoIgUiVSEue+lX8VVgX3SP5VbJBwvxwpeaER/WXqsQ+ZXdkC1aEoLrYmiubQrP Bx8/D3/GYl0ijkkTMocM3bcOP5X8ZGWwQYLL13G/uasJrTTtzCpPJXVt7Fj/U0vXTK7c 6q4ej4insJuvsE5jP22B1H4DA/kYnYpDFUgNZ8t4lVn8btVe66QvIvyLQAnttKTT5RJb Y1gnK+uNMLUNtOj9TwSRpFXMg8b3ikfsz82oJMkhep7x6vn8N6z7ANpu6vZhlbY7oOrh aaBaqtAU8VZdu/3/Ys8ocxief3f0H4z4SGnS69bhMTEi5cI4JUnRXug3UbZRVaRUUXyA fhDA== X-Gm-Message-State: AOAM531xcazdCisrKwc3bMcv8YG9qFFA+/RY3dGk3jofkIKaHvWV1JB6 mb9f4S0bZQ7kBVAkEvgmO+Ict9HZY3NpHn2/ekMnl9O0M7ymZhLKLBQvnPzKEgeWqxYKISxMP+x An3IFx+tiPjr/jNFZtcQNI/7ANTwfdCX29uIlWD04l36AOpD9YhMbZMMmslpp X-Received: by 2002:a05:6402:b9c:: with SMTP id cf28mr5927117edb.356.1630791359184; Sat, 04 Sep 2021 14:35:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySpfwBNyUCi2NOB9MMbgkATjbkqjygbrUgVM/kh5MwLAxauDhbCuLgORjr93b3rTE4FPnnGg== X-Received: by 2002:a05:6402:b9c:: with SMTP id cf28mr5927100edb.356.1630791358984; Sat, 04 Sep 2021 14:35:58 -0700 (PDT) Date: Sat, 4 Sep 2021 17:35:56 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 01/35] vhost-vdpa: Do not send empty IOTLB update batches Message-ID: <20210904213506.486886-2-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Eugenio =?utf-8?B?UMOpcmV6?= 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: 1630791460846100002 From: Eugenio P=C3=A9rez With the introduction of the batch hinting, meaningless batches can be created with no IOTLB updates if the memory region was skipped by vhost_vdpa_listener_skipped_section. This is the case of host notifiers memory regions, device un/realize, and others. This causes the vdpa device to receive dma mapping settings with no changes, a possibly expensive operation for nothing. To avoid that, VHOST_IOTLB_BATCH_BEGIN hint is delayed until we have a meaningful (not skipped section) mapping or unmapping operation, and VHOST_IOTLB_BATCH_END is not written unless at least one of _UPDATE / _INVALIDATE has been issued. v3: * Use a bool instead of a counter avoiding potential number wrapping * Fix bad check on _commit * Move VHOST_BACKEND_F_IOTLB_BATCH check to vhost_vdpa_iotlb_batch_begin_once v2 (from RFC): * Rename misleading name * Abstract start batching function for listener_add/del Signed-off-by: Eugenio P=C3=A9rez Message-Id: <20210812140933.226288-1-eperezma@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-vdpa.h | 1 + hw/virtio/vhost-vdpa.c | 35 ++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h index 9188226d8b..a8963da2d9 100644 --- a/include/hw/virtio/vhost-vdpa.h +++ b/include/hw/virtio/vhost-vdpa.h @@ -22,6 +22,7 @@ typedef struct VhostVDPAHostNotifier { typedef struct vhost_vdpa { int device_fd; uint32_t msg_type; + bool iotlb_batch_begin_sent; MemoryListener listener; struct vhost_dev *dev; VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX]; diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 4fa414feea..ca1227e5dc 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -89,19 +89,13 @@ static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, h= waddr iova, return ret; } =20 -static void vhost_vdpa_listener_begin(MemoryListener *listener) +static void vhost_vdpa_listener_begin_batch(struct vhost_vdpa *v) { - struct vhost_vdpa *v =3D container_of(listener, struct vhost_vdpa, lis= tener); - struct vhost_dev *dev =3D v->dev; - struct vhost_msg_v2 msg =3D {}; int fd =3D v->device_fd; - - if (!(dev->backend_cap & (0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH))) { - return; - } - - msg.type =3D v->msg_type; - msg.iotlb.type =3D VHOST_IOTLB_BATCH_BEGIN; + struct vhost_msg_v2 msg =3D { + .type =3D v->msg_type, + .iotlb.type =3D VHOST_IOTLB_BATCH_BEGIN, + }; =20 if (write(fd, &msg, sizeof(msg)) !=3D sizeof(msg)) { error_report("failed to write, fd=3D%d, errno=3D%d (%s)", @@ -109,6 +103,16 @@ static void vhost_vdpa_listener_begin(MemoryListener *= listener) } } =20 +static void vhost_vdpa_iotlb_batch_begin_once(struct vhost_vdpa *v) +{ + if (v->dev->backend_cap & (0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH) && + !v->iotlb_batch_begin_sent) { + vhost_vdpa_listener_begin_batch(v); + } + + v->iotlb_batch_begin_sent =3D true; +} + static void vhost_vdpa_listener_commit(MemoryListener *listener) { struct vhost_vdpa *v =3D container_of(listener, struct vhost_vdpa, lis= tener); @@ -120,6 +124,10 @@ static void vhost_vdpa_listener_commit(MemoryListener = *listener) return; } =20 + if (!v->iotlb_batch_begin_sent) { + return; + } + msg.type =3D v->msg_type; msg.iotlb.type =3D VHOST_IOTLB_BATCH_END; =20 @@ -127,6 +135,8 @@ static void vhost_vdpa_listener_commit(MemoryListener *= listener) error_report("failed to write, fd=3D%d, errno=3D%d (%s)", fd, errno, strerror(errno)); } + + v->iotlb_batch_begin_sent =3D false; } =20 static void vhost_vdpa_listener_region_add(MemoryListener *listener, @@ -170,6 +180,7 @@ static void vhost_vdpa_listener_region_add(MemoryListen= er *listener, =20 llsize =3D int128_sub(llend, int128_make64(iova)); =20 + vhost_vdpa_iotlb_batch_begin_once(v); ret =3D vhost_vdpa_dma_map(v, iova, int128_get64(llsize), vaddr, section->readonly); if (ret) { @@ -221,6 +232,7 @@ static void vhost_vdpa_listener_region_del(MemoryListen= er *listener, =20 llsize =3D int128_sub(llend, int128_make64(iova)); =20 + vhost_vdpa_iotlb_batch_begin_once(v); ret =3D vhost_vdpa_dma_unmap(v, iova, int128_get64(llsize)); if (ret) { error_report("vhost_vdpa dma unmap error!"); @@ -234,7 +246,6 @@ static void vhost_vdpa_listener_region_del(MemoryListen= er *listener, * depends on the addnop(). */ static const MemoryListener vhost_vdpa_memory_listener =3D { - .begin =3D vhost_vdpa_listener_begin, .commit =3D vhost_vdpa_listener_commit, .region_add =3D vhost_vdpa_listener_region_add, .region_del =3D vhost_vdpa_listener_region_del, --=20 MST From nobody Fri May 3 05:42:18 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=1630791459; cv=none; d=zohomail.com; s=zohoarc; b=MITb0fPkv6btrLGBRIDZs2e6tWRlCyDR697DIjSzLM47RaaiEjFBnY6WihKd9upAbitAb/ypVzsm5/d+Qf5tlfmQIUB0nYcrqOm+U8pHse10pbCZVAYkm3UgyF8dUnbYCdVOFiuNT22/uW7nA/UAQR4aOrioe0sRxySSP8ieC+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630791459; 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=doYK/spK0f25lGEJlA5QHUXT/MrGzKE697ZoiH7sqDc=; b=Zo5leYBpfFn+mxzDUOaqsv4mK/7Rbuu20ic4xzDfV17fNTBIljUojtgORBFrX9vRTXFBIh61/78unjD0stvf6JzAmr+VN0Q92FLSAwO4yH1ymGCP2uwiMojKmg8Bxe93gYyu+33oROANXELYgX0ObVDwgH9ckihcYrr24QCSjhQ= 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 1630791459407336.06369349872614; Sat, 4 Sep 2021 14:37:39 -0700 (PDT) Received: from localhost ([::1]:34238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdM2-0006EF-9L for importer@patchew.org; Sat, 04 Sep 2021 17:37:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKY-0003TM-Rx for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31098) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKX-0000jS-CS for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:06 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-lfBFxvypPpqu9Oqn905APg-1; Sat, 04 Sep 2021 17:36:03 -0400 Received: by mail-ej1-f69.google.com with SMTP id v19-20020a170906b013b02905b2f1bbf8f3so865101ejy.6 for ; Sat, 04 Sep 2021 14:36:03 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id n13sm1523782ejk.97.2021.09.04.14.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791364; 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=doYK/spK0f25lGEJlA5QHUXT/MrGzKE697ZoiH7sqDc=; b=gLn+XnLCeT737OzuOCAQlL7ld2pDhpBc/0mi3Ez6kl5k4NlMer8asvXVzLio6zG7DvTAkm A+JQD6iHyFzFI0akbJGdBYZmuxMIf/ySuIS4kgoOjSal7hUCV+AAiEAQeC6DjYg2tyHvNU rAQfI45kSSS54+jN8L8R/j4b2BVx76I= X-MC-Unique: lfBFxvypPpqu9Oqn905APg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=doYK/spK0f25lGEJlA5QHUXT/MrGzKE697ZoiH7sqDc=; b=mkk/ClPfwuYWoimLzSrlILUnAxAPT8ePuEFABI5KmlsyAOgmdu9Gtgrjys9LQ/o5J6 hD1UgrjkICkHTfXa4xV5NG6WEk+YAV2G2fMKoxKBgKNBz7L9OYYzX6vzWfWnaP4haMp5 UVFE8aTTWop/thZ0+PsaCjEFao3QFEida1sysaY5lx6eoHEFFdvCvASiD3NNRiuP9Ag5 uA8OD8M9hpA4hu/Aiuy6snE3kQjffAOXX6RW3cUrZlQuoobu70MiST15xiu6b2OUTs5G OXDzbG3cD1Xd6S91QzBr/N4BISwEbTrlAca4ackjckPjf4fBhDl/vM5/mseYxOruzRev Fa5w== X-Gm-Message-State: AOAM533DRUek9ofZvhZUBuDup1wnvvyR0xyRATuALQUhdtVFCpLaqf9J aGulV8hIO1UUCobhoxq5lG8hDFB/eAdLzNv56YH4W+U74vtsC7hVepsZDKSnxYF0E/YGbNC8Urc hBynZNl1K9bT0cc5G20TFClPLslsRp5/V3u930N73Bk2xGg7yedKn392Gw0Dx X-Received: by 2002:a17:906:b18e:: with SMTP id w14mr6044199ejy.63.1630791362204; Sat, 04 Sep 2021 14:36:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjqnl++0IXqB1wzzTGxb/qs0Wa02rtRPPHZvBmEqvfUOhJYnQlcf/7pS15pXjtSKCkMU1ffQ== X-Received: by 2002:a17:906:b18e:: with SMTP id w14mr6044181ejy.63.1630791361939; Sat, 04 Sep 2021 14:36:01 -0700 (PDT) Date: Sat, 4 Sep 2021 17:35:59 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 02/35] hw/virtio: Fix leak of host-notifier memory-region Message-ID: <20210904213506.486886-3-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Yajun Wu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630791460821100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yajun Wu If call virtio_queue_set_host_notifier_mr fails, should free host-notifier memory-region. Fixes: 44866521bd ("vhost-user: support registering external host notifiers= ") Signed-off-by: Yajun Wu Message-Id: <1629077555-19907-1-git-send-email-yajunw@nvidia.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 2407836fac..33002300c2 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1474,6 +1474,7 @@ static int vhost_user_slave_handle_vring_host_notifie= r(struct vhost_dev *dev, g_free(name); =20 if (virtio_queue_set_host_notifier_mr(vdev, queue_idx, &n->mr, true)) { + object_unparent(OBJECT(&n->mr)); munmap(addr, page_size); return -1; } --=20 MST From nobody Fri May 3 05:42:18 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 1630791469179667.8184188220151; Sat, 4 Sep 2021 14:37:49 -0700 (PDT) Received: from localhost ([::1]:34634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdMB-0006Ue-VT for importer@patchew.org; Sat, 04 Sep 2021 17:37:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKc-0003ZR-9n for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKa-0000lV-AZ for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:10 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-dRW1tzFtOfuqENl7PfvUYg-1; Sat, 04 Sep 2021 17:36:06 -0400 Received: by mail-ed1-f72.google.com with SMTP id j13-20020aa7ca4d000000b003c44c679d73so1500813edt.8 for ; Sat, 04 Sep 2021 14:36:06 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id r22sm1537264ejj.91.2021.09.04.14.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791367; 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=3NXmvXOOKi/tunk/Hq6HEtfFMZdnhsYQiE7ckdleGA4=; b=Blv2ldGq0k0D0mkl4iV4fhYlBC9ec42q+ZGIBiHzSsV7JhwF4AVih3jplU3tE+pMjkr5l5 83ygGFaPDSwr6QHicwZqRuYsUBZyiSD9ihmeifE9e4jfPYRGqeImF/kizufDRmblOqt4RJ tv6HSJFggNUxfkGPKh02NBjwrSJQ3C8= X-MC-Unique: dRW1tzFtOfuqENl7PfvUYg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3NXmvXOOKi/tunk/Hq6HEtfFMZdnhsYQiE7ckdleGA4=; b=c0sVlzke8qsJ5QzLMeVu6qhQFooYKhy6QjK+s5Dn8M34r7KkW+Sd4OaueJRO9EsDsZ YUAQBmqeybpLFMFSZREZbwvjEdwYKQzthJzBeqJM1R6I8WPW1J37t5EpV124nwYQwEmr jpq9RCQwlTRIb1l2+s/9FB678ROSU1vz2oNNVMUP5jNij8QAXW7XMQSdroPUotYU/8wL pmeu+33aToBHsJWCrRYlGSjCrGJFtXgNa1JUXOZJFmwbvnHRqJm7GoxQtZlLD5jjFVEH PCd9C85OKlwCAr4BIQLAtHiFBWt52IU30WrlRaf7NR/goSVVe7evfSE5J59vavKAAy9r wvEQ== X-Gm-Message-State: AOAM530f7yz6V7q9U9/J+lseb52EIP2AOFALExy6oJKk4vL1GjAZZp8i 01zIZSZOofEmdsojfcpMwzgoham9YXG3xjUNButXlbWJnxjGem5g9FqFkoiaYS8vSmLKVw52DGi yIvXR0ZtMwiUvbcWUXUs9L0yC2caJfvy6dJIJIeLP+HH+jPUgjCXaxQsoDldB X-Received: by 2002:a17:906:d8ce:: with SMTP id re14mr5722685ejb.364.1630791364839; Sat, 04 Sep 2021 14:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWeVAzqfo3+eFTi3ei5TCBtFrbVe7pAtKW5lxy9IhPnoTJRWfEuZPA9loiumVURc1r15KOMw== X-Received: by 2002:a17:906:d8ce:: with SMTP id re14mr5722671ejb.364.1630791364614; Sat, 04 Sep 2021 14:36:04 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:02 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 03/35] vhost: make SET_VRING_ADDR, SET_FEATURES send replies Message-ID: <20210904213506.486886-4-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Denis Plotnikov , Peter Maydell 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: 1630791470932100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Denis Plotnikov On vhost-user-blk migration, qemu normally sends a number of commands to enable logging if VHOST_USER_PROTOCOL_F_LOG_SHMFD is negotiated. Qemu sends VHOST_USER_SET_FEATURES to enable buffers logging and VHOST_USER_SET_VRING_ADDR per each started ring to enable "used ring" data logging. The issue is that qemu doesn't wait for reply from the vhost daemon for these commands which may result in races between qemu expectation of logging starting and actual login starting in vhost daemon. The race can appear as follows: on migration setup, qemu enables dirty page logging by sending VHOST_USER_SET_FEATURES. The command doesn't arrive to a vhost-user-blk daemon immediately and the daemon needs some time to turn the logging on internally. If qemu doesn't wait for reply, after sending the command, qemu may start migrateing memory pages to a destination. At this t= ime, the logging may not be actually turned on in the daemon but some guest page= s, which the daemon is about to write to, may have already been transferred without logging to the destination. Since the logging wasn't turned on, those pages won't be transferred again as dirty. So we may end up with corrupted data on the destination. The same scenario is applicable for "used ring" data logging, which is turned on with VHOST_USER_SET_VRING_ADDR command. To resolve this issue, this patch makes qemu wait for the command result explicitly if VHOST_USER_PROTOCOL_F_REPLY_ACK is negotiated and logging ena= bled. Signed-off-by: Denis Plotnikov Message-Id: <20210809104824.78830-1-den-plotnikov@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 145 ++++++++++++++++++++++++++++------------- 1 file changed, 101 insertions(+), 44 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 33002300c2..a4eb6cde7e 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1095,23 +1095,6 @@ static int vhost_user_set_mem_table(struct vhost_dev= *dev, return 0; } =20 -static int vhost_user_set_vring_addr(struct vhost_dev *dev, - struct vhost_vring_addr *addr) -{ - VhostUserMsg msg =3D { - .hdr.request =3D VHOST_USER_SET_VRING_ADDR, - .hdr.flags =3D VHOST_USER_VERSION, - .payload.addr =3D *addr, - .hdr.size =3D sizeof(msg.payload.addr), - }; - - if (vhost_user_write(dev, &msg, NULL, 0) < 0) { - return -1; - } - - return 0; -} - static int vhost_user_set_vring_endian(struct vhost_dev *dev, struct vhost_vring_state *ring) { @@ -1288,33 +1271,6 @@ static int vhost_user_set_vring_call(struct vhost_de= v *dev, return vhost_set_vring_file(dev, VHOST_USER_SET_VRING_CALL, file); } =20 -static int vhost_user_set_u64(struct vhost_dev *dev, int request, uint64_t= u64) -{ - VhostUserMsg msg =3D { - .hdr.request =3D request, - .hdr.flags =3D VHOST_USER_VERSION, - .payload.u64 =3D u64, - .hdr.size =3D sizeof(msg.payload.u64), - }; - - if (vhost_user_write(dev, &msg, NULL, 0) < 0) { - return -1; - } - - return 0; -} - -static int vhost_user_set_features(struct vhost_dev *dev, - uint64_t features) -{ - return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, features); -} - -static int vhost_user_set_protocol_features(struct vhost_dev *dev, - uint64_t features) -{ - return vhost_user_set_u64(dev, VHOST_USER_SET_PROTOCOL_FEATURES, featu= res); -} =20 static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t= *u64) { @@ -1360,6 +1316,107 @@ static int vhost_user_get_features(struct vhost_dev= *dev, uint64_t *features) return 0; } =20 +static int enforce_reply(struct vhost_dev *dev, + const VhostUserMsg *msg) +{ + uint64_t dummy; + + if (msg->hdr.flags & VHOST_USER_NEED_REPLY_MASK) { + return process_message_reply(dev, msg); + } + + /* + * We need to wait for a reply but the backend does not + * support replies for the command we just sent. + * Send VHOST_USER_GET_FEATURES which makes all backends + * send a reply. + */ + return vhost_user_get_features(dev, &dummy); +} + +static int vhost_user_set_vring_addr(struct vhost_dev *dev, + struct vhost_vring_addr *addr) +{ + VhostUserMsg msg =3D { + .hdr.request =3D VHOST_USER_SET_VRING_ADDR, + .hdr.flags =3D VHOST_USER_VERSION, + .payload.addr =3D *addr, + .hdr.size =3D sizeof(msg.payload.addr), + }; + + bool reply_supported =3D virtio_has_feature(dev->protocol_features, + VHOST_USER_PROTOCOL_F_REPLY_= ACK); + + /* + * wait for a reply if logging is enabled to make sure + * backend is actually logging changes + */ + bool wait_for_reply =3D addr->flags & (1 << VHOST_VRING_F_LOG); + + if (reply_supported && wait_for_reply) { + msg.hdr.flags |=3D VHOST_USER_NEED_REPLY_MASK; + } + + if (vhost_user_write(dev, &msg, NULL, 0) < 0) { + return -1; + } + + if (wait_for_reply) { + return enforce_reply(dev, &msg); + } + + return 0; +} + +static int vhost_user_set_u64(struct vhost_dev *dev, int request, uint64_t= u64, + bool wait_for_reply) +{ + VhostUserMsg msg =3D { + .hdr.request =3D request, + .hdr.flags =3D VHOST_USER_VERSION, + .payload.u64 =3D u64, + .hdr.size =3D sizeof(msg.payload.u64), + }; + + if (wait_for_reply) { + bool reply_supported =3D virtio_has_feature(dev->protocol_features, + VHOST_USER_PROTOCOL_F_REPLY_ACK); + if (reply_supported) { + msg.hdr.flags |=3D VHOST_USER_NEED_REPLY_MASK; + } + } + + if (vhost_user_write(dev, &msg, NULL, 0) < 0) { + return -1; + } + + if (wait_for_reply) { + return enforce_reply(dev, &msg); + } + + return 0; +} + +static int vhost_user_set_features(struct vhost_dev *dev, + uint64_t features) +{ + /* + * wait for a reply if logging is enabled to make sure + * backend is actually logging changes + */ + bool log_enabled =3D features & (0x1ULL << VHOST_F_LOG_ALL); + + return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, features, + log_enabled); +} + +static int vhost_user_set_protocol_features(struct vhost_dev *dev, + uint64_t features) +{ + return vhost_user_set_u64(dev, VHOST_USER_SET_PROTOCOL_FEATURES, featu= res, + false); +} + static int vhost_user_set_owner(struct vhost_dev *dev) { VhostUserMsg msg =3D { --=20 MST From nobody Fri May 3 05:42:18 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 1630791578113401.2438476657004; Sat, 4 Sep 2021 14:39:38 -0700 (PDT) Received: from localhost ([::1]:43040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdNx-0003o2-5O for importer@patchew.org; Sat, 04 Sep 2021 17:39:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKf-0003jg-UB for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKe-0000oB-9N for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:13 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-trMns-AqPgW16SsjsM_FJg-1; Sat, 04 Sep 2021 17:36:10 -0400 Received: by mail-ej1-f72.google.com with SMTP id bi9-20020a170906a24900b005c74b30ff24so865153ejb.5 for ; Sat, 04 Sep 2021 14:36:10 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id e22sm1923376edu.35.2021.09.04.14.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791371; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VYHzA7budtkHT237yd0sQgTDt9WNd03nKuIvCS+MnNE=; b=azHDe6swDx0pKz3a4wgX4Fx8+ywVuegjMQWEvaPwEMXB+EBooYDjWBQtk1bVLgrk2m2GoO etcX8WKsbyZ6gLNKvDz2tb+zcb3abjFWALMwLf5Jm3fBBhos4JbxCl6r5ZcDaNTO8pwbjT sosatFBCUSXhqdP/ZjAELuBa/jL2cFI= X-MC-Unique: trMns-AqPgW16SsjsM_FJg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=VYHzA7budtkHT237yd0sQgTDt9WNd03nKuIvCS+MnNE=; b=X0GSGmHANFklBJsXuhVzbsqLHLuGIOTzwdhipuyKXQNX0jqyJhY2/0rBmlCIPcx80o 27X/UHNF8LCh/R+0MOK/rMpWsMXaG85oRv6YM3AMcifA7SIWdi0cCm7XHIBiuwTc62KQ cib0wcc62iJX1E1W2CGYlHlnTNXyp2EL4EJk6qZ8jTMenTlD56dvN8LxIs1r8pwmMyHA +KZiaSSO1mQLMnd68s2NAii6W/e5qJardzZjjPgqYKzaJNjX1SYT7xE9h+ma1GbFqZMf yfuFEGhHivsrpdbjkuEJq7yGIFOA33rr0fTxtDoVXilakp6mGx8lIz0DrFBS+YyXO8Qa JcvQ== X-Gm-Message-State: AOAM530DSZ+i93gPksrQHVUPM1JTKv39YU9OzVB1UKMhFeOoEas65JFM EKlRV1cCqt8Hgfj6ovNpG3rPtzZx9eRd6mUqWg/Id3TmFeU+tFgywmbBT2rXQEpzppLf4WooxKU BfW5aycKwfVOuvO8IHw7xa5lzoSlLNUjIlEeXWiYzRgyqDz/Vm5a8q4qAcHjE X-Received: by 2002:a17:906:7848:: with SMTP id p8mr6018815ejm.212.1630791369006; Sat, 04 Sep 2021 14:36:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXJ7NKx63JhEM7bjcrhbnsrs6qPQvpjSmzkA1S+MukIFv2ahlOovDq0IGKdabR1wrSo6RVVQ== X-Received: by 2002:a17:906:7848:: with SMTP id p8mr6018792ejm.212.1630791368796; Sat, 04 Sep 2021 14:36:08 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:04 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 04/35] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place Message-ID: <20210904213506.486886-5-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Richard Henderson , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Paolo Bonzini , Ani Sinha , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Aurelien Jarno 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: 1630791580355100001 From: Ani Sinha Now that we have "acpi-pci-hotplug-with-bridge-support" PIIX4 PM property b= eing used for both q35 and i440fx machine types, it is better that we defined th= is property string at a single place within a header file like other PIIX4 properties. We can then use this single definition at all the places that n= eeds it instead of duplicating the string everywhere. While at it, this change a= lso adds a definition for "acpi-root-pci-hotplug" PIIX4 PM property and uses this definition at all places that were formally using the string value. Signed-off-by: Ani Sinha Message-Id: <20210816083214.105740-1-ani@anisinha.ca> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/acpi.h | 2 ++ hw/acpi/ich9.c | 2 +- hw/acpi/piix4.c | 4 ++-- hw/i386/acpi-build.c | 4 ++-- hw/i386/pc.c | 4 ++-- hw/i386/pc_q35.c | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h index 9e8a76f2e2..cc0d370745 100644 --- a/include/hw/acpi/acpi.h +++ b/include/hw/acpi/acpi.h @@ -47,6 +47,8 @@ #define ACPI_PM_PROP_PM_IO_BASE "pm_io_base" #define ACPI_PM_PROP_GPE0_BLK "gpe0_blk" #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len" +#define ACPI_PM_PROP_ACPI_PCIHP_BRIDGE "acpi-pci-hotplug-with-bridge-suppo= rt" +#define ACPI_PM_PROP_ACPI_PCI_ROOTHP "acpi-root-pci-hotplug" =20 /* PM Timer ticks per second (HZ) */ #define PM_TIMER_FREQUENCY 3579545 diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 778e27b659..1ee2ba2c50 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -451,7 +451,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED, ich9_pm_get_enable_tco, ich9_pm_set_enable_tco); - object_property_add_bool(obj, "acpi-pci-hotplug-with-bridge-support", + object_property_add_bool(obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, ich9_pm_get_acpi_pci_hotplug, ich9_pm_set_acpi_pci_hotplug); } diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 48f7a1edbc..f0b5fac44a 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -647,9 +647,9 @@ static Property piix4_pm_properties[] =3D { DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, = 0), DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, = 0), DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2), - DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState, + DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, PIIX4PMState, use_acpi_hotplug_bridge, true), - DEFINE_PROP_BOOL("acpi-root-pci-hotplug", PIIX4PMState, + DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCI_ROOTHP, PIIX4PMState, use_acpi_root_pci_hotplug, true), DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState, acpi_memory_hotplug.is_enabled, true), diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a33ac8b91e..6c27e12e2a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -267,10 +267,10 @@ static void acpi_get_pm_info(MachineState *machine, A= cpiPmInfo *pm) qobject_unref(o); =20 pm->pcihp_bridge_en =3D - object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-suppor= t", + object_property_get_bool(obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, NULL); pm->pcihp_root_en =3D - object_property_get_bool(obj, "acpi-root-pci-hotplug", + object_property_get_bool(obj, ACPI_PM_PROP_ACPI_PCI_ROOTHP, NULL); } =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1276bfeee4..22aa598d50 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -101,7 +101,7 @@ GlobalProperty pc_compat_6_0[] =3D { { "qemu64" "-" TYPE_X86_CPU, "model", "6" }, { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, - { "ICH9-LPC", "acpi-pci-hotplug-with-bridge-support", "off" }, + { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, }; const size_t pc_compat_6_0_len =3D G_N_ELEMENTS(pc_compat_6_0); =20 @@ -313,7 +313,7 @@ const size_t pc_compat_2_0_len =3D G_N_ELEMENTS(pc_comp= at_2_0); GlobalProperty pc_compat_1_7[] =3D { PC_CPU_MODEL_IDS("1.7.0") { TYPE_USB_DEVICE, "msos-desc", "no" }, - { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" }, + { "PIIX4_PM", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, { "hpet", HPET_INTCAP, "4" }, }; const size_t pc_compat_1_7_len =3D G_N_ELEMENTS(pc_compat_1_7); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 565fadce54..46cd542d17 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -238,7 +238,7 @@ static void pc_q35_init(MachineState *machine) OBJECT(lpc), &error_abort); =20 acpi_pcihp =3D object_property_get_bool(OBJECT(lpc), - "acpi-pci-hotplug-with-bridge-su= pport", + ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, NULL); =20 if (acpi_pcihp) { --=20 MST From nobody Fri May 3 05:42:18 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 163079148171533.920425446712215; Sat, 4 Sep 2021 14:38:01 -0700 (PDT) Received: from localhost ([::1]:35338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdMO-0006y5-Kl for importer@patchew.org; Sat, 04 Sep 2021 17:38:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKj-0003sf-1g for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKh-0000qV-EY for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:16 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-0QDGEXOjPNGGQNu-PYboNw-1; Sat, 04 Sep 2021 17:36:13 -0400 Received: by mail-ed1-f70.google.com with SMTP id y19-20020a056402441300b003cd8ce2b987so1499933eda.6 for ; Sat, 04 Sep 2021 14:36:13 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id gz22sm1551201ejb.15.2021.09.04.14.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791374; 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=nhVlr8z9JFFPqYkwW9X45ltc35AYn16o3eufQ5sbAy0=; b=iD4xyiUJZHZBAZ3rYcFu29+EPOi1jZzT0XBtUHs41qaBU4Mz6lljOE6MPY6bcZG/iPIoYF GBN52CMcASxQOlceD2mAyfIeKM7aRtgs+j0XeEB+ZDGhjxO8CxicA8spuX43qH5T3eTYvs /Jc+N+4qEGpqmid5pd+XfrlayvoT+NA= X-MC-Unique: 0QDGEXOjPNGGQNu-PYboNw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nhVlr8z9JFFPqYkwW9X45ltc35AYn16o3eufQ5sbAy0=; b=LQZ0vSuJurbWe/UVIR0Cbsa6jZ9DWb3Nri/1xgRUT2pwmQNvZk9G9ppRVjkEI/mGSF i04h+0xm0Ru8O8+fyOgr2s0YxKYVZF4zoBeO8RWH9J31NqciE28n7/VvnPtwkVn+kS6q 8EqMuTQxgq3ODkgjR5GVKdmiEs9Tf4oR7Vn7qsErx1B8mfVKjuJcAbA6YnSsGM5tmomw h52DHMpgYL7/jIfAgQdpf0zjfYyNXE66OP7nu1VTtmxM92v0RcRJogN438wHxxL4fEMn bBEwwFAYDZuUSVmbwMtkqfcoj7Hx++V2iFsDlh5VdtzOzsKuREXXvewnV4+jGbzWm7mZ k8EQ== X-Gm-Message-State: AOAM5320qEW3MeurEi/xw5tcKX0eWxC16Y6xy7fa8FndhYfC9epRdgnH IbyaVk2yZB5a0BIl2dem4ASa6WAgL/s+byhVuudM1gr0PuN7WuwRuMg6Ac3tTUgH0auZhpFgeu9 e0Y3BkURkNKR0+oGF09OzFVKFnbnP5pzEjk562aTfzssJqOVDUZPsPWJRG0ju X-Received: by 2002:a17:906:8297:: with SMTP id h23mr6069282ejx.168.1630791372077; Sat, 04 Sep 2021 14:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOGVVHQVa5FMlRH/cwG/wkzyPPXHLT9XOZxMLClat8vx8vu31FcGP6FEf1zKCloM7UFfimzw== X-Received: by 2002:a17:906:8297:: with SMTP id h23mr6069266ejx.168.1630791371865; Sat, 04 Sep 2021 14:36:11 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 05/35] q35: catch invalid cpu hotplug configuration Message-ID: <20210904213506.486886-6-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Gerd Hoffmann , Igor Mammedov 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: 1630791482977100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Gerd Hoffmann Related: https://bugzilla.redhat.com//show_bug.cgi?id=3D1985924 Signed-off-by: Gerd Hoffmann Message-Id: <20210812102341.3316254-1-kraxel@redhat.com> Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/isa/lpc_ich9.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 5f9de0239c..5f143dca17 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -31,6 +31,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" +#include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/range.h" #include "hw/isa/isa.h" @@ -676,6 +677,18 @@ static void ich9_lpc_realize(PCIDevice *d, Error **err= p) DeviceState *dev =3D DEVICE(d); ISABus *isa_bus; =20 + if ((lpc->smi_host_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BI= T)) && + !(lpc->smi_host_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT)= )) { + /* + * smi_features_ok_callback() throws an error on this. + * + * So bail out here instead of advertizing the invalid + * configuration and get obscure firmware failures from that. + */ + error_setg(errp, "cpu hot-unplug requires cpu hot-plug"); + return; + } + isa_bus =3D isa_bus_new(DEVICE(d), get_system_memory(), get_system_io(= ), errp); if (!isa_bus) { --=20 MST From nobody Fri May 3 05:42:18 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 1630791722350491.42593692618823; Sat, 4 Sep 2021 14:42:02 -0700 (PDT) Received: from localhost ([::1]:51330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdQH-00013W-9R for importer@patchew.org; Sat, 04 Sep 2021 17:42:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKn-00047f-7e for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKk-0000t7-RO for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:20 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-298-cJzueab5PTCNZxlRphKk8A-1; Sat, 04 Sep 2021 17:36:17 -0400 Received: by mail-ed1-f72.google.com with SMTP id b8-20020a056402350800b003c5e3d4e2a7so1508422edd.2 for ; Sat, 04 Sep 2021 14:36:16 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id lm21sm1526471ejb.58.2021.09.04.14.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791378; 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=MQoIZJyFdMdY94hp3DrB3LttB4+tU2elDC8nXR7x6VQ=; b=dRbECr/eMELv+Pg1xg6dciDCAVde/HgMVosjE1iTVlUVneqxy3m2HM4gnCPST/Zp63J0m7 5jTA+ahVKPfgUVOHY1S6yuUcpdQLSfE3MKXrtJvrsWeGKdvbDOpBL/JnXxlq1ySyOgqUgm jNo5/PNP0wC6paoj2r2IqxmTZ1oZOlY= X-MC-Unique: cJzueab5PTCNZxlRphKk8A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MQoIZJyFdMdY94hp3DrB3LttB4+tU2elDC8nXR7x6VQ=; b=FlDKAflIycT8T6EuOtLDSetzhp1v7yzlIXBun1ZjYbSwSXN8Js4tsKWFttf2yibFv0 fDoaHg8eMV1L/ZMEuSpgIowvHq5VIQvOuq4UDvwfdAdWjM1bapsU/VoDm56+JO/NSZ4I aT9FPOgy5KR2UmJ4qeHhZII/j0773At2T9pDVK8ZnM2hozP/WijKyQpRHJtAX9tzIBGp MlLVrqtGSB8M7iqDTtvSj55ZeMfQbO+cPefQ5EudtxwPPgu5FtIfvpn5BZlPPabLDsaS oFBYdWrNLw175HhFK+kb1zPlpJfbWIUxsF57kYEjPewg8WMRPBZaHzZRdd8e91Ywl15Z mo0Q== X-Gm-Message-State: AOAM532i/ASYoK6rws3vlI4VjHXpS9I0Ot/b0r6WYbdrultp0DzVOYRw IhxT/rDWhNs/xWuUmsjb5ZgxCDdNaRr258FXzj1JIF5ucSuujE+kocUAHzSBvAKvB5KPEq9nVOr 8yaHAcPG6S/7bABwUNopD7+hLLu13EvRexWi6actMZ/5diRndyoqhwzoEdoIZ X-Received: by 2002:a17:906:d057:: with SMTP id bo23mr6015501ejb.208.1630791375425; Sat, 04 Sep 2021 14:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5Qud6wVMK513eGB4fzWeB94mvPqCHn/afnvilM8vOTF1gA2FV1jb8v/73LkW9raOTYy64DQ== X-Received: by 2002:a17:906:d057:: with SMTP id bo23mr6015474ejb.208.1630791375048; Sat, 04 Sep 2021 14:36:15 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:12 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need Message-ID: <20210904213506.486886-7-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Rikalo , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Ani Sinha , Igor Mammedov , Aurelien Jarno 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: 1630791723879100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ani Sinha Currently various acpi hotplug modules like cpu hotplug, memory hotplug, pci hotplug, nvdimm hotplug are all pulled in when CONFIG_ACPI_X86 is turned on. This brings in support for whole lot of subsystems that some targets like mips does not need. They are added just to satisfy symbol dependencies. This is ugly and should be avoided. Targets should be able to pull in just what = they need and no more. For example, mips only needs support for PIIX4 and does n= ot need acpi pci hotplug support or cpu hotplug support or memory hotplug supp= ort etc. This change is an effort to clean this up. In this change, new config variables are added for various acpi hotplug subsystems. Targets like mips can only enable PIIX4 support and not the rest of all the other modules which were being previously pulled in as a part of CONFIG_ACPI_X86. Function stubs make sure that symbols which piix4 needs but are not required by mips (for example, symbols specific to pci hotplug etc) are available to satisfy the dependencies. Currently, this change only addresses issues with mips malta targets. In fu= ture we might be able to clean up other targets which are similarly pulling in l= ot of unnecessary hotplug modules by enabling ACPI_X86. This change should also address issues such as the following: https://gitlab.com/qemu-project/qemu/-/issues/221 https://gitlab.com/qemu-project/qemu/-/issues/193 Signed-off-by: Ani Sinha Message-Id: <20210812071409.492299-1-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- configs/devices/mips-softmmu/common.mak | 5 +-- hw/acpi/acpi-cpu-hotplug-stub.c | 50 +++++++++++++++++++++++++ hw/acpi/acpi-mem-hotplug-stub.c | 35 +++++++++++++++++ hw/acpi/acpi-nvdimm-stub.c | 8 ++++ hw/acpi/acpi-pci-hotplug-stub.c | 47 +++++++++++++++++++++++ hw/acpi/Kconfig | 10 +++++ hw/acpi/meson.build | 14 +++++-- 7 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 hw/acpi/acpi-cpu-hotplug-stub.c create mode 100644 hw/acpi/acpi-mem-hotplug-stub.c create mode 100644 hw/acpi/acpi-nvdimm-stub.c create mode 100644 hw/acpi/acpi-pci-hotplug-stub.c diff --git a/configs/devices/mips-softmmu/common.mak b/configs/devices/mips= -softmmu/common.mak index ea78fe7275..752b62b1e6 100644 --- a/configs/devices/mips-softmmu/common.mak +++ b/configs/devices/mips-softmmu/common.mak @@ -18,10 +18,7 @@ CONFIG_PCSPK=3Dy CONFIG_PCKBD=3Dy CONFIG_FDC=3Dy CONFIG_ACPI=3Dy -CONFIG_ACPI_X86=3Dy -CONFIG_ACPI_MEMORY_HOTPLUG=3Dy -CONFIG_ACPI_NVDIMM=3Dy -CONFIG_ACPI_CPU_HOTPLUG=3Dy +CONFIG_ACPI_PIIX4=3Dy CONFIG_APM=3Dy CONFIG_I8257=3Dy CONFIG_PIIX4=3Dy diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stu= b.c new file mode 100644 index 0000000000..3fc4b14c26 --- /dev/null +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -0,0 +1,50 @@ +#include "qemu/osdep.h" +#include "hw/acpi/cpu_hotplug.h" +#include "migration/vmstate.h" + + +/* Following stubs are all related to ACPI cpu hotplug */ +const VMStateDescription vmstate_cpu_hotplug; + +void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, + CPUHotplugState *cpuhp_state, + uint16_t io_port) +{ + return; +} + +void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, + AcpiCpuHotplug *gpe_cpu, uint16_t base) +{ + return; +} + +void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list) +{ + return; +} + +void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, + CPUHotplugState *cpu_st, DeviceState *dev, Error **e= rrp) +{ + return; +} + +void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, + AcpiCpuHotplug *g, DeviceState *dev, Error **= errp) +{ + return; +} + +void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, + DeviceState *dev, Error **errp) +{ + return; +} + +void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, + CPUHotplugState *cpu_st, + DeviceState *dev, Error **errp) +{ + return; +} diff --git a/hw/acpi/acpi-mem-hotplug-stub.c b/hw/acpi/acpi-mem-hotplug-stu= b.c new file mode 100644 index 0000000000..73a076a265 --- /dev/null +++ b/hw/acpi/acpi-mem-hotplug-stub.c @@ -0,0 +1,35 @@ +#include "qemu/osdep.h" +#include "hw/acpi/memory_hotplug.h" +#include "migration/vmstate.h" + +const VMStateDescription vmstate_memory_hotplug; + +void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner, + MemHotplugState *state, hwaddr io_base) +{ + return; +} + +void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***l= ist) +{ + return; +} + +void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem= _st, + DeviceState *dev, Error **errp) +{ + return; +} + +void acpi_memory_unplug_cb(MemHotplugState *mem_st, + DeviceState *dev, Error **errp) +{ + return; +} + +void acpi_memory_unplug_request_cb(HotplugHandler *hotplug_dev, + MemHotplugState *mem_st, + DeviceState *dev, Error **errp) +{ + return; +} diff --git a/hw/acpi/acpi-nvdimm-stub.c b/hw/acpi/acpi-nvdimm-stub.c new file mode 100644 index 0000000000..8baff9be6f --- /dev/null +++ b/hw/acpi/acpi-nvdimm-stub.c @@ -0,0 +1,8 @@ +#include "qemu/osdep.h" +#include "hw/mem/nvdimm.h" +#include "hw/hotplug.h" + +void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev) +{ + return; +} diff --git a/hw/acpi/acpi-pci-hotplug-stub.c b/hw/acpi/acpi-pci-hotplug-stu= b.c new file mode 100644 index 0000000000..734e4c5986 --- /dev/null +++ b/hw/acpi/acpi-pci-hotplug-stub.c @@ -0,0 +1,47 @@ +#include "qemu/osdep.h" +#include "hw/acpi/pcihp.h" +#include "migration/vmstate.h" + +const VMStateDescription vmstate_acpi_pcihp_pci_status; + +void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus, + MemoryRegion *address_space_io, bool bridges_enabled, + uint16_t io_base) +{ + return; +} + +void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState= *s, + DeviceState *dev, Error **errp) +{ + return; +} + +void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) +{ + return; +} + +void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpSta= te *s, + DeviceState *dev, Error **errp) +{ + return; +} + +void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev, + AcpiPciHpState *s, DeviceState *d= ev, + Error **errp) +{ + return; +} + +void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off) +{ + return; +} + +bool vmstate_acpi_pcihp_use_acpi_index(void *opaque, int version_id) +{ + return false; +} diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index cfc4ede8d9..3b5e118c54 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -8,6 +8,8 @@ config ACPI_X86 select ACPI_CPU_HOTPLUG select ACPI_MEMORY_HOTPLUG select ACPI_HMAT + select ACPI_PIIX4 + select ACPI_PCIHP =20 config ACPI_X86_ICH bool @@ -24,6 +26,14 @@ config ACPI_NVDIMM bool depends on ACPI =20 +config ACPI_PIIX4 + bool + depends on ACPI + +config ACPI_PCIHP + bool + depends on ACPI + config ACPI_HMAT bool depends on ACPI diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index 29f804d13e..7d8c0eb43e 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -6,16 +6,20 @@ acpi_ss.add(files( 'core.c', 'utils.c', )) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu_hotplug.c= ')) +acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c', 'cpu_= hotplug.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hot= plug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hot= plug.c')) +acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-= hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_true: files('nvdimm.c')) +acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_false: files('acpi-nvdimm-stub.= c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_= device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: = files('ghes-stub.c')) -acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('piix4.c', 'pcihp.c')) +acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) +acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) +acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-s= tub.c')) acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files= ('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) @@ -23,4 +27,6 @@ acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-bu= ild-stub.c', 'ghes-stub.c')) softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-buil= d-stub.c', - 'acpi-x86-stub.c', 'ipmi= -stub.c', 'ghes-stub.c')) + 'acpi-x86-stub.c', 'ipmi= -stub.c', 'ghes-stub.c', + 'acpi-mem-hotplug-stub.c= ', 'acpi-cpu-hotplug-stub.c', + 'acpi-pci-hotplug-stub.c= ', 'acpi-nvdimm-stub.c')) --=20 MST From nobody Fri May 3 05:42:18 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=1630791588; cv=none; d=zohomail.com; s=zohoarc; b=aSWCXe4Jc6HsC7/T1ymPid2lVpIiLrwHYNsZ4KrZg/imTZTlegbdUjW5Db7Wk5Djsp/DSF7MDQYE9GweDd5yBprfXsY3OazlOv4Nhd+i6i4WGUkM1Umy/uWGrszJ4pM+XO/lUmlnLPzuAd0aoiV4XQF+VM74YOEM2MoeZycCPKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630791588; 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=hCHwqKgJMHDZmaFu4SqI/1mhtVjkcBxwofkmJYkzfzI=; b=ZT54/7YTSwaY4I14kGWY7lFYHmpJ1we/+mQvekIQ2/1GbLvvCMER5LlJnP0lEqQpXg9m8E+fNZm2eFzCdtZb99KoKm6TzgCOC5NwEZtlMZphJmCIu0Io+CLHdo9o/hnhHaOsugqNF2mTUtZYn3p6YeG9AC7weAccrUBKWTQaXLA= 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 1630791588622810.2423005287785; Sat, 4 Sep 2021 14:39:48 -0700 (PDT) Received: from localhost ([::1]:43900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdO7-0004PL-Jz for importer@patchew.org; Sat, 04 Sep 2021 17:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKp-0004GF-Ca for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKn-0000uC-Gy for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:23 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-pfY5MHZtMoGjEVrg8VWOrQ-1; Sat, 04 Sep 2021 17:36:19 -0400 Received: by mail-ed1-f70.google.com with SMTP id g4-20020a056402180400b003c2e8da869bso1497039edy.13 for ; Sat, 04 Sep 2021 14:36:19 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id di15sm1896963edb.20.2021.09.04.14.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791380; 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=hCHwqKgJMHDZmaFu4SqI/1mhtVjkcBxwofkmJYkzfzI=; b=dJJvUsd4Sdl/PBsnw1OHHlMpXG0bHr0bD5J05MdkFZ7xhmaVdFtL6Teo/0k/c7gomivNFJ Jm76n+egUEUzXtN+Dhk69IqkPLns0HNQsF9cuwgmvymIlSMBt06fP52RMUYO5OfSV/k5MT CwkbPlvatRXKqzFf9npBqY4FBYkpDUI= X-MC-Unique: pfY5MHZtMoGjEVrg8VWOrQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hCHwqKgJMHDZmaFu4SqI/1mhtVjkcBxwofkmJYkzfzI=; b=EOOISqBnVV3OO7XaTFvTiww7g9ugR5NWC3Cb/N8blHuTwGe8jNtfgXstxKY7z4i+9g l4SQ69zUCWrLEocoZlC91TKiMDH6E0L+ERmaB060ZKINUzZGLGH1QJRXwJjGQk47HnJ7 iDcIy3cp1qBm4t74P4jSUpQ3hoPfj09OQDCNomHu5GilRv8sYRUpxy36M6iYt5gweroZ wa7ZVyoXthHoXke+v4L4MYrjDqq8NrYeE/BjbvKMQxgivP8V+6HQXFoePt/QuAMfmRjf D/ktMufeyRvEKSnBExHVFi6KB8moCFAHIImWSDrdPW/KCssKuTH3lQWH2HqVFTWffoa1 tUBQ== X-Gm-Message-State: AOAM530AqD9bZhuJcdYdDbaEVfHVMdpYnI6wzlrWAnjFIaBAYS3IL95i V8hLps3r9tkgrsAwXjc9GVykwBSivx3p1e8dOPDYATcZStXXklHEVQVRuPGAI2uSpHY2PEQZJpL AO5xXMXOhFUdatjy+VKFWoDljkXJ9lG850KTBR72mfjvAP5l3Q/oXi3XleD/J X-Received: by 2002:a05:6402:283:: with SMTP id l3mr5785938edv.399.1630791377997; Sat, 04 Sep 2021 14:36:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXdwNbyvJelmThR11+A0qztkKm57qJDrrQuMMU2Wq3j/Oq0QaNfkIV9uV78p4M3zN5smlSXg== X-Received: by 2002:a05:6402:283:: with SMTP id l3mr5785927edv.399.1630791377832; Sat, 04 Sep 2021 14:36:17 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:15 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 07/35] hw/virtio: move vhost_set_backend_type() to vhost.c Message-ID: <20210904213506.486886-8-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Tiberiu Georgescu , Raphael Norwitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630791590572100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Tiberiu Georgescu Just a small refactor patch. vhost_set_backend_type() gets called only in vhost.c, so we can move the function there and make it static. We can then extern the visibility of kernel_ops, to match the other VhostOps in vhost-backend.h. The VhostOps constants now make more sense in vhost.h Suggested-by: Raphael Norwitz Signed-off-by: Tiberiu Georgescu Message-Id: <20210809134015.67941-1-tiberiu.georgescu@nutanix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-backend.h | 6 ------ include/hw/virtio/vhost.h | 4 ++++ hw/virtio/vhost-backend.c | 30 +----------------------------- hw/virtio/vhost.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 35 deletions(-) diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-ba= ckend.h index 8475c5a29d..81bf3109f8 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -173,12 +173,6 @@ typedef struct VhostOps { vhost_force_iommu_op vhost_force_iommu; } VhostOps; =20 -extern const VhostOps user_ops; -extern const VhostOps vdpa_ops; - -int vhost_set_backend_type(struct vhost_dev *dev, - VhostBackendType backend_type); - int vhost_backend_update_device_iotlb(struct vhost_dev *dev, uint64_t iova, uint64_t uaddr, uint64_t len, diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 045d0fd9f2..5ee306568b 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -95,6 +95,10 @@ struct vhost_dev { const VhostDevConfigOps *config_ops; }; =20 +extern const VhostOps kernel_ops; +extern const VhostOps user_ops; +extern const VhostOps vdpa_ops; + struct vhost_net { struct vhost_dev dev; struct vhost_virtqueue vqs[2]; diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index 594d770b75..b65f8f7e97 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -293,7 +293,7 @@ static void vhost_kernel_set_iotlb_callback(struct vhos= t_dev *dev, qemu_set_fd_handler((uintptr_t)dev->opaque, NULL, NULL, NULL); } =20 -static const VhostOps kernel_ops =3D { +const VhostOps kernel_ops =3D { .backend_type =3D VHOST_BACKEND_TYPE_KERNEL, .vhost_backend_init =3D vhost_kernel_init, .vhost_backend_cleanup =3D vhost_kernel_cleanup, @@ -328,34 +328,6 @@ static const VhostOps kernel_ops =3D { }; #endif =20 -int vhost_set_backend_type(struct vhost_dev *dev, VhostBackendType backend= _type) -{ - int r =3D 0; - - switch (backend_type) { -#ifdef CONFIG_VHOST_KERNEL - case VHOST_BACKEND_TYPE_KERNEL: - dev->vhost_ops =3D &kernel_ops; - break; -#endif -#ifdef CONFIG_VHOST_USER - case VHOST_BACKEND_TYPE_USER: - dev->vhost_ops =3D &user_ops; - break; -#endif -#ifdef CONFIG_VHOST_VDPA - case VHOST_BACKEND_TYPE_VDPA: - dev->vhost_ops =3D &vdpa_ops; - break; -#endif - default: - error_report("Unknown vhost backend type"); - r =3D -1; - } - - return r; -} - int vhost_backend_update_device_iotlb(struct vhost_dev *dev, uint64_t iova, uint64_t uaddr, uint64_t len, diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 3c0b537f89..e21e144510 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -174,6 +174,35 @@ static uint64_t vhost_get_log_size(struct vhost_dev *d= ev) return log_size; } =20 +static int vhost_set_backend_type(struct vhost_dev *dev, + VhostBackendType backend_type) +{ + int r =3D 0; + + switch (backend_type) { +#ifdef CONFIG_VHOST_KERNEL + case VHOST_BACKEND_TYPE_KERNEL: + dev->vhost_ops =3D &kernel_ops; + break; +#endif +#ifdef CONFIG_VHOST_USER + case VHOST_BACKEND_TYPE_USER: + dev->vhost_ops =3D &user_ops; + break; +#endif +#ifdef CONFIG_VHOST_VDPA + case VHOST_BACKEND_TYPE_VDPA: + dev->vhost_ops =3D &vdpa_ops; + break; +#endif + default: + error_report("Unknown vhost backend type"); + r =3D -1; + } + + return r; +} + static struct vhost_log *vhost_log_alloc(uint64_t size, bool share) { Error *err =3D NULL; --=20 MST From nobody Fri May 3 05:42:18 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=1630792742; cv=none; d=zohomail.com; s=zohoarc; b=R8wE4hLn9ngdAUyurtS0kfypMNFmP8uwOmnu76z6yUO9I6DzLCfqOUNYmmsTf9r5gTp5IZ6EtzRwdjuRb5HXtS4QCrNj4hSfGxULh0t/Kvj9PfSAqytYBVwKTNYDZ+ht2IFJUuefTiyOqDLHWqhEmZx4DpZMXDc7Ue6UzUbYmh8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792742; 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=yIKxpWcU56OqvhkLWqT8KFXeISWeq1cxadhweZ1jVpE=; b=PyL13VLiEC0+O5IALyEYFZXAZX8//X3S7H+hinM1wGlwXY2WtcTPIXXY9sFx84Vm9ngR4HOshn9Rw9rjm4eJiXh4zTlZZH9rLCbWNNWC1K9Nqq8Il4Q2MC/1McrGj/+Dyvy0IFmch6sl5YTqMJPfJRmP7SEPGBmXfBumXU6BDWw= 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 1630792742140259.8905748178738; Sat, 4 Sep 2021 14:59:02 -0700 (PDT) Received: from localhost ([::1]:54116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdgj-0007B8-2E for importer@patchew.org; Sat, 04 Sep 2021 17:59:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdNP-0002rC-Ex for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:39:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdNN-0002bV-TY for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:39:03 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-551-L7o2qHxcOwiRcHVxNa4qQA-1; Sat, 04 Sep 2021 17:36:21 -0400 Received: by mail-ed1-f72.google.com with SMTP id b15-20020a05640202cf00b003cd5efcd633so1506539edx.9 for ; Sat, 04 Sep 2021 14:36:21 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id f10sm1537816ejc.51.2021.09.04.14.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791541; 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=yIKxpWcU56OqvhkLWqT8KFXeISWeq1cxadhweZ1jVpE=; b=bCylt6pkYt1zr4qhg8uahVSOrAvRJ12a7AAMClqd9rC2LmhZsfCBXZlm7Dp7C+tR3zndAy yIemgbvCbZdf4addIUqm/HOw/HtQwPppgdOHxhSJje+beuX9Sisjt+1oaQZAPKFX25Yf3t CAV1UaBT1oX59vmRWxDXH+EAEtPNjeo= X-MC-Unique: L7o2qHxcOwiRcHVxNa4qQA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yIKxpWcU56OqvhkLWqT8KFXeISWeq1cxadhweZ1jVpE=; b=U8DPaj990CneSnm36iLBklJ2OQtkccc0JJlRdJMeO4Mz3Goz39NjUUXShBK/RNcH3C yVojy5Ej6sDs2dZRkD7NWGYzGkNwyANFYwrGczt7qKDFYDsV+d2jBu5wel4/bi9+8B5u 8QXejGGhrBGi6/mSSvpnMV1//O6ByBmgOXAk8ABkyQHrjibIVRq87g0KMg+yzDby+gt+ aGwLSGrJeWgt1iEOTJZRj2UqdMA9au594r5qD53aHQ7Xjk6/Q4CTmBQAYSaLq7C4hlEQ KH3Xc6d7Ixdzxc9reSYlHGwkjmCZBwKh7vIzAh4fVpECG+4Mb+mYVAeRwK6mcBNoXOmH dd9w== X-Gm-Message-State: AOAM530KZk8LHYkNYc2Xa0p66eBnUwVforhzWs7rONuDdp9+RPr5UnFO xbN0n9wHwScmPFBojPyLn62Eq0i/5ibPa77XkpJ/aFMHAcHIE85inmnzdelFKYunK7qOO5OvKtX RztoESf/NJlL1cRaN2BBEN96JTe0ElV7hol9ekoT5bpKrT/J2bvgNSHz8shY5 X-Received: by 2002:a17:906:c05a:: with SMTP id bm26mr5884893ejb.498.1630791380408; Sat, 04 Sep 2021 14:36:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEUIMeYFQt+8syoq9RN3R3S+F9Em4X02SywKKnahKk3nIlT5Qjh5hGwZIcTTS7vIPYXNbGaQ== X-Received: by 2002:a17:906:c05a:: with SMTP id bm26mr5884884ejb.498.1630791380237; Sat, 04 Sep 2021 14:36:20 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:18 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 08/35] vhost-user: add missing space in error message Message-ID: <20210904213506.486886-9-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Alyssa Ross Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792743652100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Alyssa Ross This would previously give error messages like > Received unexpected msg type.Expected 0 received 1 Signed-off-by: Alyssa Ross Message-Id: <20210806143926.315725-1-hi@alyssa.is> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index a4eb6cde7e..360d9bc040 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -429,7 +429,7 @@ static int process_message_reply(struct vhost_dev *dev, } =20 if (msg_reply.hdr.request !=3D msg->hdr.request) { - error_report("Received unexpected msg type." + error_report("Received unexpected msg type. " "Expected %d received %d", msg->hdr.request, msg_reply.hdr.request); return -1; --=20 MST From nobody Fri May 3 05:42:18 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 1630791638186359.9342266499208; Sat, 4 Sep 2021 14:40:38 -0700 (PDT) Received: from localhost ([::1]:46044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdOv-0005rq-5S for importer@patchew.org; Sat, 04 Sep 2021 17:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKu-0004bw-LB for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKt-0000xL-0H for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:28 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-563-RVBLBSW4Msmi6rw2ixstiw-1; Sat, 04 Sep 2021 17:36:24 -0400 Received: by mail-ej1-f69.google.com with SMTP id v19-20020a170906b013b02905b2f1bbf8f3so865168ejy.6 for ; Sat, 04 Sep 2021 14:36:24 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id i7sm1541051ejx.73.2021.09.04.14.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791386; 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=a99C9crsAiO4p+uk+bJauItmwvIN3BCi69tD3HDwFvQ=; b=OQqR66vQEQYXs6j/bEQImDhiflhqUcWWalqErolSkTFuDqC8uzxo9qzwjFSEH3JT442//k 7dgqkWB7E0KtnDw3aMMafXMhHf6vOVFQlVdPAo3hGJuqnc6jnPNRUPQU/3WICxeGwZh6fk SA7Kd55/wINCk4e3VndbYy1v8QjVPFg= X-MC-Unique: RVBLBSW4Msmi6rw2ixstiw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=a99C9crsAiO4p+uk+bJauItmwvIN3BCi69tD3HDwFvQ=; b=NlNCGB8cWtVxwl16JzO42YIory4mrVPD3LAdL/6j42CVLHSNt3mbmjV58u6+E/wQ3h vuHXRu4PfvRwkE+kGTsUD6KMd9vA/wRnI8td4oPbpZbd2/Y5xSGk/c1Cus7eVFUZyZg6 ib4JnE1TCoxP1mmfWSJv0/B+jdG6dny9GtatkNf8JUnP4BBuW/xhzJc2af/Qmg+c2Ceq ohHVjRt6Qj2fI/DWlAwBqmK3bun5armKbypKAx6DI7eOPdX19FdwxYH5x1sUvzPPeEFm o79GPWPpbxHJxtYNaRQs9qu+xdTfnHdeE4GymaAEAcrFVnYebD9cOih3ZOdVVeVkC4CK R50w== X-Gm-Message-State: AOAM532XdIDvAi36gh1gBLWDGyuvoZzWP+RIpdUpC1D6/WVaDB4JHCyQ tniLrXJGlk+vaN5WaUuzei7dOzoQ8R4GN9q+ZS/sWvr5IpRRAwd/CE0C8FWbsjBvtvOu5S2/CCi kqNZAs70pp8a4uDAGV/XMfCKNYzoic7iLYeph262yPBPm+sy6FmoyBTtD1/Qp X-Received: by 2002:a17:906:63ca:: with SMTP id u10mr5938636ejk.411.1630791383318; Sat, 04 Sep 2021 14:36:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY7C9JlnQTEoKqamNmCq/fdEAKdIatXHvpdnZ/N5CW+lRjbcpVH9e3IKTpcagpkVEZ8R9ZUg== X-Received: by 2002:a17:906:63ca:: with SMTP id u10mr5938620ejk.411.1630791383169; Sat, 04 Sep 2021 14:36:23 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:20 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 09/35] acpi: Delete broken ACPI_GED_X86 macro Message-ID: <20210904213506.486886-10-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ani Sinha , Peter Maydell , Gerd Hoffmann , Eduardo Habkost , Igor Mammedov 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: 1630791640078100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost The macro never worked and never will, because the AcpiGedX86State type never existed. Signed-off-by: Eduardo Habkost Message-Id: <20210805193431.307761-2-ehabkost@redhat.com> Reviewed-by: Igor Mammedov Reviewed-by: Gerd Hoffmann Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/generic_event_device.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/gener= ic_event_device.h index 6bed92e8fc..d49217c445 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -70,8 +70,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) =20 #define TYPE_ACPI_GED_X86 "acpi-ged-x86" -#define ACPI_GED_X86(obj) \ - OBJECT_CHECK(AcpiGedX86State, (obj), TYPE_ACPI_GED_X86) =20 #define ACPI_GED_EVT_SEL_OFFSET 0x0 #define ACPI_GED_EVT_SEL_LEN 0x4 --=20 MST From nobody Fri May 3 05:42:18 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 1630791830628880.3888314511323; Sat, 4 Sep 2021 14:43:50 -0700 (PDT) Received: from localhost ([::1]:59752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdS1-0006jD-IK for importer@patchew.org; Sat, 04 Sep 2021 17:43:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKz-0004pk-8Y for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKw-00010c-PI for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:31 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-VmE7g7qxOquHM9Q7M46r8A-1; Sat, 04 Sep 2021 17:36:29 -0400 Received: by mail-ed1-f69.google.com with SMTP id h4-20020aa7c604000000b003c423efb7efso1491047edq.12 for ; Sat, 04 Sep 2021 14:36:28 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id h2sm1929515edd.43.2021.09.04.14.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791390; 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=6c4pKbq4HffI/CB8k5O6YlmR6P/++9oBvmvZgdDQscQ=; b=M6K0uxd7dzMyNXDWHbQnMtHcteXy2rT2fAXDPP1E1EBXzBLgHYKYgH4tAkSMG3Z/GdBFna s89eI5Ly9Ehz5tYxIcZ0MdA7Edi6WOVqTFET0j4wZJkGRbpWXGIvoBqIc4q0pd1f/g5urQ RLdU5W3OHbv+22T8tahY7FYu3ncvZ4A= X-MC-Unique: VmE7g7qxOquHM9Q7M46r8A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6c4pKbq4HffI/CB8k5O6YlmR6P/++9oBvmvZgdDQscQ=; b=TyMyR5FKiCK0ROr2FAPTMKIjuJdX81g4yck4a3Xu/d/0ykYP7C3Bny+CIDGM0Zip8x wotqAqOiW1zfY2j6ksyi/4bBHU9rxANWWZYX1Y6kH56XkvYGRo8iM1FfJtzpLSvi4zlQ 5wYgmRqEsXsvAuK8TWpvvxqmKIQjJ0XHIUhcrcgAv4gAxD9lxmuUVT8Dx+kcLc5IqDmx y9SNvkh76U2kbm6D87TohQBMg4owbVRgNPzRJwGcMaP5/owMhrrjVA2OQ2ADDD7B6JPV +7PZJprt4assK+aVzG8gg7qq9a9A3Tdv6fo4AEbAd1DqXd4kyA7QdnwE2qd9ED07zXkB bT5Q== X-Gm-Message-State: AOAM533RIjMgFb9riYXk78wKCGHsvYmwtkBN3hyJ+4mWICj8tlSW9wNH evkH2BZePthCuvK/XEZIiDWMDDR++MjvJ9/79F2xYjbc4/G/2+PBIwGopeZ+XA5WQZ9E+EKFhJN KchFvy602VqrgH2T6/LhAvtlCVc6ncOtJFwb1BLSUIIkiWQKIzBPO2Jf/lYF6 X-Received: by 2002:a05:6402:35cd:: with SMTP id z13mr993858edc.13.1630791387476; Sat, 04 Sep 2021 14:36:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgtxc5I37gKa9byopvmEIIOV32oXoGiDlGwQz65pfKsdKjaTSRkptIC+At6wB+kiMBGX/igw== X-Received: by 2002:a05:6402:35cd:: with SMTP id z13mr993838edc.13.1630791387277; Sat, 04 Sep 2021 14:36:27 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:23 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 10/35] Use PCI_HOST_BRIDGE macro Message-ID: <20210904213506.486886-11-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Richard Henderson , Igor Mammedov , Ani Sinha , Paolo Bonzini 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: 1630791832407100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost OBJECT_CHECK(PciHostState, ..., TYPE_PCI_HOST_BRIDGE) is exactly what the PCI_HOST_BRIDGE macro does. We can just use the macro instead of using OBJECT_CHECK manually. Signed-off-by: Eduardo Habkost Message-Id: <20210805193431.307761-7-ehabkost@redhat.com> Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 8 ++------ hw/pci-host/i440fx.c | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 6c27e12e2a..9a9572cadb 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -303,13 +303,9 @@ Object *acpi_get_i386_pci_host(void) { PCIHostState *host; =20 - host =3D OBJECT_CHECK(PCIHostState, - object_resolve_path("/machine/i440fx", NULL), - TYPE_PCI_HOST_BRIDGE); + host =3D PCI_HOST_BRIDGE(object_resolve_path("/machine/i440fx", NULL)); if (!host) { - host =3D OBJECT_CHECK(PCIHostState, - object_resolve_path("/machine/q35", NULL), - TYPE_PCI_HOST_BRIDGE); + host =3D PCI_HOST_BRIDGE(object_resolve_path("/machine/q35", NULL)= ); } =20 return OBJECT(host); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 28c9bae899..cd87e21a9b 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -316,9 +316,7 @@ PCIBus *i440fx_init(const char *host_type, const char *= pci_type, =20 PCIBus *find_i440fx(void) { - PCIHostState *s =3D OBJECT_CHECK(PCIHostState, - object_resolve_path("/machine/i440fx", = NULL), - TYPE_PCI_HOST_BRIDGE); + PCIHostState *s =3D PCI_HOST_BRIDGE(object_resolve_path("/machine/i440= fx", NULL)); return s ? s->bus : NULL; } =20 --=20 MST From nobody Fri May 3 05:42:18 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 1630791974268391.699805792043; Sat, 4 Sep 2021 14:46:14 -0700 (PDT) Received: from localhost ([::1]:39916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdUL-0003oI-87 for importer@patchew.org; Sat, 04 Sep 2021 17:46:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdL2-00051H-9c for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdL0-000132-EU for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:36 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-cNlMuN9UPU2y45g7ZHe14Q-1; Sat, 04 Sep 2021 17:36:32 -0400 Received: by mail-ed1-f71.google.com with SMTP id bf22-20020a0564021a5600b003c86b59e291so1352430edb.18 for ; Sat, 04 Sep 2021 14:36:32 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id d19sm1521623ejj.122.2021.09.04.14.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791393; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mkIr8cglWhMVi64rmTTfudlfUFh3v3LmM0D5ITWVaqM=; b=dVd6EfN5QtBt3BlnFUdr/A1eFFzyUuUpMNQrWiA6ZYN29mFFWSvHzKCyLikEseurPZ+P2H QltafH12vShDOxu8dzgo4X1XWCXGCc7pn5BbvpQfB1byqUCNnLZGZmdIzFosjZ7H+1aNS/ EQmUgg5utrYk8n4PEqezX5hxQcu/+uc= X-MC-Unique: cNlMuN9UPU2y45g7ZHe14Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=mkIr8cglWhMVi64rmTTfudlfUFh3v3LmM0D5ITWVaqM=; b=U88VXcAMNVQJmVibo6Fx116L3nmIRHIVaXz4AA8mAZRNr3ePKtC2trVqoP0mWdEddR z01bwrXHn1YnDM5+C/au/78dQvFcYd6vX/NyKpzh2U01awZmH8+ZizqHvkRKbVP3UaOx udzqVQp5e0bPq2xVukq61JHhJomAKv9CwO+5ca5hlT/vrZrSlJLvfjDf9xJXEofsV+bu Q2ZXkw0bwSmTYe50dPkSzxx7UEi0R7jVTOHHcFdpcJfUsu/va3QUf9ZZriPumNA1HsZQ tA6BGiedCVG48qK9Mo02OMb7NLT8hxYWN6qwrSrTpeodqiztT5aX7JnfkFENaomV9nQw ztLQ== X-Gm-Message-State: AOAM530GeUIzL0iJ6ieHpySAk4hDmeE68iFPXkmpLJEy2btiTB4M1/8L QMPosnhdMukrR5lRCKDovMiTQqFgWmabIY7xojLVITrSScYowVc3SMdhDHBKWDbZ46vjkHb/2I4 eUQEYWflB+ipS9GFYEeloM+U1g8S23t+pa6Tktxlzmq1IOi58bNHsFn3UDInb X-Received: by 2002:a50:c31e:: with SMTP id a30mr5860099edb.123.1630791390996; Sat, 04 Sep 2021 14:36:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTSQZe9xZxhSIG7YZx5Lb7OrwKQ/iFK+7Ffsap/lhKIflmjcm2yw8J/IZDpByPVlVloE2DJg== X-Received: by 2002:a50:c31e:: with SMTP id a30mr5860078edb.123.1630791390743; Sat, 04 Sep 2021 14:36:30 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 11/35] virtio-balloon: don't start free page hinting if postcopy is possible Message-ID: <20210904213506.486886-12-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , David Hildenbrand , Juan Quintela , qemu-stable@nongnu.org, Alexander Duyck , "Dr. David Alan Gilbert" , Wei Wang , Peter Xu , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= 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: 1630791974920100001 From: David Hildenbrand Postcopy never worked properly with 'free-page-hint=3Don', as there are at least two issues: 1) With postcopy, the guest will never receive a VIRTIO_BALLOON_CMD_ID_DONE and consequently won't release free pages back to the OS once migration finishes. The issue is that for postcopy, we won't do a final bitmap sync while the guest is stopped on the source and virtio_balloon_free_page_hint_notify() will only call virtio_balloon_free_page_done() on the source during PRECOPY_NOTIFY_CLEANUP, after the VM state was already migrated to the destination. 2) Once the VM touches a page on the destination that has been excluded from migration on the source via qemu_guest_free_page_hint() while postcopy is active, that thread will stall until postcopy finishes and all threads are woken up. (with older Linux kernels that won't retry faults when woken up via userfaultfd, we might actually get a SEGFAULT) The issue is that the source will refuse to migrate any pages that are not marked as dirty in the dirty bmap -- for example, because the page might just have been sent. Consequently, the faulting thread will stall, waiting for the page to be migrated -- which could take quite a while and result in guest OS issues. While we could fix 1) comparatively easily, 2) is harder to get right and might require more involved RAM migration changes on source and destination [1]. As it never worked properly, let's not start free page hinting in the precopy notifier if the postcopy migration capability was enabled to fix it easily. Capabilities cannot be enabled once migration is already running. Note 1: in the future we might either adjust migration code on the source to track pages that have actually been sent or adjust migration code on source and destination to eventually send pages multiple times from the source and and deal with pages that are sent multiple times on the destination. Note 2: virtio-mem has similar issues, however, access to "unplugged" memory by the guest is very rare and we would have to be very lucky for it to happen during migration. The spec states "The driver SHOULD NOT read from unplugged memory blocks ..." and "The driver MUST NOT write to unplugged memory blocks". virtio-mem will move away from virtio_balloon_free_page_done() soon and handle this case explicitly on the destination. [1] https://lkml.kernel.org/r/e79fd18c-aa62-c1d8-c7f3-ba3fc2c25fc8@redhat.c= om Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Cc: qemu-stable@nongnu.org Cc: Wei Wang Cc: Michael S. Tsirkin Cc: Philippe Mathieu-Daud=C3=A9 Cc: Alexander Duyck Cc: Juan Quintela Cc: "Dr. David Alan Gilbert" Cc: Peter Xu Signed-off-by: David Hildenbrand Message-Id: <20210708095339.20274-2-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Xu --- hw/virtio/virtio-balloon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 4b5d9e5e50..ae7867a8db 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -30,6 +30,7 @@ #include "trace.h" #include "qemu/error-report.h" #include "migration/misc.h" +#include "migration/migration.h" =20 #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-access.h" @@ -662,6 +663,18 @@ virtio_balloon_free_page_hint_notify(NotifierWithRetur= n *n, void *data) return 0; } =20 + /* + * Pages hinted via qemu_guest_free_page_hint() are cleared from the d= irty + * bitmap and will not get migrated, especially also not when the post= copy + * destination starts using them and requests migration from the sourc= e; the + * faulting thread will stall until postcopy migration finishes and + * all threads are woken up. Let's not start free page hinting if post= copy + * is possible. + */ + if (migrate_postcopy_ram()) { + return 0; + } + switch (pnd->reason) { case PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC: virtio_balloon_free_page_stop(dev); --=20 MST From nobody Fri May 3 05:42:18 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 163079174538177.92152797865867; Sat, 4 Sep 2021 14:42:25 -0700 (PDT) Received: from localhost ([::1]:53546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdQe-0002VG-DG for importer@patchew.org; Sat, 04 Sep 2021 17:42:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdL6-0005Cg-63 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdL4-000157-EH for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:39 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-Y44P2hx0N-SFTb6WqbQCqA-1; Sat, 04 Sep 2021 17:36:35 -0400 Received: by mail-ed1-f70.google.com with SMTP id a23-20020aa7cf17000000b003caffcef4beso1502811edy.5 for ; Sat, 04 Sep 2021 14:36:35 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id am3sm1520345ejc.74.2021.09.04.14.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791397; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xp1Zu6Ykn24pneBxs9zUAOW4U4cc/WjH89YFNE8EmiI=; b=EW8pYQjhiagqksS701D8z35sewigxjmAKJLR9eDBDX8uZkuDyjVacP50wMxd64qCnyxRtd jRz75porEK73XAybpWZrMozGgBiWsThFdwwghcXMxF9XYPsCSmBB/2SzJGuZd9DLETRUd8 7SUrcE9Xv56Jpbc4BpvyrhInXFHXfLk= X-MC-Unique: Y44P2hx0N-SFTb6WqbQCqA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Xp1Zu6Ykn24pneBxs9zUAOW4U4cc/WjH89YFNE8EmiI=; b=tFjlKMbZnvrfkCaRGvZWK5zwrc06d3IfAokl89glbYAXJKMsEe+hm50UZPt9KMMf1S Q0pEYEhobFbygCLxOiftdfyhNKHs3WGd3c+E9abt+zRt8AqDPykfbOlsD32Lmg0IUq0R 1H2a7l2vS6G29RiLGGquSh7CR/zffeiq5AwbyOZXPAZvyzDKi8w/nSpf6whheF0/urFf Z/kbr7V71oIvnlXtOXHKXtdK5xUuXNcekIDbtmFwEdZvWvlq5jc8CKmBaxO21JJsyFlH +7YRV6/3Vm0k51Kz3DyzQjRJAl+Z63qh9A3uBcqLfAqvpXXKPsZg5qF2M23RK0YmTlhL c98Q== X-Gm-Message-State: AOAM531eFJx65B+5VqHHiJ07EVAP5mAeA98VfTN0JEVeexZh83G5Mbp2 628mJRR+TWJPX0uOk5kKGPmRVusdmv1Cl3FFo4GZHtJSBYhlzWQGyZHKtyoF+lOsOBSF71BpE+V prTvCOYWnCpqcc3y+ihloIqR0EL52KvWP4dB7DBLX9l6IpvMDD1dgHO6aOp7o X-Received: by 2002:a17:907:266f:: with SMTP id ci15mr5789105ejc.509.1630791394357; Sat, 04 Sep 2021 14:36:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDK1up5IQH+vgHPGaIqqveQmJFwVk6e4xhdwTLnEKYM+VGsV5OqddvZgi73Na4adNUzzDYgA== X-Received: by 2002:a17:907:266f:: with SMTP id ci15mr5789083ejc.509.1630791394157; Sat, 04 Sep 2021 14:36:34 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:31 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 12/35] virtio-balloon: free page hinting cleanups Message-ID: <20210904213506.486886-13-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Juan Quintela , David Hildenbrand , "Dr. David Alan Gilbert" , Alexander Duyck , Wei Wang , Peter Xu , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= 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: 1630791746493100001 From: David Hildenbrand Let's compress the code a bit to improve readability. We can drop the vm_running check in virtio_balloon_free_page_start() as it's already properly checked in the single caller. Cc: Wei Wang Cc: Michael S. Tsirkin Cc: Philippe Mathieu-Daud=C3=A9 Cc: Alexander Duyck Cc: Juan Quintela Cc: "Dr. David Alan Gilbert" Cc: Peter Xu Signed-off-by: David Hildenbrand Message-Id: <20210708095339.20274-3-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-balloon.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index ae7867a8db..5a69dce35d 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -534,22 +534,18 @@ static bool get_free_page_hints(VirtIOBalloon *dev) if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_REQUESTED && id =3D=3D dev->free_page_hint_cmd_id) { dev->free_page_hint_status =3D FREE_PAGE_HINT_S_START; - } else { + } else if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_STAR= T) { /* * Stop the optimization only when it has started. This * avoids a stale stop sign for the previous command. */ - if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_START) { - dev->free_page_hint_status =3D FREE_PAGE_HINT_S_STOP; - } + dev->free_page_hint_status =3D FREE_PAGE_HINT_S_STOP; } } =20 - if (elem->in_num) { - if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_START) { - qemu_guest_free_page_hint(elem->in_sg[0].iov_base, - elem->in_sg[0].iov_len); - } + if (elem->in_num && dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S= _START) { + qemu_guest_free_page_hint(elem->in_sg[0].iov_base, + elem->in_sg[0].iov_len); } =20 out: @@ -592,16 +588,10 @@ static void virtio_balloon_free_page_start(VirtIOBall= oon *s) { VirtIODevice *vdev =3D VIRTIO_DEVICE(s); =20 - /* For the stop and copy phase, we don't need to start the optimizatio= n */ - if (!vdev->vm_running) { - return; - } - qemu_mutex_lock(&s->free_page_lock); =20 if (s->free_page_hint_cmd_id =3D=3D UINT_MAX) { - s->free_page_hint_cmd_id =3D - VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; + s->free_page_hint_cmd_id =3D VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_= MIN; } else { s->free_page_hint_cmd_id++; } @@ -649,8 +639,7 @@ static void virtio_balloon_free_page_done(VirtIOBalloon= *s) static int virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data) { - VirtIOBalloon *dev =3D container_of(n, VirtIOBalloon, - free_page_hint_notify); + VirtIOBalloon *dev =3D container_of(n, VirtIOBalloon, free_page_hint_n= otify); VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); PrecopyNotifyData *pnd =3D data; =20 @@ -919,8 +908,7 @@ static void virtio_balloon_device_realize(DeviceState *= dev, Error **errp) s->dvq =3D virtio_add_queue(vdev, 128, virtio_balloon_handle_output); s->svq =3D virtio_add_queue(vdev, 128, virtio_balloon_receive_stats); =20 - if (virtio_has_feature(s->host_features, - VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { + if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_FREE_PAGE_HI= NT)) { s->free_page_vq =3D virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE, virtio_balloon_handle_free_page= _vq); precopy_add_notifier(&s->free_page_hint_notify); --=20 MST From nobody Fri May 3 05:42:18 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=1630792100; cv=none; d=zohomail.com; s=zohoarc; b=Eu9JthhuF1f10ACG3ZJVVBvuaB3R5BgUcJbJUhP9kHuowhSWfqgZEOmRIe5OqxQOfBG68IXVjsABmw23+d/ByqK/Q1cjEKGP3fS3iFGsyZqwUB7kxq6mqCo6qq8NzhIqGorlabosndL2v3E+Sf/mDF179QvDdCD1Qo5acoGVB9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792100; 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=pfB4Y9HSTQVin+i7dr55RoRMesM0x0vA9aYgJNYKXbs=; b=XXlyesg1kb4ZyGvD4ny0JTj25vRl6SyeMMJ1mqD+fjez2ADESOn8M+qKLhEjdEZeG5Vh/5mRPBtm1iEWzdJ/hV3eMj2mqVv8xYfmjf4AKymWCjL39Vg8wLJCujhagNtNWtNylfnHMgMhEKqMaOaSfxG9RPM4GclsJ+HkRv8pSzc= 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 163079210057180.62078158578458; Sat, 4 Sep 2021 14:48:20 -0700 (PDT) Received: from localhost ([::1]:48462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdWM-0001A2-2i for importer@patchew.org; Sat, 04 Sep 2021 17:48:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdL8-0005GX-FQ for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdL6-00016u-Cl for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:42 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-167-_xWYaAWBOSiXo9H-j-339g-1; Sat, 04 Sep 2021 17:36:38 -0400 Received: by mail-ej1-f71.google.com with SMTP id m18-20020a170906849200b005c701c9b87cso862062ejx.8 for ; Sat, 04 Sep 2021 14:36:38 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id f26sm1888071eds.90.2021.09.04.14.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791399; 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=pfB4Y9HSTQVin+i7dr55RoRMesM0x0vA9aYgJNYKXbs=; b=Lqfo4p0In378R5XYjl0+dJejAM4rNR/zi319/J2iQNq0b3e6MmLDyoZ+RKSql0GnNWb8MH 3ZmmSGLEg6XRU3k5J9nsKcDM4ABbgw6p1PDdsCYbe+JvPD4WVf4IvFZuGk9qmvhwxNRb7D Q8RFtFdAiiDSczguL48t6PtmWvF+h20= X-MC-Unique: _xWYaAWBOSiXo9H-j-339g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pfB4Y9HSTQVin+i7dr55RoRMesM0x0vA9aYgJNYKXbs=; b=SgRbp63KJhQFysPw45j6BNdH1w1WVRWfwNzLqCxrWiXzRhNUJeZojwmkR9SBOFZayV LpmOYxyFrfnnlkQaIfzb2aKJkQs7upqv9gkwh8q4QeyGK7Pyj2qn5Troqwvjqqa2VOz0 LZeDXSFL76SNcsALbS1DXc7yPVO1USCpzZZykaUWbziaQWjmkWxu81CopI8+Zck7jJPt aZGGZQUAF+4qgsp7U8LAHnkDdh5Cmgzz/ee9VqAeaPxvCJbT6DLM3otFq/4Sw4Issg7X iHtAkVd4NLf1j9Rr7jkEZHIVGRPn9O2L0n7O/1zlMKHnnADhi48I1ysWPugBxOwPMWw+ AfKQ== X-Gm-Message-State: AOAM530bRp9zAsvKL1YyMHRiGFtptUrf4GPPvrCslLSFwfPPJ8JpKqoH z737C4/rAaB/0OuqY8gku7RMZe9/EZ9lOV452G5QsSGxCRYkR2qWlW0XXd6LRHIVRupEUb3T00y DMXiDu5lnnbX6Px9NnCCeeqPsNfWW/CZ0RfZUlZnwK9x/C3k4SKp7tFo0cuSL X-Received: by 2002:a50:9a84:: with SMTP id p4mr5963708edb.189.1630791396989; Sat, 04 Sep 2021 14:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzcPIJJ5BqzOY9+w03uWscaL5Wonqz2qjvYryPngN7Eitm/NUJIvvjjKiVdvKmgF4w8F0ZdQ== X-Received: by 2002:a50:9a84:: with SMTP id p4mr5963691edb.189.1630791396750; Sat, 04 Sep 2021 14:36:36 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:34 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 13/35] virtio-bus: introduce iommu_enabled() Message-ID: <20210904213506.486886-14-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792102424100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang This patch introduce a new method for the virtio-bus for the transport to report whether or not the IOMMU is enabled for the device. Signed-off-by: Jason Wang Message-Id: <20210804034803.1644-2-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-bus.h | 4 +++- hw/virtio/virtio-bus.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h index ef8abe49c5..7ab8c9dab0 100644 --- a/include/hw/virtio/virtio-bus.h +++ b/include/hw/virtio/virtio-bus.h @@ -93,6 +93,7 @@ struct VirtioBusClass { */ bool has_variable_vring_alignment; AddressSpace *(*get_dma_as)(DeviceState *d); + bool (*iommu_enabled)(DeviceState *d); }; =20 struct VirtioBusState { @@ -154,5 +155,6 @@ void virtio_bus_release_ioeventfd(VirtioBusState *bus); int virtio_bus_set_host_notifier(VirtioBusState *bus, int n, bool assign); /* Tell the bus that the ioeventfd handler is no longer required. */ void virtio_bus_cleanup_host_notifier(VirtioBusState *bus, int n); - +/* Whether the IOMMU is enabled for this device */ +bool virtio_bus_device_iommu_enabled(VirtIODevice *vdev); #endif /* VIRTIO_BUS_H */ diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index 859978d248..d23db98c56 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -325,6 +325,20 @@ static char *virtio_bus_get_fw_dev_path(DeviceState *d= ev) return NULL; } =20 +bool virtio_bus_device_iommu_enabled(VirtIODevice *vdev) +{ + DeviceState *qdev =3D DEVICE(vdev); + BusState *qbus =3D BUS(qdev_get_parent_bus(qdev)); + VirtioBusState *bus =3D VIRTIO_BUS(qbus); + VirtioBusClass *klass =3D VIRTIO_BUS_GET_CLASS(bus); + + if (!klass->iommu_enabled) { + return false; + } + + return klass->iommu_enabled(qbus->parent); +} + static void virtio_bus_class_init(ObjectClass *klass, void *data) { BusClass *bus_class =3D BUS_CLASS(klass); --=20 MST From nobody Fri May 3 05:42:18 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=1630791723; cv=none; d=zohomail.com; s=zohoarc; b=WRKPXzBmn+tG5gS/Qe6Rhz1lrddEsFFgYCrB2d1NNphK7/kXS6zvjT0RdDa650Qt4z+U+uo1Pamdl+eMTbalO3Paxn/MmpTTcFP+6zLjitWbj2vteWwBbtBOpufDVEHKJG4HY8Jk2qOC689AhxT2lYbdbsyiqjfQY1xXS6HTiis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630791723; 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=xjmYjxZE9lLfwg0tVzBHYCGbkvW274evNrtxFcpgMnM=; b=DpOF0WnB8hOcG2huXuIAFhE5vpQmbBXOSVxJ7hhVWeihXI7uwNEskX5sxFD7J7cVP7kkfp+nTCbHYqZQE8tZp0eVmtx20+v3eqRG6KzY8bKpINYaRivkA9LJfNd5xTFdlL/oyC4OERlQdKt9wL/SXsKuxdt93cQeYAZ9iH4/FNM= 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 1630791723224141.14968424474216; Sat, 4 Sep 2021 14:42:03 -0700 (PDT) Received: from localhost ([::1]:51544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdQI-0001C9-8z for importer@patchew.org; Sat, 04 Sep 2021 17:42:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLC-0005St-6W for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLA-00018P-LN for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:45 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-582-DlpemcnYO8mBI2c0xZPkxg-1; Sat, 04 Sep 2021 17:36:41 -0400 Received: by mail-ej1-f72.google.com with SMTP id q15-20020a17090622cf00b005c42d287e6aso841749eja.18 for ; Sat, 04 Sep 2021 14:36:41 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id lb12sm1523638ejc.28.2021.09.04.14.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791402; 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=xjmYjxZE9lLfwg0tVzBHYCGbkvW274evNrtxFcpgMnM=; b=dLPXaikmGUMzu0DMxU6mIC2TnQir1flQy6I/YU5+VgAMr2/iz1CmFS6k5deDYBBT/NWkHx vpcUufpua5TMdSW3U5FiIWGlENtXPU9OixKH8fD2Y40Vu8vOhS3rrDZx0PGR5JhjyFIAsU NBLAMJJQOwCWJsHxOZmRpNT0hUVpKx4= X-MC-Unique: DlpemcnYO8mBI2c0xZPkxg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xjmYjxZE9lLfwg0tVzBHYCGbkvW274evNrtxFcpgMnM=; b=aVr7aCcL35+EG7P+wBLju5+SdFdG5FtYW54K5Ampj/frsfmdz1eY7H2Z4dfd1+iwCm Sj4daG36SSW3SbrszQePsE9iCO6BNs+euAGnqsaAUwSXZSNm9YL2d1Gz34i7mipb5vUs ZpCG55tvCADrxTG1FEENECwejeAf342YoKDDjt4zk/GN0rM8bJqF4QqPn6HVAgWQa5V5 D3V3bZtbWxJqvvOn3peEyQ5baIdk9kGIJcWfQ615Y+qIzwxwsoCW7HlfWYepYGkalckw DueDFN6SDmR4YfuuL4qCkwFubWgIri9XX/5dI22fQi0erJF574EB+buTeCsI506f0wI2 Rxzg== X-Gm-Message-State: AOAM5315IFEksNQHLuIH5DU9/YK6TAM3+Xr2GOdg/A9rNT6B+/aS/sMQ cVSRahvnmbccZgeeJqdmjFSB2IkaywF2jCwumgy8R4X37lORHaj3lgXIGadWh7jI8sL8o/fFYAk +EVAPBHBs7K4i2GLmX0Jh28f2keKtUmoSl9NCv3bKMQTeyEpqT83sK12ZiVqy X-Received: by 2002:a05:6402:2032:: with SMTP id ay18mr5922492edb.364.1630791400017; Sat, 04 Sep 2021 14:36:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyGnp9GfQAUtemjZtKWjIfWiKDyH+L/VggMK4PX/cPUvgYhagCIKEJeM9tkbKOvN5LEzV0JA== X-Received: by 2002:a05:6402:2032:: with SMTP id ay18mr5922474edb.364.1630791399748; Sat, 04 Sep 2021 14:36:39 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:36 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 14/35] virtio-pci: implement iommu_enabled() Message-ID: <20210904213506.486886-15-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630791723868100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang This patch implements the PCI transport version of iommu_enabled. This is done by comparing the address space returned by pci_device_iommu_address_space() against address_space_memory. Note that an ideal approach is to use pci_device_iommu_address_space() in get_dma_as(), but it might not work well since the IOMMU could be initialized after the virtio-pci device is initialized. Signed-off-by: Jason Wang Message-Id: <20210804034803.1644-3-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 433060ac02..6e16e2705c 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1121,6 +1121,19 @@ static AddressSpace *virtio_pci_get_dma_as(DeviceSta= te *d) return pci_get_address_space(dev); } =20 +static bool virtio_pci_iommu_enabled(DeviceState *d) +{ + VirtIOPCIProxy *proxy =3D VIRTIO_PCI(d); + PCIDevice *dev =3D &proxy->pci_dev; + AddressSpace *dma_as =3D pci_device_iommu_address_space(dev); + + if (dma_as =3D=3D &address_space_memory) { + return false; + } + + return true; +} + static bool virtio_pci_queue_enabled(DeviceState *d, int n) { VirtIOPCIProxy *proxy =3D VIRTIO_PCI(d); @@ -2202,6 +2215,7 @@ static void virtio_pci_bus_class_init(ObjectClass *kl= ass, void *data) k->ioeventfd_enabled =3D virtio_pci_ioeventfd_enabled; k->ioeventfd_assign =3D virtio_pci_ioeventfd_assign; k->get_dma_as =3D virtio_pci_get_dma_as; + k->iommu_enabled =3D virtio_pci_iommu_enabled; k->queue_enabled =3D virtio_pci_queue_enabled; } =20 --=20 MST From nobody Fri May 3 05:42:18 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=1630792815; cv=none; d=zohomail.com; s=zohoarc; b=jmz54M7xBmS5O21/9wtDDKYGMHNoPCnl525/k43H9Bpb2obzTcyrcCg9+ECTZdP5I2Yyd/WFJJzjz3PzcJU1L9idqhb9ZQtpz9XknmqIJNjqicndmCNMoL3WOvr9tKmQPS1BnaFy8+MoKoNbyq/CNPUY1gZi4Kx7Yh3wPAx9mo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792815; 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=4oSJitA/lzrTpzddQXggI9ORdHqMXT3PxB8e6htKSV8=; b=UmlaPvBhkJ/f/76hSmn515egnFvnX/+e6Ao88+6aVJFQ7PzKNaf378IIB35ZSVHLgrJSLL2+a5p4rFpRib2xrCAIAQCGsC0VU0HzxKZhS0rxBL9ODeTT9Ie+MtkxBo9bXMCkxLz4+INtT58kJ4rVvnEpO8oWbVjJNxBoDdP4GCA= 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 1630792815308632.3458018774733; Sat, 4 Sep 2021 15:00:15 -0700 (PDT) Received: from localhost ([::1]:56270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdhu-0000BW-0S for importer@patchew.org; Sat, 04 Sep 2021 18:00:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdOO-0006a2-KX for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:40:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdOM-0003G1-VI for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:40:04 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-R6RgGJtvNVC5zzTlFk2V_Q-1; Sat, 04 Sep 2021 17:36:45 -0400 Received: by mail-ed1-f71.google.com with SMTP id g4-20020a056402180400b003c2e8da869bso1497477edy.13 for ; Sat, 04 Sep 2021 14:36:44 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id 4sm1926243edw.45.2021.09.04.14.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791602; 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=4oSJitA/lzrTpzddQXggI9ORdHqMXT3PxB8e6htKSV8=; b=gveVe6xsDdnxPAjCvyJPgiq4zndyWjpq3KxAGwHjZCXleC7Yai5sAiCq5jjWemddAGG1Sx Pfk4xLPKY2sT4yc4WEvAYJV1ooKkjx/D6evPgFX7e8FwPxSmDiejCnNJmCBj68rrpbsKcK nBh8cG/77giVozWOTkh+Kwww/5cT4S0= X-MC-Unique: R6RgGJtvNVC5zzTlFk2V_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4oSJitA/lzrTpzddQXggI9ORdHqMXT3PxB8e6htKSV8=; b=MmCbg1QN2je9aMg5UfXSd4iVgdLA5nBgDAQ/enc6sCWN8WgxQjJpzRqVGt8+XViXKI vJJRLK6q7kNyMRfBlm+lqIYMceZAytbmxlbvYwpASLfVbNs34xTwqYF4mjLwzXa1xQ8C lWAXJhRzS2EqpN8cQ+iml6cW0ieiewAV4Ck6/+FcgUVstH0AGtisGXgVbyFcNFatfsiD 0cgI10DdxL7tNC1uvQR19cULWIiUHr/R2pmpjOquAUwKD2I5CIBTeucHcuJZeJGPP8Km m5Vt/XVQc99RrRlCm2kypOZmTUKBI+UmmtnlNj2FAb5qFcoktNpzcofCs/yk2Kstc5Fa lWOw== X-Gm-Message-State: AOAM5313u+egQZAwQQWvQLuJ8bjErVFGiJ/QXA31kv/uT8BmtaTlwz7y 5C36bPdbMtB/zXSy0vXi0MfBX5dYBvDCBRhWemMnhsxGnGddJcR0ap0TN0hP6O49A/fd1G6Kj93 hfG8dem0SJArBiJaXC8l9E9OL1CheiAKa33bO8w3uA4VQw63X/Sh26CkXSAfw X-Received: by 2002:aa7:d487:: with SMTP id b7mr5739758edr.61.1630791403479; Sat, 04 Sep 2021 14:36:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9ZfZtnmb0VC+4WSd5HRHyAYKuLXwN7noNlfRx6S9Wfl20x77y11Qr4ukoThHVt3u9UaIapg== X-Received: by 2002:aa7:d487:: with SMTP id b7mr5739748edr.61.1630791403283; Sat, 04 Sep 2021 14:36:43 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 15/35] vhost: correctly detect the enabling IOMMU Message-ID: <20210904213506.486886-16-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792815968100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Vhost used to compare the dma_as against the address_space_memory to detect whether the IOMMU is enabled or not. This might not work well since the virito-bus may call get_dma_as if VIRTIO_F_IOMMU_PLATFORM is set without an actual IOMMU enabled when device is plugged. In the case of PCI where pci_get_address_space() is used, the bus master as is returned. So vhost actually tries to enable device IOTLB even if the IOMMU is not enabled. This will lead a lots of unnecessary transactions between vhost and Qemu and will introduce a huge drop of the performance. For PCI, an ideal approach is to use pci_device_iommu_address_space() just for get_dma_as. But Qemu may choose to initialize the IOMMU after the virtio-pci which lead a wrong address space is returned during device plugged. So this patch switch to use transport specific way via iommu_enabled() to detect the IOMMU during vhost start. In this case, we are fine since we know the IOMMU is initialized correctly. Signed-off-by: Jason Wang Message-Id: <20210804034803.1644-4-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index e21e144510..b4b29413e6 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -315,7 +315,7 @@ static int vhost_dev_has_iommu(struct vhost_dev *dev) * does not have IOMMU, there's no need to enable this feature * which may cause unnecessary IOTLB miss/update trnasactions. */ - return vdev->dma_as !=3D &address_space_memory && + return virtio_bus_device_iommu_enabled(vdev) && virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); } =20 --=20 MST From nobody Fri May 3 05:42:18 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 1630791855419518.6734253689697; Sat, 4 Sep 2021 14:44:15 -0700 (PDT) Received: from localhost ([::1]:33742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdSQ-0008Bv-DX for importer@patchew.org; Sat, 04 Sep 2021 17:44:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLL-0005dz-PO for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLG-0001Ci-Gm for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:54 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-YUCyoR_ZNfiWPcroFZc1hw-1; Sat, 04 Sep 2021 17:36:48 -0400 Received: by mail-ed1-f69.google.com with SMTP id i17-20020aa7c711000000b003c57b06a2caso1347547edq.20 for ; Sat, 04 Sep 2021 14:36:48 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id x15sm1526049ejv.95.2021.09.04.14.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791409; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6uDcGv5RC4jtHvohYZqBjP0QWBU1keDM9ihWG0zP6OU=; b=U81S3EygexBM14PhVL8HRKkMuY5GYZF0DWsv2M636PQKB/l4evUVSgpK5X9EptiQyUmcRq /4oRRJHVltyMRlw/HIYB1qk/GytI8DSpQf5tBKtNpgjmG/TE4CxeAhjtz8F+BJ4x5JTpaa vcuIv46I4CRCzhqWUf8TH+RphqJ6NK0= X-MC-Unique: YUCyoR_ZNfiWPcroFZc1hw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=6uDcGv5RC4jtHvohYZqBjP0QWBU1keDM9ihWG0zP6OU=; b=MQEKTydPQpVpNMUNvhXx4i7RYDSNGIbTYPsxOjrI1aYh/IXN0oGsrD0xEFJMOhYI4n 8BuAvf162opFYhCJ1vi04Ff41Y74m6X4qPB2fou6LAYYaXyLUqQAXmtLNCEd2f0AEebY NfElklqYNkLNJq51I88gOQHKRPB1ZyBZBEZxHmwKOIyhdrXEeEY+r99JvZ9dqI0WmDsb +wYTFtY5cUJJVJekgA7kGdO0vgbtO5panVxNbm64Bc8pcZj4zfGpOcUs3ZGDq4x5Qcpn kmMqk97VAhDnkcvfLeVGqX6UU9qgifZRgmQOMeyTgUwZCqrStyw+zrbJhKu9NbC2Kb+5 tYQA== X-Gm-Message-State: AOAM533Uih7JwSl9heafmAlXW07te39FGvRrru66FO2DG2pUlNuunVyx 9Eim4qcf13eYPJzlx/b3LuB9Frt9CGSOy9EdRKB/foND3WFuEWuAubSRKi2p/oniBTwLE9HVRaI npOh5u0eNvAO3NcisQTPcUVmnErEXgzk2pVDX6Jdqp9fAzVKZT1yADSzOGFSJ X-Received: by 2002:a17:906:3e16:: with SMTP id k22mr5932777eji.280.1630791406951; Sat, 04 Sep 2021 14:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxlu/hpeGnhobt1I/GH0xGwV4K6DVPrSsuvft2laTgm2nr1Usj8MPVdUHkRD0EQwJ4lenToQ== X-Received: by 2002:a17:906:3e16:: with SMTP id k22mr5932755eji.280.1630791406715; Sat, 04 Sep 2021 14:36:46 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:43 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 16/35] hw/i386/acpi-build: Get NUMA information from struct NumaState Message-ID: <20210904213506.486886-17-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Jingqi Liu , Richard Henderson , Paolo Bonzini , Ani Sinha , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= 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: 1630791856926100001 From: Jingqi Liu Since commits aa57020774b ("numa: move numa global variable nb_numa_nodes into MachineState") and 7e721e7b10e ("numa: move numa global variable numa_info into MachineState"), we can get NUMA information completely from MachineState::numa_state. Remove PCMachineState::numa_nodes and PCMachineState::node_mem, since they are just copied from MachineState::numa_state. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jingqi Liu Message-Id: <20210823011254.28506-1-jingqi.liu@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 4 ---- hw/i386/acpi-build.c | 12 +++++++----- hw/i386/pc.c | 9 --------- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 97b4ab79b5..4d2e35a152 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -47,10 +47,6 @@ typedef struct PCMachineState { bool default_bus_bypass_iommu; uint64_t max_fw_size; =20 - /* NUMA information: */ - uint64_t numa_nodes; - uint64_t *node_mem; - /* ACPI Memory hotplug IO base address */ hwaddr memhp_io_base; } PCMachineState; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9a9572cadb..d1f5fa3b5a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1914,6 +1914,8 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) X86MachineState *x86ms =3D X86_MACHINE(machine); const CPUArchIdList *apic_ids =3D mc->possible_cpu_arch_ids(machine); PCMachineState *pcms =3D PC_MACHINE(machine); + int nb_numa_nodes =3D machine->numa_state->num_nodes; + NodeInfo *numa_info =3D machine->numa_state->nodes; ram_addr_t hotplugabble_address_space_size =3D object_property_get_int(OBJECT(pcms), PC_MACHINE_DEVMEM_REGION_SIZ= E, NULL); @@ -1957,9 +1959,9 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) next_base =3D 0; numa_start =3D table_data->len; =20 - for (i =3D 1; i < pcms->numa_nodes + 1; ++i) { + for (i =3D 1; i < nb_numa_nodes + 1; ++i) { mem_base =3D next_base; - mem_len =3D pcms->node_mem[i - 1]; + mem_len =3D numa_info[i - 1].node_mem; next_base =3D mem_base + mem_len; =20 /* Cut out the 640K hole */ @@ -2007,7 +2009,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) } =20 slots =3D (table_data->len - numa_start) / sizeof *numamem; - for (; slots < pcms->numa_nodes + 2; slots++) { + for (; slots < nb_numa_nodes + 2; slots++) { numamem =3D acpi_data_push(table_data, sizeof *numamem); build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS); } @@ -2023,7 +2025,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) if (hotplugabble_address_space_size) { numamem =3D acpi_data_push(table_data, sizeof *numamem); build_srat_memory(numamem, machine->device_memory->base, - hotplugabble_address_space_size, pcms->numa_node= s - 1, + hotplugabble_address_space_size, nb_numa_nodes -= 1, MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED= ); } =20 @@ -2525,7 +2527,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) } } #endif - if (pcms->numa_nodes) { + if (machine->numa_state->num_nodes) { acpi_add_table(table_offsets, tables_blob); build_srat(tables_blob, tables->linker, machine); if (machine->numa_state->have_numa_distance) { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 22aa598d50..7e523b913c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -802,18 +802,9 @@ void pc_machine_done(Notifier *notifier, void *data) =20 void pc_guest_info_init(PCMachineState *pcms) { - int i; - MachineState *ms =3D MACHINE(pcms); X86MachineState *x86ms =3D X86_MACHINE(pcms); =20 x86ms->apic_xrupt_override =3D true; - pcms->numa_nodes =3D ms->numa_state->num_nodes; - pcms->node_mem =3D g_malloc0(pcms->numa_nodes * - sizeof *pcms->node_mem); - for (i =3D 0; i < ms->numa_state->num_nodes; i++) { - pcms->node_mem[i] =3D ms->numa_state->nodes[i].node_mem; - } - pcms->machine_done.notify =3D pc_machine_done; qemu_add_machine_init_done_notifier(&pcms->machine_done); } --=20 MST From nobody Fri May 3 05:42:18 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 1630792001304661.4951690758327; Sat, 4 Sep 2021 14:46:41 -0700 (PDT) Received: from localhost ([::1]:42114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdUm-0005Mh-3f for importer@patchew.org; Sat, 04 Sep 2021 17:46:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLQ-0005lP-5c for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLJ-0001EV-Vj for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:59 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-217-fJxgV6ZDP7aoNYWcWcpYOA-1; Sat, 04 Sep 2021 17:36:51 -0400 Received: by mail-ed1-f70.google.com with SMTP id bf22-20020a0564021a5600b003c86b59e291so1352807edb.18 for ; Sat, 04 Sep 2021 14:36:51 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id kw10sm1525608ejc.111.2021.09.04.14.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791413; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYn+qduJJUwE42My/YILr3Fq6lwJXG71AaCS4n8QCXM=; b=idsfPlkFU4P8MTdYw0DVIirgsVYKd2Hmwfm2o4hxi4l8cCuC10XuOZpcfNbrP8DU71zUSl Ss7RLH9C9sy6Hb74zuarTIe1LqtpnZfcijBF+BZLn/TjZRaqmbILTFOBSxOAnTNug5pYAP IPPWTxZ73N0qKE3oir3jgsmi6ECt9p0= X-MC-Unique: fJxgV6ZDP7aoNYWcWcpYOA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=jYn+qduJJUwE42My/YILr3Fq6lwJXG71AaCS4n8QCXM=; b=aCAaJLHOqkQwZa8Egny+8jxiJeigaJgzFO5Yxlh+ep5sDXiK9eeFblYIMSHWK4EMig 4AqnWLWX6OfCUv0PFLw+ToRUqv4KhkrUg27ACEMhuNPSqlFGeQvwxNttrvneusbD8V1e ErldVoGtxhn6/X+wyR5CJKTwhPCSW3SxL1R2OtpiOyuJ3s9Po1qzQgOqs6ip1MoL8vVQ InnCrMRpR6k0Mb2FeU7YzpWW8BbCeKXIXwntv8a0XVqMWV4Kdqe/touuZl7Lcakuhkzy WdDdkXxx6hxwLkj9IPvFcARMXbBHjwOmjD5TcllFaIugTIzLhVB44mNX6erRYKUnpCN1 2+Jw== X-Gm-Message-State: AOAM533NguOJ0YMpfVLX1M7S2255oW0l3l4/bPOCIL2ny2BdF2Ixr9+P k3aCGP9RshX5KRm2ttcO1XboZHlL09adPBfjR/xZydgtAZu2cqR8wCwoMYeG8r2rWPXTeL9ZjXE VHpWAB1X27gy5UGHWIGs7sM0cCRObFj64eQImOUImsuxCQS1J0oEYxIqcd2q6 X-Received: by 2002:a17:906:b84a:: with SMTP id ga10mr5865260ejb.143.1630791410442; Sat, 04 Sep 2021 14:36:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkor17kA1bLu8iQrXgO8KTeY8BXmYlVIAM5SCtsUibkWZoPpZ9grxpXOM7qgZyT7xt8Odtqw== X-Received: by 2002:a17:906:b84a:: with SMTP id ga10mr5865246ejb.143.1630791410231; Sat, 04 Sep 2021 14:36:50 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:47 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 17/35] hw/pci: remove all references to find_i440fx function Message-ID: <20210904213506.486886-18-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=216.205.24.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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ani Sinha , Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Paolo Bonzini 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: 1630792001610100001 From: Ani Sinha commit c0e427d6eb5fefc538 ("hw/acpi/ich9: Enable ACPI PCI hot-plug") remove= d all uses of find_i440fx() function. This has been replaced by the more generic = call acpi_get_i386_pci_host() which maybe able to find the root bus both for i44= 0fx machine type as well as for the q35 machine type. There seems to be no more= any need to maintain a i440fx specific version of the api call. Remove it. Tested by building from a clean tree successfully. Signed-off-by: Ani Sinha Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210825031949.919376-2-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci-host/i440fx.h | 1 - hw/pci-host/i440fx.c | 6 ------ stubs/pci-host-piix.c | 7 ------- stubs/meson.build | 1 - 4 files changed, 15 deletions(-) delete mode 100644 stubs/pci-host-piix.c diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index 7fcfd9485c..f068aaba8f 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -45,6 +45,5 @@ PCIBus *i440fx_init(const char *host_type, const char *pc= i_type, MemoryRegion *pci_memory, MemoryRegion *ram_memory); =20 -PCIBus *find_i440fx(void); =20 #endif diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index cd87e21a9b..e08716142b 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -314,12 +314,6 @@ PCIBus *i440fx_init(const char *host_type, const char = *pci_type, return b; } =20 -PCIBus *find_i440fx(void) -{ - PCIHostState *s =3D PCI_HOST_BRIDGE(object_resolve_path("/machine/i440= fx", NULL)); - return s ? s->bus : NULL; -} - static void i440fx_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); diff --git a/stubs/pci-host-piix.c b/stubs/pci-host-piix.c deleted file mode 100644 index 93975adbfe..0000000000 --- a/stubs/pci-host-piix.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "qemu/osdep.h" -#include "hw/pci-host/i440fx.h" - -PCIBus *find_i440fx(void) -{ - return NULL; -} diff --git a/stubs/meson.build b/stubs/meson.build index 275ac89c16..beee31ec73 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -26,7 +26,6 @@ stub_ss.add(files('module-opts.c')) stub_ss.add(files('monitor.c')) stub_ss.add(files('monitor-core.c')) stub_ss.add(files('pci-bus.c')) -stub_ss.add(files('pci-host-piix.c')) stub_ss.add(files('qemu-timer-notify-cb.c')) stub_ss.add(files('qmp_memory_device.c')) stub_ss.add(files('qmp-command-available.c')) --=20 MST From nobody Fri May 3 05:42:18 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 1630791980129738.9371671079355; Sat, 4 Sep 2021 14:46:20 -0700 (PDT) Received: from localhost ([::1]:40468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdUR-0004DC-5e for importer@patchew.org; Sat, 04 Sep 2021 17:46:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLP-0005l3-EC for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLM-0001Fs-W7 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:59 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-hro8X2MYOaaQRUg4THX_Iw-1; Sat, 04 Sep 2021 17:36:54 -0400 Received: by mail-ed1-f70.google.com with SMTP id s25-20020a50d499000000b003c1a8573042so1491528edi.11 for ; Sat, 04 Sep 2021 14:36:54 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id x9sm1886607edj.95.2021.09.04.14.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791416; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I6hzXvSZcmKkCiwpFrjVYwk3ML2ZhCV+5LcXx5Zj5FA=; b=gHruwHixl0Gm2LmmP9zaz+BYH5Giuq4g4ysFo9wTYX8vEKfDISsQob34fak+vtIO/08kx+ bHYnq3Y/+t4l4LMTaEAzQiAfb0Y8np9BPUyX/YGjFiHPliH9iX2+hEL69Ie+LyVqE1f+et tYd2ChRwPdLCcF9W6uzg7ktaxDOaWOE= X-MC-Unique: hro8X2MYOaaQRUg4THX_Iw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=I6hzXvSZcmKkCiwpFrjVYwk3ML2ZhCV+5LcXx5Zj5FA=; b=sizvdFAhuqcp7dFOAg0ff2xSYkhigAztWop1NMEVVl9kRer3N9ijnq4jL4t5Ay5TmI f/W0lN009K8JXnNeDX1wU0IZg8BkddZNjismSOnVv+YUihL/w2/p1jArV2XMPLHQ4LXs 4mVHqIoOoLVm1DzqPZ5pJOkqKIShNa7h1IdgayhL8LCvPYy7U2qGgduCyDhbSoCLcDB7 D6AZz+lcAtCecQZXlxGA640Xu1QNfgZy11MEomdevFySqeAsYurzpi0+CQCLugyLk4Qt U9gbb2Fcd3PYriveSOgwQs3iH4bVJ9VBuyhet6/zm7dB3Ik0m/CivpX9vo6R2ZVTC9oZ SyVA== X-Gm-Message-State: AOAM533d21cIi0pUHWsboh461+bwpgPOaMXiUMz2dTRgFxSE4CmJMUe9 XVKonRNpXJhunmad2AmT35hTk6sDUdUmOMdRq5dxbsZ5jSc6QedDyp4Cxwzb2hO2UxKcZ8/zF+u uCyoyoWYkbrg+hg7dWvdeyId6WxzrdGD1lBZcRmy6kkLjQbJZr99xtoILFmkn X-Received: by 2002:a17:906:3fd7:: with SMTP id k23mr5852978ejj.176.1630791413432; Sat, 04 Sep 2021 14:36:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAyygnQ4Efnaro8v8OKthQ/z7GBUDh8tca08RnJeSPWY85GWWg35kt9b+AprTbE9wDMsmzCg== X-Received: by 2002:a17:906:3fd7:: with SMTP id k23mr5852955ejj.176.1630791413245; Sat, 04 Sep 2021 14:36:53 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:50 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 18/35] hw/acpi: use existing references to pci device struct within functions Message-ID: <20210904213506.486886-19-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ani Sinha , Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov 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: 1630791981063100001 From: Ani Sinha There is no need to use fresh typecasts to get references to pci device str= ucts when there is an existing reference to pci device struct. Use existing refe= rence. Minor cleanup. Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210825031949.919376-3-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/pcihp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index f4d706e47d..f610a25d2e 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -283,7 +283,7 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotp= lug_dev, =20 /* Only hotplugged devices need the hotplug capability. */ if (dev->hotplugged && - acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))) < 0) { + acpi_pcihp_get_bsel(pci_get_bus(pdev)) < 0) { error_setg(errp, "Unsupported bus. Bus doesn't have property '" ACPI_PCIHP_PROP_BSEL "' set"); return; @@ -363,8 +363,8 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplu= g_dev, AcpiPciHpState *s, { PCIDevice *pdev =3D PCI_DEVICE(dev); =20 - trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn), - acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))= )); + trace_acpi_pci_unplug(PCI_SLOT(pdev->devfn), + acpi_pcihp_get_bsel(pci_get_bus(pdev))); =20 /* * clean up acpi-index so it could reused by another device --=20 MST From nobody Fri May 3 05:42:18 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 1630791836923234.73148321951055; Sat, 4 Sep 2021 14:43:56 -0700 (PDT) Received: from localhost ([::1]:60274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdS7-00074B-Us for importer@patchew.org; Sat, 04 Sep 2021 17:43:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLR-0005lW-E2 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLP-0001Hm-N9 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:00 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-s0RaldS5OiCSgCtLEA74vw-1; Sat, 04 Sep 2021 17:36:58 -0400 Received: by mail-ed1-f72.google.com with SMTP id b15-20020a05640202cf00b003cd5efcd633so1507130edx.9 for ; Sat, 04 Sep 2021 14:36:58 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id d6sm1900829edx.0.2021.09.04.14.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791419; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vFrxzlGUYuvipK0lYqredbuf7giybAcrOV0JeHM2q0Y=; b=a8xlgAL8yoS53X7QP9IfXOyhGWrujxFNDzvG3cfaG//NEIt5GiY4r2jvG/MZjYTt+u5iEZ JzwWOAUCQ7HHeExZtIxwYJfNdHpXp07uT77o2NN1fVLk68eQgytc6Bb3Uv05zLz3VKLjWS m4iwh/zWiGDVgYBpo0XqwTzmDpzq/OU= X-MC-Unique: s0RaldS5OiCSgCtLEA74vw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=vFrxzlGUYuvipK0lYqredbuf7giybAcrOV0JeHM2q0Y=; b=mucyfOZb6As63TeYGAVkS/mFlJMWyco4I3adij/fDxjIgdCgVh969GRyEb4fAJwtMH g9CjVbO4QkW1e6FPR7cAbcN5XD3f94vNh8v83zEKbbyXSwBWrqm+7sT5wBaGHrYRq9Vh Rq4/cGRHrKZ+CakIUNgPDvN2vZMxJ6yhrthzvbtr+4aphRivx7SZ7JxMVHXlomsrtA8t BJ07scgJTxhAJu/0n38s/F8y3yF8cbKLTaCWD1Jdau3isPT/Wf2La8ec+49fsV8wmDIu X98WefsdIV5Aaf4nUnnnk5x4R5pdauMwlFUeSYFHbZpp1xFYPIrACoiMvcfAecn/O3S2 WUMg== X-Gm-Message-State: AOAM530gmbNVCZcbJ2wo8Xnve8S+gcEUsAWeWSxy0E17RUOM4YzjuJHw U+9aJtMa1A/6i6oU27SFT4afp+82cOpNRX0iROxxhUMkRkWnKXKiH5jKyKzaedoHy4eHgpxcRCm EhuTvVfLzckI/6v2Ek0nb1h9qzlT59lJ1WEuSDij1q++UQf3hP7s6X/vtN/P+ X-Received: by 2002:a17:906:988a:: with SMTP id zc10mr6024740ejb.256.1630791416751; Sat, 04 Sep 2021 14:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnkjeDJtYLNSbNsguEmH4lDJgtevTGyMucaNvRFDuibG/oIX+9utyOZcAZbhmIDPA6F7rAGg== X-Received: by 2002:a17:906:988a:: with SMTP id zc10mr6024723ejb.256.1630791416559; Sat, 04 Sep 2021 14:36:56 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:53 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 19/35] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem Message-ID: <20210904213506.486886-20-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Richard Henderson , Paolo Bonzini , Ani Sinha , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= 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: 1630791838365100001 From: Ani Sinha I have developed an interest in this space and hopefully can lend some helping hand to Igor and Michael in reviewing simpler patches. Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Igor Mammedov Message-Id: <20210825031949.919376-4-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5d923a6544..6c20634d63 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1751,6 +1751,7 @@ F: docs/specs/*pci* ACPI/SMBIOS M: Michael S. Tsirkin M: Igor Mammedov +R: Ani Sinha S: Supported F: include/hw/acpi/* F: include/hw/firmware/smbios.h --=20 MST From nobody Fri May 3 05:42:18 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 1630791760521212.20517526068204; Sat, 4 Sep 2021 14:42:40 -0700 (PDT) Received: from localhost ([::1]:54672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdQt-0003Je-93 for importer@patchew.org; Sat, 04 Sep 2021 17:42:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLU-0005qP-QG for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLT-0001La-E7 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:04 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-JgBb9cyfO0a7wRdTSX9UiA-1; Sat, 04 Sep 2021 17:37:01 -0400 Received: by mail-ej1-f70.google.com with SMTP id c25-20020a170906529900b005c56c92caa2so844793ejm.19 for ; Sat, 04 Sep 2021 14:37:01 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id e22sm1924047edu.35.2021.09.04.14.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791422; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sSh2M0iEYArsKdnCzWuCUKGerGJG9NoNb7thnyEYSpU=; b=Ad3Q1TUNX/Rfj1olEL86AoYmhdmEQ29EC0TcRAty2qCYGdcIXplcbckcn6KM/qoJlD1lyl jJrB4wZzIxs/rI1n5vPwyJnP1hO6OVRsOFQtb+lLpzFBcCxLasFmQyOtGHpmZfn72pkmBn OwFIxy4PnPH1JIddhNbj/1+4oTHfJzQ= X-MC-Unique: JgBb9cyfO0a7wRdTSX9UiA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=sSh2M0iEYArsKdnCzWuCUKGerGJG9NoNb7thnyEYSpU=; b=gYiCYskbh2CFauqjAIzNOYgunXFynbbhn2SDHIpPNUNcxGrXjZju4YV0jEJ31By1OV bKnNa1Ib0PqWZBsTWMyemzETromjzqA/N41P0sBqzgFyPMATcEJ9aMRxugkARa3hta2h DrLu2VjAD3HDIRlbxMMsNuSyDRbm9zHBED6bQizHzL+EJY0tNHUmmX/mcFC3+Fkrfl1N /sd3D5Wc97Bxc0KOCTznSXegCLmJ4nqL5dWedIVgY4BxZA67AUO3ThRH7gOiBImdYzKa vvTljpoCNzAp7JKV6psX6u8iTgAThXadiQtoZMdxJtKLFrJrXzuJ/6fPkQ9slVpy9Er3 M3sA== X-Gm-Message-State: AOAM531A6EstVMYBogYgd4qn8vLiLDACzlV6FPgW/Zn6OuNiP0SMpMCW +p7uPmv4h3TiXjcoHAXLkGNswQQEqv8/hXpQBi0Tsgvw4FO4OAwUQ5XQJ2kK2N4wJCHg+i1Eyhf DxFQUBMKksH1yIbdZ5l4Fhj89rdgb/UrC77WwyEOLCHfzm/JBxdu9lAhgY14H X-Received: by 2002:a17:907:7704:: with SMTP id kw4mr5995646ejc.23.1630791420092; Sat, 04 Sep 2021 14:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWlhNZCS6UKfacvE0RZUaDf4AAYsR6T0Pv3JKjCo9+FGJNCq6u8QkJzjHdjqLvIpioRvMFkg== X-Received: by 2002:a17:907:7704:: with SMTP id kw4mr5995626ejc.23.1630791419874; Sat, 04 Sep 2021 14:36:59 -0700 (PDT) Date: Sat, 4 Sep 2021 17:36:56 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 20/35] hw/virtio: Document virtio_queue_packed_empty_rcu is called within RCU Message-ID: <20210904213506.486886-21-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Stefano Garzarella 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: 1630791762736100001 From: Philippe Mathieu-Daud=C3=A9 While virtio_queue_packed_empty_rcu() uses the '_rcu' suffix, it is not obvious it is called within rcu_read_lock(). All other functions from this file called with the RCU locked have a comment describing it. Document this one similarly for consistency. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210826172658.2116840-2-philmd@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella Reviewed-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 874377f37a..a5214bca61 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -634,6 +634,7 @@ static int virtio_queue_split_empty(VirtQueue *vq) return empty; } =20 +/* Called within rcu_read_lock(). */ static int virtio_queue_packed_empty_rcu(VirtQueue *vq) { struct VRingPackedDesc desc; --=20 MST From nobody Fri May 3 05:42:18 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 1630792107025201.44724113007965; Sat, 4 Sep 2021 14:48:27 -0700 (PDT) Received: from localhost ([::1]:49074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdWT-0001Yj-Nq for importer@patchew.org; Sat, 04 Sep 2021 17:48:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLX-0005tO-79 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLV-0001NA-Q5 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:06 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-MeWG8XIMNWSR_znHPDjJLA-1; Sat, 04 Sep 2021 17:37:04 -0400 Received: by mail-ed1-f70.google.com with SMTP id j13-20020aa7ca4d000000b003c44c679d73so1501771edt.8 for ; Sat, 04 Sep 2021 14:37:04 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id b18sm1518651ejl.90.2021.09.04.14.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791425; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DKUyiG5ulvlN8bn9hYjVPeiz0laMQTjL5M3rAODT118=; b=dl8JpKL4mE5h/M5doK4y4NGDXT3WbXkX+nuXrH/YJ7Zo/yWIzu0PkD5no7gqEYEtSH4EdV TME5hgvo6lgQSuPKzITFmSQbppu5oiP60axF9FlzNGqiMsie1UcNagwy4eNHd+EAg3Wj0D NaSUklycur3lso/g27e3CGvPkndkC38= X-MC-Unique: MeWG8XIMNWSR_znHPDjJLA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=DKUyiG5ulvlN8bn9hYjVPeiz0laMQTjL5M3rAODT118=; b=FTJkVwav7jbH6OB+87VUFOltDtyTn/+qbPLrub5nCUYe51VUP+4QdKw2+J+hCM7t8I vncshvOQOoFybDQA/1tjBi+8nGvtxtjmqfu0J+B/9sY4EdIbqPwOFw4PIqKPwfQF8Bkt 5VtiWrI5bQmR9vtLR7DT+7rgGurxcx1u4GTOTlzzxsuYzu7Gy63pgPXJkNICvVkeC/97 6TWNtZJrG5PSA6VBcUvkLh92+D0KxcEKz0SEUDi0erUDkXsvCWsMw5EW4/sR6SzlFIFy ArDeY/94Sdm/4sQp8WLY60FiVbYD50KInhOZmat4WIhM9PnmPLWGWrYjqOzGY3x3DTVS Rqqw== X-Gm-Message-State: AOAM530KUV6YiTinPTGuhgkR5lKyTe0pD3SlooocZuGLLWCzdcSuGdXX BxqJVHdkZvC/NqTjGoQ8SiMLduxdx3tilrxpR58dwznHD7iUAc9qIG0KXupdyyZs1KWXMThhCKx gMt0kxPibyFlAjy0TVlDQmLYKHQHyNguV5+aeHxxUsZbWCPrTtx07nSTOZXQt X-Received: by 2002:a17:906:9ac5:: with SMTP id ah5mr6005557ejc.224.1630791422654; Sat, 04 Sep 2021 14:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZs/laeXpFr0DvoDT3/miKSIDRJomlYg+fsr4RJXQCglVMqwYI3lt9JvRkPTYVZvEDt9WeGw== X-Received: by 2002:a17:906:9ac5:: with SMTP id ah5mr6005540ejc.224.1630791422469; Sat, 04 Sep 2021 14:37:02 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 21/35] hw/virtio: Remove NULL check in virtio_free_region_cache() Message-ID: <20210904213506.486886-22-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Stefano Garzarella 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: 1630792108432100001 From: Philippe Mathieu-Daud=C3=A9 virtio_free_region_cache() is called within call_rcu(), always with a non-NULL argument. Ensure new code keep it that way by replacing the NULL check by an assertion. Add a comment this function is called within call_rcu(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210826172658.2116840-3-philmd@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella Reviewed-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a5214bca61..3a1f6c520c 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -133,12 +133,10 @@ struct VirtQueue QLIST_ENTRY(VirtQueue) node; }; =20 +/* Called within call_rcu(). */ static void virtio_free_region_cache(VRingMemoryRegionCaches *caches) { - if (!caches) { - return; - } - + assert(caches !=3D NULL); address_space_cache_destroy(&caches->desc); address_space_cache_destroy(&caches->avail); address_space_cache_destroy(&caches->used); --=20 MST From nobody Fri May 3 05:42:18 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=1630792223; cv=none; d=zohomail.com; s=zohoarc; b=ROS41nGmtnny2fxzSUsd7Anrwr2h+aVhuFX0u0xltl6qPXTXG2Bho3jRAefUBwt8MOR+yThqzJmbut1h62JR1hyU2bWv6wLQHexrBF6VjtCofdlA+XoqzcgZnSOqiQTlec0qck+MYImQlxV0knu/ijAr0NE9KtzaoW1Cw8AY7r8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792223; h=Content-Type:Content-Transfer-Encoding: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=fjJZP5VxMZRko4GDNQkgZ7w7i54b8fphWN/XvBHKOms=; b=gJKOr+aMM+qs8NNZTOoKIMV/49vlmJIGrqptrwa+tozCJDci8IqD2EjfbRcixbOJPaV7mmU17oad72TI78grHoqW9Amq/h+5Iiovu8ZtoQEh/BGssrsQHSlVQyIjkWjeRiR62I8j6u1Emv9lMmYBFaWAdiQ3w0BdJEVPr/GW5tw= 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 1630792223838284.52200497217416; Sat, 4 Sep 2021 14:50:23 -0700 (PDT) Received: from localhost ([::1]:57650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdYM-0007EK-S6 for importer@patchew.org; Sat, 04 Sep 2021 17:50:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLZ-0005vW-R8 for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLY-0001PM-FW for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:09 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-553-z8_8pSRhM2OFNZdWY7cO1A-1; Sat, 04 Sep 2021 17:37:06 -0400 Received: by mail-ej1-f70.google.com with SMTP id x6-20020a170906710600b005c980192a39so866175ejj.9 for ; Sat, 04 Sep 2021 14:37:06 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id rl23sm1534197ejb.50.2021.09.04.14.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791428; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fjJZP5VxMZRko4GDNQkgZ7w7i54b8fphWN/XvBHKOms=; b=f984nkc0jAE8KbmF66aG2vHGAJlKCmo+aRGP/jWc9B2R09Y6s/ris0eAPM/xaNTJHPyTa0 ZVrSLaoPFyBToilUMN9uOQcxt50ePm2Jd45Q9yDAOBbTvmFFQImHAEpt1lWQuN+tKZCuFs 9Nw1u0x6aRJhn8gJHRaa0UE2aL5s6MU= X-MC-Unique: z8_8pSRhM2OFNZdWY7cO1A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=fjJZP5VxMZRko4GDNQkgZ7w7i54b8fphWN/XvBHKOms=; b=pqftAYOs90ACAXEvEeQtLXygERjiN/ZWnj578ff81ra9/9ck/9DLitA70WOHMBxTq1 abErs7quknVWobTcKsSLto5/34ecfRBFkcST8LWBBmnFX15MURGEEm49stxXa4KYva3N /+w9jDGKQlTFqfLbwBViKfJeLzXrKR8vS7OAK2bBwC3OcJ/53v73FUSdgWaTd2B+6M95 RNoqcGyxvzeIQxp7Xim2skKKD7Z5ATMuzjdM/xINcSpMrTwHb7kayE2pmcCQa2SpN39X 4uqrOq0FXlso+/5oqZQzdb/H5UcnMveoxlm45i2rK65qD2p34deiLTML8sZ9RLmWwMhe JTDA== X-Gm-Message-State: AOAM5317SFSciV9UyasWJfm8dwE/+gIzm6PpoJU1gFb6lFulS509zQKo 6oKoY9vt+DHXqIk6Ejb5G2B/lsQXbQ6IkQo2ABBO2n0R/1w3JrjMRqkaZ9zHdyVsPl1onGu4USP lclJI2LIPuIAH8Qm1G1AtF8R9f49EOyIbJIeCI2OXVJTq3wGr5w/oE7NtLaxJ X-Received: by 2002:a17:906:308d:: with SMTP id 13mr5853357ejv.570.1630791425300; Sat, 04 Sep 2021 14:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoJ6RQ9T6qMLAtwX62/UCwV1KIvqS1vbspdImDNMkeZDGTe4NH/kVD7CxI7VNy8lvPnp/Now== X-Received: by 2002:a17:906:308d:: with SMTP id 13mr5853344ejv.570.1630791425150; Sat, 04 Sep 2021 14:37:05 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:02 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 22/35] hw/virtio: Add flatview update in vhost_user_cleanup() Message-ID: <20210904213506.486886-23-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Yuwei Zhang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792225603100001 From: Yuwei Zhang Qemu will crash on vhost backend unexpected exit and re-connect = =E2=94=82 in some case due to access released memory. Signed-off-by: Yuwei Zhang Message-Id: <20210830123433.45727-1-zhangyuwei.9149@bytedance.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 360d9bc040..2c8556237f 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -2480,7 +2480,7 @@ void vhost_user_cleanup(VhostUserState *user) if (!user->chr) { return; } - + memory_region_transaction_begin(); for (i =3D 0; i < VIRTIO_QUEUE_MAX; i++) { if (user->notifier[i].addr) { object_unparent(OBJECT(&user->notifier[i].mr)); @@ -2488,6 +2488,7 @@ void vhost_user_cleanup(VhostUserState *user) user->notifier[i].addr =3D NULL; } } + memory_region_transaction_commit(); user->chr =3D NULL; } =20 --=20 MST From nobody Fri May 3 05:42:18 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 1630791868481370.2295726896913; Sat, 4 Sep 2021 14:44:28 -0700 (PDT) Received: from localhost ([::1]:35012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdSd-0000bm-Gn for importer@patchew.org; Sat, 04 Sep 2021 17:44:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLd-00060W-Fd for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLc-0001SL-2P for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:13 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-GCXaoOhoNDeklMCMGR409A-1; Sat, 04 Sep 2021 17:37:10 -0400 Received: by mail-ed1-f69.google.com with SMTP id u2-20020aa7d982000000b003cda80fa659so250872eds.14 for ; Sat, 04 Sep 2021 14:37:09 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id m6sm1874641edi.10.2021.09.04.14.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791431; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h9J1SZK6q/IrdiaUC0UN5jQCNpILg+MnT95UcKmm0bk=; b=NF99i+cKptmZqQThrPNyT+laIOwtlosZDKFrMYTP9BvgF1a/X6frNKr7tpsy4uoU+FuNxP Vj9zPLQ6dOa44F02bHkoWLXwjEdrDw3+oV0m3sX7n0/OZfAxxkbKCLIM1lW3SHHgumd0iX AbTHoiUUAPlfOaCeIW1L5t74nJAMHDw= X-MC-Unique: GCXaoOhoNDeklMCMGR409A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=h9J1SZK6q/IrdiaUC0UN5jQCNpILg+MnT95UcKmm0bk=; b=iBkn/jVdRprHyuxoItEr/+7FNFd7alh+u2AlbkGhU5Efd81Mj+hz9yD1ZViive2wJr vYyQdCSsmErol4XkquDieOyzzPHbRIGZcQwK62jHXKzsIggCCZhaEs3gEzm6BKY5Riwv TuCSV4XDzIfXIVk2zrd1e5iW/4nFAXvfhNyiQCxhNFfTAzSNmIWdSxiYAD2/f9TllDdH 79a2iulGr+dgFxVn9tFzYtSLGzwn5HQ2cEEzHaTEibiAnDjiSbNrQxQLZZAzhwA+1Uqj DpaX1ztS5Tt/0s0OORymQpqprfEYqdLvjBMuxZ7Z/AlZdb0/9G23u3/zMsaWpr726ATl i3vA== X-Gm-Message-State: AOAM531JN59mvrSHv42jh3ObdH0TuREzyBlbOYMOnD6vNgexeasYe1X2 YCxfQRFYfY8dRQDxOmx1xKCTv8T3+Awnz6sChL15zzHX/GUn48KjY7xYWMDqtD89iotg14K+srF yZvP/okdGbYwyerQKOeY0PuLBKlZlGzRqAsKO4TGAJ5T1S8hprR6Vp0ARL/WN X-Received: by 2002:a50:c905:: with SMTP id o5mr5746013edh.250.1630791428485; Sat, 04 Sep 2021 14:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1GlYq6v28X055RtGUwCbQMOR6DrO+nzNYBBB6WdTio8vlz+L32Cw39QohE81yBVSKmXzHEA== X-Received: by 2002:a50:c905:: with SMTP id o5mr5746003edh.250.1630791428326; Sat, 04 Sep 2021 14:37:08 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:05 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 23/35] tests/vhost-user-bridge.c: Sanity check socket path length Message-ID: <20210904213506.486886-24-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Coiby Xu , 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: 1630791869384100001 From: Peter Maydell The vhost-user-bridge binary accepts a UNIX socket path on the command line. Sanity check that this is short enough to fit into a sockaddr_un before copying it in. Fixes: Coverity CID 1432866 Signed-off-by: Peter Maydell Message-Id: <20210901152632.25511-1-peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/vhost-user-bridge.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 24815920b2..cb009545fa 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -540,6 +540,11 @@ vubr_new(const char *path, bool client) CallbackFunc cb; size_t len; =20 + if (strlen(path) >=3D sizeof(un.sun_path)) { + fprintf(stderr, "unix domain socket path '%s' is too long\n", path= ); + exit(1); + } + /* Get a UNIX socket. */ dev->sock =3D socket(AF_UNIX, SOCK_STREAM, 0); if (dev->sock =3D=3D -1) { --=20 MST From nobody Fri May 3 05:42:18 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 1630792123515257.7254984555981; Sat, 4 Sep 2021 14:48:43 -0700 (PDT) Received: from localhost ([::1]:50534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdWk-0002Xz-HF for importer@patchew.org; Sat, 04 Sep 2021 17:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLg-0006B3-5k for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLe-0001VJ-Ow for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:15 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-398-PhP7_B53PDmJxP9TZdce7w-1; Sat, 04 Sep 2021 17:37:13 -0400 Received: by mail-ed1-f69.google.com with SMTP id z17-20020a05640240d100b003cac681f4f4so1347509edb.21 for ; Sat, 04 Sep 2021 14:37:12 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id cf11sm1901705edb.65.2021.09.04.14.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791434; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lCTYA9qtrnGchUMuPb8pA4MhrNf+Qclj3/a+DtEJkUc=; b=OMwLB7CkWaMi+E5ChKZMvRuUDRSNkXkq9Z+lZaDIRhgfv2N8YC1QE5DreCdlspatkhBDyG NixkvyRd2VNrWM5Q3ep63dbRumUGxL1BPgl7OQyERh4049c0iqG7Duw+sEu5y3M93EIjzJ hQaJSjq6irnwzrXy52HVQjns68WtkfI= X-MC-Unique: PhP7_B53PDmJxP9TZdce7w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=lCTYA9qtrnGchUMuPb8pA4MhrNf+Qclj3/a+DtEJkUc=; b=H4XmujHaGWYzjj0uB+2jUu7ZmiVQ6se9v7QOuMLZa4DcBXmB7aOnRIsVC9YNsfllnN 3A4MOOT/ET6WxR9DNYfB3FnloPSiAyaaWhTlTiBMuJvMgOEoqcRWcsGxSgF2lCSvlvdG g78sPjpSLH3EiKErkW5MTKx75KGtSH2JCirMS6UBnmmiS1mL3S1hCXn3iaUlVr+HLvoA UQ+cI0QKBaolic+Wj5DLtf3PeuC9kC/uuqfQJ747Ka5R/xV6d+Xzzdujnbh3Wjq/6sun CliEP/tNuu5l+2rMZHgETQE9+ZB8chU2R7vZ504spzpuIv8z/ik7DVChnJM2CfkNOhsQ KU8Q== X-Gm-Message-State: AOAM533pPiCrl7KUxonoms9wTL+MmAHCarj/g4O2U3zCYALP+iXyPi+p lD0smp/osViQ6TWkf343p0xH/A7gnNK59MVuKgMD62VDjMvRlxoPps4zOl5PbplfF04X3e3JJj3 ZifsIbPNB//rG+udoiOc7MPul+8axcrWUj0viFTT9m6NpNdMtReuEiLAKVfXd X-Received: by 2002:a50:ab42:: with SMTP id t2mr5930644edc.113.1630791431527; Sat, 04 Sep 2021 14:37:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU+cj4u6U7WAjiDmPlKGb24AB/RrMzBAGFm8lUE3+Ks0Ou8+OvYGS1bujCTsjMloCq8gU8GQ== X-Received: by 2002:a50:ab42:: with SMTP id t2mr5930632edc.113.1630791431358; Sat, 04 Sep 2021 14:37:11 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:08 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 24/35] tests/vhost-user-bridge.c: Fix typo in help message Message-ID: <20210904213506.486886-25-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , 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: 1630792124917100001 From: Peter Maydell Fix a typo in the help message printed by vhost-user-bridge. Signed-off-by: Peter Maydell Message-Id: <20210901152713.25701-1-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/vhost-user-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index cb009545fa..35088dd67f 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -831,7 +831,7 @@ main(int argc, char *argv[]) out: fprintf(stderr, "Usage: %s ", argv[0]); fprintf(stderr, "[-c] [-H] [-u ud_socket_path] [-l lhost:lport] [-r rh= ost:rport]\n"); - fprintf(stderr, "\t-u path to unix doman socket. default: %s\n", + fprintf(stderr, "\t-u path to unix domain socket. default: %s\n", DEFAULT_UD_SOCKET); fprintf(stderr, "\t-l local host and port. default: %s:%s\n", DEFAULT_LHOST, DEFAULT_LPORT); --=20 MST From nobody Fri May 3 05:42:18 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=1630792263; cv=none; d=zohomail.com; s=zohoarc; b=S7pDdqlQ5DvHnSQK34wTiMwohfCLY+RJ5i/wpFwHW2EzpbzwtRmCJcvg6Pa4ttNzQVBfZ6t6lybwOtuWuOT6ndV/XKCOsv8RjgJzFjSX/0miy6/jBaETt8xrN7GxXEIx0+1vvZyXZtVMwnfWXhzED12y5U0cKyzaPKsApnqlO3k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792263; 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=NMkbP9DzPB2hGGRGylQ8qjTg4WnGCyNnq9CqzV3GViA=; b=RKrjxh1zEpxisGOKeCQRwoBZpwlHDzx3NsM0Z8OC9E2dNTuVzHQgD1dtj2wHB21fzxH7kS8epzg4LVl5aC+FUb24KvQoCH4MlkBZ7fSbMxZIda6OeF47LXwXdjE9nLP7wbHsTzdTwRApYu6EH/QxraNUu67EoHW4P2sN2NWVnfk= 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 163079226342724.713366675554994; Sat, 4 Sep 2021 14:51:03 -0700 (PDT) Received: from localhost ([::1]:59396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdZ0-0008Oe-CW for importer@patchew.org; Sat, 04 Sep 2021 17:51:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLk-0006NP-2N for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLh-0001Y6-6k for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:19 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-96-Ott6sLdVO2-VIoiDixDhhA-1; Sat, 04 Sep 2021 17:37:15 -0400 Received: by mail-ed1-f70.google.com with SMTP id g4-20020a056402180400b003c2e8da869bso1497950edy.13 for ; Sat, 04 Sep 2021 14:37:15 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id b8sm1872766edv.96.2021.09.04.14.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791436; 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=NMkbP9DzPB2hGGRGylQ8qjTg4WnGCyNnq9CqzV3GViA=; b=hfQ3LCs17dbAod6Ll4HdkmyzhmwgQnUbfVyaCAJcyLUTCSAE1SENzbsRAa/uFs1JDCkFE9 3El2t9SVRApRWGmqw4ctT/yoONU3Z1OhGaMuzcJgYAEZS94f8rwcMyzpm0PARdop0422k3 U+fQFTUlLoTfTiu/9f5fgW+N2Dzt2g4= X-MC-Unique: Ott6sLdVO2-VIoiDixDhhA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NMkbP9DzPB2hGGRGylQ8qjTg4WnGCyNnq9CqzV3GViA=; b=kJqTLW4I8IqRcM9qq26IV7KagXqnnUZO040MJQyDDMDXXUYiuQBLgrshY7LMxITUyT Z0priGHlDYQEky+Z04np5+csZValuiQWnjIHStuZpskd3hAJnRmV4dpLGEt9tF3mdx/0 lJSly1aYMuksE3bf90H+6wzswjpIaFUfbC+TF4N/7I290lpbc0vBiY4EBw13Ygi4woIb FDflGK0mTcSFQLtpkB1XKbJ32crX06pxZawHXVpIu/eusmprPIjhP5tgFTzPyKox2HIB FmcpKzCCf7ExzLcK51KGbVVturFadkMjvl0Sd2P2b+qtCKkUDCVDFSi03go2PAlzDXst 6ppA== X-Gm-Message-State: AOAM530EBBmnq4wnq/nj+RxKoX7T+K6jF/02Mozr40xke4SUxRBwXdJo wQeQRXodVnYu3ad8fkwXQux/WnrRmoXs0O7htplz6bLFRJA+jO63sSxDUACapmMdpkoPInilevR 7fadRkBl0ZJ9cQb0HRJCuCCE/044HPc6zIDQysm3LhXKg0PgL4HbNU/C9ZslZ X-Received: by 2002:a17:906:1806:: with SMTP id v6mr6161266eje.420.1630791434012; Sat, 04 Sep 2021 14:37:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpynYWYI4HoSkXA7MGkF4YnXtpEl8K0/ykNZgl5Q4ulPJKPVdI4q6tto0h7Cw8iC08mhVSbQ== X-Received: by 2002:a17:906:1806:: with SMTP id v6mr6161250eje.420.1630791433839; Sat, 04 Sep 2021 14:37:13 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:11 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 25/35] vhost-vdpa: remove unused variable "acked_features" Message-ID: <20210904213506.486886-26-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792264517100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang "acked_features" is unused, let's remove that. Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-2-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 19187dce8c..72829884d7 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -29,7 +29,6 @@ typedef struct VhostVDPAState { NetClientState nc; struct vhost_vdpa vhost_vdpa; VHostNetState *vhost_net; - uint64_t acked_features; bool started; } VhostVDPAState; =20 --=20 MST From nobody Fri May 3 05:42:18 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=1630792336; cv=none; d=zohomail.com; s=zohoarc; b=Xe7Ze1A/tEVTQwd6q2LuDp4qvaxT6sbxtpOx1Xh70yP54JhFIRzy6QSELoyxyvJZriEOcJtDpR2JEhUKVEg/W0hJX1K/Zg2/VNpu0EK3Q+rt7z331KOiRntKChQha2drccGiHTmO7vDWWdnx8diVD91whDzjqBXDLhLIFMQ/WRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792336; 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=gxjgw5K6TAq8wdnebl9wv86LxwojBdURJMXLYjBqW1M=; b=doKzes9rNfhOECS91nDEgpG++NtOR6ReIaGWPRKoj+BYqWsgGDEDV+6D3dXC7WHM2Scoq1TkqM9FnVro/lffykfICpcWhqQpqsa1BL5jo7gvcqXE3AJ7Pt/ZH6shtVl7qI08iuvXW4vx5wHCYU2XQKe1T5ZENWuEcxbEer77fXw= 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 1630792336948673.7561494254445; Sat, 4 Sep 2021 14:52:16 -0700 (PDT) Received: from localhost ([::1]:35860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdaB-0003AD-EQ for importer@patchew.org; Sat, 04 Sep 2021 17:52:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLl-0006TG-MQ for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLk-0001ZT-7r for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:21 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-JHnE3mH7OLG3BSD_SVXITg-1; Sat, 04 Sep 2021 17:37:18 -0400 Received: by mail-ed1-f71.google.com with SMTP id u2-20020aa7d982000000b003cda80fa659so251007eds.14 for ; Sat, 04 Sep 2021 14:37:18 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id e22sm1924333edu.35.2021.09.04.14.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791439; 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=gxjgw5K6TAq8wdnebl9wv86LxwojBdURJMXLYjBqW1M=; b=V6a+ZuH0d68yi5QptffbRHGMSmlHy4RwTxzkZI0Mg5t9WnVwb+8qwHZEMxtbW2hrSM6V/C xKjxv4A/RkJNvIBBIvPi/d8rFDTs8m3m6HqHoaSq6vYHOuMKve7EUmC1sXzsLyBZlobepb GFfchmf5/7m0LOqmh9nlm/0D7sM1G8A= X-MC-Unique: JHnE3mH7OLG3BSD_SVXITg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gxjgw5K6TAq8wdnebl9wv86LxwojBdURJMXLYjBqW1M=; b=eX52qCpxRvhT+rdkEi3sHLSXG418AslD2KD3bvBl5KAIGhR3dfWX8pH1bUrUn0nhzj KU5UkBT6ZaEClQWG6BAcrxKeVhpynxSjtCQIuKG2bj1UPp0k13+Enr/gIo6ywhxrLCi4 qrM/ZaiaBhfJhtE8H619V9PijW86O/YrSIpyYDZTdj9RJncMvPVXcvbK30nA/1z2OwgY UZTuYQqqen6t+jNqLSI0qMIa+0TJlen40th2YIA6O7DczpCn8Wh2AlSp7bjW4PqtjFLk jazDC7xP19AiGQ77N006mHPxmmIG2KwnPRT01+e1JJuweCu/gLhnqnlHwBjzuHMDcWtE X6Mw== X-Gm-Message-State: AOAM533K+Mzoik1xiGJig41jaIkIT87krQ4YaSBTUBhH/q1ZMtNCqEir fvaenjyB36LVmN9CqaWalyMbOZrlm19DZuRBqayRRCX1Sq0V9+ln1SAwgkWt52qDzyQZ+diIpqB n/91N/vjER1AC+iUQhTIJOa0V6S24k9muWgr2sfAqpYuB+Ds1zkbpFkdBWM1f X-Received: by 2002:a50:ec97:: with SMTP id e23mr6089889edr.25.1630791437059; Sat, 04 Sep 2021 14:37:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBmtwHVmRuP4SiqjvxDWmkyMFy05bpBHPdR8LPUQdVtE83GXzLV773yCJq4d60HGaPuje+dg== X-Received: by 2002:a50:ec97:: with SMTP id e23mr6089877edr.25.1630791436904; Sat, 04 Sep 2021 14:37:16 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:14 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 26/35] vhost-vdpa: correctly return err in vhost_vdpa_set_backend_cap() Message-ID: <20210904213506.486886-27-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792338678100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang We should return error code instead of zero, otherwise there's no way for the caller to detect the failure. Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-3-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index ca1227e5dc..7633ea66d1 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -443,13 +443,13 @@ static int vhost_vdpa_set_backend_cap(struct vhost_de= v *dev) int r; =20 if (vhost_vdpa_call(dev, VHOST_GET_BACKEND_FEATURES, &features)) { - return 0; + return -EFAULT; } =20 features &=3D f; r =3D vhost_vdpa_call(dev, VHOST_SET_BACKEND_FEATURES, &features); if (r) { - return 0; + return -EFAULT; } =20 dev->backend_cap =3D features; --=20 MST From nobody Fri May 3 05:42:18 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=1630792042; cv=none; d=zohomail.com; s=zohoarc; b=EWsURQONQ5QtyFtGKCfmXPC9quM4QgVlhKhxNVOLgAFqCrmZTQm4ddBg4KryVN8Fg/uivJb+ZK2+A+3hEPkrpjwcB9l3I+3glIIYO7BjVNuGhle7Fqxv7LZRA1QkX4+HBIXqFfOq+iYcZly2nN73A4R/lAJdLZgglOfIawJVMVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792042; 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=I3Te7ctUBeSH2vWRq8Hp57/DJQXdTxejxP5IFFM93wQ=; b=kYXnOVMx9GoLBYwK2GUPErwDo06VJvAW5bDnmCVUo9Z5YgXgAQUokry/r3hynQLhaEBaBYJMj2KNoEyyYFgcknBfgHo8ug/e9D/5xL69Ux/BjszPQsvFgY0G7G00TL+3LNOVTtMybRmj42I9beuGw+1Csqp5GQRXPeN8QrSREto= 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 1630792042364929.6604962280807; Sat, 4 Sep 2021 14:47:22 -0700 (PDT) Received: from localhost ([::1]:43772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdVR-0006UG-Cf for importer@patchew.org; Sat, 04 Sep 2021 17:47:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLo-0006fs-Fh for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLn-0001bb-3F for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:24 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-HQJT5GXHONyLGEd0jrim6Q-1; Sat, 04 Sep 2021 17:37:21 -0400 Received: by mail-ej1-f70.google.com with SMTP id s11-20020a170906060b00b005be824f15daso871857ejb.2 for ; Sat, 04 Sep 2021 14:37:21 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id q15sm1546123ejx.3.2021.09.04.14.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791442; 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=I3Te7ctUBeSH2vWRq8Hp57/DJQXdTxejxP5IFFM93wQ=; b=NooNZzWT0OBJrgXZcPele5EWCMl3gataBRkn6gHbF1UFUhhcuIkZEM4xbkGxD7MUo3xt7p EVuK15xSZWw036FCoDz2smV86C6n8Cw09QXQHHbE5l13KP7XHwuWyzRA2JjYVb93apTUm6 HmDmDLCElUhh+Ssm3occwusi87u2ZJg= X-MC-Unique: HQJT5GXHONyLGEd0jrim6Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=I3Te7ctUBeSH2vWRq8Hp57/DJQXdTxejxP5IFFM93wQ=; b=XNZWbuoCd51H/vkoa1x9QUmqeptGMkUTKZgQXyMIDUTyerOmQbSGCDY1JQqrRPbuEr Pxa6L6kYRGerV87tAdi37sso4+irCL/MwzxEj41TJH5HgHG5Rx7Vy8XsAae5C0O5afxF kDEhiBtGqz7c5D3pgS5wZftQ7Iy5n99syB/EIl57nsfXr+v+SvTejueouh3eth+NfOmo 15iQyHD09reFMhtbKpnhf+lGw+mgNwxmX0Ql6lLG0+BhNkJ5Vb9/qSrLIzsP9kECbbsq 9QJ1h2C9SrAGLrPpkZhfuqixXTA3eP7UWRi2Pe85HnqypN5DUGTfDzBas+Cr7fqPmGs/ 6jCQ== X-Gm-Message-State: AOAM532KIjxyRamRgWR0vaUU1Shwpw0pUB7CRtWJP2COZkYb/BdbUl5c cNFUlBuqKC3PgkaWqXGXU5Tywpp8HT+EDMDHe7xQsbg+VaNRqaimxRLA7hbGJinWz+w0leDfMy1 Dc5AS142C3VLPa+2YNnN75FImeLLUjoEuB1MbtUhxHwpQ6/IhGWi/Ihprhxp5 X-Received: by 2002:a50:9e41:: with SMTP id z59mr5869854ede.376.1630791439770; Sat, 04 Sep 2021 14:37:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+lEbDeI7WwXaQPUJPoIYv457hmGlbtFZrAJWnUsLQUErK91yXRkLS83mRXch5Zh90nfvPEA== X-Received: by 2002:a50:9e41:: with SMTP id z59mr5869843ede.376.1630791439580; Sat, 04 Sep 2021 14:37:19 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:17 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 27/35] vhost_net: remove the meaningless assignment in vhost_net_start_one() Message-ID: <20210904213506.486886-28-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Eli Cohen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792042918100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang The nvqs and vqs have been initialized during vhost_net_init() and are not expected to change during the life cycle of vhost_net structure. So this patch removes the meaningless assignment. Reviewed-by: Eli Cohen Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-4-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/vhost_net.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 10a7780a13..6ed0c39836 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -242,9 +242,6 @@ static int vhost_net_start_one(struct vhost_net *net, struct vhost_vring_file file =3D { }; int r; =20 - net->dev.nvqs =3D 2; - net->dev.vqs =3D net->vqs; - r =3D vhost_dev_enable_notifiers(&net->dev, dev); if (r < 0) { goto fail_notifiers; --=20 MST From nobody Fri May 3 05:42:18 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=1630792139; cv=none; d=zohomail.com; s=zohoarc; b=ipILIPFC9uUXFgKtWzdjCKHJdOW7HnM6eLiY5lc7mEDZBTffnzMINU9G9OloPe3Tw0vJLihkyVIJdoizFWgPcEq1Zr8gmru4bTHHNW8YUK3gwqnmcdWI7jgRPrqk2SCduJkyu3alrtSnhHfc9HFo8fUo/5T5jcCZ/6v7et7teUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792139; 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=IjCtuAOy6SdTHjv5qp1otabN9iGtptn9vlMz9BZZt3o=; b=FyqjXWOVTDtaTbrjSEV3pmwG82n6kJBAYX5YijTDrk7UVDnBUjoxeTE2BjXS9sCXVdQFx5C1yzZn5Uq86ZNNOKyeDrR0yBMoH3w+KovJCGg0X+URQuuy6HJfIVT3W6WQ12TY958XBlRp9h9PTX+6bmTKWgdWTDihOYgAvZgRdgw= 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 1630792139719601.8389506907868; Sat, 4 Sep 2021 14:48:59 -0700 (PDT) Received: from localhost ([::1]:52200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdX0-0003dr-Ou for importer@patchew.org; Sat, 04 Sep 2021 17:48:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLr-0006ro-Fo for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLq-0001dL-0g for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:27 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-520-QPelkxL6PtOjga6JvWoVPQ-1; Sat, 04 Sep 2021 17:37:24 -0400 Received: by mail-ed1-f69.google.com with SMTP id d25-20020a056402517900b003c7225c36c2so1517493ede.3 for ; Sat, 04 Sep 2021 14:37:24 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id js21sm1529826ejc.35.2021.09.04.14.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791445; 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=IjCtuAOy6SdTHjv5qp1otabN9iGtptn9vlMz9BZZt3o=; b=EPzwUO1JF6TN1nhZx5HYbC3rPmHWX9EATYkzE4+YxiVr3Mh6lPCkPW9Dw2F7fm4Z5hGi83 HoOuVBlcTDTn3obdAc1Dxj1+xXHhCq3q39wSiPtF53ww9MW5j02V9aQJB+Vcj8WpKVghcw D9qcm11yqK4OOPx4CyvoDgFh04XWv3k= X-MC-Unique: QPelkxL6PtOjga6JvWoVPQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IjCtuAOy6SdTHjv5qp1otabN9iGtptn9vlMz9BZZt3o=; b=SS4qkMD834S9eBMCXEPmUMu2rqMiWQ6j144Dl64ohyVDfWYP+pkzlphCKgzU4zGMGo Zd+AGtT79i4SMebt+mbFaM0VmO5QJXLixImIu2UC7GXrXlm10yHMEHPopVoBV2RGzumV 3Vu3Y3ie9WIinGF0ASBhGFh9Thezhb2v6WJ5CSwiq4tzbicIlJ0QoOmf90dlsDaeSotz /gK8mG+PO/hy6TmmS4betzw5bB04SZs4iepfg6TfPKAIs7u0k0nVwkoulxi6daEk5Gav 1uQYhiwnD7RIQo933uz8DikD2aGFF1SJXldkpFL6qgrLhLSFklI1gEinHUTfW9uyVyNU CsHw== X-Gm-Message-State: AOAM5327szVASZULdm9EuM78EqGUbMZlyjNC5h1iTwaXcWMnOr6kJRkI LN4sjU9rPtyjoIF4ZnZ4nBny6ET34OQi/bI7I4tgaDOQJnWheDcsAty+m4nnKZLYcFVCd4Guu9S A+rUFQJQNJNIYUnnEoDXxitLbsaV+CXC5G/iMymHD+rkoVfsFr6BLyHgYSxoG X-Received: by 2002:a05:6402:5:: with SMTP id d5mr5926795edu.359.1630791442799; Sat, 04 Sep 2021 14:37:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYLMyMYMs/g6WyaGScdWTtpyZid5tJ5hVZ979/z1iYFPK6ny6HQo/W1AWxPvFhqS+Bvmmfuw== X-Received: by 2002:a05:6402:5:: with SMTP id d5mr5926773edu.359.1630791442536; Sat, 04 Sep 2021 14:37:22 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:20 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 28/35] vhost: use unsigned int for nvqs Message-ID: <20210904213506.486886-29-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Eli Cohen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792141283100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Switch to use unsigned int for nvqs since it's not expected to be negative. Reviewed-by: Eli Cohen Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-5-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 5ee306568b..1a9fc65089 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -71,7 +71,7 @@ struct vhost_dev { int n_tmp_sections; MemoryRegionSection *tmp_sections; struct vhost_virtqueue *vqs; - int nvqs; + unsigned int nvqs; /* the first virtqueue which would be used by this vhost dev */ int vq_index; /* if non-zero, minimum required value for max_queues */ --=20 MST From nobody Fri May 3 05:42:18 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 1630792370818909.0571194001604; Sat, 4 Sep 2021 14:52:50 -0700 (PDT) Received: from localhost ([::1]:36992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdaj-0003vK-Sg for importer@patchew.org; Sat, 04 Sep 2021 17:52:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLv-000789-Lz for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLt-0001gs-2j for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:31 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-AqVAdjyQMVmtF9B24AH8iA-1; Sat, 04 Sep 2021 17:37:27 -0400 Received: by mail-ed1-f71.google.com with SMTP id o11-20020a056402038b00b003c9e6fd522bso1356607edv.19 for ; Sat, 04 Sep 2021 14:37:27 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id q6sm1521890ejm.106.2021.09.04.14.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791448; 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=DfR+OS/tguqo24I2t3557CNvlcUjLWWgLMMyFe3f2DA=; b=OUjLVgNcv4I6oGzFljMm5UL2gbeOKqHZXURhyUaJGhb9qTpPYHeStj/HM4NH8W5uFrHfcN unrPvNpWHRR5dWzKhXYOpNtD1cjcCn7LY/ksRveWXgmHBKU/Q5DMiPzfsTbChS6F9YgaPs Zl85hxCbWne6Aj3U6olJjvMdCje/FtM= X-MC-Unique: AqVAdjyQMVmtF9B24AH8iA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DfR+OS/tguqo24I2t3557CNvlcUjLWWgLMMyFe3f2DA=; b=FaLDX5Y5i04vivGN3ouVFl6YA7Eh6aA5Pq66RhiJNz6SDCoOeceWi0kMDs7BWPP47G bwcQ0rS9lbKWpRpG4oSCmaXguKIhpP7VPAB4RP/ZSHFWSUOrYYbLOlyNceZ1Yk/i/OmB DSq8Rgb36NjnqK0S22aEMFgJHD919e5FdrxsQxJNdz/toVXB4YzzbVbEcBkWu/eOmhcc fVmP54rnEk8BoVWu4IoL/mQS39TYcNm51lSqW8uV3ueW2+2CTjSEk4VKbhHlpANQkYIa m54Ft6eXVDl6GrVS0oSZtt32T2Zy0ZW37LHkubRRHhrI1mbiaKL8OIIbNEDD8G3R7jdt uhHw== X-Gm-Message-State: AOAM533TOCyjXlTL8wA1E5dPulX83xNBYshguJCyYvFWY8MYDoi5eMmH foaq6mfE02XBl56tjqh1NlEcU+nFW0nF/YP3sYY6cCW1sLwjSJwOyRd5EQvDpgfXRrbm1e9rhpQ Xika2PpTeqBt2Uksp2qnFs3t/fOO0fzwugJY+dC8hHWH/Xkd1HdkTY4dDi2Gy X-Received: by 2002:a17:906:680a:: with SMTP id k10mr5978908ejr.298.1630791445742; Sat, 04 Sep 2021 14:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwessc/3wByNsrSQ7BTVzg6qkW58e43/dxwiVDVhMwVQEPG4y7+A/1EdDGIzjKqtSZNRN+L9g== X-Received: by 2002:a17:906:680a:: with SMTP id k10mr5978889ejr.298.1630791445524; Sat, 04 Sep 2021 14:37:25 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:22 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 29/35] vhost_net: do not assume nvqs is always 2 Message-ID: <20210904213506.486886-30-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Eli Cohen , Stefano Garzarella 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: 1630792371578100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang This patch switches to initialize dev.nvqs from the VhostNetOptions instead of assuming it was 2. This is useful for implementing control virtqueue support which will be a single vhost_net structure with a single cvq. Note that nvqs is still set to 2 for all users and this patch does not change functionality. Reviewed-by: Stefano Garzarella Reviewed-by: Eli Cohen Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-6-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/net/vhost_net.h | 1 + hw/net/vhost_net.c | 2 +- net/tap.c | 1 + net/vhost-user.c | 1 + net/vhost-vdpa.c | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index 172b0051d8..fba40cf695 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -14,6 +14,7 @@ typedef struct VhostNetOptions { VhostBackendType backend_type; NetClientState *net_backend; uint32_t busyloop_timeout; + unsigned int nvqs; void *opaque; } VhostNetOptions; =20 diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 6ed0c39836..386ec2eaa2 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -165,9 +165,9 @@ struct vhost_net *vhost_net_init(VhostNetOptions *optio= ns) goto fail; } net->nc =3D options->net_backend; + net->dev.nvqs =3D options->nvqs; =20 net->dev.max_queues =3D 1; - net->dev.nvqs =3D 2; net->dev.vqs =3D net->vqs; =20 if (backend_kernel) { diff --git a/net/tap.c b/net/tap.c index f5686bbf77..f716be3e3f 100644 --- a/net/tap.c +++ b/net/tap.c @@ -749,6 +749,7 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, qemu_set_nonblock(vhostfd); } options.opaque =3D (void *)(uintptr_t)vhostfd; + options.nvqs =3D 2; =20 s->vhost_net =3D vhost_net_init(&options); if (!s->vhost_net) { diff --git a/net/vhost-user.c b/net/vhost-user.c index 6adfcd623a..4a939124d2 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -85,6 +85,7 @@ static int vhost_user_start(int queues, NetClientState *n= cs[], options.net_backend =3D ncs[i]; options.opaque =3D be; options.busyloop_timeout =3D 0; + options.nvqs =3D 2; net =3D vhost_net_init(&options); if (!net) { error_report("failed to init vhost_net for queue %d", i); diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 72829884d7..395117debd 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -104,6 +104,7 @@ static int vhost_vdpa_add(NetClientState *ncs, void *be) options.net_backend =3D ncs; options.opaque =3D be; options.busyloop_timeout =3D 0; + options.nvqs =3D 2; =20 net =3D vhost_net_init(&options); if (!net) { --=20 MST From nobody Fri May 3 05:42:18 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=1630792277; cv=none; d=zohomail.com; s=zohoarc; b=BUjqqSvAS7iXox41xsTZtI8qyipnl1sJikyVsnzMbx73i82ZRlthsP5vh7YlMgz/D6xe91swjEQCiBnOGeO0PE4nFKa2PVSN96CfLNXlDonUyLNd22AWlxvktrbAOKMtCrSxbW87dBOH/LlJ+4fSLb76u6sohAez1ZXy21OG+Xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792277; 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=wdEHFLO28MnHxnuu6NlFDZP5KdwfTCWh4jlJfZEIZpk=; b=GkHLwdzFI05pOtWrKJXqOAR+1ccDjEtSKuhltZc3DG23sKo+JeFapruvOuXoD1Njr0Y4NOmL0E/thQ1/JSeE1cN+/9jeSdG39RciuSi88ipYvxQ6V/H8cVWk9fIkzdEXwbdlzhxz9VraiOa8xWl9d77Tjsyqrt6GcF/zyZ0KtsY= 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 1630792277581876.3860394919758; Sat, 4 Sep 2021 14:51:17 -0700 (PDT) Received: from localhost ([::1]:60112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdZE-0000S2-KC for importer@patchew.org; Sat, 04 Sep 2021 17:51:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLx-0007By-3v for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLv-0001jC-JM for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:32 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-ZpcWh4BHO2u0nS3wnwnZ8Q-1; Sat, 04 Sep 2021 17:37:29 -0400 Received: by mail-ed1-f71.google.com with SMTP id s25-20020a50d499000000b003c1a8573042so1492056edi.11 for ; Sat, 04 Sep 2021 14:37:29 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id cn16sm1898786edb.87.2021.09.04.14.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791451; 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=wdEHFLO28MnHxnuu6NlFDZP5KdwfTCWh4jlJfZEIZpk=; b=Tv5DuVqrMoeY7vHxLaddvlnAKxBXi+wXdf+Mt5895kK0rea2W/Q0lqr0TMr1O0IzMQllmD N/UzO4OflH5C2ht8WUwV9SeZVa98PDtBBpS+lh7+GYCj14X2x0qaACi7R/NpyMeXRAUg57 tZMfhOwTKyo0BWnoO8bgtfusl7YMpZs= X-MC-Unique: ZpcWh4BHO2u0nS3wnwnZ8Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wdEHFLO28MnHxnuu6NlFDZP5KdwfTCWh4jlJfZEIZpk=; b=EXY84Lvff+betrEY3cff9oe+e7uijzjOc9usxn9KSPyz0Ky3EwyP6W/WtCtOt2/zeE IuSImNh+6mhCy5WzI3URdCDEVpo7jgORSVp8JVP/QvPMMhbcofCnsNWf9GnJwquHgPhY xZ11ORKE4pSlb2mTvzAvugiYQCGoOLgJlnf6yug+jA3x6pukPcKG98Vs0bJcFeuCH5AC aP3tGOEQ7J3OTI8XkMtythylsunTci9sTwQsuAXv3sRnsgSBsorhSpTakXRV5BLzY+Tw YJW76l7PwWNX2s4fB5cGWbGzD42sH/fAQ5PzaqAsZ441fx/J6c9ojJNsfcccGcQGhjm1 fvMw== X-Gm-Message-State: AOAM532MHXHyp9enAeLSdP3SoJp7r21V2IcCZH0R8a3orD79WnkVBNjQ RZQfPyP+WyUWtsZQH93UTVSvb6cmvYYohehKlVSCzZ2GdKjcDhvqcfsiIqoHt/vVv548P/+2YxZ wa1LqDUajiEAwSc65Xy1uvHCr0YeNcBSLKPyELxbHQAzKQx8Lf+RfgfZA9VAE X-Received: by 2002:a05:6402:26d2:: with SMTP id x18mr5878514edd.195.1630791448397; Sat, 04 Sep 2021 14:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ9wYBmp5/Wa1npVBRpfY3Tsr26a+wrnu9mSZHb71kpq8ob3OhyP7N/y4SkQnhkHCUuWiVOg== X-Received: by 2002:a05:6402:26d2:: with SMTP id x18mr5878502edd.195.1630791448186; Sat, 04 Sep 2021 14:37:28 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:25 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 30/35] vhost-vdpa: remove the unnecessary check in vhost_vdpa_add() Message-ID: <20210904213506.486886-31-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792279018100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang The VhostVDPAState is just allocated by qemu_new_net_client() via g_malloc0() in net_vhost_vdpa_init(). So s->vhost_net is NULL for sure, let's remove this unnecessary check in vhost_vdpa_add(). Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-7-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 395117debd..5c09cacd5a 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -111,10 +111,6 @@ static int vhost_vdpa_add(NetClientState *ncs, void *b= e) error_report("failed to init vhost_net for queue"); goto err; } - if (s->vhost_net) { - vhost_net_cleanup(s->vhost_net); - g_free(s->vhost_net); - } s->vhost_net =3D net; ret =3D vhost_vdpa_net_check_device_id(net); if (ret) { --=20 MST From nobody Fri May 3 05:42:18 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=1630792471; cv=none; d=zohomail.com; s=zohoarc; b=bONlsv3Nt0eFm1RDQLaZbmEljtQECAQot9V8iKafFiU3hQcHy/7Djo/ZyCnL8/0zESEmLmTADDXsOWfCfHaQ0sfft3QyGgnCDdMYIIKOPFOYnTZ3blVQsQUzrY2rSlS7SlmE/uucY9NTowQiFjACWmhTfjxNuakplbYEPlNIMyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792471; 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=zCB7vIb7x0G7L9EN7GtILOvYbJbo5hiB2KP6eTMzDhg=; b=H3mfjoPPKvnknDlfa0e3LarUYr7CRQrPvoBh7U35LUiHJnYzTa6HTLZKaFxB2IOU94Ex5DYKSdlfrsbPNhmzhZXgEEH4mIO9joemk9eUDJ/KT2DfPHPuz3YtMcg6/5JMKRP4McJ72280vOkjNqBJWx9mc8auCt2rMDObB/kW2GA= 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 1630792471108568.4029122863184; Sat, 4 Sep 2021 14:54:31 -0700 (PDT) Received: from localhost ([::1]:41280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdcM-0006oM-4E for importer@patchew.org; Sat, 04 Sep 2021 17:54:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdM0-0007Og-1M for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdLy-0001l1-IS for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:35 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-36_xIl4OOfSSGiBtOWx8gg-1; Sat, 04 Sep 2021 17:37:32 -0400 Received: by mail-ed1-f69.google.com with SMTP id g17-20020a056402425100b003cd5ba2852fso1509671edb.1 for ; Sat, 04 Sep 2021 14:37:32 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id d16sm1912186edu.8.2021.09.04.14.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791453; 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=zCB7vIb7x0G7L9EN7GtILOvYbJbo5hiB2KP6eTMzDhg=; b=LNEAdwUIuOchtAomrGcEW+fl19HBFSa64lPKeEXQGikrbvpTHKyWEqOz+yhTQ2BG5b8kuU o8+aky8E6FAUo3WNOZBUnNWhBvw29GdCKam+o0TzgOMjoN8cr9mMZKBxNkw3CDzg11WoRy efwNuyBb3N4w9RjrOnE7nCTK5E/p25o= X-MC-Unique: 36_xIl4OOfSSGiBtOWx8gg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zCB7vIb7x0G7L9EN7GtILOvYbJbo5hiB2KP6eTMzDhg=; b=W+WRahnuEse3WcBdlkgGxqwhOuZ59LvuuQxpJxqVbGzczN1JGWDWARLZwRTB3SUqzX V/YqZ5CVToE72lJlnHJbhyqcFHw48NZ73H5WL9/8tKqsWO4B4vayD+CzaXpK2jFe7+P4 W3VZOa3MowB2PIyEh5wXUuINQKtoNN/JlpUKmaM1kM7qs3guHBdSYxSb5+TyUaQqzMMz s158DVobDugFv/XNSApLyiDCz7kMcWdRruv+dctGrCmJGe+70dLqcfcoivdMQLFpiVmt nIN2AWo8f6CNY6abcpYOZx/KXDxjDAr77cP+jCn/Yt4F3ujbcYPM++aDgWJzCyfVSg9X JK4Q== X-Gm-Message-State: AOAM533FshBqHLjSE21R9dk0qdBkb9mT5dpvpxsYL1l0OKSTcS+qCFk1 oTyAczcFI5lI2Y3jHHzVwkm0vnMs50yfiSyfDjhvrhPeio5iRx/3DKmhm3Lm1zTK269FiGhhbwi ZHFQlrKy4GYuiBuVUu4MXwXJw1+VyCoh6MdIF/AliO99HCvXRp6sAN7NlmHyX X-Received: by 2002:a17:907:2677:: with SMTP id ci23mr5788541ejc.429.1630791451338; Sat, 04 Sep 2021 14:37:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYipNLk8sxvZlwfjYEwHMRV9QGtoGJh2soKCkwqAc509hFYc6GPClXJqI21NLO9qCI/aXd/A== X-Received: by 2002:a17:907:2677:: with SMTP id ci23mr5788524ejc.429.1630791451144; Sat, 04 Sep 2021 14:37:31 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:28 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 31/35] vhost-vdpa: don't cleanup twice in vhost_vdpa_add() Message-ID: <20210904213506.486886-32-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792472249100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang The previous vhost_net_cleanup is sufficient for freeing, calling vhost_vdpa_del() in this case will lead an extra round of free. Note that this kind of "double free" is safe since vhost_dev_cleanup() zero the whole structure. Reviewed-by: Stefano Garzarella Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-8-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 5c09cacd5a..3213e69d63 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -81,16 +81,6 @@ static int vhost_vdpa_net_check_device_id(struct vhost_n= et *net) return ret; } =20 -static void vhost_vdpa_del(NetClientState *ncs) -{ - VhostVDPAState *s; - assert(ncs->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VDPA); - s =3D DO_UPCAST(VhostVDPAState, nc, ncs); - if (s->vhost_net) { - vhost_net_cleanup(s->vhost_net); - } -} - static int vhost_vdpa_add(NetClientState *ncs, void *be) { VhostNetOptions options; @@ -121,7 +111,6 @@ err: if (net) { vhost_net_cleanup(net); } - vhost_vdpa_del(ncs); return -1; } =20 --=20 MST From nobody Fri May 3 05:42:18 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=1630792543; cv=none; d=zohomail.com; s=zohoarc; b=OvwWshVozcFBAWRc1egtF8jRjcVxMklOjqThHy003pg3DFPRy9Q+YiR9bsJPcxlhmweJ0WreWhIIouIrnzzgEGItCHTo9lfiPef8L/y9a9wyCVeRm213n1MKF9zrrcZO5kOy6pUy7NyU8M5CUPPJQTdGl3k5OYnUUV6enF+V/4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792543; 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=LSmn8hNZpZJAtKWf/4Rp7i0Ir0780EOu5ZSFZW4+a58=; b=hb5+uG5PFIe8dHL0uivLp9uLGEALshr0HYo7yOYvH84sC/VFf0ppr7EkIRkNh2EQuENGK9fvVwvszzOoMmIqnWxJf2CSUytVMf4WRbwWlSHlcerTnB9pSCQSjL/6QtLNeno90A1FHuAlqx+bCwajfj8cZdh3j9VkzcUcF9nUCfM= 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 163079254364454.198072120051734; Sat, 4 Sep 2021 14:55:43 -0700 (PDT) Received: from localhost ([::1]:44628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMddW-0000lv-FJ for importer@patchew.org; Sat, 04 Sep 2021 17:55:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdPM-0007vy-6i for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:41:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdPK-0003w9-Lf for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:41:03 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-LO2V2c0WOXGmSOeYseLRUg-1; Sat, 04 Sep 2021 17:37:35 -0400 Received: by mail-ed1-f70.google.com with SMTP id b8-20020a056402350800b003c5e3d4e2a7so1509667edd.2 for ; Sat, 04 Sep 2021 14:37:35 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id e7sm1965300edk.3.2021.09.04.14.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791661; 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=LSmn8hNZpZJAtKWf/4Rp7i0Ir0780EOu5ZSFZW4+a58=; b=PL1oxMY8EDYkRux6c5WJkn9qy4cSiKG5FvgCLa+m5Rm0IhbAAOuqqN9rfjziAQFEO9Kk7O 3kmcEGBzaVWks64LfePBZWzijgNqZQsSnK8d7wDXOz8YlrpehgseNj7tLS2HoYEiago1iV eZ+uojvugewLnkCF5BHJbyD+W/IqAs0= X-MC-Unique: LO2V2c0WOXGmSOeYseLRUg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LSmn8hNZpZJAtKWf/4Rp7i0Ir0780EOu5ZSFZW4+a58=; b=X+On4zFXhNJ6758H4jhNH2Om5vgSW0gxh++BvSAI0MQB8Op6BjllGXPIRE00hOrrAe OY99rywcN1/8bckT5iKM3LCiLBgzpzmKmKvOJcDFjLSVb5zpngPobt4mrbMiFSAbMIpS D4Pj0DkJ+eAXMVbqQjf7HD+EiBlKCLA8Yb/9dZqRHt5hlMErWJcky6C9USvKFbM9UBdQ OIrfE+WinwsRZgswN0mGin3vg2Xt6McgN+n52IsZyvXM2FotHRtMXbUr6TuOVi9pAifZ kBvTlPfXJmrDqDrogs+/BToBFdVpi5pVdGfkCYf84o095DajOb+UvSGP60nzVOlFxBy1 1MSw== X-Gm-Message-State: AOAM5329wKxLnOyGfjWsKIqGCI3g3Xut3D8EHKnEcfpdUI5uUL6RmDMP zAQ5DM0fcdq23kU01kn7TimVihXcyuIzLPlTUffAFD5G4faX40F8BustahYxTpKAB1NNEcegvy8 4zlkh7YEQ7fE/PWGrYZ6kCZsEECehQQ0Me0VumPLiL67CCW8IaMXOG/HxG3yk X-Received: by 2002:a17:906:249a:: with SMTP id e26mr5824143ejb.221.1630791453956; Sat, 04 Sep 2021 14:37:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwynrE6bKvk9B/TAo8J6DOXCKEB9sm3UuyT/1J3bwmjIhNBx9MU6luzjiqXjlSj2ajju8YsHA== X-Received: by 2002:a17:906:249a:: with SMTP id e26mr5824130ejb.221.1630791453799; Sat, 04 Sep 2021 14:37:33 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:31 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 32/35] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add() Message-ID: <20210904213506.486886-33-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792544593100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Reviewed-by: Stefano Garzarella Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-9-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 3213e69d63..b43df00a85 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -110,6 +110,7 @@ static int vhost_vdpa_add(NetClientState *ncs, void *be) err: if (net) { vhost_net_cleanup(net); + g_free(net); } return -1; } --=20 MST From nobody Fri May 3 05:42:18 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=1630792571; cv=none; d=zohomail.com; s=zohoarc; b=Ohz11NfZDLnGOYPnY8Oyf1GT3+MVhXy+6vNw8gzj14zm99Iw3gvsLbF4Jh6ePXscIaf+B8s/5FpmZJkIjpzPODmv2SkMXDniUih2lq0DlXKyLkhAYfS1YVsO/4XuZDmTqbciM2Pq8EJT9rg8OUUgTnalMCO+/i2ISRpO8/Z2wqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792571; 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=Mcfixr9sWA02pp6Gb17P43f1otbtram3wFNIQC/3H/s=; b=cwhgVRjyywa7PKV5DSYR1OPIQv5FuloHE6PQtovoiX5Rf7z/ra22Z6gDsG5bOkrqXbjHc32k5EhYE/HnI8OvEZjPZRNfNP83EjpK6nG7ajp9HMyB0aOa/j1+GSZm6NC9Ah1oLaa/nshtfRrL4XERBAHpDQyGGCf63VMCxR7BUuc= 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 1630792571037991.7726999892292; Sat, 4 Sep 2021 14:56:11 -0700 (PDT) Received: from localhost ([::1]:45640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMddx-0001TX-Vl for importer@patchew.org; Sat, 04 Sep 2021 17:56:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdM5-0007gz-My for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdM4-0001op-8M for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:41 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-JXYkdInJOkm8bV2Vs0YFkQ-1; Sat, 04 Sep 2021 17:37:38 -0400 Received: by mail-ej1-f72.google.com with SMTP id bi9-20020a170906a24900b005c74b30ff24so865397ejb.5 for ; Sat, 04 Sep 2021 14:37:38 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id c19sm1517557ejs.116.2021.09.04.14.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791459; 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=Mcfixr9sWA02pp6Gb17P43f1otbtram3wFNIQC/3H/s=; b=EOzZnCEf0dS+IGUE9HAbk52RhejuNKNmbkKDZH7ad7J7Ju1yebg9SalK+X7qpQrVTHy1q+ o0xOeHykRMIid5sZUYxdVvH2Vl0T1XjWYVFRBZ5XUvKMOVEoJh3exwl3lG1NI3+KWnkRip 8MasJ+mIC5iZR0MUk+Ubfnpk7MbhzU0= X-MC-Unique: JXYkdInJOkm8bV2Vs0YFkQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Mcfixr9sWA02pp6Gb17P43f1otbtram3wFNIQC/3H/s=; b=txf8ovqmlrebVjXL1lxDRrLnajNPCQTY1CV3zVFjFZ6J3R7ZybqoxztRP9v7r9Pm5n yJEpNxB5VFlp9n68ZaK+1qi4DzggJZbcPsmu0lBKTfF9+VPU+5hS77s1tkEA2dQMGfic AESa0H6e63XyWKsllI0ZM9PnEsoJa7pKYNvkQO6D30O0SHvpNVTORR784TmB8SkwWZDF NThWPZtRkxmLdSBzDKsiijHEUW9mZrVhJhJirBeOk6GKauGNXQkvikvqXEC1CDWOfN9K QprQkip1SRNdH57mljaysk5QMShY4H3Cv5U8zeLgvBcaXj0Ldxsx0EdlSRTcJUxiRCVg NoYQ== X-Gm-Message-State: AOAM530h3XXfvnc9fPBs78O6awjyc+XD6QMdxf0jreg4iHY7ik4GaK/2 pftbSif7OpNo8WINuyf85IIqpS7cy5uYMF2p8HESYOVuvfYpcb4O20oSTtHkKuhc0Ic5NtR5IsE 0jcQjiOj0eE+tzdIJD58TLcpUnjSsZHO/Wbz4ElzRzU0tDRjs592z8saWG6ri X-Received: by 2002:a17:906:1d41:: with SMTP id o1mr5960055ejh.232.1630791457063; Sat, 04 Sep 2021 14:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye5EiFzfe9Cz8a/2arxhEifrwmqjZynxCnD6tcLyaBbAW7XmwfT68hw1TjoW7KupZA4wHbxg== X-Received: by 2002:a17:906:1d41:: with SMTP id o1mr5960044ejh.232.1630791456919; Sat, 04 Sep 2021 14:37:36 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:34 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 33/35] vhost-vdpa: tweak the error label in vhost_vdpa_add() Message-ID: <20210904213506.486886-34-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792573059100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Introduce new error label to avoid the unnecessary checking of net pointer. Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-10-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index b43df00a85..99327d17b4 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -99,19 +99,18 @@ static int vhost_vdpa_add(NetClientState *ncs, void *be) net =3D vhost_net_init(&options); if (!net) { error_report("failed to init vhost_net for queue"); - goto err; + goto err_init; } s->vhost_net =3D net; ret =3D vhost_vdpa_net_check_device_id(net); if (ret) { - goto err; + goto err_check; } return 0; -err: - if (net) { - vhost_net_cleanup(net); - g_free(net); - } +err_check: + vhost_net_cleanup(net); + g_free(net); +err_init: return -1; } =20 --=20 MST From nobody Fri May 3 05:42:18 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=1630792449; cv=none; d=zohomail.com; s=zohoarc; b=MVqN8+mH4YgnY+l2D+7g8ZHpXH/9/oWaE58O0Wt7Q2jXjyQwG0NMhYGiTXDwf0tGbdCqEKyK7u7mkucrLn00r1vIYahxjpEHycXshwDJWFzGIXwG6L41s0tAgcMKgm5NqU+s096GjGTwLb/8jNmj65hQJBSnMmcTZ8TGDqGeGI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792449; 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=xjuzAmf2KkHQdIs6JW/8X9WZ9cd/2U1SOrubuoXWXrY=; b=MXo7gFNF73TdqEapsvLaiDFlYnQH406OMpBPRA5UfiIIzGq0ho43jWLjZ8/laHIyDK7idUTkB3nNe4VWEQiZ8DQVDoj8arb35hkcexlQWhqv0R8j1xls3BiKds5j3natpdEePDuqwwjxjwn1LLQ19YaJbN7zmHo3YPB3ACxQUqM= 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 1630792449554990.8317765794848; Sat, 4 Sep 2021 14:54:09 -0700 (PDT) Received: from localhost ([::1]:40106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdc0-00061T-9K for importer@patchew.org; Sat, 04 Sep 2021 17:54:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdMC-0007nn-0Q for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdM7-0001qm-BQ for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:47 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-w-k7QAeqOByhN3LvvwDLUg-1; Sat, 04 Sep 2021 17:37:41 -0400 Received: by mail-ed1-f72.google.com with SMTP id i17-20020aa7c711000000b003c57b06a2caso1348356edq.20 for ; Sat, 04 Sep 2021 14:37:41 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id h7sm1919792edr.4.2021.09.04.14.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791462; 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=xjuzAmf2KkHQdIs6JW/8X9WZ9cd/2U1SOrubuoXWXrY=; b=Fobjud2pfqBvnrBASMXxsqlvqs03oMwWlARFYB4XwmzqK5c5sWU51jNoTWhQtRrq+4Xj+H aatW7CYpqPsa/wkkWAg9cP3mvkOBJUkIr+JOWf+pGtsN85MmlhIQ2gq0onSUuOcqQEqfij G/EidR1jgxSdhZMK49FjAKQnlrdB1p8= X-MC-Unique: w-k7QAeqOByhN3LvvwDLUg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xjuzAmf2KkHQdIs6JW/8X9WZ9cd/2U1SOrubuoXWXrY=; b=fdzUlIyaTdxbeeN8caHWyaDM8CnD183yEN78pK6ycL0tvpMoFsMQgRLhAgQm9nKGvF WFleKZwChcaYwuoZApomXK83edYjD+iZyjlmwFgcn344lJYGCM1GacVfEUcNjTdcA5H1 SdP1Yme1x4ELoVyZ2SpfsaL/uJ9VNBt1OVehTRDLyebwzEVROln8l76/dVxnVSEPTB3W XeSJp/ieIkLciMBlJCMdW2NAbp4IUid9exxLrFKTBJ6HEeeco45lkGR3fWR6dLKCPunQ H2XVVn9p1iafqf/0jDPLWTHLWAmf4Jx+7NAsMJ8yBLARvJYMNhDbJGgl3ow4B7TqB7K9 2dNg== X-Gm-Message-State: AOAM533VjxwSCetBeNellePVQLjIxO3ECkn156jnx2oJcrBnh3JwDkyX y53sDAjS3snqZe3YMQrXiJqTwgDdgVJenEwovFDhfaK2rIsGQXu4/fL944eN+6I46Qyr3HrrQL/ 2iL3qjrB7Mj/xl7CsZRVR0SqLO16eSlEH9/yIQrrxWusLr9awyA+Y2nFvpcCj X-Received: by 2002:aa7:cd92:: with SMTP id x18mr5820165edv.325.1630791460056; Sat, 04 Sep 2021 14:37:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh6nl4KHfY2P2aR+oiDpZH9oDa0Eleht0IMTdia38ZA2sRkt5ih0Yj7cIIHiVL9mh24eA/bQ== X-Received: by 2002:aa7:cd92:: with SMTP id x18mr5820155edv.325.1630791459890; Sat, 04 Sep 2021 14:37:39 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:37 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 34/35] vhost-vdpa: fix the wrong assertion in vhost_vdpa_init() Message-ID: <20210904213506.486886-35-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792449852100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Vhost_vdpa_add() can fail for various reasons, so the assertion of the succeed is wrong. Instead, we should free the NetClientState and propagate the error to the caller Reviewed-by: Stefano Garzarella Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-11-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 99327d17b4..d02cad9855 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -173,7 +173,10 @@ static int net_vhost_vdpa_init(NetClientState *peer, c= onst char *device, } s->vhost_vdpa.device_fd =3D vdpa_device_fd; ret =3D vhost_vdpa_add(nc, (void *)&s->vhost_vdpa); - assert(s->vhost_net); + if (ret) { + qemu_close(vdpa_device_fd); + qemu_del_net_client(nc); + } return ret; } =20 --=20 MST From nobody Fri May 3 05:42:18 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=1630792666; cv=none; d=zohomail.com; s=zohoarc; b=hnz7tTIrxAD/LSh4ItN12k7OvivtShy2bIYdpnICte6ntuo4hYo4Oy9nOzLV7Hk8AVmDgwvBhqDRbbwImx3qpPj5fckqvD04eEFpfKijjXcpFSAz0b5nzaowovVE4l0OFruUC56qUbSIm8pU2HmjGuWDMuGdjYcmqxbJhWE+6H8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630792666; 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=HlvXhUtB/AN0yn39xV5VTOrfdV0zshjuzF146PZp9mo=; b=W3Mw6RshoYemebg1w84vBFLKduu9Y7BTTneQxCyTXfhSCNhvCUM5uOaHg/mXyBEuEqX6ay70iyNM8D3dT90mWzAWlVx0tVOBcxORTcBip6TLF/NDar7vtI2LB1LyiDngdAGBzCMks4LoMWKqRGML1qmEAQgiAP6vHt+ueBNq4fk= 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 1630792666524874.0991903555948; Sat, 4 Sep 2021 14:57:46 -0700 (PDT) Received: from localhost ([::1]:49916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdfV-0004Kz-JN for importer@patchew.org; Sat, 04 Sep 2021 17:57:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdMC-0007qn-Mk for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdMB-0001s9-9Q for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:37:48 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-551-4UGWOeb8MACCruf-KI5ByA-1; Sat, 04 Sep 2021 17:37:44 -0400 Received: by mail-ed1-f71.google.com with SMTP id h4-20020aa7c604000000b003c423efb7efso1492261edq.12 for ; Sat, 04 Sep 2021 14:37:44 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id q1sm1864434edr.68.2021.09.04.14.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791465; 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=HlvXhUtB/AN0yn39xV5VTOrfdV0zshjuzF146PZp9mo=; b=XSK65/+Sgg5sM0K0oEE7XzGumHQZfXFjG3kzz3T5NaOtgVEGhuGmrZq+qyrtktejBxU9vv Ydb55bUWATmSPRIueqk29PMDiTn2mqqFxLFICAhew6ib+Oqgfv5NhAixi6I3ro5LySkm+3 h7IQu5s35eW8OvMRfWiWRvESxfaWwO4= X-MC-Unique: 4UGWOeb8MACCruf-KI5ByA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HlvXhUtB/AN0yn39xV5VTOrfdV0zshjuzF146PZp9mo=; b=r7V3vtMOkDE5xH6Iz/cHIle3dBWtyQP/k+EIfKqSzyBibTL88cQhnSoEAiHCnPodZ6 ylgvrxFJK66MWmDPQlRxjaID1KmhTgS6G0rEXOxoZKL7+m5DOJqcAUBV5w8KUtM2ns7I e8WxvEkG1fMUP0FE1J6WcpYNo7KmqDwvNTGNaCHe0APSEKBkrbVhjovNkquuTwsL/ctv B6fj2NnoOKa8AH/KqMavOtGHhMMaYhdRE9bc+eypysTJQgYX+IqebvFZVZ1As9tQ5LKk urpdYoA5QeXYzvOyKSErm5OHoOhFJke6ftNzfZVr4mNrRfKcFt06YUVRNiDUmf74Vaba hhPQ== X-Gm-Message-State: AOAM530rV+wXSoyl3Lep+hdTEMw2V754saMlNEd3YurFqEIvQkkM+mx5 RccvfzegQEWWoM2Hf7vNdpeUiBbMBqzridAI6i8PmVjo21YQMxLco5Uf6EgxkMKvGtAUPCNFHd8 ScuRC0Kld1XLp3kmZiuHzHTkt2ZX6jbUfFhVFUqrXXWV70ioeYwGePcrJ1Xez X-Received: by 2002:a17:906:4c89:: with SMTP id q9mr5904844eju.118.1630791463008; Sat, 04 Sep 2021 14:37:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuxWFYeFbqkJQlH5qGTtej//1XO+kXRvALo+o5C+ElWLHRcrOTUFowLAt3rwZ/57Pd1U9MJg== X-Received: by 2002:a17:906:4c89:: with SMTP id q9mr5904830eju.118.1630791462799; Sat, 04 Sep 2021 14:37:42 -0700 (PDT) Date: Sat, 4 Sep 2021 17:37:40 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 35/35] vhost-vdpa: remove the unncessary queue_index assignment Message-ID: <20210904213506.486886-36-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630792667831100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang The queue_index of NetClientState should be assigned in set_netdev() afterwards, so trying to net_vhost_vdpa_init() is meaningless. This patch removes this. Reviewed-by: Stefano Garzarella Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-12-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index d02cad9855..912686457c 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -165,7 +165,6 @@ static int net_vhost_vdpa_init(NetClientState *peer, co= nst char *device, assert(name); nc =3D qemu_new_net_client(&net_vhost_vdpa_info, peer, device, name); snprintf(nc->info_str, sizeof(nc->info_str), TYPE_VHOST_VDPA); - nc->queue_index =3D 0; s =3D DO_UPCAST(VhostVDPAState, nc, nc); vdpa_device_fd =3D qemu_open_old(vhostdev, O_RDWR); if (vdpa_device_fd =3D=3D -1) { --=20 MST