From nobody Mon May 20 00:21:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1593548562; cv=none; d=zohomail.com; s=zohoarc; b=ICj4dWWtKwG3GPdTaKV8spvLImouj6guSdzT3Bh81UonCzQhiFY8BLbMj+Vz8B3X0+vmJTFJivR//pUMa8Hsp+68ce64jOcu9v0uN9beWABQ2sONwXpGzfRJ8Rm7/xAfazW7dIoAT/NvAcZD0ZZha5txcFk/7NRndi0OmFFwlMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593548562; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Dp3HSCtIV/lXP32QAqMRr6+RRQjxFi9Xaxl/dQaSR+o=; b=bv5o3INRtWGNPItwSHJZ1BqMdbQZhWt/l0DsCO8t8dbZqvocOL/zxATrXmaohC7qVhrE4lVEE4SR2tWA7BcC6g2GfpAiC+KYTahJftixbakVY7+7dZ0DrPzXqCSQSGD+rFkwJVVxEHz8GcZP4B/mNX2mkqHhbkwd0DvvUQHOuiE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593548562801404.86292695361703; Tue, 30 Jun 2020 13:22:42 -0700 (PDT) Received: from localhost ([::1]:36388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqMm9-0006q0-EI for importer@patchew.org; Tue, 30 Jun 2020 16:22:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqMl5-0005Tx-Ey; Tue, 30 Jun 2020 16:21:35 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:36486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqMl1-0007ik-2Z; Tue, 30 Jun 2020 16:21:34 -0400 Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Jul 2020 04:21:26 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 13:10:17 -0700 Received: from us6fgspc2.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.58.109]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Jun 2020 13:21:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1593548491; x=1625084491; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ojAhTAodAG171f5PlmTZAafllSlW13AZrgcMFIZqJxY=; b=ePhuPiMwnWZXVQlajEUnNzdYzpMh0ezG0fo8u7VudGHZ5M0dorBNHlkL rcmLZTEr2ZFjH20deWdbYloAX6omDxmwjlhOQ27r0h3DQEt29oissmJ4J Glw7skxJ7gRr06r6dXVEcuASHs2ZDb5EWPpXzQe6WEQQ3B3ZvVILs05gs r4ag0EDW7YOhStQ9ucCu2r1KDCQyUP062+tdMIYvS4QYVKK5FNMS239mg Jf3FQSN/T71aT6hwsHU0erdFnfu0Rxb8kvUGZFQWTdu+S633wm884SZPm T9oI1E+aRcfh4ixo0HWpFgPPtXTDrD9+zxzLRk4TwsNOhyS/9inwK6r/a Q==; IronPort-SDR: hQ837rPzfPZg46bTPco8TElKJ8tGkGTdJh8q0tO0BnTsvR4kPG+JgepiSpEcfl7i4ql6wos8O0 bqJs49MDiZJI0/88QdQPJi6NLoXBk6iT4TXKT/pf6JzvlGTr7bI/cMpa/oWntdObHrB7TaJrQM HfPwpiVzwL6cq/GGvZYAcnMmKfhk/DYJX/zXHoDG1v2oAsBzlo/iHEwrB92rr4KBS4Q2+lEUuc 96oRilcnNmtwAae36lIVCE3AesFVztNomdIPiseYaMXBr9CWEXhlKKyCHlngnsnKZW6DCeiWrD NQs= X-IronPort-AV: E=Sophos;i="5.75,298,1589212800"; d="scan'208";a="142665038" IronPort-SDR: 5T7PBfVB+rQFPXV2CwE4Xnz1rwKXvVoSFpugjpSfL+nKHKz9tK3YYJoevbloc0FLyu6MbePTdW xISKMoGKGKDbliAJLp1dku6HsRQNcJjc0= IronPort-SDR: mXd4yNBGp1KnYr7ioxBmhoI/Ef6AEME2Z0bhcOfrURAPcJut4Ze/u1k3yIjOuDo6v9KnTKds6C 0hXd6A1cWvYA== WDCIronportException: Internal From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v1 1/3] hw/char: Convert the Ibex UART to use the qdev Clock model Date: Tue, 30 Jun 2020 13:12:08 -0700 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.71.154.45; envelope-from=prvs=44328bdba=alistair.francis@wdc.com; helo=esa6.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 16:21:24 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair.francis@wdc.com, palmer@dabbelt.com, alistair23@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Conver the Ibex UART to use the recently added qdev-clock functions. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/char/ibex_uart.h | 2 ++ hw/char/ibex_uart.c | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h index 2bec772615..322bfffd8b 100644 --- a/include/hw/char/ibex_uart.h +++ b/include/hw/char/ibex_uart.h @@ -101,6 +101,8 @@ typedef struct { uint32_t uart_val; uint32_t uart_timeout_ctrl; =20 + Clock *f_clk; + CharBackend chr; qemu_irq tx_watermark; qemu_irq rx_watermark; diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c index 45cd724998..f967e6919a 100644 --- a/hw/char/ibex_uart.c +++ b/hw/char/ibex_uart.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" #include "hw/char/ibex_uart.h" #include "hw/irq.h" +#include "hw/qdev-clock.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/log.h" @@ -330,7 +331,7 @@ static void ibex_uart_write(void *opaque, hwaddr addr, } if (value & UART_CTRL_NCO) { uint64_t baud =3D ((value & UART_CTRL_NCO) >> 16); - baud *=3D 1000; + baud *=3D clock_get_hz(s->f_clk); baud >>=3D 20; =20 s->char_tx_time =3D (NANOSECONDS_PER_SECOND / baud) * 10; @@ -385,6 +386,18 @@ static void ibex_uart_write(void *opaque, hwaddr addr, } } =20 +static void ibex_uart_clk_update(void *opaque) +{ + IbexUartState *s =3D opaque; + + /* recompute uart's speed on clock change */ + uint64_t baud =3D ((s->uart_ctrl & UART_CTRL_NCO) >> 16); + baud *=3D clock_get_hz(s->f_clk); + baud >>=3D 20; + + s->char_tx_time =3D (NANOSECONDS_PER_SECOND / baud) * 10; +} + static void fifo_trigger_update(void *opaque) { IbexUartState *s =3D opaque; @@ -444,6 +457,10 @@ static void ibex_uart_init(Object *obj) { IbexUartState *s =3D IBEX_UART(obj); =20 + s->f_clk =3D qdev_init_clock_in(DEVICE(obj), "f_clock", + ibex_uart_clk_update, s); + clock_set_hz(s->f_clk, 50000000); + sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->tx_watermark); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->rx_watermark); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->tx_empty); --=20 2.27.0 From nobody Mon May 20 00:21:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1593548563; cv=none; d=zohomail.com; s=zohoarc; b=c69b0xe0QenLbLCgaZjpIhC5NIsoNJx7rktfkZXVqhqMR30m4q3uNbD/I0ZyipYMwGMHCobN7ligekrEp6qAox83Dmtp+ZwkEQAmaF+njr1iQVNISeRPNhbNUYxBMOSlXmZcypjRRJlkWzPCfeARMkKKi/Zy744JU/67uZuIsJ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593548563; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H8Hl3oaZMFCo4aszBaDQrf/fEulDb/QZhQ/TSnymQgI=; b=h/Zlf87OKut4YNChpLBn79dvxb4XVCC3aHygKn4UoZNlAG921/pHxt1jK8ayXZB4Ojs7OjYlfWrTlfaL7c8BVnveoU5Hiu8ax0YMm0fMU3Cnp5oh+tYAbjlr7w+n20AnC9VsLqazmo1jHWEUDAIkukonG10/AT0n5kaLS7K67Mg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593548563236323.06026735960177; Tue, 30 Jun 2020 13:22:43 -0700 (PDT) Received: from localhost ([::1]:36446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqMmA-0006rI-1T for importer@patchew.org; Tue, 30 Jun 2020 16:22:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqMl6-0005VK-RW; Tue, 30 Jun 2020 16:21:36 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:36481) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqMl2-0007iT-3L; Tue, 30 Jun 2020 16:21:36 -0400 Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Jul 2020 04:21:29 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 13:10:20 -0700 Received: from us6fgspc2.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.58.109]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Jun 2020 13:21:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1593548492; x=1625084492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0+pISn8B5Cqa+3MVexHhrMyVOacv3IJ6UqgEj1CUxAU=; b=MRh6hcUxxkU45nB5BKJ3XQ/AHgVatuyLIiVeMofhUwDZJtMJNlLNcPos Ce6GKuNg1XI4WD5hFilM+WJTRv7vAB9KAQsoOZRYHPVyL/nPIKONCWAoq o4iRqXt3S3kiZUavZPOABQ2lfNAFkhdGELv+aOdNbD/0n4fzcqak0YOzc rmjSbQN4DX8n2PebNQfcQfsbuNjur//HSj3oqAxTY8Q8d0hhr/NS8OOAO scKYQweXE2jQktI+STfDdkeoH8r3OrdowTwJwRHdGoeSjDKD4NkLDK8th 9bN7dfTwjyoh6CWomZtCjC1rTK4XKrogpFEztd22+AJ2zBdLSdrKa845k g==; IronPort-SDR: SDQLaSr2mcT3AvDtgNqz4YzcufIIFa/VfvIq6FzPrSRyhwUGZokD7aiKRRE02lLp1cW1/K8FUi MJ9sYiGQS+cBVrbqc4iJukqTpNXCqSonme0IZfJ+T6cpFDPSpknkfrg5vwnzhrgHd/5/t326ct 2Kr3tbigHC1XyqtgRmiL0tO/hGvAd2aNTwFTx0nQpeyt2L4+Y8YgmpIwM8BIJMJG/WSdhfROmG TKOBvS5lnNmZQOJSFT1UyGBCivnw2GuCy/gqlBf8NRhBOsTlOhwEZoM54BcS3u/EDA+HJMv5J5 Qfo= X-IronPort-AV: E=Sophos;i="5.75,298,1589212800"; d="scan'208";a="142665039" IronPort-SDR: w99jhB40SuRgms7rerYLVgA9znZSN68eIMnS2n0MCd78wDxNC2cDWiNh5/p4RCMY+JdGv9uNL4 DT0zTWSE1zkmD+4yPLNd2AdXTyomZewYk= IronPort-SDR: XElD7X+fg94vro0qHSBPkwwdYTO0miJsV4946VlzksYRM1ZvjneEke+6FC3qbVQpUf4nAQ+Mq+ kvoyND+jfVzQ== WDCIronportException: Internal From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v1 2/3] hw/riscv: Allow 64 bit access to SiFive CLINT Date: Tue, 30 Jun 2020 13:12:11 -0700 Message-Id: <122b78825b077e4dfd39b444d3a46fe894a7804c.1593547870.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.71.154.45; envelope-from=prvs=44328bdba=alistair.francis@wdc.com; helo=esa6.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 16:21:24 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair.francis@wdc.com, palmer@dabbelt.com, alistair23@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit 5d971f9e672507210e77d020d89e0e89165c8fc9 "memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"" broke most RISC-V boards as they do 64 bit accesses to the CLINT and QEMU would trigger a fault. Fix this failure by allowing 8 byte accesses. Signed-off-by: Alistair Francis Reviewed-by: LIU Zhiwei Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/riscv/sifive_clint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/sifive_clint.c b/hw/riscv/sifive_clint.c index b11ffa0edc..669c21adc2 100644 --- a/hw/riscv/sifive_clint.c +++ b/hw/riscv/sifive_clint.c @@ -181,7 +181,7 @@ static const MemoryRegionOps sifive_clint_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, .valid =3D { .min_access_size =3D 4, - .max_access_size =3D 4 + .max_access_size =3D 8 } }; =20 --=20 2.27.0 From nobody Mon May 20 00:21:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1593548628; cv=none; d=zohomail.com; s=zohoarc; b=YEz6uZnqjjeQgsqD/IrUXqL450CC+ACEbUDLMDnC21cpSrHiFT2WkgbbGxaBXJQelVdjgj4VjTvSSIn9LTdGOhZFkR2DYViuCOtmW/9pWlud9RoC7tNts1DUgUNsFMVXUnUw43tl0pr8mN0vgj0cFETBdmebAhUEWNp3VFdcUf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593548628; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Nl6hNtM8vOmDI0Iq/2KrB/zol3YLF/XbII2hsGOG8Qk=; b=bgUPsGBN+s3cRJysBGHUTyV7uGxg86jDaOkhM1Z8aYzCXAod5i3OvymnX8ZMR5DamMB5CjesPaWmvYcSYMnyU+IKzujNqOjgKNV/LwQ8dHsvCHyIhr+Ke1s4VCa/NzYd1cagt087otBosb4jFpXbjkBdRZSvgcXCVw3sc5yQND0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593548628167471.86419558628313; Tue, 30 Jun 2020 13:23:48 -0700 (PDT) Received: from localhost ([::1]:41108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqMnC-0000UQ-PP for importer@patchew.org; Tue, 30 Jun 2020 16:23:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqMl9-0005Zh-BW; Tue, 30 Jun 2020 16:21:39 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:36486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqMl6-0007ik-Ij; Tue, 30 Jun 2020 16:21:39 -0400 Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Jul 2020 04:21:32 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 13:10:23 -0700 Received: from us6fgspc2.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.58.109]) by uls-op-cesaip02.wdc.com with ESMTP; 30 Jun 2020 13:21:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1593548497; x=1625084497; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oe/HJvqIrpe1Q963Js2YhP3t8Wj7CiObFT3VDk5z1o8=; b=OdNW0M3h2W97AAJjx1r0FA/WQLH6eetQ8M+M3ssFkIyIUHY0Zg6UDaVD wL/EIhUD1mU1Q2zisO+zCBLkCE4nXRkuaAkkNVxLTl3DJFhHWu44Aw8Bb ANaB9Hq11rMBzVzZoRLhaBdaetZhuUu+Qg6uIfM+wUdeJ9N9G8aTojUYn 9UsKmyVUDjrIRcHdqIi7UC90EP0L7doQ6w4zFB2ecJNve340Fi9rlHBsm p52wqLnqQSOjVZxjxYWoykZjnxfFhkk8g8duvOMgsOfhKWKgXZSL0Z9SF 9cETWzMi6N/uDgryzMg3d4zmeIHHvjyMXHcwanSYAmfqLUAvtjRBqCEn/ g==; IronPort-SDR: 5MJgjR+SrZWiAq7SPVI4Y7b90JKLx+mEQGNjb1DVTyp4ZwaYlw+81smFZjFpptUiDUSGigfitF bIjmJxFzG9l0HnxxnIWhnovdHG5Z7TX28B7FQu9dqkDP38YsbebWKZQAB/EHFcBbJaAMsbCIZM +62DzCKVhsneFWE5zfJew7oJHgRhrneE/NtmXC83txftCtvUsiciR1/Mt5aemmi83rm4ExpGPG 0c2SpmboIkx3E+DqRMWvbySqh8TxPpwqZpj4nTjEwqbN8rbxsAzoLd3XH0b05vQNvGXSlFdh1P YLg= X-IronPort-AV: E=Sophos;i="5.75,298,1589212800"; d="scan'208";a="142665042" IronPort-SDR: HfWYZyXpBhM4GGljnyTaHw4G2RVBfcGmTGS7YJ7SZ6Qha2M2sNvBPWe4BfDGf6VkgZm8Vx823F 38a66sgiNbYyM8ZwfYIiNI6cOYAIiKm+E= IronPort-SDR: oY5mkjpCir8lill1zcfNbQ4ehqRRe6RyKBb8gd+UYngMQzo3MUFrpLJP98J626ZKY06vmUqXkg N0pqtQk06FRQ== WDCIronportException: Internal From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v1 3/3] target/riscv: Regen floating point rounding mode in dynamic mode Date: Tue, 30 Jun 2020 13:12:13 -0700 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.71.154.45; envelope-from=prvs=44328bdba=alistair.francis@wdc.com; helo=esa6.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 16:21:24 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair.francis@wdc.com, palmer@dabbelt.com, alistair23@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When a guest specificies the the rounding mode should be dynamic 0b111 then we want to re-caclulate the rounding mode on each instruction. The gen_helper_set_rounding_mode() function will correctly check the rounding mode and handle a dynamic rounding, we just need to make sure it's always called if dynamic rounding is selected. Fixes: 1885350 ("RISCV dynamic rounding mode is not behaving correctly") Signed-off-by: Alistair Francis --- target/riscv/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index ce71ca7a92..a39eba679a 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -490,7 +490,7 @@ static void gen_set_rm(DisasContext *ctx, int rm) { TCGv_i32 t0; =20 - if (ctx->frm =3D=3D rm) { + if (ctx->frm =3D=3D rm && rm !=3D 7) { return; } ctx->frm =3D rm; --=20 2.27.0