Message ID | 20240409105537.18308-3-philmd@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp154571wrs; Tue, 9 Apr 2024 03:57:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXaEHeFOJOvHI6XR9QuShPUlPgR0OPV6uX4YqzZo3BrJqSdsydizKScTwgZYAezYNsSWX9Kowwb1WKDxtsdh4e8 X-Google-Smtp-Source: AGHT+IEi3WRfqly8d5c11AqnGoLLZ/WtEAvraB5xnKClacnMubJg1cCZIbcxAsAAe0QwuLPDBpEB X-Received: by 2002:a05:6214:19e5:b0:69b:1ecd:c7c0 with SMTP id q5-20020a05621419e500b0069b1ecdc7c0mr5436799qvc.39.1712660237535; Tue, 09 Apr 2024 03:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712660237; cv=none; d=google.com; s=arc-20160816; b=AC7LCOygzsHayzqH7o9CMWaj5Zx1Y4H33/XXFwRzDwK1l0DCP/RtCzvpR4wcIVRl/D DfvL9UO2UtHb8xdskQhGxbwtIPNYtAxe4Mkn532431wBWBLADV+uCMwEzClUt++t1h7z iDiGorPG36YfIlxkrJOXnqXdraP4X96E60hZ/0KUdPNvlpwmvKDfGzqIWCAqtDi1jGyN AB/nla66TIWcjiFJOtieaTb0KUNJ2D81FKqU9SYQQiTXGHeEy2fi3UVV0XyNnkOZX3qz 74pxeYXrvw7P3gJgQ1oVMT1Y/PyR07LXu2B2berXkQ69jH5OygKR2MqnnS+oasMFUjT6 X5Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7ftq4zs1KH4h2Nl8xlNfkOji3kcpdUIoLmwA4b59RfE=; fh=bDdqkbtH6aFW4lgKnCOAxcgEPDnd0fGhfEaFyXPuU4g=; b=o0xOn+6KMZBD4EvPy95Mm4IPlZMpZpd94YWL4dwZAxPpiOYYtIV8HJNqPnwEhOPU9V vOm94dvHB5uQal9aVmwbY0aAA3ZyDc3LPigKLVHoJV5VX4v/fG175SM4MO0SxB6CNO8/ AXqJme9zotdQgjZmwj4Wwqyvl+NvUVQX4Ct3u1pBHaNjLHgqD412wsSOAipWNRn+/j+m n/U+N2rR0CAFgBUWCQDwMbsRfroFNb9KHRmuHdk7nWP9+TU/UifP0r31cHh1r1LmnpCP pHjLLplYKZ5UvZVRiI4/+aJcWCC27PXeX2oq/exdkDwdNN/vruQCBVY8bD4VFSNePEhG IfeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MEQZrmo/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id cp14-20020ad44aee000000b006994885bf8fsi8380288qvb.527.2024.04.09.03.57.17 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2024 03:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MEQZrmo/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1ru98w-0001OH-9r; Tue, 09 Apr 2024 06:55:58 -0400 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 <philmd@linaro.org>) id 1ru98u-0001Nl-C4 for qemu-devel@nongnu.org; Tue, 09 Apr 2024 06:55:56 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1ru98s-00038I-E7 for qemu-devel@nongnu.org; Tue, 09 Apr 2024 06:55:56 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a450bedffdfso765490666b.3 for <qemu-devel@nongnu.org>; Tue, 09 Apr 2024 03:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712660152; x=1713264952; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7ftq4zs1KH4h2Nl8xlNfkOji3kcpdUIoLmwA4b59RfE=; b=MEQZrmo/82y0cVFn3YUaOr6Ui5GrOZTz3VwLXcdbma9eaNhtF5TcC9TWbKmJFiAj3x KJi6YqPbEWx0U7JS52ky/zWm0jwtNgdtXy4RPLTsHrVJWunXMTDTJlGZ/ngWUatHQhmw MnGJk4UL8EYV0BOrERhp6fmu4qBBXLeerunzKso1pMDcf1rRh4D9FfacuMYRlns6dBaA ff4T1fenvrR9NalBvO2ukKy1tZkBfEezi2ZxKJcrUUnzqz/MMn9Zi9cuUHuNRXX104LK /PHSflEc92/zMSFzZYR+TAnexE85dg7K8l3ksoDoGC9a4/4MoYzVCuNZv71YRxvRXOHn toyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712660152; x=1713264952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ftq4zs1KH4h2Nl8xlNfkOji3kcpdUIoLmwA4b59RfE=; b=HMKJLWgc+lXZ5QUKcXKRcLAq3EiaKo9fvgxoZVQNGjTtDfNu0HSdAF+5rwz5tUabKI betRops9YYv5UvJD14OH+NwjDDCiZBhnA/H2Cvatx/c9GnpjvNcGq3G/q0G3hw1i+1EO j955HeRUyrPB7ucAVO9GkO6hsTcJ1YwD0zVQEvg2Se8j7Dw//asWngotmVMJY6i71vLV HKurWTQglA2vvp9pXInQcn4Zr+Dt2kijz2Gl43MMsHoFdMBZuGLWGuQs65CygHUQM22k txrcsnJfOh0P7y/ksuOOUb7BtEc1IXcmncF+/rSPVjmQ58nLX5RbfL19b6NU3F6sIwOg RQJw== X-Gm-Message-State: AOJu0Yy4urzNkRXXqcwV7jGucTwOmqJgA3ezzsPcLPhFLzgV62aNRikR b6J6vSgld0DPijRWlTHwBt68IXiojP0ScnCpvzO5BqZvV7vYA4sEKZEUJk4VUpokgJ5+jtK5ADu T X-Received: by 2002:a17:907:72cc:b0:a51:c1db:6578 with SMTP id du12-20020a17090772cc00b00a51c1db6578mr6332833ejc.14.1712660152654; Tue, 09 Apr 2024 03:55:52 -0700 (PDT) Received: from m1x-phil.lan ([176.176.160.134]) by smtp.gmail.com with ESMTPSA id ov7-20020a170906fc0700b00a4e44f724e8sm5519312ejb.186.2024.04.09.03.55.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Apr 2024 03:55:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Amit Shah <amit@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Laurent Vivier <lvivier@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, qemu-stable@nongnu.org, Alexander Bulekov <alxndr@bu.edu>, Yongkang Jia <kangel@zju.edu.cn>, Xiao Lei <nop.leixiao@gmail.com>, Yiming Tao <taoym@zju.edu.cn> Subject: [PATCH-for-9.0 v2 2/4] hw/display/virtio-gpu: Protect from DMA re-entrancy bugs Date: Tue, 9 Apr 2024 12:55:35 +0200 Message-ID: <20240409105537.18308-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240409105537.18308-1-philmd@linaro.org> References: <20240409105537.18308-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/virtio: Protect from more DMA re-entrancy bugs
|
expand
|
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 78d5a4f164..ae831b6b3e 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1492,10 +1492,8 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) g->ctrl_vq = virtio_get_queue(vdev, 0); g->cursor_vq = virtio_get_queue(vdev, 1); - g->ctrl_bh = qemu_bh_new_guarded(virtio_gpu_ctrl_bh, g, - &qdev->mem_reentrancy_guard); - g->cursor_bh = qemu_bh_new_guarded(virtio_gpu_cursor_bh, g, - &qdev->mem_reentrancy_guard); + g->ctrl_bh = virtio_bh_new_guarded(qdev, virtio_gpu_ctrl_bh, g); + g->cursor_bh = virtio_bh_new_guarded(qdev, virtio_gpu_cursor_bh, g); g->reset_bh = qemu_bh_new(virtio_gpu_reset_bh, g); qemu_cond_init(&g->reset_cond); QTAILQ_INIT(&g->reslist);