From nobody Sun Apr 28 08:36:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561473025; cv=none; d=zoho.com; s=zohoarc; b=bt9l9mo1t2Vt1mCGOpAs4+hO/Sfabb1NCQkOsK9l8k9Woj8E7mi7N5lmyt57S0dHIVPjYOv4MZAOhWsvmjV5mMryRt9GLXOtnppUno//NGd3VX7VruXrSiJ/NEn6ws7mBqwG+Mad2Rl60dUQFgwOBH9C6c0vSPDBKRzYynBK4Xk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561473025; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=wk/auvU2Glo6OWJgQ1eRQ74mgFEbRan9TE1a/Fgkmg8=; b=Y6uE6nBxQqHU1Ni+7Oqa7M64fZtoMc+65KFU37DzBXyunVu1sBDZoX5QfwpIkMIrHuqUnVSxQ7BRfNjesnx2CjA7o3Q+8tNHzl/gaNufhf0nj4Y/RtloEeXmR0b85AIsum619a5jNkpVcqmytBOtOdB5FEOYycCD/ZwBajGp0q0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561473025616818.5213077212558; Tue, 25 Jun 2019 07:30:25 -0700 (PDT) Received: from localhost ([::1]:60866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfmS4-0002iU-Rt for importer@patchew.org; Tue, 25 Jun 2019 10:29:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44835) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfmQB-0001My-4O for qemu-devel@nongnu.org; Tue, 25 Jun 2019 10:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfmQ7-0005fJ-4t for qemu-devel@nongnu.org; Tue, 25 Jun 2019 10:27:40 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56562 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfmQ6-0005ch-BI for qemu-devel@nongnu.org; Tue, 25 Jun 2019 10:27:38 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 960441A1D70; Tue, 25 Jun 2019 16:27:35 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 79B1F1A1CCA; Tue, 25 Jun 2019 16:27:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 16:27:17 +0200 Message-Id: <1561472838-32272-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561472838-32272-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561472838-32272-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH 1/2] dma/rc4030: Fix off-by-one error in specified memory region size 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: arikalo@wavecomp.com, hpoussin@reactos.org, f4bug@amsat.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic The size is one byte less than it should be: address-space: rc4030-dma 0000000000000000-00000000fffffffe (prio 0, i/o): rc4030.dma rc4030 is used in MIPS Jazz board context. Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Rikalo Reviewed-by: Herv=C3=A9 Poussineau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/rc4030.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 6ccafec..88ff271 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/mips/mips.h" #include "hw/sysbus.h" @@ -678,7 +679,7 @@ static void rc4030_realize(DeviceState *dev, Error **er= rp) =20 memory_region_init_iommu(&s->dma_mr, sizeof(s->dma_mr), TYPE_RC4030_IOMMU_MEMORY_REGION, - o, "rc4030.dma", UINT32_MAX); + o, "rc4030.dma", 4 * GiB); address_space_init(&s->dma_as, MEMORY_REGION(&s->dma_mr), "rc4030-dma"= ); } =20 --=20 2.7.4 From nobody Sun Apr 28 08:36:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561473142; cv=none; d=zoho.com; s=zohoarc; b=P2lal/45iztTgN4+vHVJZb+fGtL6U+r6i8v5Yz5JdGpE0xYRhig/z+Er5r86C0Jw9RwzzhoVXAH2Ow+l+yVhFDntYUB7C7K1TDwI5XLPmjCc8bBdzY0Z1qS8r4VXWHOtvB8kvldSRP3c5rKCXrFy2zBd4xyFKSCo/iUiuVMPwSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561473142; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=caHjCH35fv6RjQ8At41/AHOGPICP07jNw0Z4sTNnuK4=; b=JpHw+ERDo6A+Zoei6R+/3qG+AaKhaoNkTacJPrIv9FueNb6Wd8OsusYr/L2fejY9ruUCTziPpXAnz5/AvnBsjraF5qM+EEOxAQ2zAEPBRbI0BuYp1f20C+T475tCtztsD8s7g5JFKfOngwKEs8FlRPXlTdgksv+epcMTtnfnVms= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561473142720642.7946429845359; Tue, 25 Jun 2019 07:32:22 -0700 (PDT) Received: from localhost ([::1]:60868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfmS6-0002l6-4U for importer@patchew.org; Tue, 25 Jun 2019 10:29:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44898) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfmQH-0001O6-2S for qemu-devel@nongnu.org; Tue, 25 Jun 2019 10:27:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfmQD-0005ny-ER for qemu-devel@nongnu.org; Tue, 25 Jun 2019 10:27:47 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:58897 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfmQD-0005jj-4n for qemu-devel@nongnu.org; Tue, 25 Jun 2019 10:27:45 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 6CEE31A23A3; Tue, 25 Jun 2019 16:27:40 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 46DE81A1CCA; Tue, 25 Jun 2019 16:27:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 16:27:18 +0200 Message-Id: <1561472838-32272-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561472838-32272-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561472838-32272-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH 2/2] dma/rc4030: Minor code style cleanup 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: arikalo@wavecomp.com, hpoussin@reactos.org, f4bug@amsat.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Fix some simple checkpatch.pl warnings in rc4030.c. Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Rikalo Reviewed-by: Herv=C3=A9 Poussineau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/rc4030.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 88ff271..155af9b 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -58,8 +58,8 @@ typedef struct dma_pagetable_entry { =20 #define TYPE_RC4030_IOMMU_MEMORY_REGION "rc4030-iommu-memory-region" =20 -typedef struct rc4030State -{ +typedef struct rc4030State { + SysBusDevice parent; =20 uint32_t config; /* 0x0000: RC4030 config register */ @@ -152,8 +152,9 @@ static uint64_t rc4030_read(void *opaque, hwaddr addr, = unsigned int size) case 0x0058: val =3D s->cache_bmask; /* HACK */ - if (s->cache_bmask =3D=3D (uint32_t)-1) + if (s->cache_bmask =3D=3D (uint32_t)-1) { s->cache_bmask =3D 0; + } break; /* Remote Speed Registers */ case 0x0070: @@ -538,8 +539,9 @@ static void rc4030_reset(DeviceState *dev) =20 s->memory_refresh_rate =3D 0x18186; s->nvram_protect =3D 7; - for (i =3D 0; i < 15; i++) + for (i =3D 0; i < 15; i++) { s->rem_speed[i] =3D 7; + } s->imr_jazz =3D 0x10; /* XXX: required by firmware, but why? */ s->isr_jazz =3D 0; =20 @@ -551,7 +553,7 @@ static void rc4030_reset(DeviceState *dev) =20 static int rc4030_post_load(void *opaque, int version_id) { - rc4030State* s =3D opaque; + rc4030State *s =3D opaque; =20 set_next_tick(s); update_jazz_irq(s); @@ -591,7 +593,8 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t = *buf, int len, int is_wri hwaddr dma_addr; int dev_to_mem; =20 - s->dma_regs[n][DMA_REG_ENABLE] &=3D ~(DMA_FLAG_TC_INTR | DMA_FLAG_MEM_= INTR | DMA_FLAG_ADDR_INTR); + s->dma_regs[n][DMA_REG_ENABLE] &=3D + ~(DMA_FLAG_TC_INTR | DMA_FLAG_MEM_INTR | DMA_FLAG_ADDR_INTR); =20 /* Check DMA channel consistency */ dev_to_mem =3D (s->dma_regs[n][DMA_REG_ENABLE] & DMA_FLAG_MEM_TO_DEV) = ? 0 : 1; @@ -603,8 +606,9 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t = *buf, int len, int is_wri } =20 /* Get start address and len */ - if (len > s->dma_regs[n][DMA_REG_COUNT]) + if (len > s->dma_regs[n][DMA_REG_COUNT]) { len =3D s->dma_regs[n][DMA_REG_COUNT]; + } dma_addr =3D s->dma_regs[n][DMA_REG_ADDRESS]; =20 /* Read/write data at right place */ --=20 2.7.4