From patchwork Tue Feb 18 19:39:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183612 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6487657ile; Tue, 18 Feb 2020 11:41:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzGmM6Co58fVN020sFiiJ4s9Xe2IJXQ973ZEqNg6GxR6Uae9gCYnMCyigFGEDl3WQM4bBop X-Received: by 2002:a37:bc6:: with SMTP id 189mr19734216qkl.459.1582054909064; Tue, 18 Feb 2020 11:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582054909; cv=none; d=google.com; s=arc-20160816; b=Zx/xc+D06gcNcjC8UXMjkyfTZdlornB/5lSEGOP2Eysc+Qojuw/tXCvlWzL3r/BkEc jt7IbDGP3vD4t+Vc5UgEDKG+HdUqcrAT2QjH33ZxcjUPKrLP0XLjQA3ybZd2Z10dJLIs z/ZCGnmgRtAZ1ioX2HXAUWzt+I300IB70dQCnYJOm8gQcnIuI7Lodz9tf+OyoshNVRdo wEVpY12VwLB/vHQczBJeR6dLDfsilBIKgBD3tXkwJM8NApGWlB4bsW08AWr1lMivhQWt cXfGsKhVojwj6SNLEeZX5p1t3lBD9Ew46UqcYgn1Bsch2EgLhYAe6lo4K3LVXa96hmXZ wLMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=oxNPd/QkKRHeWi1ZwK35YEXvYDOJm8fo+psN51CFfCE=; b=QM3q5oWdmC/VLJmRPyZAjB7PbA34Ny1Nf6UvZHeItVJsSOKhLHIHjcducfNPlXLVMp Bu9fYM+PDC5+VzCAKEfbOUlUhiC35Msqd7cUHMXIo/C5Jx9Ib++J0n7LdNfCNzP5X9pZ IvjPE6wl5uDv11BXPEUef5GASMfn9S/Ijz7wE4Vqu6jxo2UR5YgjdoBORaOqFveSrwfu brHiS0pGOb6o7Fo1iNaMlSqQNv+Oz0bMq7n3n/ASNTNl+WynMvGvL8//CwuZQfFK+91Q nbueRJ3Eydbg7+r4i3GXPLjVtZCc7gtcg4Q+OcrOCZq7W1qzqCGl7Rft1nif2cu2k01b WJDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QqNDPA96; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n197si2372767qke.95.2020.02.18.11.41.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:41:49 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=QqNDPA96; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48ke-00074T-He for patch@linaro.org; Tue, 18 Feb 2020 14:41:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54830) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48iV-0003YQ-DG for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48iU-0004Cx-AV for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:35 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:43602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48iU-0004BO-4v for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:34 -0500 Received: by mail-pf1-x429.google.com with SMTP id s1so11149970pfh.10 for ; Tue, 18 Feb 2020 11:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oxNPd/QkKRHeWi1ZwK35YEXvYDOJm8fo+psN51CFfCE=; b=QqNDPA96P6n8HKuahSWYbC6VO/tDywq9jGpeOVoQIlhZnod8THLzSpU9IJQkmMT9x1 I5/P7WfapfgYf1hLF5GFkAtfK5lBxnU5C+zgOEClroyU/hzD5dKusLAplgJHAP2rhKPN LURe35h5QbwEdLLfrMH8Nn4S7dpLKYZTUTvq0EiivEaZz74NPaFwtG7c7XM7ntcLN1Jo +rF1/9OjvZyvZLk07k+Uov/vEyCF6mqsH4v7YF92g12uRKEAglMco9z3ywatVliCsq/K MOjc59ccpXPdwaR5nuYfr1wZMl1DMDrxj09kGKZiiJ2mTB7ENa3mNxAdTRoL18YjblzB iZsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oxNPd/QkKRHeWi1ZwK35YEXvYDOJm8fo+psN51CFfCE=; b=CC6EyFdDQ3MQktAqtrft471LZC3zeMegZ0BNtwfxRmrfGeKIFuk3i4KU+w55ExWL86 9KyOVJqVvyDaX/UZZv0xv1lyUAaAHUnfhXnyF2PoCI4K9NxXNFHLAWeE+3JxVCh6zIJN pwpivyQ7dcPYycc3jYQFg0tmEaSW1U2N9tUgz1dFcrSNAeHaq6j9A4iqWvIpby10hd2U VqLpZU1D91W6vpdvSXrRbkVGPWWa/hppfyUBM6ngzfVZ3/VaGW+2Aah9qHgM1KPZxaUK b5A94NG/mqCP75MttoZqLPBPMOKNYktAGhdApv94oMz5zueeBRNWOwPaZ0Iy3WwDgcAQ xTSQ== X-Gm-Message-State: APjAAAXNXFwsBXv9rgYZ/07ICnl0IN6SfM7gyIB/I11MPY1JXzA3Z2zS rBy+tRsFax4KzToIzpOK9c50NYJtcnM= X-Received: by 2002:aa7:9ec9:: with SMTP id r9mr23001986pfq.85.1582054772794; Tue, 18 Feb 2020 11:39:32 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 1/9] hw/display/artist: Move trace event to draw_line() Date: Tue, 18 Feb 2020 11:39:21 -0800 Message-Id: <20200218193929.11404-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::429 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: peter.maydell@linaro.org, Sven Schnelle , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Instead of emitting the trace event before each call to draw_line(), call it once at draw_line() entrance. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Sven Schnelle Message-Id: <20200214001303.12873-2-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/display/artist.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.20.1 diff --git a/hw/display/artist.c b/hw/display/artist.c index 65be9e3554..abacb0e27d 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -563,6 +563,7 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, bool c1; uint8_t *p; + trace_artist_draw_line(x1, y1, x2, y2); if (update_start) { s->vram_start = (x2 << 16) | y2; @@ -654,7 +655,6 @@ static void draw_line_pattern_start(ARTISTState *s) int endy = artist_get_y(s->blockmove_size); int pstart = s->line_pattern_start >> 16; - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, -1, pstart); s->line_pattern_skip = pstart; } @@ -668,7 +668,6 @@ static void draw_line_pattern_next(ARTISTState *s) int endy = artist_get_y(s->blockmove_size); int line_xy = s->line_xy >> 16; - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, s->line_pattern_skip, s->line_pattern_skip + line_xy); s->line_pattern_skip += line_xy; @@ -683,7 +682,6 @@ static void draw_line_size(ARTISTState *s, bool update_start) int endx = artist_get_x(s->line_size); int endy = artist_get_y(s->line_size); - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, update_start, -1, -1); } @@ -743,7 +741,6 @@ static void draw_line_xy(ARTISTState *s, bool update_start) return; } - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, -1, -1); } @@ -755,7 +752,6 @@ static void draw_line_end(ARTISTState *s, bool update_start) int endx = artist_get_x(s->line_end); int endy = artist_get_y(s->line_end); - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, update_start, -1, -1); } From patchwork Tue Feb 18 19:39:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183610 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6487647ile; Tue, 18 Feb 2020 11:41:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwjCzAfP/XKi7OMnRU0CWpeOtp0xMVQBs/9sSQE2F/UHni0ibumhZmSh6rBTZvxb68C3WYN X-Received: by 2002:ac8:7309:: with SMTP id x9mr19351698qto.338.1582054908423; Tue, 18 Feb 2020 11:41:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582054908; cv=none; d=google.com; s=arc-20160816; b=c1dwmaQaIbIpoT4KBVnJ+/mwhl46FCBf27UTSVmsl1QNSb6hSGWl8t4t5u+tquuxAP iZKplRdrEhHS4bbADea+CgOepaJsABLTzIbf096+JmrZj7S+TZKv8UbkIS4RSNQUFfdv eQUaBATetkTg4z6039RQycmMvQRDCatai/RGtQLWDrDjZQjEkd1llvPS3qJLVnSYaBCN npCDR/zeRr5Xu2I6BYtVojVC+BwKtdqF5tA+vIfl64+ahGBuNMAJCA5nfRQBsLnEByfT AFL33cY0KYd8JX04WIXEmK3D9uWOphqHAzNerjYM5jNFdNKW3tnQb5Rxy/+nAOVXiipH YihQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=9xp9YT+6BXF/GDcu+K5TvURlBEjt56+scFGDcoCg8XI=; b=c0XUOGvo8SNrb9S96tZFBPeTfEmWDQMKM4sxvbo1SZBO9KTTtuuOZeIcblmtNxXB1e VPhLh2JjpiWPYpnlqsS6HOMwhJ84m4dw9BxWZdXowgXgSjbkBM4ztYU/BhytZNfr0m4n rBvqZ7+IbdxFCXrMSLyQ5LzQgdZYn6Eb1HrD0uMgIY/O1yoZGujs9oT/KE0Pk6UjQRTD +cr5f2BWVnw6GBLaaq37eW9STF5Yhlr0ThD4/pqhMS3GFDLTNHayRrlrXsNFql627d3v DHn3kfoFtlaN/dal4V6r7etrcIv0s6THNq/dOm2zOD1NpC6m+UL02gwZZX2OYBfRkpFP +yoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rdq+mRnl; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d19si145472qkk.358.2020.02.18.11.41.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:41:48 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=rdq+mRnl; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48kd-00072b-Ry for patch@linaro.org; Tue, 18 Feb 2020 14:41:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48iW-0003Z1-O5 for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48iV-0004GJ-Qs for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:36 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:45753) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48iV-0004EM-KJ for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:35 -0500 Received: by mail-pf1-x42c.google.com with SMTP id 2so11142079pfg.12 for ; Tue, 18 Feb 2020 11:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9xp9YT+6BXF/GDcu+K5TvURlBEjt56+scFGDcoCg8XI=; b=rdq+mRnlGdvIWcenw2xPzU7WNU/j2DqSZy2NjxrUkjLMMGLByuPfYOhu9vlhDipfcm KlC50yJ3NYUnW6g+6l127yLp8lnj5yxhDCRCrnc6hfi/yh52v6THJrlx90ZzthLVkHr1 KRC6c5vEKqSm2ZbqXqSVqNWHZPdC6WKJdXKwdE6lhM9jMqYjM4kNPBrJLY/xU5985nok ZQ6mhaDTGq8nbuG8AzaE1TUc0sWdBoNgyHazJrdppLwppQbmcHOa+srx1xKooESfO9vS h+3SbgWCpkpDp29UjSTPk2G6vW7J8hZpts5sJDKpzWuiDS4wWgB0yvOTvjBCyHIxAmui chjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9xp9YT+6BXF/GDcu+K5TvURlBEjt56+scFGDcoCg8XI=; b=XfkzOo/Qb7ZCgJfr5tUILzGx/SJKcpmnJck4HyHhuzDqU1/xkC4J/SJ0+VWF8WGYPW ttbl3NdIFQc+hzlQEZcWWJW0J/lD20JDQhI2E+x9DDL7TNleXbboaO1Ew35DDKF3vhfv BdWQ9k91t2jHH0Jx3Yr1mWDZJ4KoEXZW9i1xa8dlJ01D5Up+csUggBtCSqFwUs4zoGcZ tveq3rUDDyrS8z4Glux9aqcjxkMLxKJW7/HcSNROv/wEsQ2bXRkZGS+0SLCfxOSbT3qy YRFyP50YbLbI2UyuzLI+1/uAe37+A2NHk1xL6Tm3/v5rSMNemmP9vtEfMa+Kk0VwkTbm alaQ== X-Gm-Message-State: APjAAAVmW+MhWgiXyBBMBHfL2vLozBCqdK9xLnZyD/0kxorJQn4gMDmS Y+bAPk2Ia6YyeB7uZydDM6K2owVMfR4= X-Received: by 2002:a63:78c4:: with SMTP id t187mr21661123pgc.88.1582054774237; Tue, 18 Feb 2020 11:39:34 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 2/9] hw/display/artist: Remove pointless initialization Date: Tue, 18 Feb 2020 11:39:22 -0800 Message-Id: <20200218193929.11404-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42c 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: peter.maydell@linaro.org, Sven Schnelle , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We are initializating incy inconditionally: if (y1 <= y2) { incy = 1; } else { incy = -1; } Signed-off-by: Philippe Mathieu-Daudé Acked-by: Sven Schnelle Message-Id: <20200214001303.12873-3-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/display/artist.c | 1 - 1 file changed, 1 deletion(-) -- 2.20.1 diff --git a/hw/display/artist.c b/hw/display/artist.c index abacb0e27d..47f0e9f0bc 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -572,7 +572,6 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, buf = &s->vram_buffer[ARTIST_BUFFER_AP]; c1 = false; - incy = 1; if (x2 > x1) { dx = x2 - x1; From patchwork Tue Feb 18 19:39:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183615 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6488953ile; Tue, 18 Feb 2020 11:43:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzUgZzV4MT2szHYtopBcyM8q2+QHIkv0hltz982+vvbI3qpRADS4v50vbC6Ot51Tz7jixFz X-Received: by 2002:a05:620a:9cc:: with SMTP id y12mr20296486qky.446.1582055001451; Tue, 18 Feb 2020 11:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055001; cv=none; d=google.com; s=arc-20160816; b=Z35CWuu+RW6sOttAOUBKwRg+31rPQMQSZTO68DFtkOBM0TD8In83qUGjBnPCHhai5+ /8mnz2OgSG5pnhyNltSN7F/LxfyXZ/4DMaXa64meCrF4pCD9nAGJqp2SvS4dgbHV1OXA YfuexNfTr94y37fyhyqPp6GIFHlvRietc2DZj4eKv5/BsDoEDjtami6HX4W3og39SqAP /1bc36Z7V0aXxDQnZ3IKcPqYuEZNZblufOMMay7ZBm3MiHvN0BnRGA+SQEqSGfZTnMdo kEbo5H7at0L0PF8+LCH3HzXSoNbdyzWBa0EpdB1nz89FvNk29imCecDSKbJmvExPN4/j FX7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=UwMVy3DhT2jUtkg7ZPdWAKnQO+6DWfWffPjgYExKp2o=; b=NZ3s6/9mTMnPnJqr1n4+v+7wF6imrhDMgEQi0nKybjrfaWZNK4Kng9f6j60/JjCUGK yXtnET2WI3c2LSQ8pKs8fZABtY0ig+QrLgYuNFpyMfWJVywnAd4sma+efU3iOLteRzaN Smlbkdhi1ElIFzfcSxLUtDgitklQyUpFOaA+gMtXHNoHxB61Zk6HhYYbxv0Md5AI3iy9 M+Ecyysoetyj9Hc2Z4w8kJE05zQrLib1Bowcwtj6WNdHDa5TlxbSn7oxulKD7mQx+c6Y Dd1ykFvy6fVeKSOexbGZWJb53JFtiTCpkV1PCDf6b2UMUCQIyaxAbjP2oddJEXUl4zUD zrBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=USz99uwm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 191si2435440qkl.67.2020.02.18.11.43.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:43:21 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=USz99uwm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48m8-0001TM-W8 for patch@linaro.org; Tue, 18 Feb 2020 14:43:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54965) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48iX-0003Za-UO for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48iW-0004Id-VP for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:37 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:43521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48iW-0004HA-P8 for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:36 -0500 Received: by mail-pg1-x534.google.com with SMTP id u12so11079556pgb.10 for ; Tue, 18 Feb 2020 11:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UwMVy3DhT2jUtkg7ZPdWAKnQO+6DWfWffPjgYExKp2o=; b=USz99uwmXbaCrCFCIdZdP+xafQVcgC6G98Bq9WZr7x1asRBL5IjEieOMIxYsGBarDR RWr1c2bUsWvCsjuvhg/nt8MzYfcmwmAIHKXsUDbVjQpjAbDx49WIDb2Wa4C4gwcK0F2t cn8iBQkkDOsDBoBADfA2Efu40UmlE2mGaIdx+/BCSadlAFYkSolKViTwfgh23LzMqFKr 4sCpKl5Q/eYBAzbcuigEbM4/49/WJLSwdZ67U4XHIl74uh8zlWNcVgZ2alp4OBWtf/5p KcRi/283uE1vpmLIFwQD9MkWJf0vZfFdD8ut1QG4kofFsq7dou1NMTL3WqCCRS2/cVZg HUJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UwMVy3DhT2jUtkg7ZPdWAKnQO+6DWfWffPjgYExKp2o=; b=gkjpAV3K6GFOWoeU3FO/n19RJj+QR5DoOpAdyfctJ7z1nTAVORyqgiOi0XN2H8aQ0s VvUw70J0zMJYuC7Ps3hAx8OPThFIYoKECiapjyDb1Kv/2e3WsvsBij+1KuuBMGjU/5wu YtaO0nwOE0m4ESS4pajy+EKsdXdStLP+44J8XDzganesaxlx5+60awfDcJjQE8LzYBik lBB8mjQLLZBnLHnPaUsraRxWZMHJxy1RBPcyLU+XISt7rie+H4t5zpnbBFsnlHuhtSX1 C+IIc4NxFwb+g/YbvnXjhL2rjRfILbi3A2U6GjkdLiRbBTM1Ebr+/Gk1c+u4bkHPdJZi LKgg== X-Gm-Message-State: APjAAAXuSny9ImHaGRPsdiJM4r/yF0CTtkjqEeriCOh7/S11S97xiKpC TRm5rXL3DC6V+FhYYBE1HG337C3FT3c= X-Received: by 2002:a63:d207:: with SMTP id a7mr24561623pgg.225.1582054775469; Tue, 18 Feb 2020 11:39:35 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 3/9] hw/display/artist: Delay some variables initialization Date: Tue, 18 Feb 2020 11:39:23 -0800 Message-Id: <20200218193929.11404-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::534 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: peter.maydell@linaro.org, Sven Schnelle , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We want to have an early exit path. Delay some initializations before the variables are used. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Sven Schnelle Message-Id: <20200214001303.12873-4-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/display/artist.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/hw/display/artist.c b/hw/display/artist.c index 47f0e9f0bc..97c811b35e 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -558,7 +558,7 @@ 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; - uint8_t color = artist_get_color(s); + uint8_t color; int dx, dy, t, e, x, y, incy, diago, horiz; bool c1; uint8_t *p; @@ -569,10 +569,6 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, s->vram_start = (x2 << 16) | y2; } - buf = &s->vram_buffer[ARTIST_BUFFER_AP]; - - c1 = false; - if (x2 > x1) { dx = x2 - x1; } else { @@ -583,6 +579,8 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, } else { dy = y1 - y2; } + + c1 = false; if (dy > dx) { t = y2; y2 = x2; @@ -620,6 +618,8 @@ 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 Tue Feb 18 19:39:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183616 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6488980ile; Tue, 18 Feb 2020 11:43:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyJRB/c2fKHlSKe0d5nipokexCOEzEl+uBy4sS8v4RDuMJM5L4HRbQSCQgwjEYb3VEjdkbD X-Received: by 2002:a0c:b61c:: with SMTP id f28mr18470606qve.101.1582055003087; Tue, 18 Feb 2020 11:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055003; cv=none; d=google.com; s=arc-20160816; b=rXNHuKCT37+m8Ci/ZRHLTFHs01+B5iuZ9iQOoOWzGhPjzXbNV13b/d7cPJYsT6gLvY lMbgh3vBh5+1lh9pWELl7czEZiUQU7mn/+1ZZ5n73fkwDeAkE78Xlxx/fAbdVw2yPyyZ KnynK2bbt6yY7QPhU3ncUIbBvmtAnKIuDejhDFBpzWhnLay8a8YFlBiW0pLy+/qS/TV2 5Pba5EWl5VSQndW4kQh/hSp+lnaPzBbpnPDl+yKgD0Ob3V92yTOQvYkB0rv6MVef+Y4u W7YDJCfPDdYFADw4OV8OF/7bF1z2gim+3py/RKnTOpj5SzYvS9+OTyMHdkbacCyVARrK n7sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=VWkmmOSNRrmSWVThvM1btX2IQ2jQ25rI+tGcKooV13k=; b=Tcfz7zNj5HTNgmcelhHepM83/W028Z1qtCtg/J2D0L+f+1x/TEYWaBG8o6bWfiLJx6 /Nd649RitVAaj4rZjcw5a2urkNow0rN3hLJIWXJhySyIMBBvthh9oPQcJ70VhxpYsA1D e7lBgZve4qEa0k/MsZL65U6UNCmwO204rFtdsD9roL8SndtsPIh5AOYeDbckBCWo5BOc 8HFhGow0Cpxka2gPZoj7siVcmtbU5+XSZI9NmRiqQ1B3QyjRkYtyyB6kqGFRuFGsUYuC +yHhvEwvkhw6Ek7CoJEBWLdmTEWBHiJZlPqvHNYxg967CPxja3DNa1gKFiFSOoiprV9r KkHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RUYFJ2yB; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k8si2219050qvp.76.2020.02.18.11.43.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:43:23 -0800 (PST) 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=RUYFJ2yB; 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]:41124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48m9-0001Ue-Ky for patch@linaro.org; Tue, 18 Feb 2020 14:43:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55060) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48iZ-0003co-F7 for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48iY-0004Lg-GJ for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:39 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:42812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48iY-0004K7-Ag for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:38 -0500 Received: by mail-pg1-x529.google.com with SMTP id w21so11428992pgl.9 for ; Tue, 18 Feb 2020 11:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VWkmmOSNRrmSWVThvM1btX2IQ2jQ25rI+tGcKooV13k=; b=RUYFJ2yBNNB/FI7ZcZaMOn8rTEZ+F93tRFKn0W8+h0ccY49o6pkEK5NCCN1NFgRg2C wzIwa1CUwDgPi2j8yKasWW10C+TW+ojUGT+eyzNSMWkvDp+XFkOiBPXPJZRSgOCQJkzb mUFNWsne7c5mmXgxhHQavOr1d9kT+dJyGI/EtyPpYAkkafCxSUXd3ocxlt+QFxYck3Hy wwWxwdmX2oICJ7QFUA3hw5C8+HnBVPad+polGMGpXcn4iJRr6mJ/VSUSZ+hW0hRE6GGs rqFHsrpS52Rqp5t7Blyl43osNdAZv3u3kcZXDznH2y+A1SJ/3SDEbEF3Wyz52yJPOEf+ yM9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VWkmmOSNRrmSWVThvM1btX2IQ2jQ25rI+tGcKooV13k=; b=oda91bcmlEmJz7K+YoZ9Tb9PWa60Nf4YCDgwHc+M0klxRu9WDIDUrgmyrB3GDMM3Et ikqF/l0nHpicy7QydXzdfp8LjWVKZ+oqbnL3GPVOcKqAJFMFNeCNKA4qBf5vHe1kuZFX l9TZ2KQo8XjGUINfkkxYbIVlbX3QmkdIPhSdhoHjSdG9u2lKPYAMnAcNau7XUHUTPJgs OQJkgaTNYanz911jiwdYaZH4MdO4/ppukfMH/I6dND6YgEuZHX5EBhIJ7WBoj0H5VS4o yixv7MOc287QSLCKNGMVMG/wberZCWfZvL48ZDVwDxJ7WaQP4HXusJG3r+zJEpsY4VNY mkEA== X-Gm-Message-State: APjAAAXp6hyK0i/cPyEwgDEVOEW/z/zq6e1HFphVs5hQCM3+0MgELXTW 3UT+aLxuOe55DOGapKKe/x1J5PF73mw= X-Received: by 2002:a63:445e:: with SMTP id t30mr24625651pgk.367.1582054776923; Tue, 18 Feb 2020 11:39:36 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 4/9] hw/display/artist: Avoid drawing line when nothing to display Date: Tue, 18 Feb 2020 11:39:24 -0800 Message-Id: <20200218193929.11404-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::529 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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200214001303.12873-5-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/display/artist.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/hw/display/artist.c b/hw/display/artist.c index 97c811b35e..5492079116 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -579,6 +579,9 @@ 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 Tue Feb 18 19:39:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183613 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6487722ile; Tue, 18 Feb 2020 11:41:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwCzZQ8nUJlm1MgPGm30NhXg4Nw/26nNkjBIQrHdGXvT6BDKde5GNdR94YIWZ61RVL6bEa8 X-Received: by 2002:ac8:592:: with SMTP id a18mr19165886qth.107.1582054915005; Tue, 18 Feb 2020 11:41:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582054915; cv=none; d=google.com; s=arc-20160816; b=y6ZRYkM44c4F9yBFjPF2yRpC2qncVJlS+weAwbgiE72560+KJ6sGq/WB7NtutzTDD2 vWXJghvRZH33H8T/afTaACaW6IzCJ/u/z4aUyLG1C1j40xmgJ5n4/b8vwyYIy2ui2mW6 ic6Iph1pq5auMevkqC5HJpj++Z1/qPnAGwyQWKZkwUQyiCY99xZ3tY3KWvrTxmn5/f8M LDjssHfyDRnNMU/9xP1AkfPk8FympETuLXiEKElCxqGQnROU7JGdoqhuIPJZ5/Ye0gOn stUeMWLyTfhDuLy60c3ZdcB2r0TjRY+QtyZreGUYIiuyytHyohoIzUqLzBsRYVWHcBCJ 69tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=jAN9/5WEnE9dxJr6iL5ixKsH798kIxR23zQ9JVcmqi8=; b=kRG9AojWYGwf4sl+rFKIwA5pprBQ/cQCHoMRyNq2qMCs/u8u8jnsqatcqKQavqY60m YdwXfmqDOXIicBPwEwMLqNrbBGEijKB3Amu3OHZWlfoAyANjfZ6jgdRNNxhW0wp7vTRM DeaS+OjX6gD4idjnJ0eIQFslTDkXihToYiTDzr9CEG9CcLyUrh1q0RuMcz+Lejk4I0s4 5tY1emXmA+yAIySTfQ8RkpPBcywI52tc5wEQ8EQ3Sceee6lroejRB9p/Biu7uL8ZHE1+ qqrmZvtYnokkC10SkEPWvsTV3/AexkSZbZJ4/fFFmj1gtgNJS8fQqmE495jHtyUY651o LW6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="fXerTJA/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a16si2129476qtw.15.2020.02.18.11.41.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:41:54 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b="fXerTJA/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48kk-0007J3-Fi for patch@linaro.org; Tue, 18 Feb 2020 14:41:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55133) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48ia-0003fd-Pa for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48iZ-0004O4-NB for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:40 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:42681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48iZ-0004M7-GT for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:39 -0500 Received: by mail-pf1-x42e.google.com with SMTP id 4so11147922pfz.9 for ; Tue, 18 Feb 2020 11:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jAN9/5WEnE9dxJr6iL5ixKsH798kIxR23zQ9JVcmqi8=; b=fXerTJA/78ZheSMhs2rpB8CviX/9SYutyA4Ct9KpYId2tli/PRUoCCi+a97qP4X0en KEZjvDulRV9zO09FuiTuPnXYblt3B0iHwv8CJQlTU+Ch1UbHqroqTSs481vcjT7rkDVn zsmr/cDLeB/ueyBN7JLkhkcJ03UzOcdMxy+qVL6u+lOCYTyn7z2y2sednQknpOXMn1Gj X1bDkwftYSlYkcOR1Gcb6NGnp/rTNEA+KsyS/MH/9jGAVYDBXm3//V1S7xGpwKUbtO05 rHHE8ctINLN2TIM0DOIWQW4ND6PjP88d5K6uDbkwIKbY9GWEgv0li61svmRvLkHw4nh/ Tlfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jAN9/5WEnE9dxJr6iL5ixKsH798kIxR23zQ9JVcmqi8=; b=Yf1wQjihJsCu3EaqGuDgfFZf7+D5ChQOkctG/J5xkDHegnCvC1Y8NYCxDSbU2h9Blv 74IvY51N45IeZbQ89iZCVHJD/yS5QBkD8nfbKaHaDeLiKxyP/WsISmjmHyp9uITduyJq N+AY2OjwtHaP//KM1+N2HZJW1ZDDWaZWXK+7x25NRl/lr3GkAVeYpm8RfjPrlC6TpL/8 j+vxRkYBhruKEohi1mdCTk8kcjwm7BnAkJm+sszZb2wbsgSOePOUjHzH22l3kg4aDOtW kLwhO+SNNdQSn8HVGpNAH/ktn/Zxi5gNBtupqCxS9Xr4eUsXrFB2LDIaQu2D2F+ELYso Tcsw== X-Gm-Message-State: APjAAAVNUOdHy1G2zvcrQKSpBAKsXhJET6WvSrkv7VeTk8xOjdHMBAQq JPLCO+jU9C3iq/ThZi402gC09MKBum8= X-Received: by 2002:a63:6407:: with SMTP id y7mr24377957pgb.45.1582054778035; Tue, 18 Feb 2020 11:39:38 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 5/9] hw/display/artist: Remove dead code (CID 1419388 & 1419389) Date: Tue, 18 Feb 2020 11:39:25 -0800 Message-Id: <20200218193929.11404-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42e 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: peter.maydell@linaro.org, Sven Schnelle , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Coverity reports: *** CID 1419388: Control flow issues (DEADCODE) /hw/display/artist.c: 739 in draw_line_xy() 733 if (endy < 0) { 734 endy = 0; 735 } 736 737 738 if (endx < 0) { >>> CID 1419388: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "return;". 739 return; 740 } 741 742 if (endy < 0) { 743 return; 744 } *** CID 1419389: Control flow issues (DEADCODE) /hw/display/artist.c: 743 in draw_line_xy() 737 738 if (endx < 0) { 739 return; 740 } 741 742 if (endy < 0) { >>> CID 1419389: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "return;". 743 return; 744 } 745 746 trace_artist_draw_line(startx, starty, endx, endy); 747 draw_line(s, startx, starty, endx, endy, false, -1, -1); 748 } Fixes: Covertiy CID 1419388 and 1419389 (commit 4765384ce33) Signed-off-by: Philippe Mathieu-Daudé Acked-by: Sven Schnelle Message-Id: <20200214001303.12873-6-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/display/artist.c | 9 --------- 1 file changed, 9 deletions(-) -- 2.20.1 diff --git a/hw/display/artist.c b/hw/display/artist.c index 5492079116..753dbb9a77 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -734,15 +734,6 @@ static void draw_line_xy(ARTISTState *s, bool update_start) endy = 0; } - - if (endx < 0) { - return; - } - - if (endy < 0) { - return; - } - draw_line(s, startx, starty, endx, endy, false, -1, -1); } From patchwork Tue Feb 18 19:39:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183618 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6490260ile; Tue, 18 Feb 2020 11:44:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwgS1dbzMoWYhlkWxKn9jPlwUsY3dAMrIQGauw/CKTp64UgOsDcHzjO4r8sc/9FXNMBnK2A X-Received: by 2002:a0c:e2d1:: with SMTP id t17mr18430294qvl.25.1582055093877; Tue, 18 Feb 2020 11:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055093; cv=none; d=google.com; s=arc-20160816; b=YiTczsh6DUCFtxognpi7NflteEsWTrR6iXvXa53i/Dpavofyc4Xbh9UdvK/2EtQWLG 3i2szKgihawT71fGcCgTXNjUPdQO7I0DT8tTdp3KnY3x0aP68peg4X/bit58tMDA5Rzi wAvydsDnB2nSw1vPs57uXn9Ence3ACpF3v2krp3mymoccCNz7Ww+Ou1tXEsoKgdB8HiI L8pkejuM8+zarhMVlCOz7cUGjsBproISZrl2O/HxTgT3plxOndBxDAgcqfKLtLvNRGbM YecU4yW4TX9/j4DGPsGfo56AkRNK+gaaKY4bzK6n+97aFWhm8Mt9mZ8qQJV4TjgyffoO sKJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=oZO5RKA9Grp6ITlGi7FVOEFNRvhDdW0o8hVNMgXHdmY=; b=Fsw0ZWaoPFAv5L0zxIY3kEIy4wevwr9gxifFSPt6jyzOrw6IXUPODTGaqbnCGOYUiZ M/cCjsoLeqbARo8yDLdENZTG24g0KpI8UX5eObqoYQNrNEwOVsqU75pB4zcwf13jwDCs QpO/jdiHsNaXIa2MMjNbkNNeal2j1aVwz3oo9by/cSXXsXbFomu8nuWwpsySI4DPB06Y 2bqY0x5B/YYnTYJlkyhdrjjIWG/KnXr8edpO+X/b128wTLTu6IlEf4u0t5fPaTxd0Due 4WRBpjD+RMV507Lyuk/RKT1H4rrW7385uwiT8wusXLYHwP86rwjHasELTRgx75QOll+k y4Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=z5PZcdM3; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g2si2135033qtr.72.2020.02.18.11.44.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:44:53 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=z5PZcdM3; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48nd-0003QX-Fg for patch@linaro.org; Tue, 18 Feb 2020 14:44:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55208) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48ic-0003hz-8G for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48ib-0004Qo-7J for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:42 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:35795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48ib-0004PT-1R for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:41 -0500 Received: by mail-pl1-x62a.google.com with SMTP id g6so8487794plt.2 for ; Tue, 18 Feb 2020 11:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oZO5RKA9Grp6ITlGi7FVOEFNRvhDdW0o8hVNMgXHdmY=; b=z5PZcdM3GwfshQMTb+zkOYVWQxLMe8XtkmZqYkJdrc92e/r8MZUVqGsfVy9QAbBAAf /yvajMui0bQH9bVNuH539y0Ce8CedmHmiO5zmiwosDHjFfxOqb/TPpYXAQr1IXfc4FIQ OKCyCbXJ77pbWZ+6UsbXdKOFGPJL1heXOmi+xovIztzXx9+2aXKvQlsA/oQhOGV92prL /FHNURWpHnW28ywc7QsXzNquhaXqt0Vz7bSkyy4Qmzwh8jwy6h47/5Fw5ZutD6rky9ZS YI7JVVnG6Smm25aaNJfyDYfI4gmXsZnLFv/J1IkYAiZfxKSbEHT46Xbr791zWNFdxf7E 0Zrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oZO5RKA9Grp6ITlGi7FVOEFNRvhDdW0o8hVNMgXHdmY=; b=azVHyeTk2uI5MwCXkfBKv3ZT3j6KkiyCsTk0L9f2y6dvWrXYIea2J2tbN972c6Den3 K9xYu3EAoiybl24IbOh/lUKX4XrC+EOYRFguHprGKn5NEED2oM0rw7ebPQtRso1GAl+4 FSqR3DxWUiqDrMUgVcJUY2XrbZf6AJNtcZqPiuJMTOjDJj4R6M5NmEz11d/7TknKqvz8 odPAfgdvz71GOBjmh3mo15voNGS8eyFGCeMg7D7wWkCy/e5eD0aje7ju6ZnRZmJBZrvi gqU0cGerTNLuh+IJ3DfQAKLirEvzD6yv5W6O4snCfw8bgJB7cb3zeWapfo+28+8UeaXZ sbYA== X-Gm-Message-State: APjAAAWgmPRIA83lXY+SvYNcQC6oOfPRKGS0voCqE4KA/iEglK0OwJji H2VtXoyUl+Ir3g9FpuVQDuoTwcA0WU8= X-Received: by 2002:a17:90a:db0b:: with SMTP id g11mr4395370pjv.140.1582054779627; Tue, 18 Feb 2020 11:39:39 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 6/9] hw/hppa/dino: Add comments with register name Date: Tue, 18 Feb 2020 11:39:26 -0800 Message-Id: <20200218193929.11404-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62a 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: peter.maydell@linaro.org, Helge Deller , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Add a comment with the name of each register in the 0x800-0x8ff range. Acked-by: Helge Deller Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200218063355.18577-2-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/hppa/dino.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- 2.20.1 diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 9797a7f0d9..c237ad3b1b 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -85,18 +85,18 @@ #define DINO800_REGS ((DINO_TLTIM - DINO_GMASK) / 4) static const uint32_t reg800_keep_bits[DINO800_REGS] = { - MAKE_64BIT_MASK(0, 1), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 8), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 9), - MAKE_64BIT_MASK(0, 32), - MAKE_64BIT_MASK(0, 8), - MAKE_64BIT_MASK(0, 30), - MAKE_64BIT_MASK(0, 25), - MAKE_64BIT_MASK(0, 22), - MAKE_64BIT_MASK(0, 9), + MAKE_64BIT_MASK(0, 1), /* GMASK */ + MAKE_64BIT_MASK(0, 7), /* PAMR */ + MAKE_64BIT_MASK(0, 7), /* PAPR */ + MAKE_64BIT_MASK(0, 8), /* DAMODE */ + MAKE_64BIT_MASK(0, 7), /* PCICMD */ + MAKE_64BIT_MASK(0, 9), /* PCISTS */ + MAKE_64BIT_MASK(0, 32), /* Undefined */ + MAKE_64BIT_MASK(0, 8), /* MLTIM */ + MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ + MAKE_64BIT_MASK(0, 25), /* PCIROR */ + MAKE_64BIT_MASK(0, 22), /* PCIWOR */ + MAKE_64BIT_MASK(0, 9), /* TLTIM */ }; typedef struct DinoState { From patchwork Tue Feb 18 19:39:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183617 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6489120ile; Tue, 18 Feb 2020 11:43:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx5SnOjjJkibRZ+nKcGLDllR3HcMCVO4E6ApYv2flJYKZPoSZvtQOepbqogloB5A9dEN5H8 X-Received: by 2002:ac8:83d:: with SMTP id u58mr18487068qth.60.1582055013535; Tue, 18 Feb 2020 11:43:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055013; cv=none; d=google.com; s=arc-20160816; b=nyUY6QsEumGKDdaBi0txkPNjLnYWGVqgzfzqXPZpqoRN5XSDk4KdYSkXvB/RzteT7a GFZGho71cC7a125WKX8FndMotb08k4DEmmzB0iESdewcS54QDyJMlXXZoJRhuxRR2ztZ MuV9ZepST14iIk73U1EYlRy5SO4Y8l/EP8GNIAROkEy6/yVPB4I93cl4ye4ba56zZ+CQ vZl7eDmAu3UnzwrdJw8hrPDLNsr5Ai8fTKFT/MMscHv5HHSZwtd2ByLxyKkbcz5417EI +dMTGlLD/csbE4dLqAd/ouPLBfSwR8fekxrZJBq+sBS5WYnPRKPEVzC7NE1XRmjPOCgR tJOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=1tElKPiRfZ14QGmD+h4hKk0xES24fZ4k3wRcrxxOi0E=; b=rfhO5Xo5wIaqAJi24aS0VnbQdeCuJwqHiGAJsARsHAf5Nrxo6yknM7t+2wawGlAk1n tMxo4vripv0mUneTN7ZTwdHWpRAdVp28bVrMaqPOotE2TmActS32CnO/O9nS7iZDUgl2 03T7tGhv/niUqh54YulyIGk2TtWgD3zKMdE4PujnIS0tD+rFU4giDz/rzMFQUUaGdEgF fbu6qFKOFDSW+mnYChAyW5IWkfszA+Cbra6d/DVkgjM+SWWqKWPunnW+neTUqgkmmVzo vfCON3x7JQo+/NWeIjXROlTGOmsFWsZ/SfjVWD+C6NDs8dL9HGGEee4cHVq7lOfUc8Fm Lidw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qnjieUOz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u39si2212173qth.337.2020.02.18.11.43.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:43:33 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=qnjieUOz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48mL-0001Yl-1h for patch@linaro.org; Tue, 18 Feb 2020 14:43:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55322) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48ie-0003nQ-Cd for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48ic-0004Te-LU for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:44 -0500 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:50809) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48ic-0004SE-Cx for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:42 -0500 Received: by mail-pj1-x1042.google.com with SMTP id r67so1478948pjb.0 for ; Tue, 18 Feb 2020 11:39:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1tElKPiRfZ14QGmD+h4hKk0xES24fZ4k3wRcrxxOi0E=; b=qnjieUOzxuvQ5Qpyhwj7NRW+7/uxkrjBChajfKII0yTgGom+d3yDh06y47nfg7qxLq lZ9ueKylZl+5ad494qiPFSavkZObmJ5oxm+Iaigo9/oqDUPuZMXyNnVLyaZW8XCTXHXU yFiZSh6IYqkla1/qZRB1iZQkwFCzzdNL3wAeGzTY3ngvIRMnn+FxVw+jQlfroAJ5LJwh lUcxEPWNDbfBS58Tuqvc+0AnmO4hN6jXnr4Pag+YcCiz7Tl7xmLHahjKRAnfOyBPWo0o YnlfrxRuMucXwF9hy/HyHDG31d0+/PzPoL0et7PaEREWTsppyYckONsDcWFhDVtM1qfc 0feA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1tElKPiRfZ14QGmD+h4hKk0xES24fZ4k3wRcrxxOi0E=; b=G8bkk2DU7TMkK76iMhmMdw7Jc4EuVGGe1ikS2KHZOw0jkFb2mM7y5zhu3hOMF1fsim cdr3TY0V0wqok1elaVHP0ia/1gRHQx0DFMwfkZERxvbnnWWqN+KjoRCNkJpeEsB3OD1l mkFBE5JLjqRKoUQWbzqmlZDfNJtue8OX3BqCNdUt0nYUopuHtNNYFq+x/+YJWd0ySn5o BwTfjQ6lD42tCP4hTSaab3sk9Ta+hROjePE9z0S/CY0l94/vEH/hOouAFf2LLS3iuOMz 3HKss/Ry6j6J8Ggo9o6AAddsDdpMIk7fgyBYosCrI2TyFOXQQuDfQQVzAG14+ngjnZVT O/ig== X-Gm-Message-State: APjAAAVKsfkD2L7a5PkAkP8wU37VhbjU+fyroVpE+KgPUaqcsS8sUl6g gOhCQ8y02JMlViYh8VFwPWCrXuDuvbk= X-Received: by 2002:a17:90a:c084:: with SMTP id o4mr4379091pjs.35.1582054780800; Tue, 18 Feb 2020 11:39:40 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 7/9] hw/hppa/dino: Fix reg800_keep_bits overrun (CID 1419387 1419393 1419394) Date: Tue, 18 Feb 2020 11:39:27 -0800 Message-Id: <20200218193929.11404-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1042 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: peter.maydell@linaro.org, Helge Deller , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Coverity reports: *** CID 1419387: Memory - illegal accesses (OVERRUN) /hw/hppa/dino.c: 267 in dino_chip_read_with_attrs() 261 val = s->ilr & s->imr & s->icr; 262 break; 263 case DINO_TOC_ADDR: 264 val = s->toc_addr; 265 break; 266 case DINO_GMASK ... DINO_TLTIM: >>> CID 1419387: Memory - illegal accesses (OVERRUN) >>> Overrunning array "s->reg800" of 12 4-byte elements at element index 12 (byte offset 48) using index "(addr - 2048UL) / 4UL" (which evaluates to 12). 267 val = s->reg800[(addr - DINO_GMASK) / 4]; 268 if (addr == DINO_PAMR) { 269 val &= ~0x01; /* LSB is hardwired to 0 */ 270 } 271 if (addr == DINO_MLTIM) { 272 val &= ~0x07; /* 3 LSB are hardwired to 0 */ *** CID 1419393: Memory - corruptions (OVERRUN) /hw/hppa/dino.c: 363 in dino_chip_write_with_attrs() 357 /* These registers are read-only. */ 358 break; 359 360 case DINO_GMASK ... DINO_TLTIM: 361 i = (addr - DINO_GMASK) / 4; 362 val &= reg800_keep_bits[i]; >>> CID 1419393: Memory - corruptions (OVERRUN) >>> Overrunning array "s->reg800" of 12 4-byte elements at element index 12 (byte offset 48) using index "i" (which evaluates to 12). 363 s->reg800[i] = val; 364 break; 365 366 default: 367 /* Controlled by dino_chip_mem_valid above. */ 368 g_assert_not_reached(); *** CID 1419394: Memory - illegal accesses (OVERRUN) /hw/hppa/dino.c: 362 in dino_chip_write_with_attrs() 356 case DINO_IRR1: 357 /* These registers are read-only. */ 358 break; 359 360 case DINO_GMASK ... DINO_TLTIM: 361 i = (addr - DINO_GMASK) / 4; >>> CID 1419394: Memory - illegal accesses (OVERRUN) >>> Overrunning array "reg800_keep_bits" of 12 4-byte elements at element index 12 (byte offset 48) using index "i" (which evaluates to 12). 362 val &= reg800_keep_bits[i]; 363 s->reg800[i] = val; 364 break; 365 366 default: 367 /* Controlled by dino_chip_mem_valid above. */ Indeed the array should contain 13 entries, the undocumented register 0x82c is missing. Fix by increasing the array size and adding the missing register. CID 1419387 can be verified with: $ echo x 0xfff80830 | hppa-softmmu/qemu-system-hppa -S -monitor stdio -display none QEMU 4.2.50 monitor - type 'help' for more information (qemu) x 0xfff80830 qemu/hw/hppa/dino.c:267:15: runtime error: index 12 out of bounds for type 'uint32_t [12]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phil/source/qemu/hw/hppa/dino.c:267:15 in 00000000fff80830: 0x00000000 and CID 1419393/1419394 with: $ echo writeb 0xfff80830 0x69 \ | hppa-softmmu/qemu-system-hppa -S -accel qtest -qtest stdio -display none [I 1581634452.654113] OPENED [R +4.105415] writeb 0xfff80830 0x69 qemu/hw/hppa/dino.c:362:16: runtime error: index 12 out of bounds for type 'const uint32_t [12]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior qemu/hw/hppa/dino.c:362:16 in ================================================================= ==29607==ERROR: AddressSanitizer: global-buffer-overflow on address 0x5577dae32f30 at pc 0x5577d93f2463 bp 0x7ffd97ea11b0 sp 0x7ffd97ea11a8 READ of size 4 at 0x5577dae32f30 thread T0 #0 0x5577d93f2462 in dino_chip_write_with_attrs qemu/hw/hppa/dino.c:362:16 #1 0x5577d9025664 in memory_region_write_with_attrs_accessor qemu/memory.c:503:12 #2 0x5577d9024920 in access_with_adjusted_size qemu/memory.c:539:18 #3 0x5577d9023608 in memory_region_dispatch_write qemu/memory.c:1482:13 #4 0x5577d8e3177a in flatview_write_continue qemu/exec.c:3166:23 #5 0x5577d8e20357 in flatview_write qemu/exec.c:3206:14 #6 0x5577d8e1fef4 in address_space_write qemu/exec.c:3296:18 #7 0x5577d8e20693 in address_space_rw qemu/exec.c:3306:16 #8 0x5577d9011595 in qtest_process_command qemu/qtest.c:432:13 #9 0x5577d900d19f in qtest_process_inbuf qemu/qtest.c:705:9 #10 0x5577d900ca22 in qtest_read qemu/qtest.c:717:5 #11 0x5577da8c4254 in qemu_chr_be_write_impl qemu/chardev/char.c:183:9 #12 0x5577da8c430c in qemu_chr_be_write qemu/chardev/char.c:195:9 #13 0x5577da8cf587 in fd_chr_read qemu/chardev/char-fd.c:68:9 #14 0x5577da9836cd in qio_channel_fd_source_dispatch qemu/io/channel-watch.c:84:12 #15 0x7faf44509ecc in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x4fecc) #16 0x5577dab75f96 in glib_pollfds_poll qemu/util/main-loop.c:219:9 #17 0x5577dab74797 in os_host_main_loop_wait qemu/util/main-loop.c:242:5 #18 0x5577dab7435a in main_loop_wait qemu/util/main-loop.c:518:11 #19 0x5577d9514eb3 in main_loop qemu/vl.c:1682:9 #20 0x5577d950699d in main qemu/vl.c:4450:5 #21 0x7faf41a87f42 in __libc_start_main (/lib64/libc.so.6+0x23f42) #22 0x5577d8cd4d4d in _start (qemu/build/sanitizer/hppa-softmmu/qemu-system-hppa+0x1256d4d) 0x5577dae32f30 is located 0 bytes to the right of global variable 'reg800_keep_bits' defined in 'qemu/hw/hppa/dino.c:87:23' (0x5577dae32f00) of size 48 SUMMARY: AddressSanitizer: global-buffer-overflow qemu/hw/hppa/dino.c:362:16 in dino_chip_write_with_attrs Shadow bytes around the buggy address: 0x0aaf7b5be590: 00 f9 f9 f9 f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9 0x0aaf7b5be5a0: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9 0x0aaf7b5be5b0: 07 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0aaf7b5be5c0: 00 00 00 02 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0aaf7b5be5d0: 00 00 00 00 00 00 00 00 00 00 00 03 f9 f9 f9 f9 =>0x0aaf7b5be5e0: 00 00 00 00 00 00[f9]f9 f9 f9 f9 f9 00 00 00 00 0x0aaf7b5be5f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0aaf7b5be600: 00 00 01 f9 f9 f9 f9 f9 00 00 00 00 07 f9 f9 f9 0x0aaf7b5be610: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 0x0aaf7b5be620: 00 00 00 05 f9 f9 f9 f9 00 00 00 00 07 f9 f9 f9 0x0aaf7b5be630: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==29607==ABORTING Fixes: Covertiy CID 1419387 / 1419393 / 1419394 (commit 18092598a5) Acked-by: Helge Deller Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200218063355.18577-3-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/hppa/dino.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index c237ad3b1b..8868e31793 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -83,7 +83,7 @@ #define DINO_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE) -#define DINO800_REGS ((DINO_TLTIM - DINO_GMASK) / 4) +#define DINO800_REGS (1 + (DINO_TLTIM - DINO_GMASK) / 4) static const uint32_t reg800_keep_bits[DINO800_REGS] = { MAKE_64BIT_MASK(0, 1), /* GMASK */ MAKE_64BIT_MASK(0, 7), /* PAMR */ @@ -96,6 +96,7 @@ static const uint32_t reg800_keep_bits[DINO800_REGS] = { MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ MAKE_64BIT_MASK(0, 25), /* PCIROR */ MAKE_64BIT_MASK(0, 22), /* PCIWOR */ + MAKE_64BIT_MASK(0, 32), /* Undocumented */ MAKE_64BIT_MASK(0, 9), /* TLTIM */ }; From patchwork Tue Feb 18 19:39:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183614 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6488944ile; Tue, 18 Feb 2020 11:43:20 -0800 (PST) X-Google-Smtp-Source: APXvYqznvpqLPtiyJicIceoRQOlZgUkBPOaueMbt3nl1CKF/DigOA5j02vaW5sB37YMLCaESXvFL X-Received: by 2002:ac8:2bf8:: with SMTP id n53mr18615350qtn.1.1582055000447; Tue, 18 Feb 2020 11:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055000; cv=none; d=google.com; s=arc-20160816; b=uCjjQHYuDjoyVSAJCK8GVWHUB0HObTVulep4z/fOvtPWAxebaWrQRbbKbMdImhAOtZ mxaCmmoQHXNUBBwGH/aeujbcGz+TU8bhHll40zwPhNYyHvawmMr5pnGiJ65qoo+JWELD Z0sjel11CRrigSD/GQN1v0K15jx8z8KeaD69gsvk2kg6HBiJUBgqiVA+75gOnx5tftQ1 LofTkV1MLtD+l+v6WZp807VgrzLRUyFbLjd+oeBPIITxH/FcUeYlc4nrP7cZmFiBBDWQ WfbM1m5yB6nViq+wv0+WoctOdCWtL7zl5tJFNuWB5alPX7xOdeBaVIQ5M7njNW6cQbOH dlJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=fkf1cCU+0nMjQ3/Y/EWHF6ItnUhhF98WWxF5yKDha6U=; b=E21vRwisPOmktM7EF7RNgb/2iYyVES33kIxhLfylzDoPDSMR7Bde1O9WHhLUZxE2I1 LhnAJhwXXI6BGheVQGjwThMAG4ZXFUshKZbf/hygDlrh/R/J1aXUNFPnHrrIJsEjmqQr lDl+JD8sSlAu4b/hKgH4yzCjj25yjb3BuuITpLBzdz9eHMcmdSPSHhiI139VrvskMm5i d1oNp0/ZONse2Pzci6YbNcv4GMo6JgaPS8lJSVYyApdMi8fa+3PQnB9mnGgv/K3PY0Lq 7ZYIDxJfdfA6sHiEx8h+m0QVnQcHfUL3P6gkMvHpobEX6uTRZblD+YbMS6E6au6bK3TY 6BRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Jng6cjJ1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i3si2194632qvr.220.2020.02.18.11.43.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:43:20 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=Jng6cjJ1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48m7-0001RF-Ui for patch@linaro.org; Tue, 18 Feb 2020 14:43:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55342) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48ie-0003oK-NK for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48id-0004Vg-LJ for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:44 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:41457) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48id-0004U4-Ex for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:43 -0500 Received: by mail-pf1-x42d.google.com with SMTP id j9so11147339pfa.8 for ; Tue, 18 Feb 2020 11:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fkf1cCU+0nMjQ3/Y/EWHF6ItnUhhF98WWxF5yKDha6U=; b=Jng6cjJ1KQzNj5yLYHF63m6IEbsOSuKsIS91rowT385wkEdGQ1jP8qJloYgS7q3AnH cmPVgZYrz6yoxuac+AAK/yYhkzP+cvqiLA3rY3kzXkM/JaTe1c2/0tbczAVkwjm1p7ME a2nvC5isR0/65eQ4C8vqNPvEldVkm+dElsftBpqJybuWmKu1cV/mmb9/M/AQl7C9s8O9 4Hee8IFJSgTHUO+xyMh2IjkhpuJNnjPbXXPjEjXtg0aPFplTYHZgHsSw8eLknW2k8HJF 0jQ1R3ZM0CHM+2PfdYht4z4mzRYmsf5NraPNyj76Iy8PNbWw/UtLJjEu8UcvP8dCNfYy smCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fkf1cCU+0nMjQ3/Y/EWHF6ItnUhhF98WWxF5yKDha6U=; b=TBc/bxbs+UfBsLAYUZo27hS4npmYFn/NI/xxF6EkNWbr5Fj1Gwt8fIuO0pFajQRB26 ise2LtBrxZeTUcO2rO8kaCmsNsSULw8IvMW/+j4vUR8GJFVXqVApfkUMCNXntil2eVTB rV6tbMcpU50o/nDyGmeatM1m4/Xf0UewaWOg6f5Tx3ml62fflK/XHzLeQC0+bGCjqta9 Tyl/MIHRSelO1Sk7z3ePQ6ji8y+2sW0Yiv2JNvjZIYkzgi/fWn0o+Q8lAH+6yA8ItkKl xmEunvFS0TXzUBSA/A0WM0fFIZzY7wrnTOjhDlpjeT50XobAmBbN1OzxocY6zIlnDVBl h9lA== X-Gm-Message-State: APjAAAVV/UwJ1VLXg7gUNlJ4QXvnfCsIKwcIac6WlcgkSwjqkxdGQEEZ jc7sJFJOFRggykobixeM/OHuM20YsD0= X-Received: by 2002:a63:1e5e:: with SMTP id p30mr25945016pgm.112.1582054782116; Tue, 18 Feb 2020 11:39:42 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 8/9] hw/hppa/dino: Fix bitmask for the PCIROR register Date: Tue, 18 Feb 2020 11:39:28 -0800 Message-Id: <20200218193929.11404-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42d 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: peter.maydell@linaro.org, Helge Deller , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Only 24 bits of the PCIROR register are documented (see pp. 37 of datasheet referenced in this file header). Acked-by: Helge Deller Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200218063355.18577-4-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/hppa/dino.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 8868e31793..be799aad43 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -94,7 +94,7 @@ static const uint32_t reg800_keep_bits[DINO800_REGS] = { MAKE_64BIT_MASK(0, 32), /* Undefined */ MAKE_64BIT_MASK(0, 8), /* MLTIM */ MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ - MAKE_64BIT_MASK(0, 25), /* PCIROR */ + MAKE_64BIT_MASK(0, 24), /* PCIROR */ MAKE_64BIT_MASK(0, 22), /* PCIWOR */ MAKE_64BIT_MASK(0, 32), /* Undocumented */ MAKE_64BIT_MASK(0, 9), /* TLTIM */ From patchwork Tue Feb 18 19:39:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183619 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp6491817ile; Tue, 18 Feb 2020 11:46:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwiK+NKHgS/61LdGifPLjYlA6oT8Dre39+SoMnZzWEhyQuczOBnUyi6Mi8Ir5Hb11qvp+f7 X-Received: by 2002:ac8:592:: with SMTP id a18mr19181374qth.107.1582055186070; Tue, 18 Feb 2020 11:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055186; cv=none; d=google.com; s=arc-20160816; b=LQ1kWuzod2wJR9L6r54+3mvd9XZYiex3rYuhxBtRhhs7mrXFkienpmn3ips1sy+7Jl rSRkUjHu7dOeqOVx3S4LZlLsIl5qZ/YkOv2ztpSgJLo7URV+SOvhy0TORAGfRvtoD0xQ 2tV/WhhnCK4/PgrETb6F7oFjRyQr/8XVR3tIWiMWxRYe1uL/2tHNrlCitipuDbLU0Eam FeGUObf0Fh0Cp+VJmnYioULcjotQZbkNrP9RJwWnQDqf1IkT8yVfViUxaISqX77DY4qH uud/g/rnb036ZIwtLh52Z+Jn024asBWPpfEWXyeero2FqGZY+/aW3JbndNc0JBdM5zUY 4K5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=QSNJImV6Sv3hjKepfQ333kr7g+hkYoplwMWy8vc32R4=; b=Xv+5aAX/MbH+ZqeeoAYjuWYq+GbNK8UUeYOtiqoh1FuQoqobQ8bV1RC1smWQA5wiQF t/PT2fWihHR61IDqUSKt/cqfrsaAETadByfAN9LRwWMwifCQgKw1Lyr8MlfI69Ekjv3A ReQMNpKZX3995lc09yM1od2XCVzwCq9a9uBly6/+iGM9kS0rUn69XdDkP601Pt2vQam6 AOrwLFUtRUiH07n+BTWBiHIcQKZseKRVbOe7IV7Oyjo6IUhquWSv6wNt5B64m/jHg5SE oz9wpBLgyEkNej49evVj7SEfk5Gg1QqTKC3nYeIK3jJ4P+rCbJT0HUO+F2i7h+VHejV0 q/0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p+nUt1NZ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h3si2097634qvs.71.2020.02.18.11.46.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 11:46:26 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=p+nUt1NZ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48p7-0004zJ-LH for patch@linaro.org; Tue, 18 Feb 2020 14:46:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55417) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j48if-0003r4-RU for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j48ie-0004Xz-Rq for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:45 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:46356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j48ie-0004WR-Kb for qemu-devel@nongnu.org; Tue, 18 Feb 2020 14:39:44 -0500 Received: by mail-pf1-x42e.google.com with SMTP id k29so11140217pfp.13 for ; Tue, 18 Feb 2020 11:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QSNJImV6Sv3hjKepfQ333kr7g+hkYoplwMWy8vc32R4=; b=p+nUt1NZPZDuAmJfkVnK457U7ab00RT3CzSfwMmbu1JFbVFfr0bYGKMDks1xhEa+jR jlwfmZYxHrnCmHI9src3LkTtA9CG5Jomo5lfLSz1IJs5EKnrN+MOcOdNovthW1OiFdjz ujCqSU3gKPIhzrddlFxDQTyNCWHONDeuFWP8h/3Zp2ci1SBMCDq+ZzzxrbC0j9SwpDLq QhVFTr5FErXWnyoN0O+bLOCnwX96wCMwD1qKFt/jxfaWVXuRZHYbzLIMNzWN/rrSghPu o4bp660AsTREEi46fPICnti0+M9SImkYe3Xv29zFj6nes/gTqoLHUo4awtmv2w2Bf1JY 1Z6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QSNJImV6Sv3hjKepfQ333kr7g+hkYoplwMWy8vc32R4=; b=RXz2oHnZGVqyidS+6PSD/IiiyspTzkpobHC1wI+L1z1WEVcKrPiQVGGwkAzgIagQiH sVkq0t+Qwcf7FgloAeMnKsvDuW2I5ynUi3lI3HGR41JJbi2ans4tgUTRm4aK0vOrN+Kw gLI/1nNdSeRToAvZRYr9uryqMIaGwYt9JLQTIRWnIoDQ+4/sq3eT+OaHMBdw0gDGrXpX yH6iAnG94ulg4iOlqvq4k2+x1XFsOkfx8rakQ3/RWYeYPP7ZoK3WAI8Hquc9cFmYomJr IM6+8AiEz5Eu6HlcurnI1fWzQedbc/mSvrOTa5+xSEGF8ZWMEsr0VEoQjQgzalE3iYAx v5Hw== X-Gm-Message-State: APjAAAX5tAfadVKDoz1GATq1GE9/2z3JIi/2KshS7vmHHKbDz/O9XwJz xJJ2JlNZHQcFW4AgW6IFPdVEcC0bquE= X-Received: by 2002:a63:5f4e:: with SMTP id t75mr23941327pgb.7.1582054783296; Tue, 18 Feb 2020 11:39:43 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y15sm424395pgj.78.2020.02.18.11.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:39:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 9/9] hw/hppa/dino: Do not accept accesses to registers 0x818 and 0x82c Date: Tue, 18 Feb 2020 11:39:29 -0800 Message-Id: <20200218193929.11404-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218193929.11404-1-richard.henderson@linaro.org> References: <20200218193929.11404-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42e 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: peter.maydell@linaro.org, Helge Deller , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Register 0x818 is documented as 'undefined', and register 0x82c is not documented. Refuse their access. Acked-by: Helge Deller Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200218063355.18577-5-f4bug@amsat.org> Signed-off-by: Richard Henderson --- hw/hppa/dino.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index be799aad43..2b1b38c58a 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -181,7 +181,9 @@ static bool dino_chip_mem_valid(void *opaque, hwaddr addr, case DINO_IO_ADDR_EN: case DINO_PCI_IO_DATA: case DINO_TOC_ADDR: - case DINO_GMASK ... DINO_TLTIM: + case DINO_GMASK ... DINO_PCISTS: + case DINO_MLTIM ... DINO_PCIWOR: + case DINO_TLTIM: ret = true; break; case DINO_PCI_IO_DATA + 2: