From nobody Wed Nov 27 00:32:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1703582706; cv=none; d=zohomail.com; s=zohoarc; b=P5O77/pjkKvekjiloHdZRfun7r1mHoeNS6xy2LDd6LN8r5N761cvtYCzY0uXM4hXDGkpeCwlAx2xcwma5lq2C9o1lfEJ3x3guXtN3jDmLABCks40Tzh1j/EyDGIwpxG6YQqs8mmrCOSj8Mz81sICNOBpRDevOhEQ2rJjzMlR42g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703582706; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o2xfTTZNpltmefGE+HE4JL4JH7Ql9blgDHyAGxKzSyU=; b=SO5UDJ73JnEerELlm5C+vPytFUOdb6lsmOJoL+U1BIImkGMZyGSiwicNK9cauAydG6v+BDpO7Nd+/TEYc1Zmshu5azdYw357GSZg3c4W7E79aYzku8VXxxRkr1KvgW18BfOjQaeF6MEtpjd9Ojkr4OA4D4j7aVOjorgA+xKwmzs= 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 1703582706547118.01566773759271; Tue, 26 Dec 2023 01:25:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rI3fa-00016o-1v; Tue, 26 Dec 2023 04:24:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rI3fY-00016N-5E for qemu-devel@nongnu.org; Tue, 26 Dec 2023 04:24:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rI3fW-0008FE-P2 for qemu-devel@nongnu.org; Tue, 26 Dec 2023 04:24:11 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-80-yaHVmNVZNpGq2-cK-TSRSg-1; Tue, 26 Dec 2023 04:24:08 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3367b16449bso2796275f8f.3 for ; Tue, 26 Dec 2023 01:24:08 -0800 (PST) Received: from redhat.com ([2.55.177.189]) by smtp.gmail.com with ESMTPSA id q17-20020adfcd91000000b003362d0eefd3sm12096408wrj.20.2023.12.26.01.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 01:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703582650; 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=o2xfTTZNpltmefGE+HE4JL4JH7Ql9blgDHyAGxKzSyU=; b=UxS1oD2qYTZhD6xftG+NsLUBV3y2INPtYSFdUaGZdDrfXrEVuhf15C9dxyahZP+D/qEujb E7nspn36MiFhmsm86vrBU/J7Sos1E/WAzOuQHTZzHXCAoDvG/qf+/MjPDYldI8CDj4dJAj HAAAKS8X/4DHLDYfRweB/UpKI+eflFA= X-MC-Unique: yaHVmNVZNpGq2-cK-TSRSg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703582646; x=1704187446; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o2xfTTZNpltmefGE+HE4JL4JH7Ql9blgDHyAGxKzSyU=; b=uocL8OOs9Fjl2E17oWYbeHXvH2nZUrpzCk5MAvZjNNqAV3J9GX/2qMtgx5/7DPk+i7 cxKwsFTjvvzMNgmPvAojSgVT0cLKxwvYAVLx+5LwYj3lXFq56gut5RbofFm0g9SJ8tjB nX3JqvKE3A2r/Os7rP9wrofEOcde8OQqk1Dl3j7VF0HNJ2EiXCbHN+ctiB1BXT5uvZqE 9Rr1oQdIYlNkvxf5GoqFSIA5abgLquKHZLoGqIkwz1ibaTbyKVfMSnzBW3OpD7F0WDpd 7WRd8JP4glXTVk5UGX63AjNYB9Um8lHEHYypgnHrqh60MELH2e8Ro3G+uLINpBbdervE c5KQ== X-Gm-Message-State: AOJu0YyVSxdnYhSBQ7/pmh/cFSRYPTjivz1HI5W680wTcG8fmUjQ03q+ ANt+9ReDEUQRgB5t48kWGx3VA2gS0dYz/JT2sV1eb/VZhk5f/ia4PUuIhhfoGZ0eN7oCR1qR8f+ MdT1bY0gHnXoFIwy/vLmUtVooKtgl0rylMAskVwccVK3pTRqHvmSLaDmHeiT5cZqarcGSRxwq5S Oh X-Received: by 2002:a5d:6992:0:b0:336:de69:c215 with SMTP id g18-20020a5d6992000000b00336de69c215mr362505wru.102.1703582646365; Tue, 26 Dec 2023 01:24:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGp1ft5Yw1fA2QKmka4/VngXYvJ5urOywK68YYFwPaOVnPcAjOtEXSduFeJmFIMd6KFlcXQJg== X-Received: by 2002:a5d:6992:0:b0:336:de69:c215 with SMTP id g18-20020a5d6992000000b00336de69c215mr362496wru.102.1703582646089; Tue, 26 Dec 2023 01:24:06 -0800 (PST) Date: Tue, 26 Dec 2023 04:24:01 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mathieu Poirier , Leo Yan , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 01/21] virtio: rng: Check notifier helpers for VIRTIO_CONFIG_IRQ_IDX Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.977, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1703582707097100001 From: Mathieu Poirier Since the driver doesn't support interrupts, we must return early when index is set to VIRTIO_CONFIG_IRQ_IDX. Basically the same thing Viresh did for "91208dd297f2 virtio: i2c: Check notifier helpers for VIRTIO_CONFIG_IRQ_IDX". Fixes: 544f0278afca ("virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX") Signed-off-by: Mathieu Poirier Message-Id: <20231025171841.3379663-1-mathieu.poirier@linaro.org> Tested-by: Leo Yan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user-rng.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/virtio/vhost-user-rng.c b/hw/virtio/vhost-user-rng.c index efc54cd3fb..24ac1a22c8 100644 --- a/hw/virtio/vhost-user-rng.c +++ b/hw/virtio/vhost-user-rng.c @@ -129,6 +129,14 @@ static void vu_rng_guest_notifier_mask(VirtIODevice *v= dev, int idx, bool mask) { VHostUserRNG *rng =3D VHOST_USER_RNG(vdev); =20 + /* + * We don't support interrupts, return early if index is set to + * VIRTIO_CONFIG_IRQ_IDX. + */ + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } + vhost_virtqueue_mask(&rng->vhost_dev, vdev, idx, mask); } =20 @@ -136,6 +144,14 @@ static bool vu_rng_guest_notifier_pending(VirtIODevice= *vdev, int idx) { VHostUserRNG *rng =3D VHOST_USER_RNG(vdev); =20 + /* + * We don't support interrupts, return early if index is set to + * VIRTIO_CONFIG_IRQ_IDX. + */ + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } + return vhost_virtqueue_pending(&rng->vhost_dev, idx); } =20 --=20 MST