From patchwork Sun Aug 9 05:23:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 276893 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.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 96842C433DF for ; Sun, 9 Aug 2020 05:27:36 +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 6616120709 for ; Sun, 9 Aug 2020 05:27:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="eiDW1yWr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6616120709 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4drr-0007vq-GH for qemu-devel@archiver.kernel.org; Sun, 09 Aug 2020 01:27:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4doq-0006DQ-DC for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:28 -0400 Received: from mout.gmx.net ([212.227.17.20]:35623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dol-0002on-7u for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596950645; bh=z/QXmt5sYC3nu5t+U0TkgIU+Re5QzTPu4ajnWt9P04Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=eiDW1yWrFMK8mrGo9Stx5xY+TpUxq7uvINKxOAMNQ26w23JQygQ8npOK71OGHpgSm wjWhi0spfGrkSlNoWi2HOlS2a/vehSyMRBQNVEcvEGLXMQoxmZJuXK4NpZ62saTe+7 hiD26qArytBV46h/byHQh0QOgTKE4GJ4DbMITNL4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.185.161]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MdvmY-1kc3gh2IcQ-00b3PG; Sun, 09 Aug 2020 07:24:05 +0200 From: Helge Deller To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PATCH v4 03/12] hw/hppa: Implement proper SeaBIOS version check Date: Sun, 9 Aug 2020 07:23:53 +0200 Message-Id: <20200809052402.31641-4-deller@gmx.de> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200809052402.31641-1-deller@gmx.de> References: <20200809052402.31641-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:inmzKodvaSSyFXUTrViAjZaJJw5e+rR5/aiqtsmbQgZpw6dJWVn K7hIDzMh/A/qsQGkE/SfyFZKuHzkockiF4yQe0VaW06+/tI+Eof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06LSdFYUzze/mdOvl3mo34DDU5VTXIpZ+lBzQhEs1KzQS2NxmFeUVnLcXPtdDB2 EvWzGEBa/GIqQ9NhjN5Sdr2CY9d49qflr1eeoXvQjLIaHa4bRTUUeCj6uPWZ+S5k7L+XkD+l7 c715yKBr4lkXe+clpEoqEl0FIFLJM0juG2LteVTxSKiZ7krSK6a17XFzXXhUFZvMYRg12Ub4V anjtqkCbWX+QQrzYr3MzHEAarie8tkI1cot/L2vBXZwoH9yI0Oi5/T2BmbUB1u+DxM63q8EYB NW159XM3+AZzt8CkCd5l27129MQxh5BbECftIm1hmmn1QHLhm+V8JSDr9BtuUWmFGbsZntlX9 l5Axs3JS5VMl4EPV2 Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 01:24:22 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, 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: Helge Deller , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" It's important that the SeaBIOS hppa firmware is at least at a minimal level to ensure proper interaction between qemu and firmware. Implement a proper firmware version check by telling SeaBIOS via the fw_cfg interface which minimal SeaBIOS version is required by this running qemu instance. If the firmware detects that it's too old, it will stop. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- 2.21.3 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 49155537cd..90aeefe2a4 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -25,6 +25,8 @@ #define MAX_IDE_BUS 2 +#define MIN_SEABIOS_HPPA_VERSION 1 /* require at least this fw version */ + static ISABus *hppa_isa_bus(void) { ISABus *isa_bus; @@ -56,6 +58,23 @@ static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr) static HPPACPU *cpu[HPPA_MAX_CPUS]; static uint64_t firmware_entry; +static FWCfgState *create_fw_cfg(MachineState *ms) +{ + FWCfgState *fw_cfg; + uint64_t val; + + fw_cfg = fw_cfg_init_mem(QEMU_FW_CFG_IO_BASE, QEMU_FW_CFG_IO_BASE + 4); + fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus); + fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ram_size); + + val = cpu_to_le64(MIN_SEABIOS_HPPA_VERSION); + fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", + g_memdup(&val, sizeof(val)), sizeof(val)); + + return fw_cfg; +} + static void machine_hppa_init(MachineState *machine) { const char *kernel_filename = machine->kernel_filename; @@ -118,6 +137,9 @@ static void machine_hppa_init(MachineState *machine) 115200, serial_hd(0), DEVICE_BIG_ENDIAN); } + /* fw_cfg configuration interface */ + create_fw_cfg(machine); + /* SCSI disk setup. */ dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); lsi53c8xx_handle_legacy_cmdline(dev); From patchwork Sun Aug 9 05:23:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 276892 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 2AA75C433E0 for ; Sun, 9 Aug 2020 05:32:41 +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 DFDAA206C3 for ; Sun, 9 Aug 2020 05:32:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="JRYkPuaD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFDAA206C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4dwl-00034w-VR for qemu-devel@archiver.kernel.org; Sun, 09 Aug 2020 01:32:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dos-0006ES-B4 for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:30 -0400 Received: from mout.gmx.net ([212.227.17.21]:47543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4doq-0002p1-4g for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596950646; bh=yi/ZvGbDbrIWKgg46+4OlOrFcTrRqKN6hBd0HkJl3lk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=JRYkPuaD2t7dqG4ecFr2GYHv5M9M2WS1/tOY1ow8INwa2mh1Uuw9BQO/uM8nJo06b QoUy+N9xduUPzVneZkQWnLdi3FBxeQpSzM8W3GleUe/wHjzie0gjdx56ozB9qnSsjD SlQLo8ekVA+usV/jJX9TaXhMg10StdCccnu6bEMc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.185.161]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M42jQ-1k4doU1BSK-0004lI; Sun, 09 Aug 2020 07:24:06 +0200 From: Helge Deller To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PATCH v4 06/12] hw/display/artist: Check offset in draw_line to avoid buffer over-run Date: Sun, 9 Aug 2020 07:23:56 +0200 Message-Id: <20200809052402.31641-7-deller@gmx.de> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200809052402.31641-1-deller@gmx.de> References: <20200809052402.31641-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:VZ0dI0PCpQDgStnc0PZaNLSTTXlOddNN6t773ICTQSqad9c7XB+ wjAZdQYIkH3mkAHsbqHIkmwD19WUR3qb3zLuk4Wc3lLD/BpHBXEfSCNTs3LLfAEk3MLC2E5 u/WzKxImw58kXO5Spb3CHoE/2QmWsXvIDpmXvQggEX8AlNMZCsaUgupfPt5YBcQZHu45bM1 OF6jcerbc9AlmD5Iw75ww== X-UI-Out-Filterresults: notjunk:1; V03:K0:/Z98zWAS98o=:HE0fPEW+L7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ejNz+FllrF+3GFt9/L409Je056y4C89goEPejILqyzOA8 d0qsuB0NRW59vhqL0hmAWzcqsKozJUDfm+Ub+TLZW9SEd9ylan5fEE1N5BaI3UNl4iuyWIviq l5jTsJYiwptynF5oaAc79DZ46CSuaYPAQmIWdGkIzEAcjxMe5WOoQNkuwhJ/pC9O2AC//tV40 M03vHuXgyI/MklEcY Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 01:24:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, 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: Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Invalid I/O writes can craft an offset out of the vram_buffer range. We avoid: Program terminated with signal SIGSEGV, Segmentation fault. 284 *dst &= ~plane_mask; (gdb) bt #0 0x000055d5dccdc5c0 in artist_rop8 (s=0x55d5defee510, dst=0x7f8e84ed8216 , val=0 '\000') at hw/display/artist.c:284 #1 0x000055d5dccdcf83 in fill_window (s=0x55d5defee510, startx=22, starty=5674, width=65, height=5697) at hw/display/artist.c:551 #2 0x000055d5dccddfb9 in artist_reg_write (opaque=0x55d5defee510, addr=1051140, val=4265537, size=4) at hw/display/artist.c:902 #3 0x000055d5dcb42a7c in memory_region_write_accessor (mr=0x55d5defeea10, addr=1051140, value=0x7ffe57db08c8, size=4, shift=0, mask=4294967295, attrs=...) at memory.c:483 Reported-by: LLVM libFuzzer Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Helge Deller --- hw/display/artist.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.21.3 diff --git a/hw/display/artist.c b/hw/display/artist.c index de56200dbf..a206afe641 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -555,7 +555,7 @@ static void fill_window(ARTISTState *s, int startx, int starty, static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, bool update_start, int skip_pix, int max_pix) { - struct vram_buffer *buf; + struct vram_buffer *buf = &s->vram_buffer[ARTIST_BUFFER_AP]; uint8_t color; int dx, dy, t, e, x, y, incy, diago, horiz; bool c1; @@ -563,6 +563,12 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, trace_artist_draw_line(x1, y1, x2, y2); + if (x1 * y1 >= buf->size || x2 * y2 >= buf->size) { + qemu_log_mask(LOG_GUEST_ERROR, + "draw_line (%d,%d) (%d,%d)\n", x1, y1, x2, y2); + return; + } + if (update_start) { s->vram_start = (x2 << 16) | y2; } @@ -620,7 +626,6 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, x = x1; y = y1; color = artist_get_color(s); - buf = &s->vram_buffer[ARTIST_BUFFER_AP]; do { if (c1) { From patchwork Sun Aug 9 05:23:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 276888 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.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 B4D2EC433DF for ; Sun, 9 Aug 2020 05:43:37 +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 8033C206C3 for ; Sun, 9 Aug 2020 05:43:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="Bg0ER1H8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8033C206C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4e7M-00030v-JI for qemu-devel@archiver.kernel.org; Sun, 09 Aug 2020 01:43:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dp7-0006Ox-UB for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:45 -0400 Received: from mout.gmx.net ([212.227.17.20]:52893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dp5-0002rB-4u for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596950646; bh=WOmbPSJ1IovLaHobnoaa9ga8qpoZn56dcothAl1FiBM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Bg0ER1H8oxu+p3fHsl8qZZw5aYk8uT7NXNSich2HvWNwEpVWC+rAU9onFRA0ro7NY q806j/rRBmLFGvNeY24hIeT2qUhZCUvDT0kd/4oNRGzWBAktfb83zvt25AaPIHWjrC VMPX2/VmuIQS+93AXy2DR7tI2gk5rtiBvLGHmh60= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.185.161]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MUowb-1kDGlT2dFp-00QiKj; Sun, 09 Aug 2020 07:24:06 +0200 From: Helge Deller To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PATCH v4 08/12] Revert "hw/display/artist: Avoid drawing line when nothing to display" Date: Sun, 9 Aug 2020 07:23:58 +0200 Message-Id: <20200809052402.31641-9-deller@gmx.de> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200809052402.31641-1-deller@gmx.de> References: <20200809052402.31641-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:nDutxwXwdVKdDZE0nVk0EmY+gCenI8vyf3V6Kvrqv/ZBRIO0w1+ fIN2Vri5uDYLeDG079wJcwfpFp0O83pAwO9i79owMcEMvlWOAMSIwPdKTa7PpzawIQ0QGv8 SjUzmAgaqANM2be+qXYAijQlRkUpigv9FSN8OSnilRZaQFqRCtMHAW9r40yu04DCMrKsHti jsk7b6uA7rX4RekPj7Eyg== X-UI-Out-Filterresults: notjunk:1; V03:K0:xaQv6S+clNk=:GXVRjrqBR+dNr+heoGqF2u 5RN3BhCiZgwhoRqU6NyBUFfRiEmmmdcnYjQB+Bkz5M+L9oQyqd3yJxWgCVUR4OIV3sfK/dKzk 2SkozN17naxY6WjUsoGoarPF6Q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BgVH9KCYCDk bh92rLkhwMXydNI1CVga9iNpt3eoGLxAftIKXrAi/86GccwE+Bz7vh0irD334y8m8o/c8j2bc QaI4Omy8OuWF0ock1 Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 01:24:22 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, 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: Helge Deller , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit b0f6455feac97e41045ee394e11c24d92c370f6e. It's wrong. A line could even be a dot. Signed-off-by: Helge Deller --- hw/display/artist.c | 3 --- 1 file changed, 3 deletions(-) -- 2.21.3 diff --git a/hw/display/artist.c b/hw/display/artist.c index 47de17b9e9..f37aa9eb49 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -591,9 +591,6 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, } else { dy = y1 - y2; } - if (!dx || !dy) { - return; - } c1 = false; if (dy > dx) { From patchwork Sun Aug 9 05:24:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 276891 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 C8E06C433DF for ; Sun, 9 Aug 2020 05:34:15 +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 9402620729 for ; Sun, 9 Aug 2020 05:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="acwuMDI1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9402620729 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4dyI-00048E-NA for qemu-devel@archiver.kernel.org; Sun, 09 Aug 2020 01:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dow-0006IJ-U0 for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:34 -0400 Received: from mout.gmx.net ([212.227.17.20]:47993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dov-0002qd-38 for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596950647; bh=UM40+2G2vyXFjKCGqiCh/R4Twx07UdJyaTx0+Ksjn+o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=acwuMDI1xQ9lGJDDQIK/K0uuKlV1kQO3mgiO1Gb5mySpv8mlBqFZggWtQbhXNu5vO 1sjb6r2w6BIHOyi35+CH6Jebv+iG0Hwk5UaaJ883fJIMse/k2TIp5PTBnORjyo5R5x qzGQqFL//975I3UC5zl1hzBosNG6o0SHStnxeMmE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.185.161]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbAci-1kbUf11C9o-00bcRI; Sun, 09 Aug 2020 07:24:07 +0200 From: Helge Deller To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PATCH v4 10/12] hw/display/artist: Unbreak size mismatch memory accesses Date: Sun, 9 Aug 2020 07:24:00 +0200 Message-Id: <20200809052402.31641-11-deller@gmx.de> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200809052402.31641-1-deller@gmx.de> References: <20200809052402.31641-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Na6y4G11RFxFivFaxGLyKTc7yT+sls/y5uNFm8kxZdzWNH3IIxr sFcuIUV18a2yRqZSJSU+/IF9v2Akbc62eEbupWlIZ+7+7Z40wGINeFebQFlbtt5Li+cxb9H OYWe93huk9FqG4/tOWymMoTvlJp2wtrHgeJkUcIm/hlju2tYwhmAnD0cLxmDw5RnwtVGNbn X7quj8uOB5WjsdQDIgdbQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:EnZluhXh8YU=:A4RK/TwB9SMz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AmbIZpvi3iqkwRdDetnxuduA HyRAG/pbjqeGcVP6CG7/rxkxlFq6X2+woYgaRYZRD9i5TMwEXowquaHQ8LCF2d51pM0fdtQ6S su2XjeiArvG6b7lln1PdLj/83Il0zaQmkDsDYSTD6/4r/h3pePPGKghMBjTcHjfKMOuoG2Jsi 83L8XbtQC/UtCgUEY Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 01:24:22 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, 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: Helge Deller , Sven Schnelle , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Commit 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid") broke the artist driver in a way that the dtwm window manager on HP-UX rendered wrong. Fixes: 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid") Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller --- hw/display/artist.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.21.3 diff --git a/hw/display/artist.c b/hw/display/artist.c index 904a955aff..e7452623f9 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -1234,20 +1234,16 @@ static const MemoryRegionOps artist_reg_ops = { .read = artist_reg_read, .write = artist_reg_write, .endianness = DEVICE_NATIVE_ENDIAN, - .valid = { - .min_access_size = 1, - .max_access_size = 4, - }, + .impl.min_access_size = 1, + .impl.max_access_size = 4, }; static const MemoryRegionOps artist_vram_ops = { .read = artist_vram_read, .write = artist_vram_write, .endianness = DEVICE_NATIVE_ENDIAN, - .valid = { - .min_access_size = 1, - .max_access_size = 4, - }, + .impl.min_access_size = 1, + .impl.max_access_size = 4, }; static void artist_draw_cursor(ARTISTState *s) From patchwork Sun Aug 9 05:24:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 276890 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 C0252C433E0 for ; Sun, 9 Aug 2020 05:38:14 +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 7F70220729 for ; Sun, 9 Aug 2020 05:38:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="cj6HmNnq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F70220729 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4e29-0007TP-JX for qemu-devel@archiver.kernel.org; Sun, 09 Aug 2020 01:38:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dp5-0006Mp-M8 for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:43 -0400 Received: from mout.gmx.net ([212.227.17.21]:51419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dp0-0002r1-Uj for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596950647; bh=2UbG+VuR+383yBth20KOm93Ei+XhQ6gmt03UBV3WNTE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=cj6HmNnq92Cc1+1DXRWM3NjFK1IrxrCMLpp/jrZ9+5qH/qWJPKP8T2qfrB93vrfEo Vy5yr6A9IY+6bFAZALm3j8MwY+FLkechPiXFc5ykybLsKqD2kb74L44L9Dvc3H3TTV Hjh3gR97m1Zux2MWbK5pYeqvwA4P14UmV74uy5q8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.185.161]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeCtj-1kbmhk1vNP-00bKOB; Sun, 09 Aug 2020 07:24:07 +0200 From: Helge Deller To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PATCH v4 11/12] hw/display/artist: Fix invalidation of lines in artist_draw_line() Date: Sun, 9 Aug 2020 07:24:01 +0200 Message-Id: <20200809052402.31641-12-deller@gmx.de> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200809052402.31641-1-deller@gmx.de> References: <20200809052402.31641-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:d710uOpSrkoxnvA7TvEy5MlTwHnvPdHfc0ZZD702QewNqQSSYB6 1BveSfPPZ1dRWH9/nXPEzCxLMeqv5Q9UyMwBdA8B4qomNOmk/HhU053iMkQuAS2CWD5bWuB K9P+uiBmKX4DjemFIVrU0gCawuUFx3JWnpGIyvQfjQOUL0PGh+NFp2220Pi83R/tJJjPgY+ yHm1SIoNkPaZVCpcOVGvg== X-UI-Out-Filterresults: notjunk:1; V03:K0:PKA8nSDEMFI=:ZxBYZ/Frjahz7YQCJVRTbD /dH+hveLJuuoJHb6xGGOP9aDQUl+VI46lP5xRtOG9KO7zRA9HIxplDVGkIanvzmwaCGIcbMOM p6uucBkwZpSaqVWrx3se5WKPV6Kb7yIQbboJhYMAN7xOPvaJCFO0t2uoTiSOqi+MegEfbcDQ1 3WiWRfg57oVAJNn29E3KMre5XEZvcJ3B0NpCuvyen2H0gXzyOucduHnq85mCeYZeiSYYxYkXg /b2plUMtnQTtd6PN8djH3VyEJFabbBYMF6pBbUIO/anF4TZdUh54e681vuRePZ+B7kG00NLC0 xtpzeK+2nwyrsmh3W94k4liv9miKM2u4wcHJRDZJtTtgDMCN/UMIilmP50/M1+7gbst+ZdqHy Ia1m0wsnqajlB12YH5yO3Rj8KLA3laQbTdZQHPJsizH96G0r7nxELgVJXUSvpRKhk6IXIqLPs c5SECN1oJ41n4XxR+UbTtrhPxslq8XormRahCbuZNB0gzE0n3LTyXrACf0JUGZlBLVBuYccJ3 /4RNuGwk346pQGYhzbGNm2+KnVNCC9P0/2bdut1E11xCCLQzx5krzQqrepPTcYO1/MnwGIQqu nhunLTkBEidr+/g84KeNvbrIyY9lvqcQBCZ4sQIh4HbHdkHiibb8v0JLcFO1VIQD/BEFg6HnK iqCzIiVXaIgk9bE+cyHoB6j4atKG55K5obeuULK30G9+GOG6IRMkeakPhVMXTruG+EdlRG79I mqVlDvGCu+Q3dJi7wkwxZ4cf5FZedwq/WGRtNmdfD6wAI3fTvrfxH6moRzsJl+5bTx/3SCAEo Cnfj1AwkEMSbMGgf1vD7QIRgsxgG3fvHSLYyPmAHbgoP2IhYhWdW2OhJ/gfMn8voC3gKLelaB RmdGbIfsIC7raCKFXNVn/CdJh1IECshMQvHAKdiEGdJaK1wXD0jow3AEbEBRx3rco+oUu73i8 9ge2MreonAwRErB7XnYoxi+nxQstzvtDAMlKPwnU9f7+Slkk++xcaHX70LyQwxGyKILhAJV6I gCoSJRAjpNkPzgiWHK3gv37TRouWzQw0/lwD6Dm3JxDOLtf6j1BCGo2Bxjhc9P5wUkKKvH6rJ Qg2No1r42NgEGA+8fDLePwrQIHHxJP6nE7d4hOTC2axu4vNrszT6aKQPndXF1fHNw3p4ppoFB Qh+vXbes7evuXDY3NqXhEnQAtnztweQXze3Oy4VDoWs0JYMn4owBqUdcYGnrNFTQUIGnxmJ3C /ZuVus63saAciFnad Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 01:24:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, 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: Helge Deller , Sven Schnelle , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle The old code didn't invalidate correctly when vertical lines were drawn. Fix this and move the invalidation out of the loop. Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller --- hw/display/artist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.21.3 diff --git a/hw/display/artist.c b/hw/display/artist.c index e7452623f9..09d8b541f5 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -662,7 +662,6 @@ static void draw_line(ARTISTState *s, } if (e > 0) { - artist_invalidate_lines(buf, y, 1); y += incy; e += diago; } else { @@ -670,6 +669,10 @@ static void draw_line(ARTISTState *s, } x++; } while (x <= x2 && (max_pix == -1 || --max_pix > 0)); + if (c1) + artist_invalidate_lines(buf, x, dy+1); + else + artist_invalidate_lines(buf, y, dx+1); } static void draw_line_pattern_start(ARTISTState *s) From patchwork Sun Aug 9 05:24:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 276889 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 C14D0C433DF for ; Sun, 9 Aug 2020 05:39:40 +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 8BD8920729 for ; Sun, 9 Aug 2020 05:39:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="JDvvBBKI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BD8920729 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4e3X-00005W-JS for qemu-devel@archiver.kernel.org; Sun, 09 Aug 2020 01:39:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4doz-0006KF-6n for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:52385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4dox-0002qk-H2 for qemu-devel@nongnu.org; Sun, 09 Aug 2020 01:24:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596950647; bh=4cu5DCwNBFInqID3CJQEwuqMV1flM13s9w/a+nvBy40=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=JDvvBBKISbdA/b4fcLdlBQ3wQRydPJbmviJolbL4NgsAnhbjtAKD7tmF6KqybHB5m 8lb+knknuaiEcJ7U19VPufFHUd0mVRD60U7700HC0gAPIfVm7I7Y4y4q+PDw8gfkXv Xl56VOiyscigyolnwJKJY0uxT5ZKrfCxfD3kPRcU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.185.161]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MMobU-1kLDG72gNQ-00IhZg; Sun, 09 Aug 2020 07:24:07 +0200 From: Helge Deller To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PATCH v4 12/12] hw/display/artist: Fix invalidation of lines near screen border Date: Sun, 9 Aug 2020 07:24:02 +0200 Message-Id: <20200809052402.31641-13-deller@gmx.de> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200809052402.31641-1-deller@gmx.de> References: <20200809052402.31641-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:C8b8NIzhwhK2ClhEX1a4Un/JILwhcE/qe+SZXLGcu3NZWpph449 PuFfnMjMd4oLftQKH6Ig1+DL/v/8acUGmhZUuzWxvBdh2FQfhvN+mQZFw8CrBftqd7eZ8kU hJ2dqLweg1ZGZFDewGCqApK3RVh8bU/LOIZmcoIhBfxt6hLwj/AJaBOXR3RQT4dhS9zsNGK VolL7xKJvJi1+QIm9DNhw== X-UI-Out-Filterresults: notjunk:1; V03:K0:z44uQtOgeqM=:NqSdmBZw9TMClOGlEhFBVU iiGYf89nr4+ILnCto1tLGlzqp+rrG3R01K56lOKLbB3I3b5HWAkEbfNzGxtP2YWCvnl0PC9Js 250PZAu6Ld9k8ZEMOP7eDkmEwby57fne+DfXmRiFJo87XYbWNKaBZljJWiujSAJF+C3k58wkQ D/9XAchXta4lWQMk1SGCTRBL7rr8pRRQgnmyxH+ZLWL55yGmbMfPEu0NGNvRExRydlrOUBhHZ SVJLNOKC2NHXIqlZmoQWfDQV7xHk4YT2Qqy1w2Y9oUrn51usj6m1epfZ9h62Gyg5CuriQg7DL gjP1rW+BvvLRSjzMzfc7zdP2Fx5QXdJjtZN865JU2LXG/mUVo6Z73vGQQyNS0SP3E8INZl2d7 AwaLN+YF9U4QztuOOuUJRpU+eAV77G2+GNIviCI8+63WvOUREH+DHek0/vJXfhJAuD5f+9+Dy ZKlo2e4ovOo5RJjzgFJHl4x7rs3IYoCG+vy4K+iRxIahaiGQHhXGuzHtyJGw9akN+DvDmCwBx kEkbNb3/fTTwWwJjNNLJoANtPLrcvWDCHS8P0tW/CkHDHBCmY6kyWgqUfHegqQIpa82QeRswq M9HEnhjs7EHSqPMbc8x94YnDs+n8ttCYdto52MDet+oRWf11LJp9QUchN+dq1k6DIKpT/f9ba oTfhhQpNVF9KpsNpy8TM9Bpdi2DlIyObIgNyAND4XXlk3ye+MmooGlwkSTdLOgyGcyBJpKhlJ yE9TG7VuXpLRncXTb3FDLNu5rLXP2hL+MOBzA95fNzZSgezh56rCefkmD7GC7t9bSRJ+OmHGo r9XpbMdIDpoPJHCitYwZ9rLRD66QiAP0QxZzXS6wOkgwhaCOUj5m8VpnfC3C6Wn8XcOBBE7+P DnhyjIad6Xy49i000bwQPZSp0MEIscO473+yvRpsifj79sCtrXOpQ5hjkbyjttXUnJATv8wC6 5HQylE5BNLjdVR5oXwvta1j+iFdihhdS11W2kzv1v5Y+Sc7w1ZCel3ak6DdWK8CalRmz0qfrj oQ/Y2J+fqCbPFjY//KFUa5II7GDf2PWGDTueTIm2SrSjsDROy73yUG6Px2hCAB19BcMn8y1l+ oQVfP9r8nIfl1QTy75y8QHZG9swO3VCqiIlPixXoKmVSL1URvCDjDED6bDcOzLHKZ3x5qUIvS xwYESTNSjKJVSoVdMzBVaTnP+EuMpgNodJ4PVufj9MdAy0bwdnBYB/ZCPTrvkhNEgfoDekU1m KfMlK6c8Jqrzbh3i+ Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 01:17:21 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, 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: Helge Deller , Sven Schnelle , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle If parts of the invalidated screen lines are outside of the VRAM buffer, the code skips the whole invalidate. This is incorrect when only parts of the buffer are invisble - which is the case when the mouse cursor is located near the screen border. Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller --- hw/display/artist.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.21.3 diff --git a/hw/display/artist.c b/hw/display/artist.c index 09d8b541f5..720db179ab 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -206,7 +206,12 @@ static void artist_invalidate_lines(struct vram_buffer *buf, int starty, int height) { int start = starty * buf->width; - int size = height * buf->width; + int size; + + if (starty + height > buf->height) + height = buf->height - starty; + + size = height * buf->width; if (start + size <= buf->size) { memory_region_set_dirty(&buf->mr, start, size);