From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D435C433DB for ; Sun, 21 Feb 2021 15:21:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2AAE64EF1 for ; Sun, 21 Feb 2021 15:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2AAE64EF1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDqXh-0004zy-S1 for qemu-devel@archiver.kernel.org; Sun, 21 Feb 2021 10:21:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDqWT-0003ws-OP for qemu-devel@nongnu.org; Sun, 21 Feb 2021 10:19:49 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:40051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDqWQ-0004br-MI for qemu-devel@nongnu.org; Sun, 21 Feb 2021 10:19:49 -0500 Received: by mail-ed1-x52e.google.com with SMTP id q10so18768927edt.7 for ; Sun, 21 Feb 2021 07:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r3OO76eD9GG8cyNnTCv/4npaCM8tdHppYxn/MW39wtA=; b=oEyNc5lk0HpyeyCCI5az2IfK5H+d6yA1O9LI4KYjf0lzmer6gNHa2P9rtacJmMO7g2 QyxNP5GD5IXK5OJ6yxPAxtU5tLpVFjvvEiouXunmmyMSr21SkEmW2kKXlwrnA4jqvQx0 cG4zn1fqodhuz92JTdUS2o5rX6cEDtJhZUAj9jvEY98LZF5vIb0B0kCfUkbCA8vko2gL eXdPA1dduTDIti6TeBsoVPn7rd27uHaHjjqhEf9TMcVmvQi5agI3AAvDtvTf43il4BxW nastp8lgKOeM8DkLi7cT7Q76ANzSoqz850VCyVrvyopPIz+Bi0rIJ2OTcsZuJPmbsCtO m7iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r3OO76eD9GG8cyNnTCv/4npaCM8tdHppYxn/MW39wtA=; b=SSmNLy0QbFVtLSx5ATmXrpQc+nikhr9WXcpmgULQUHmZy4SaDFsIt5qCtXEzBb99oz w4gG18Ry3KWQ2nOMDa4DOEbnlDILlK8glHv3ETy8U3EHOEopQ0UsT7yt6wDnahHechvs uho5N0uaB/AqHlUX/ik+yW1urjo1g9jXT06A+tmc3XeBipXztVWGe0Pzk2jljMQMIbS/ ItSN9bplxDVIHAF8ZqHwv0Uh1/VjYBHW5B7BbFkUquQQ/M6Hcwpsyt4p5WOJWWMx9CLe tmi8mU9VGKEqXDC0Tui7NEk8ZjVC/HrpcsVAY+DAPV2iZHlFMTejDMnRkaxHMRkI99yx G9Nw== X-Gm-Message-State: AOAM531JPHje2u2i/R2zusNUi4uPcyUoeLsTJItLqifvh8TIUt/bDI2K gxuKBkzRWLmYyaxNy+VZup1RCMWChGJTiNaQEuj8Bw== X-Google-Smtp-Source: ABdhPJzi2fS5h976bQr1VW6wGadZ5j3g2clcMWRJ46mBQHdsEEGvvOp8K0dJZFzPV2D+7B3ZAL5n5T+z8Wdfn6NdOYQ= X-Received: by 2002:a05:6402:3494:: with SMTP id v20mr19079078edc.146.1613920784908; Sun, 21 Feb 2021 07:19:44 -0800 (PST) MIME-Version: 1.0 References: <20210221150430.6223-1-zpmarvel@gmail.com> In-Reply-To: <20210221150430.6223-1-zpmarvel@gmail.com> From: Peter Maydell Date: Sun, 21 Feb 2021 15:19:33 +0000 Message-ID: Subject: Re: [PATCH] hw/char/pl011: fix receiving multiple chars To: Zack Marvel Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=peter.maydell@linaro.org; helo=mail-ed1-x52e.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=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: QEMU Trivial , qemu-arm , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Sun, 21 Feb 2021 at 15:04, Zack Marvel wrote: > > When using the GTK UI with libvte, multicharacter keystrokes are not > sent correctly (such as arrow keys). This is not an issue for e.g. the > SDL UI because qemu_chr_be_write is called with len=1 for each character > (SDL sends more than once keystroke). > > Buglink: https://bugs.launchpad.net/qemu/+bug/1407808 > > Signed-off-by: Zack Marvel > @@ -300,7 +300,9 @@ static void pl011_put_fifo(void *opaque, uint32_t value) > > static void pl011_receive(void *opaque, const uint8_t *buf, int size) > { > - pl011_put_fifo(opaque, *buf); > + for (int i = 0; i < size; i++) { > + pl011_put_fifo(opaque, buf[i]); > + } > } I think this is a bug in whatever is on the other end of the chardev connection. The pl011 can_receive routine only ever returns 0 or 1, so it is an error for the code calling its receive function to ever pass a size that is greater than 1. thanks -- PMM