From nobody Tue Feb 10 19:17:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1593163869; cv=none; d=zohomail.com; s=zohoarc; b=C+hZWeXBTBmt0ALmfC2dQa2RM7pTJqGrBk7okJz0PkZrJvBRla1lTM/00Qga++ZLXXP/DkTC7l/eRpYIWd1FYffyWPoKoXofpHNyREqKqHJSmCutWRWvaUtVHIMdGqTt6ZTFnDLjSfjlEqIQlHWj5BoCcTEh6fYcy7QCsbhXNM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593163869; h=Content-Transfer-Encoding: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=WUGNUjOfZsPX+VRCLFpInHPP/o/z//uxiOhanSjtP7w=; b=B7Ddcgca9oR90ZryBOEsAS2HoctpCJdpKihg7aoxaaNo2yrMJGEyLTGqgi7kb2TyrgPpsbB+pxKgol7vI4EvJH2sD/BavrqCekknOK5/T9V7OeY8FuxEwy9OUmRVMm9vroBnMb0q9cqV4YcNDH2GTSq7+d7wMZIwEy6hln6+w3U= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593163869983141.0696131643732; Fri, 26 Jun 2020 02:31:09 -0700 (PDT) Received: from localhost ([::1]:42774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jokhO-0000ok-VB for importer@patchew.org; Fri, 26 Jun 2020 05:31:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jokbQ-0005z5-6G; Fri, 26 Jun 2020 05:24:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:34340 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jokbN-0005JI-8H; Fri, 26 Jun 2020 05:24:55 -0400 Received: from host86-158-109-79.range86-158.btcentralplus.com ([86.158.109.79] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jokbL-0007bz-1O; Fri, 26 Jun 2020 10:24:55 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, laurent@vivier.eu, david@gibson.dropbear.id.au, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Fri, 26 Jun 2020 10:23:11 +0100 Message-Id: <20200626092317.3875-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200626092317.3875-1-mark.cave-ayland@ilande.co.uk> References: <20200626092317.3875-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.158.109.79 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 16/22] cuda: add adb_autopoll_block() and adb_autopoll_unblock() functions X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Ensure that the CUDA buffer is protected from autopoll requests overwriting its contents whilst existing CUDA requests are in progress. Signed-off-by: Mark Cave-Ayland Tested-by: Finn Thain Acked-by: Laurent Vivier Message-Id: <20200623204936.24064-17-mark.cave-ayland@ilande.co.uk> --- hw/misc/macio/cuda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index b7071e89d5..5bbc7770fa 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -116,6 +116,7 @@ static void cuda_update(CUDAState *s) { MOS6522CUDAState *mcs =3D &s->mos6522_cuda; MOS6522State *ms =3D MOS6522(mcs); + ADBBusState *adb_bus =3D &s->adb_bus; int packet_received, len; =20 packet_received =3D 0; @@ -126,6 +127,9 @@ static void cuda_update(CUDAState *s) /* data output */ if ((ms->b & (TACK | TIP)) !=3D (s->last_b & (TACK | TIP))) { if (s->data_out_index < sizeof(s->data_out)) { + if (s->data_out_index =3D=3D 0) { + adb_autopoll_block(adb_bus); + } trace_cuda_data_send(ms->sr); s->data_out[s->data_out_index++] =3D ms->sr; cuda_delay_set_sr_int(s); @@ -140,6 +144,7 @@ static void cuda_update(CUDAState *s) /* indicate end of transfer */ if (s->data_in_index >=3D s->data_in_size) { ms->b =3D (ms->b | TREQ); + adb_autopoll_unblock(adb_bus); } cuda_delay_set_sr_int(s); } --=20 2.20.1