From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943372; cv=none; d=zohomail.com; s=zohoarc; b=mviVG9TutQRPv9vZDFJa+6XRARlvu1ctKMYKftCop2iYBElPRSAPo3Xfw/kLIrbbSJOMMPK7ExMow1qzLOz99VWfdOSCP2NtD9IRAy0gBGC40Z8DQ1L1GOXDPUUup5VbI+fxivIxLdJNxnnuSFduhQBNSNOkccu2PjJSE7tv3Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=P79ova5bfhvdNtcXbRn3PCQfTzuWJLAcssq4u0+DQy4=; b=TSG0YUAXTYzEO/jIg57oA7JX+ojXJnJzW95MAdNutzy2hk44l26G89ddMliMAmWMVc+2Ws7sP3t1F79CbYKWK0uKNJKO+1oBwcOB+tjhmKPHnJHmPIIYa+RzFfOwds3YUGTCiyWtg94l6HmDuV5Bt2aly1FNEY1GV74j+j/ndiQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1602943372227430.0240338317087; Sat, 17 Oct 2020 07:02:52 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id d81so6153401wmc.1 for ; Sat, 17 Oct 2020 07:02:51 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id l11sm8472829wro.89.2020.10.17.07.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P79ova5bfhvdNtcXbRn3PCQfTzuWJLAcssq4u0+DQy4=; b=B8Pi0xkK9MBj6ODbJJQEPpHmuHk1S/EPn7I9X6Qq8eNHEFUX4XWnoebFPIg7P/ll3e NTQ/PqyffiBThWBQpU6gQtQ/m9Zgg+vow9D/jmXGZ1UUNpWVdT5g03IktcQ6iMsxvB1l U6f70hH1p6zW/O9AjKPpvPeiqxMtNZhN7qlnqXwgwRezWDuESysni4eZvd4NByZpHFWw qrE+tlV0ceXaReKGs03fu+f5yEWieY6QMxDGNOvXoBpTW+mAw8rCDl6hlxxU7l43w8r/ UFSnQu8tBE56jRvzoY/ufbqnFAyQ/gg1mb0mv7dlIBQR6GbK5PG/DFuIz7ITctMbaOiz HTzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=P79ova5bfhvdNtcXbRn3PCQfTzuWJLAcssq4u0+DQy4=; b=cvViztCqx+bvFiM395MHYHSDnMJqImQh/j0xIADRJBCscWSrCn/UEC7ww281SX1Wdo 6iu+Siu0YAYxCdMpWIeToXRqx/7fQoQmcEkj3Si3fXmhHlqMbRehxXLrb+kF02LIzrTL UpWsmwQxaCjVPSpuHBVaL0qAbZnTxpH1zmhDsKnJLZgOT79/K3KNA75yPslyr7Em7PJz GgEns1Q7/ny7CAS+LNpkTvj40laWzO/Yi5yfX07ZR6JvyVWCYUE+621iQTJMcPA12Qwk YFqV3Tjmer1KYdUhP4iOHPRw7lcw+aowu5SuV71J7R/11KWzjmiZb22WaMO0crmihNzJ TaKA== X-Gm-Message-State: AOAM533SIjmJL9sXF1ZVfypnhESA2w36OjCfwbNvMYlNJqw2LQorGKvm 3TEdHjbF9OiP0EWlFSN7nkI= X-Google-Smtp-Source: ABdhPJwnpX8AIGv5h69fLS+cPm2dDj6dz5oxgDfTlB/wrz3t/IOHD0mbQC6g4Veey8SDutD+yeJ7RQ== X-Received: by 2002:a1c:9cd3:: with SMTP id f202mr8677113wme.148.1602943370403; Sat, 17 Oct 2020 07:02:50 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Luc Michel , Alistair Francis Subject: [PULL 01/44] util/cutils: Introduce freq_to_str() to display Hertz units Date: Sat, 17 Oct 2020 16:02:00 +0200 Message-Id: <20201017140243.1078718-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Introduce freq_to_str() to convert frequency values in human friendly units using the SI units for Hertz. Suggested-by: Luc Michel Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Message-Id: <20201012095804.3335117-2-f4bug@amsat.org> --- include/qemu/cutils.h | 12 ++++++++++++ util/cutils.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 3a86ec0321e..4bbf4834ea5 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -158,6 +158,18 @@ int qemu_strtosz_metric(const char *nptr, const char *= *end, uint64_t *result); =20 char *size_to_str(uint64_t val); =20 +/** + * freq_to_str: + * @freq_hz: frequency to stringify + * + * Return human readable string for frequency @freq_hz. + * Use SI units like KHz, MHz, and so forth. + * + * The caller is responsible for releasing the value returned + * with g_free() after use. + */ +char *freq_to_str(uint64_t freq_hz); + /* used to print char* safely */ #define STR_OR_NULL(str) ((str) ? (str) : "null") =20 diff --git a/util/cutils.c b/util/cutils.c index 8da34e04b0b..be4e43a9eff 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -885,6 +885,20 @@ char *size_to_str(uint64_t val) return g_strdup_printf("%0.3g %sB", (double)val / div, suffixes[i]); } =20 +char *freq_to_str(uint64_t freq_hz) +{ + static const char *const suffixes[] =3D { "", "K", "M", "G", "T", "P",= "E" }; + double freq =3D freq_hz; + size_t idx =3D 0; + + while (freq >=3D 1000.0 && idx < ARRAY_SIZE(suffixes)) { + freq /=3D 1000.0; + idx++; + } + + return g_strdup_printf("%0.3g %sHz", freq, suffixes[idx]); +} + int qemu_pstrcmp0(const char **str1, const char **str2) { return g_strcmp0(*str1, *str2); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.66 as permitted sender) client-ip=209.85.128.66; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f66.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943376; cv=none; d=zohomail.com; s=zohoarc; b=PF0QLSzKYo6AZn3HL2IrKvyfD25QDUhWUoxlTi33OwDMLjKj1dke0nvNwaLDTRXldmTDbC3ORssUFqMaxzfkhmJEpOwpfzmmi0aFXJHwlTZiVef79Oq17EVQETuKlqLDJRzw9En1WPzWmCjsgTLhMmpJe3r3DH2m+mTpD/a7Pao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943376; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ckhgHIzetD2FmHEm0FTTUKRnqskZdYevul/a5BWHNys=; b=J+R/6tnjP7JoTFIWZQpr/4P70P/TFhlRGjYrctrJbCi7o6l/1uwng64r+USRHOjaY4cSdKLNdrSQo3Bv52sOQK1kTRrQ9DZropXssI+Uy3J5J9gnNbP0iJs95E624e1uqNMlKxDZ5mqRhr2xsm3F8SMj6ZnxiUURui/fo88oBws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.zohomail.com with SMTPS id 1602943376954760.9659269400795; Sat, 17 Oct 2020 07:02:56 -0700 (PDT) Received: by mail-wm1-f66.google.com with SMTP id d81so6153554wmc.1 for ; Sat, 17 Oct 2020 07:02:56 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id b189sm7279971wmb.37.2020.10.17.07.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ckhgHIzetD2FmHEm0FTTUKRnqskZdYevul/a5BWHNys=; b=MwhIzd9vmKrNrMQcJ4xyTdGkBMDODFCRnuLvsNjbU1/TLj/fr3P0cRjdLTbxkg2QZ0 zETo7T9j/B1RF2DjsFcKSrwoBiYKBpndj9Hn6/J7H9EAwAIPQTO7Ktbb2vaV+G+V00mw ZmmYucRGaXnM6gNFVskqJe/1esoAxkBSjB2nYA0xMsNB2G6CgYVrK5UnZhN1ujab7m+p bB4acVFxaKLLW+27yBHQnnd7cnJq4vl5WJi/3dQ2pMB9aGT6mOlpctjlecWYH7+PFJuv SXsnDXTYSG4QA5CYK7S+7DjWs7Qo5YI9j56liOq1B8uWB1qMK9g9Hoa/foiOFK7C0Bdc WnQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ckhgHIzetD2FmHEm0FTTUKRnqskZdYevul/a5BWHNys=; b=KWanZjCeaw23X7zcDJtHRO8wrWTqE8DL/Mzi+tdn793iesnvO/HOU+pXb7wWvQutv/ 7B30XE3dD7WuJ+iy+sH4R6781rMEfFsou67EcTMyGf8LHD9wPrEPiXrnrjt/ycOj33p4 J6fu+yFt8MzBLKg66myhZAViegQ7tve2mv6yG9df5YyyhJqYp9H3Mf4ISEiWLLcwmLx5 GFltgA0LG5emZvXB20V4IAeSVA/7FoAlGMjh1j7MblwvqgltZMOMlqNAovAxlseojqdw /B3TfShHMZM8UczUNTJ4rZlo5vCLlyMaXo7fCf13spBveT9CRSgLBgEgBMHUurbA61ql 7H2g== X-Gm-Message-State: AOAM530YpZmFFb6qYws/DkqaEjdoRhxaoxwOVRRgxRiNyyNlMuY/58o+ +XIV3B3F0PLeqU3+TszX45Q= X-Google-Smtp-Source: ABdhPJw8G3qQpcBEOQOl2n1jsv9b14X+nabi32lR8Ou+QXQn4MMlOoWQ6dDih6K8nK2W55im4NDSkw== X-Received: by 2002:a7b:c4cb:: with SMTP id g11mr8707586wmk.88.1602943375100; Sat, 17 Oct 2020 07:02:55 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Luc Michel , Damien Hedde , "Edgar E . Iglesias" Subject: [PULL 02/44] hw/qdev-clock: Display error hint when clock is missing from device Date: Sat, 17 Oct 2020 16:02:01 +0200 Message-Id: <20201017140243.1078718-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Instead of directly aborting, display a hint to help the developer figure out the problem (likely trying to connect a clock to a device pre-dating the Clock API, thus not expecting clocks). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Luc Michel Reviewed-by: Damien Hedde Reviewed-by: Edgar E. Iglesias Message-Id: <20201012095804.3335117-4-f4bug@amsat.org> --- hw/core/qdev-clock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/core/qdev-clock.c b/hw/core/qdev-clock.c index 47ecb5b4fae..6a9a340d0fb 100644 --- a/hw/core/qdev-clock.c +++ b/hw/core/qdev-clock.c @@ -12,6 +12,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/qdev-clock.h" #include "hw/qdev-core.h" #include "qapi/error.h" @@ -153,6 +154,11 @@ Clock *qdev_get_clock_in(DeviceState *dev, const char = *name) assert(name); =20 ncl =3D qdev_get_clocklist(dev, name); + if (!ncl) { + error_report("Can not find clock-in '%s' for device type '%s'", + name, object_get_typename(OBJECT(dev))); + abort(); + } assert(!ncl->output); =20 return ncl->clock; @@ -165,6 +171,11 @@ Clock *qdev_get_clock_out(DeviceState *dev, const char= *name) assert(name); =20 ncl =3D qdev_get_clocklist(dev, name); + if (!ncl) { + error_report("Can not find clock-out '%s' for device type '%s'", + name, object_get_typename(OBJECT(dev))); + abort(); + } assert(ncl->output); =20 return ncl->clock; --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) client-ip=209.85.221.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943381; cv=none; d=zohomail.com; s=zohoarc; b=l+o6Apen3rORjM6/zA2db23Kb4HwCfneId1UFawQM6UMwtwMBwzDooOAGRValStC2fOhdUZ79n4NXqEx9wmpruwBM6YDW1CkqPaKv65sRQTW4V8MilvsLZTm8C2z0DihU3FvsrFGQJ6jpmU1Wc4mnK9PIv0fHJnvby9nHFa6Lj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943381; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N+6P5UyNzQt64543jNV3+JqEP1ruUMZwDb9XjKLtnVQ=; b=XA71pCe9MQk7ZlZK5TSDKTXvJLCpKusGfB1B4cQsKNQ4bwfxAgWXD+CldamfZ9/z4ZdeHI1CjIiTyxuS19RV6i8iMCSuRixgr/XfvOxtS8Fr5ZB5hnif3wi1gAFlCbo1vgrFGQJTXOhHpDo0ZI+ljdxjmofsLTMsHs4He0CB3C8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.zohomail.com with SMTPS id 1602943381700276.6139911614571; Sat, 17 Oct 2020 07:03:01 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id x7so6608011wrl.3 for ; Sat, 17 Oct 2020 07:03:01 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id x18sm9349551wrg.4.2020.10.17.07.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N+6P5UyNzQt64543jNV3+JqEP1ruUMZwDb9XjKLtnVQ=; b=UokLcAdfIvbxLFzHsZ+I+CiGEmjwM5PeSp77ZmCFFk3RV6ATrDiOffn65e2v7lhduq 7jMmhJEcYCjBJJG2CoPiX6dcTlXZ2kuo2teiO/ZxttnL60Wa04bFnw3HiqcLGaqK7vzQ LdYyr3hVim3AQvLtvbU19ewYtKwT9ynX1D1W2chfWAgvUqjvfXJ/MmFJr7xeqWBm2EwK BDDl9wYhbeouIv4p5X/3maRTAPAqp5ZqpXKIRMiE5ueaiRAYVAS/oltTiFFb+2k5w/GG m/3LUit1+mgriud4JH5Blu+KAVP4YuQCeCiwq+b3HoTSLrx0ygcpXQH6QgFAe29oAOly lrpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=N+6P5UyNzQt64543jNV3+JqEP1ruUMZwDb9XjKLtnVQ=; b=BulQ54tBFLvwEnNSFrkx1jJwGjECHtN/0BjDEozEZfXcquIIt7J3bvFsPp/IM4KTKD Vy4qt2owBlLphRTBHf/ewKZhyP+JURmZ6a37bSO6Y5r8R6moz6BLf9dyj1u/2FFkgybH OjkkVVISnUYJ458L2uYMKGWQUZtowAjVDPedT7cvXh2wOB++yO6yKSRHvUM1NjtsriKx nFTEXrLvjh5dzP8W0hmCLOiBxW23PCD54j1wwPykENLecYwKbBMGJhUORkWVwblwO81Q EJcDVOqvp9I7dwVpy2F6tlYFoavNk7Ax63X3Bv/fPyI05QYpnuQvtfVglgo7IpLOKxx9 PzWA== X-Gm-Message-State: AOAM5321vwNVBHJBJc/jdMqyF7QXJPczwVJEkhBPj8NBP6vkQ4N2GLzj Ebxm7R5LS+QQL4Qe5C/tSHU= X-Google-Smtp-Source: ABdhPJyqrT+skP3Rc8vENV40BvEMM08JKTFVY/XKZPXcFmyh4Ppc3MLpElduEL+7q18vql3cCLBBDw== X-Received: by 2002:adf:e50b:: with SMTP id j11mr10486045wrm.263.1602943379830; Sat, 17 Oct 2020 07:02:59 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Luc Michel , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/44] hw/core/clock: Add the clock_new helper function Date: Sat, 17 Oct 2020 16:02:02 +0200 Message-Id: <20201017140243.1078718-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Luc Michel This function creates a clock and parents it to another object with a given name. It calls clock_setup_canonical_path before returning the new clock. This function is useful to create clocks in devices when one doesn't want to expose it at the qdev level (as an input or an output). Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Luc Michel Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201010135759.437903-4-luc@lmichel.fr> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/clock.h | 13 +++++++++++++ hw/core/clock.c | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/hw/clock.h b/include/hw/clock.h index d357594df99..cbc5e6ced1e 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -90,6 +90,19 @@ extern const VMStateDescription vmstate_clock; */ void clock_setup_canonical_path(Clock *clk); =20 +/** + * clock_new: + * @parent: the clock parent + * @name: the clock object name + * + * Helper function to create a new clock and parent it to @parent. There i= s no + * need to call clock_setup_canonical_path on the returned clock as it is = done + * by this function. + * + * @return the newly created clock + */ +Clock *clock_new(Object *parent, const char *name); + /** * clock_set_callback: * @clk: the clock to register the callback into diff --git a/hw/core/clock.c b/hw/core/clock.c index 7066282f7b9..f866717a835 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -23,6 +23,21 @@ void clock_setup_canonical_path(Clock *clk) clk->canonical_path =3D object_get_canonical_path(OBJECT(clk)); } =20 +Clock *clock_new(Object *parent, const char *name) +{ + Object *obj; + Clock *clk; + + obj =3D object_new(TYPE_CLOCK); + object_property_add_child(parent, name, obj); + object_unref(obj); + + clk =3D CLOCK(obj); + clock_setup_canonical_path(clk); + + return clk; +} + void clock_set_callback(Clock *clk, ClockCallback *cb, void *opaque) { clk->callback =3D cb; --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) client-ip=209.85.221.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943386; cv=none; d=zohomail.com; s=zohoarc; b=d+MZE6YOyCokBt4JGO6wDPcGshEtgNXOJhQKscpWvSTqiWcVRQLkNTAXQYeDX+i+37Rzpc9+D6+CjwZTzwnBg7wKaxVXqhHYYo4+1lBjCSrC9b+5c/wHwQIgqUDzlnaERtj6ffdIOqECTQqpqY5kesyky2kg/xAhZelgmIHaURI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943386; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w+RNDLWj4IFLfK+eBwoAQeU4+ogED2fJwsKp3kpT+Og=; b=YtpAzj25rdARiwe6Z27lTjp/dTQHbkpEkLnxVQsv8Fxu8XXjLDwsiOl6B3HVssPJJyKUy65Yq6zZuX/vHGCt+/0Uj8xExAx0KZFFlgJSyxNzuBJvMrFg3OvrSkPKeyvwV2lp0keEDT138JG/Rd9GEgO/7wR9TcfcKLf6UE99n8g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.zohomail.com with SMTPS id 1602943386520816.9032454270372; Sat, 17 Oct 2020 07:03:06 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id n18so6588897wrs.5 for ; Sat, 17 Oct 2020 07:03:05 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id f6sm8403768wru.50.2020.10.17.07.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w+RNDLWj4IFLfK+eBwoAQeU4+ogED2fJwsKp3kpT+Og=; b=lhX/T6Bru4d0moFLuUF2q4LSoamJYEL5oNBJuvK0IxgRDUtHSVPxN6AJ0Bv4l22Qks xzJEqr2pha9/XVqVVrVWi8Hs+67hZcHWQUw5mjmWWvTYyvJYI8Ntl9CQNsggRghkr3P1 ubWi1C8ear09/xBwpw1L/uG2Snkt7LKZbT7g+T3X/3C0lrQTynM7yeGGrzj+BUggViO+ 4sEV7HyrGH74z67Au32UsqRXRlXXY7x6Lv8E/66MLcocGLWozxczlZ6x7xAoZOj3vUz6 62h3ybpTChNmvIIEVnhDyEV5ELR9G4f7xirn0wQNgRSYRlWsxA3KwWODqENhfKUx79Ih ilJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=w+RNDLWj4IFLfK+eBwoAQeU4+ogED2fJwsKp3kpT+Og=; b=ULEix7VaE4bdzET8Y7jHkCdVxq14QY+8vZiR6wz9urzNT2T73ZNE/GqGh6CUJIinjS YcDGWQ/cW1z6K1VDWuoUKP1qo0jhsDiux8pZl0HfZI1KBhE17CZKQYV8l02HPbCC23ik ol9uNbMZDKJoW7qdIPayaAiI2/f+Mdxf6ndQUTbohGVQIXMDdE51i/lA5iTzYi9dN4+j 2C2rYeQ715UeXrakdRblQbF5I3ujsLE1PRHsImGvVjmgylMdfHgBriEjXlI7CjjPBk5t rfkGLXXSJA+ugjvP3fqDBf7G56Sg9tCRQ0ty2ofdrMhRDsBrtJoymDyvFKO0CZOu0aZp SvvA== X-Gm-Message-State: AOAM530yAsdbknTS+gZwHfRmQPj0MyDrCwOTBreAptwP0R1pm6hoiXaD xlnZw9ifDwrYI1x3LQrB74I= X-Google-Smtp-Source: ABdhPJxG5+l9hlcXnZrOemPyWR8o2wyYmK06a0XaqlKt/EeufscTUvpOWH0ZY346xWY67cemSmFizg== X-Received: by 2002:adf:e444:: with SMTP id t4mr10876914wrm.58.1602943384583; Sat, 17 Oct 2020 07:03:04 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , zhaolichang , David Edmondson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/44] target/mips: Fix some comment spelling errors Date: Sat, 17 Oct 2020 16:02:03 +0200 Message-Id: <20201017140243.1078718-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: zhaolichang There are many spelling errors in the comments in target/mips/. Use spellcheck to check the spelling errors. Signed-off-by: zhaolichang Reviewed-by: David Edmondson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201009064449.2336-7-zhaolichang@huawei.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/internal.h | 2 +- target/mips/translate.c | 10 +++++----- target/mips/translate_init.c.inc | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 7f159a9230c..b811f547f38 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -188,7 +188,7 @@ static inline bool cpu_mips_hw_interrupts_pending(CPUMI= PSState *env) /* * A MIPS configured with a vectorizing external interrupt control= ler * will feed a vector into the Cause pending lines. The core treats - * the status lines as a vector level, not as indiviual masks. + * the status lines as a vector level, not as individual masks. */ r =3D pending > status; } else { diff --git a/target/mips/translate.c b/target/mips/translate.c index 398edf72898..b4d009078e0 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -3718,7 +3718,7 @@ static void gen_st_cond(DisasContext *ctx, int rt, in= t base, int offset, =20 t0 =3D tcg_temp_new(); addr =3D tcg_temp_new(); - /* compare the address against that of the preceeding LL */ + /* compare the address against that of the preceding LL */ gen_base_offset_addr(ctx, addr, base, offset); tcg_gen_brcond_tl(TCG_COND_EQ, addr, cpu_lladdr, l1); tcg_temp_free(addr); @@ -25597,7 +25597,7 @@ static void gen_mxu_D16MAX_D16MIN(DisasContext *ctx) } /* return resulting half-words to its original position */ tcg_gen_shri_i32(t0, t0, 16); - /* finaly update the destination */ + /* finally update the destination */ tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRa - 1], t0); =20 tcg_temp_free(t1); @@ -25633,7 +25633,7 @@ static void gen_mxu_D16MAX_D16MIN(DisasContext *ctx) } /* return resulting half-words to its original position */ tcg_gen_shri_i32(t0, t0, 16); - /* finaly update the destination */ + /* finally update the destination */ tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRa - 1], t0); =20 tcg_temp_free(t1); @@ -25702,7 +25702,7 @@ static void gen_mxu_Q8MAX_Q8MIN(DisasContext *ctx) } /* return resulting byte to its original position */ tcg_gen_shri_i32(t0, t0, 8 * (3 - i)); - /* finaly update the destination */ + /* finally update the destination */ tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRa - 1], t0); } =20 @@ -25742,7 +25742,7 @@ static void gen_mxu_Q8MAX_Q8MIN(DisasContext *ctx) } /* return resulting byte to its original position */ tcg_gen_shri_i32(t0, t0, 8 * (3 - i)); - /* finaly update the destination */ + /* finally update the destination */ tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRa - 1], t0); } =20 diff --git a/target/mips/translate_init.c.inc b/target/mips/translate_init.= c.inc index 637caccd890..c735b2bf667 100644 --- a/target/mips/translate_init.c.inc +++ b/target/mips/translate_init.c.inc @@ -995,7 +995,7 @@ static void mvp_init (CPUMIPSState *env, const mips_def= _t *def) =20 /* MVPConf1 implemented, TLB sharable, no gating storage support, programmable cache partitioning implemented, number of allocatable - and sharable TLB entries, MVP has allocatable TCs, 2 VPEs + and shareable TLB entries, MVP has allocatable TCs, 2 VPEs implemented, 5 TCs implemented. */ env->mvp->CP0_MVPConf0 =3D (1U << CP0MVPC0_M) | (1 << CP0MVPC0_TLBS) | (0 << CP0MVPC0_GS) | (1 << CP0MVPC0_PCP) | --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) client-ip=209.85.221.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943391; cv=none; d=zohomail.com; s=zohoarc; b=G2Tjpey+HdlP+W0tR0dnTjZnXT4WschWsQrBUldIt6E6vACrc0VL2xIuF+NlRZYKuGSi928BAhUKJGZ5hbDBtChfxrMRw0RzDx6OleTzoLCWC4ma7Dwl6rqjAS8LyZ6cyECxiBp4xl8JlQuKBDDlEEPwr2wk9raAbh+anPhSO6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943391; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NKriZfWZy7VDzuwNa8INVpQFiDmOp1zR9QaKdg51zCU=; b=QBPOimLZtSn2q8j7tIVs40gGq/z7KGI5AgPtGg9eMmHw+3Fu/Co5t+qMU4Zign9gICjh4AC2rrnacDeV2jy+n7WekMsAUVX0U0Lz9GDZvFvQFa2QvNM1WTu8sjFhqWoxETgwMSYQzfTDwWxafbF3bAoAVcTmPSVLo3f9gdbZnEk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.zohomail.com with SMTPS id 1602943391336744.4493436057506; Sat, 17 Oct 2020 07:03:11 -0700 (PDT) Received: by mail-wr1-f65.google.com with SMTP id s9so6557302wro.8 for ; Sat, 17 Oct 2020 07:03:10 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id 205sm7816168wme.38.2020.10.17.07.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NKriZfWZy7VDzuwNa8INVpQFiDmOp1zR9QaKdg51zCU=; b=bmyZGF8rClLcePprRp0bTQA+NNBuA50BsV490rx1eKcKn3iTqvgHkI6OA2rFygCJRF rr3rb998/1/mz7mtLX0RHX+jWfBBPkm8FKVTZWjXRlu2cnbLVVqKknT8kl7Cc4f3tefJ iZq5czFGsuGDkICDKYEqG6EIiNUkx9rOAZcSlA2ft5KlsVvcyk6dfIBJzG6H2aH3PIzs xF8Q1iSm9cPO9oC5XH1Esuxz35vFluJb0+SDRKe0xvr3IeFXHusAjNq774JhnE0/RnqJ VyEuaQkVvY7AdBliS10D5nYqM56kqQEKHbYAK3o/OgLDVnJlUYJzsb3YPfbHKfxzesEc k0Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NKriZfWZy7VDzuwNa8INVpQFiDmOp1zR9QaKdg51zCU=; b=DS0CnevkpVr3qPNZehl8Yued/9eOuWe7TrX3qqkNcM3IW+/8XUZ+88yuraT7EREehR kgMnFeFxXnguAigcOyi/0NZfF3J7FfGgHrCBzfLUAKhGLWdk9oCYoaSOXKV6i8KJGVoK X3arDZzO3DwqhNhIK06ph8HtBxJ91Ee08E4Ncpm6HG+KV7VPDmfE/wFPAq6hzoeI7vh/ CE0uCzvPp1aCGRseizDdFDrBYtHlhto3A2KBXKD9akaiwgmRdjOi8S6OgBGXjGlTQMTF oIoPbQTFBwxtqCDGWuSlq83ijfxgp1et/GuBJG/8FOdX2TEhEgr5VJsHixQNBnN89Eco gtjA== X-Gm-Message-State: AOAM533SsxzXdnJzaSKp/Oj9XHng6wAKN1S6DgGsL2qAniLeubF3FHj0 Omc8vMq/kvxQR/XWjkKZlac= X-Google-Smtp-Source: ABdhPJytxIKlOBIIqZpZuAYMSpmIP34nE2JS6VexfJLbd1A3Qbn0WgttJR+JbJE5UM528ibPSyOWWg== X-Received: by 2002:adf:f7c1:: with SMTP id a1mr10459276wrq.399.1602943389522; Sat, 17 Oct 2020 07:03:09 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/44] target/mips: Demacro helpers for . Date: Sat, 17 Oct 2020 16:02:04 +0200 Message-Id: <20201017140243.1078718-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Aleksandar Markovic Remove function definitions via macros to achieve better code clarity. Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1602103041-32017-2-git-send-email-aleksandar.qemu.devel@gmail.= com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/fpu_helper.c | 59 ++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index 56beda49d82..f851723f22d 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -983,27 +983,46 @@ uint32_t helper_float_floor_2008_w_s(CPUMIPSState *en= v, uint32_t fst0) } =20 /* unary operations, not modifying fp status */ -#define FLOAT_UNOP(name) \ -uint64_t helper_float_ ## name ## _d(uint64_t fdt0) \ -{ \ - return float64_ ## name(fdt0); \ -} \ -uint32_t helper_float_ ## name ## _s(uint32_t fst0) \ -{ \ - return float32_ ## name(fst0); \ -} \ -uint64_t helper_float_ ## name ## _ps(uint64_t fdt0) \ -{ \ - uint32_t wt0; \ - uint32_t wth0; \ - \ - wt0 =3D float32_ ## name(fdt0 & 0XFFFFFFFF); \ - wth0 =3D float32_ ## name(fdt0 >> 32); \ - return ((uint64_t)wth0 << 32) | wt0; \ + +uint64_t helper_float_abs_d(uint64_t fdt0) +{ + return float64_abs(fdt0); +} + +uint32_t helper_float_abs_s(uint32_t fst0) +{ + return float32_abs(fst0); +} + +uint64_t helper_float_abs_ps(uint64_t fdt0) +{ + uint32_t wt0; + uint32_t wth0; + + wt0 =3D float32_abs(fdt0 & 0XFFFFFFFF); + wth0 =3D float32_abs(fdt0 >> 32); + return ((uint64_t)wth0 << 32) | wt0; +} + +uint64_t helper_float_chs_d(uint64_t fdt0) +{ + return float64_chs(fdt0); +} + +uint32_t helper_float_chs_s(uint32_t fst0) +{ + return float32_chs(fst0); +} + +uint64_t helper_float_chs_ps(uint64_t fdt0) +{ + uint32_t wt0; + uint32_t wth0; + + wt0 =3D float32_chs(fdt0 & 0XFFFFFFFF); + wth0 =3D float32_chs(fdt0 >> 32); + return ((uint64_t)wth0 << 32) | wt0; } -FLOAT_UNOP(abs) -FLOAT_UNOP(chs) -#undef FLOAT_UNOP =20 /* MIPS specific unary operations */ uint64_t helper_float_recip_d(CPUMIPSState *env, uint64_t fdt0) --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943395; cv=none; d=zohomail.com; s=zohoarc; b=RC6mqMvhvYOyqyqQsfDPH+jYQOysuCumR6+B4YIiI64MOdu1kQzxsCsJPDWMl/kS/3JsYDp92r+9urGi7nTMOHUCebKomCiY/PbbxrtJTRnTZMo16grWLI1XFBWEAJCGlqQO7ByI+zKod0Bx4i25JTSQMSHdu9RAkFgMbiznwQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943395; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ixr+1nbJukvy2COfOoRzV+WTmXwjG84YPtvZ7E/7AI0=; b=bUy01ynhUdMFz0pJddcYGZk4cIV0R2VGa7OlzaLUqlFhJK0wA6k7BfIhGtBf+HEoV/iLpTSoCwyO6VdnEQawb6m/c+Yk3ARhL/fpjM9ehK6hKf1ZcKIuZSvfHKumzxNYm5U1C+U9t0tIbf8Ao8m0urz9XdIU5/8A43GHGlmBeF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 1602943395952670.2571291697093; Sat, 17 Oct 2020 07:03:15 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id j7so2484774wrt.9 for ; Sat, 17 Oct 2020 07:03:15 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id h16sm9232144wre.87.2020.10.17.07.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ixr+1nbJukvy2COfOoRzV+WTmXwjG84YPtvZ7E/7AI0=; b=M19aeNKO/uroBwIY39BuP9GQV3DwHoBEGX5ArebTHGgr/T8YMKFeo0ucZNeWD6t90x XfEkqsX2JQSXJXM3ZyVwT/PfHnPzoxS8p83DmnXm/Bpw+6L0ce+nmQEVgfgaUvtE7pLF 0nOyLDp2JALNrbkBsgCybprMRrurcCyskwGA2yEy3Hw+VXoZUCHZ0C5dIfByeg7Vek6N o0Neb4k9MA9d4vM+FsrMjLlW3Mj6LnQVGGW3n5Ao9fQYd2DwN4cfPmMgcVZGvUvDgbdn k850hMGSZuA+2CCxzMRMi1rZJy9qNfhsliZK6lvGjSupQ64K6u5DjdxK2dtPSWNNAxSK GrLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ixr+1nbJukvy2COfOoRzV+WTmXwjG84YPtvZ7E/7AI0=; b=Muc8qk3NTfmVFpPtMNIRuJW3HZb2H7QLMrR0t29j4nB+3U3YFAELQK7zguMaE4LWck SYJ+5pNaqbBYzMhB72uZRp213vw4LZSUYxJkWT/GvDAqIL2KAuppRaDAn+6o1BWXzFKt WbD7Y2Ce9PpSLDjQlK0pSafTRWTgf9rCe3KiMY885wLpHrz5dQis36DCTl7/5GLj5XCK 78HbpaGFVErrwR4mttj4zKen5KThTPaDISRLcIlzSKnRJ8XycrJgjOb+Bb9Y+RxWb3QR TUDUmkYMfP2m91wxvMIg+MbjulBHtL/V7Fz09VAfXoBPm0bFxu9NBsgY3IVUGqAnME9n eFCQ== X-Gm-Message-State: AOAM530pXxLcS0GkBkC0NZ67AKbqvK14aO5nlhMdqsRmy5rNOSuBp/Q2 762EOTIlYyg1t+Y/j8lKrMs= X-Google-Smtp-Source: ABdhPJwehpEamaBiHfGnLBIyOv5QOZYErEvZXca3Ijw6DyX132g7ZsetO2VcUjfx2+LfLh4UF02mpA== X-Received: by 2002:adf:bbc6:: with SMTP id z6mr10331941wrg.298.1602943394108; Sat, 17 Oct 2020 07:03:14 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 06/44] target/mips: Demacro helpers for MF. Date: Sat, 17 Oct 2020 16:02:05 +0200 Message-Id: <20201017140243.1078718-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Aleksandar Markovic Remove function definitions via macros to achieve better code clarity. Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1602103041-32017-3-git-send-email-aleksandar.qemu.devel@gmail.= com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/fpu_helper.c | 63 +++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index f851723f22d..b3c715494a9 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -1666,25 +1666,54 @@ uint64_t helper_float_nmsub_ps(CPUMIPSState *env, u= int64_t fdt0, } =20 =20 -#define FLOAT_FMADDSUB(name, bits, muladd_arg) \ -uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ - uint ## bits ## _t fs, \ - uint ## bits ## _t ft, \ - uint ## bits ## _t fd) \ -{ \ - uint ## bits ## _t fdret; \ - \ - fdret =3D float ## bits ## _muladd(fs, ft, fd, muladd_arg, \ - &env->active_fpu.fp_status); \ - update_fcr31(env, GETPC()); \ - return fdret; \ +uint32_t helper_float_maddf_s(CPUMIPSState *env, uint32_t fs, + uint32_t ft, uint32_t fd) +{ + uint32_t fdret; + + fdret =3D float32_muladd(fs, ft, fd, 0, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_maddf_d(CPUMIPSState *env, uint64_t fs, + uint64_t ft, uint64_t fd) +{ + uint64_t fdret; + + fdret =3D float64_muladd(fs, ft, fd, 0, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint32_t helper_float_msubf_s(CPUMIPSState *env, uint32_t fs, + uint32_t ft, uint32_t fd) +{ + uint32_t fdret; + + fdret =3D float32_muladd(fs, ft, fd, float_muladd_negate_product, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_msubf_d(CPUMIPSState *env, uint64_t fs, + uint64_t ft, uint64_t fd) +{ + uint64_t fdret; + + fdret =3D float64_muladd(fs, ft, fd, float_muladd_negate_product, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; } =20 -FLOAT_FMADDSUB(maddf_s, 32, 0) -FLOAT_FMADDSUB(maddf_d, 64, 0) -FLOAT_FMADDSUB(msubf_s, 32, float_muladd_negate_product) -FLOAT_FMADDSUB(msubf_d, 64, float_muladd_negate_product) -#undef FLOAT_FMADDSUB =20 /* compare operations */ #define FOP_COND_D(op, cond) \ --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) client-ip=209.85.221.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943400; cv=none; d=zohomail.com; s=zohoarc; b=FjMUgWkdMYLr48hNpa3jfWgzggd/FAy4yOlDCSo0e1KA+Rmnwh7/E5bAEHiIoQZnHjve8qzxKo53UCG7KiUJB0L3hROk07kDFDsUfqkLzDvGv06gxRMCEbahNuZTBpFO+pwrvPhxABwUSGY8lJTNJZO/i1VNsSvaMJKNrLzbTmE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943400; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jY48quu39mm1u3JApFpvCc/7FiIrv2aGLcqgOkgLbGg=; b=U1vWD+sO/nLMpuY0GJZclhxVauAViRP9qreubj6VKh6lUjQ/Mqml7+tptosdzgb3i/HqeJU+R7xKCIwq95lB3QTdjCy0gpQNyypQzNa7DHq1Y/QW8osSdkoHAPhfKSHt8YXeq/vA0E8lAu5ZNkjJ42lwlqul42+LfeXVbWadhSo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.zohomail.com with SMTPS id 16029434005201005.341860282157; Sat, 17 Oct 2020 07:03:20 -0700 (PDT) Received: by mail-wr1-f67.google.com with SMTP id x7so6608637wrl.3 for ; Sat, 17 Oct 2020 07:03:19 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id s1sm7324631wmh.22.2020.10.17.07.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jY48quu39mm1u3JApFpvCc/7FiIrv2aGLcqgOkgLbGg=; b=ZhacguUpP+Nx8LAhX7k4GOyeVU4RU3lQ4DpqaohGGxPTRjqvnywlFeTfUud251GiUg UUeCvUUADvFXv6m4r030MdBCpFLQrMN41LS4nsSdMuQYoQqZ8FAGvwPO0HKr2u7W8xg4 0mjLATh0HZais2oek2s0uQSzZihCdrnlNrfYqmhPzXZfwZ5lMFP41VyTCxhMhJ4ZYEAU orc83nkMKa53fXVCJn6rtvULFRwSyDqJ0tKv2i3CBLdGD+JieBx+89w6Nn4wB++k1xPL UZ0CrwZw71YoLk+S+VQ+Nc9VoOjLF8rKjQ3w801+HvD4GTcDa18ADFEGsv7nnUoqLX+V GL5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jY48quu39mm1u3JApFpvCc/7FiIrv2aGLcqgOkgLbGg=; b=AWdthymSN66ktt8081tbeeefdRuBWQXq2qIlX/BZDxvXpwP/8dRw81RPcEN4BYRN4x Ia2C7gKpxg3KXMpNx90f5YyGWAbEb+7Hok3wfAAkV1X2NmteKgPlj2P3AuEaZ8Rgt/Ak 4vqICbYkeYhBgVDumdrPtmCJh9CxYp28KPDhmfymrjeXJrxJk7p2M6H01FeVssLdCCGj VieblT/Oo5YDtLW7iEDmOJIDQ8hx0B87or4VoAMvavDzidA1uy+rIx7QZG2b5k5uDNMl +k2X90sTL3DL/kbCF9WU2AHCppP4YJjCjieoic2bZQEBECoO6a70Jl1aIhGYuIaDtY0u Opzw== X-Gm-Message-State: AOAM530D05jRNkLVEVaRp576fyfluQxgGDulSIBejruDA2Jz8qWeoBCi XHN9lV5athWJdRWxQS89A2o= X-Google-Smtp-Source: ABdhPJyWM6lOpe7Rz+5/BmKrWycAGw2EpLvtnXuipQQ1Q5omcXSMgSKqDrsmby2/qnj7jcrs8kH7Bw== X-Received: by 2002:adf:e881:: with SMTP id d1mr10234268wrm.395.1602943398662; Sat, 17 Oct 2020 07:03:18 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/44] target/mips: Demacro helpers for . Date: Sat, 17 Oct 2020 16:02:06 +0200 Message-Id: <20201017140243.1078718-8-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Aleksandar Markovic Remove function definitions via macros to achieve better code clarity. Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1602103041-32017-4-git-send-email-aleksandar.qemu.devel@gmail.= com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/fpu_helper.c | 98 ++++++++++++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 20 deletions(-) diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index b3c715494a9..6cc956c023d 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -1475,29 +1475,87 @@ uint64_t helper_float_mulr_ps(CPUMIPSState *env, ui= nt64_t fdt0, uint64_t fdt1) return ((uint64_t)fsth2 << 32) | fstl2; } =20 -#define FLOAT_MINMAX(name, bits, minmaxfunc) \ -uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ - uint ## bits ## _t fs, \ - uint ## bits ## _t ft) \ -{ \ - uint ## bits ## _t fdret; \ - \ - fdret =3D float ## bits ## _ ## minmaxfunc(fs, ft, \ - &env->active_fpu.fp_status); \ - update_fcr31(env, GETPC()); \ - return fdret; \ + +uint32_t helper_float_max_s(CPUMIPSState *env, uint32_t fs, uint32_t ft) +{ + uint32_t fdret; + + fdret =3D float32_maxnum(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; } =20 -FLOAT_MINMAX(max_s, 32, maxnum) -FLOAT_MINMAX(max_d, 64, maxnum) -FLOAT_MINMAX(maxa_s, 32, maxnummag) -FLOAT_MINMAX(maxa_d, 64, maxnummag) +uint64_t helper_float_max_d(CPUMIPSState *env, uint64_t fs, uint64_t ft) +{ + uint64_t fdret; + + fdret =3D float64_maxnum(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint32_t helper_float_maxa_s(CPUMIPSState *env, uint32_t fs, uint32_t ft) +{ + uint32_t fdret; + + fdret =3D float32_maxnummag(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_maxa_d(CPUMIPSState *env, uint64_t fs, uint64_t ft) +{ + uint64_t fdret; + + fdret =3D float64_maxnummag(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint32_t helper_float_min_s(CPUMIPSState *env, uint32_t fs, uint32_t ft) +{ + uint32_t fdret; + + fdret =3D float32_minnum(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_min_d(CPUMIPSState *env, uint64_t fs, uint64_t ft) +{ + uint64_t fdret; + + fdret =3D float64_minnum(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint32_t helper_float_mina_s(CPUMIPSState *env, uint32_t fs, uint32_t ft) +{ + uint32_t fdret; + + fdret =3D float32_minnummag(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_mina_d(CPUMIPSState *env, uint64_t fs, uint64_t ft) +{ + uint64_t fdret; + + fdret =3D float64_minnummag(fs, ft, &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} =20 -FLOAT_MINMAX(min_s, 32, minnum) -FLOAT_MINMAX(min_d, 64, minnum) -FLOAT_MINMAX(mina_s, 32, minnummag) -FLOAT_MINMAX(mina_d, 64, minnummag) -#undef FLOAT_MINMAX =20 /* ternary operations */ =20 --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) client-ip=209.85.128.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943405; cv=none; d=zohomail.com; s=zohoarc; b=htxjCNhwwr0boC49M0+mM8y5nSOVS1oOJo7v3pURNs3AdHkE9a1IEmgHEtPhAaJOjnytT22vTMdJHGbTBg58ITsHrPC/FXuY2odjelb+FBIhHbG04o8DLEQcJqf+bsYsFQvuZ9GWjw2xeH5goME7jrTBDKXa9KgChcKD6M4MD8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943405; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vLpi4Ok952k/O5t7O1lK6hwZKOdIsy56EvHrjOgW/9g=; b=J+5Eez/Eq5LvOyFMEVAYpRg4AtQqCTmN/wt4N2ygEAkBpLPzhYsfLI5JjQ707a5iyw9n5jiegTtuVUVCdMCQ2wqc20z/Gp++ovWjEJjAZK5qnj+bI8wlLqq3+p4W76agzJTv+Q4Fu4WsIVtJ5WxYduvTc0TnStklPU3YhfBiw9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.zohomail.com with SMTPS id 1602943405334500.2159498580579; Sat, 17 Oct 2020 07:03:25 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id l15so2982952wmh.1 for ; Sat, 17 Oct 2020 07:03:24 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id v4sm7231835wmg.35.2020.10.17.07.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vLpi4Ok952k/O5t7O1lK6hwZKOdIsy56EvHrjOgW/9g=; b=QI6AoIedhod/25yyws8sXRpP3Ab6b83I/zWtfQlU3GMjCyt1W6Lqlk8eBKIJEZMUtj N1pL2HUoVYvPFM+DPoVkC8FZdlB9GXQ1QKajpuOQZ1A68Tl1p1wm5M03KZE2RzKiqS3D KBGaIC0ErWCpQfh0L0+GjEcqYSfJrnqULvfm1iDCgZpIohnpkLMZqI/2bxvzoyS9Ap97 0YalK/tfMU+Xsw/b39xz9bdpkCycDYjAoMWbcNNXWzczY7VJ3ffuReR68fmWOTFzs74g hSBfXXoEBoWYuvUwkJaaxxxxe+88Atr9bnk2SRu512Do7B4MTH1EyVgIV1CDFVVSW9po ElWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vLpi4Ok952k/O5t7O1lK6hwZKOdIsy56EvHrjOgW/9g=; b=rCU2jsIJCqcDSF8XT4OKuBscgldiv6ytKYkFkdMNzR/f+UhuO6VyVMUY8PJQUVaPgq 31dH0zyZ3079bJQEZTIytKcI/f3/kivQkPhCSNjuqDiQ63VXL74VcEejvl7Gdwlc4yxO ShctvAA1N+6Nu1fnDybiqy9uo5pKsHsFFKGEDo0AprY7/oEVt5RDiXEdajIrV865jS3I 1a3zLrST0+B6f+qaBNh8Rg2MDIwxh2UxHREFV527CR8KMiN6IfR3FGRh0Ffxo/afScj8 QS7dcQyWojwVk0DYcYxiNcpljmefsWTxvsA5N4pKJiYAQclWopthJaQkObXABAx8wrx6 3arA== X-Gm-Message-State: AOAM533+yE1UilDgFNegS/hbixXMp2qXHm+1TopAYrQKTm5izyxduB6p fFUNKSdDQkL2H/0AbCN2FQ4= X-Google-Smtp-Source: ABdhPJxFe5x167yezDjoEusJwDopfpCmIr6Ukt3R4uGJhJLT6p5SOYhg0gy4lHE2ckaCSGXseGn7rw== X-Received: by 2002:a1c:cc07:: with SMTP id h7mr9065305wmb.55.1602943403353; Sat, 17 Oct 2020 07:03:23 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 08/44] target/mips: Add loongson-ext lswc2 group of instructions (Part 1) Date: Sat, 17 Oct 2020 16:02:07 +0200 Message-Id: <20201017140243.1078718-9-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Jiaxun Yang LWC2 & SWC2 have been rewritten by Loongson EXT vendor ASE as "load/store quad word" and "shifted load/store" groups of instructions. This patch add implementation of these instructions: gslq: load 16 bytes to GPR gssq: store 16 bytes from GPR gslqc1: load 16 bytes to FPR gssqc1: store 16 bytes from FPR Details of Loongson-EXT is here: https://github.com/FlyGoat/loongson-insn/blob/master/loongson-ext.md Signed-off-by: Jiaxun Yang Signed-off-by: Huacai Chen Message-Id: <1602831120-3377-3-git-send-email-chenhc@lemote.com> [PMD: Restrict t1 variable to TARGET_MIPS64, remove unused t2/fp0] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/translate.c | 86 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index b4d009078e0..e83954d782f 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -460,6 +460,17 @@ enum { R6_OPC_SCD =3D 0x27 | OPC_SPECIAL3, }; =20 +/* Loongson EXT load/store quad word opcodes */ +#define MASK_LOONGSON_GSLSQ(op) (MASK_OP_MAJOR(op) | (op & 0x802= 0)) +enum { + OPC_GSLQ =3D 0x0020 | OPC_LWC2, + OPC_GSLQC1 =3D 0x8020 | OPC_LWC2, + OPC_GSSHFL =3D OPC_LWC2, + OPC_GSSQ =3D 0x0020 | OPC_SWC2, + OPC_GSSQC1 =3D 0x8020 | OPC_SWC2, + OPC_GSSHFS =3D OPC_SWC2, +}; + /* BSHFL opcodes */ #define MASK_BSHFL(op) (MASK_SPECIAL3(op) | (op & (0x1F << 6)= )) =20 @@ -5910,6 +5921,79 @@ no_rd: tcg_temp_free_i64(t1); } =20 +static void gen_loongson_lswc2(DisasContext *ctx, int rt, + int rs, int rd) +{ + TCGv t0; +#if defined(TARGET_MIPS64) + TCGv t1; + int lsq_rt1 =3D ctx->opcode & 0x1f; + int lsq_offset =3D sextract32(ctx->opcode, 6, 9) << 4; +#endif + + t0 =3D tcg_temp_new(); + + switch (MASK_LOONGSON_GSLSQ(ctx->opcode)) { +#if defined(TARGET_MIPS64) + case OPC_GSLQ: + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, lsq_offset); + tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_base_offset_addr(ctx, t0, rs, lsq_offset + 8); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_store_gpr(t1, rt); + gen_store_gpr(t0, lsq_rt1); + tcg_temp_free(t1); + break; + case OPC_GSLQC1: + check_cp1_enabled(ctx); + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, lsq_offset); + tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_base_offset_addr(ctx, t0, rs, lsq_offset + 8); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_store_fpr64(ctx, t1, rt); + gen_store_fpr64(ctx, t0, lsq_rt1); + tcg_temp_free(t1); + break; + case OPC_GSSQ: + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, lsq_offset); + gen_load_gpr(t1, rt); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_base_offset_addr(ctx, t0, rs, lsq_offset + 8); + gen_load_gpr(t1, lsq_rt1); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + tcg_temp_free(t1); + break; + case OPC_GSSQC1: + check_cp1_enabled(ctx); + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, lsq_offset); + gen_load_fpr64(ctx, t1, rt); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_base_offset_addr(ctx, t0, rs, lsq_offset + 8); + gen_load_fpr64(ctx, t1, lsq_rt1); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + tcg_temp_free(t1); + break; +#endif + default: + MIPS_INVAL("loongson_gslsq"); + generate_exception_end(ctx, EXCP_RI); + break; + } + tcg_temp_free(t0); +} + /* Traps */ static void gen_trap(DisasContext *ctx, uint32_t opc, int rs, int rt, int16_t imm) @@ -30774,6 +30858,8 @@ static void decode_opc(CPUMIPSState *env, DisasCont= ext *ctx) /* OPC_BC, OPC_BALC */ gen_compute_compact_branch(ctx, op, 0, 0, sextract32(ctx->opcode << 2, 0, 28)= ); + } else if (ctx->insn_flags & ASE_LEXT) { + gen_loongson_lswc2(ctx, rt, rs, rd); } else { /* OPC_LWC2, OPC_SWC2 */ /* COP2: Not implemented. */ --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943410; cv=none; d=zohomail.com; s=zohoarc; b=OVoHgFPfzy3yP5IbRVGPVR9POaeu9v4PirAWnMnKaJgkBspW9RPzLEbHRCXbIndU8DbbyhDHJyyny9PllHdlpWUl0hmuZugagYAOo1LTu8UgFiRLJgZAdSHJgxLr+7MXWGKlRGWd9PCaFUxl1V54/08mrXklBWOTxZHmoHVwK2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943410; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OSp3zRmHarSiGKoLWGfVF0cWMHS0w9Z8Zx5+7o1qy80=; b=XnvAIPzLnxtspSJ25RMDJNR1JRrxDSQ6HEGSKIOgUNB4MaFiMZ920RE481iHqQmGnLDtLz8oFQh4AKkKG49V03pCe8Qs1QfdDTV8LcnKwbFChCe6cKAobpjBGuLTlXV17pgEEFGqxVpx0H+IaV9AFaVKlMudW/ijDmeyWhwqWAs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1602943410437405.44957653372285; Sat, 17 Oct 2020 07:03:30 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id g12so6553226wrp.10 for ; Sat, 17 Oct 2020 07:03:29 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id 24sm7284039wmg.8.2020.10.17.07.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OSp3zRmHarSiGKoLWGfVF0cWMHS0w9Z8Zx5+7o1qy80=; b=oOszRg2xS8PAnc3qzG10flRDpOTzWvT3YzsGr48xb2GWVqM+CG16sv6zsRvq9FY5RH ziRpZ0eZAKZfrKGGyxBsamDXRrrdwmmPEKgDFpwTG6GgdEx4l975qB3hJmywbFzL9wWB 13aC6j4NOoO2r6GeEvvbWRgtKN+0MSr0COK+wviEcw1YWY2TGn7lq14YomD4LPNnC6ME jCLEh7cHpfYvtOWdw6s8KlAx1qon4F3TG73dVeoK/AwYRZgiPJfrHtN/wv1L87wtBxyw RocuRrlT0Nu2UWrrklcwZlh6CRyTikpTLPFgoSZ/zknXaheY45xxC9P5ALsp9nXkezlt 7aOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OSp3zRmHarSiGKoLWGfVF0cWMHS0w9Z8Zx5+7o1qy80=; b=llSp9TrYozxeVh6cR/Pw7cCdyPht29EAPH9NPD3G12U96vmstPxbKhMVtJbiDAeGeQ I4YD1mjp2zrfRSOjLOV9G14Y4GqyRVuOnvAPg7hbwKqZPVeXI/LIlpXPv1ovveimYV0B OJw1UjKgibUAId88jDD4PbXYoJBEO2sAc1i8SrW/VyPSb1y8MD3HQ+ArdcNahpq+ZF/9 t7rzPNQ+lPZRZHcfd5wkhaDZ9+FdGoN6SqiKDx8TCKd5qtws3d9yKI/Z+NyczpY2vMXq gbKdbEdUDEV5fPUFNUs5p5dysh/Kubhuppb1FZbnra2gRLz4r39mfRLMlVZ3CpNRByme LR6w== X-Gm-Message-State: AOAM5329ERHpuxmUcRsyOGLXItmTaQ3HfqCkGlyNgNX9ko7W0/UjtgAr 7fQVEl/oQbKECAFd/sTruymx3EviU5w= X-Google-Smtp-Source: ABdhPJy35ojWNF+MRnOwgt8mjVHg/+6HIWmo9n5c3IWHWROenbbla51I+0FN+HFP6oGd/gd+xsOIYg== X-Received: by 2002:adf:dfc7:: with SMTP id q7mr9941400wrn.382.1602943408022; Sat, 17 Oct 2020 07:03:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 09/44] target/mips: Add loongson-ext lswc2 group of instructions (Part 2) Date: Sat, 17 Oct 2020 16:02:08 +0200 Message-Id: <20201017140243.1078718-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Jiaxun Yang LWC2 & SWC2 have been rewritten by Loongson EXT vendor ASE as "load/store quad word" and "shifted load/store" groups of instructions. This patch add implementation of these instructions: gslwlc1: similar to lwl but RT is FPR instead of GPR gslwrc1: similar to lwr but RT is FPR instead of GPR gsldlc1: similar to ldl but RT is FPR instead of GPR gsldrc1: similar to ldr but RT is FPR instead of GPR gsswlc1: similar to swl but RT is FPR instead of GPR gsswrc1: similar to swr but RT is FPR instead of GPR gssdlc1: similar to sdl but RT is FPR instead of GPR gssdrc1: similar to sdr but RT is FPR instead of GPR Details of Loongson-EXT is here: https://github.com/FlyGoat/loongson-insn/blob/master/loongson-ext.md Signed-off-by: Jiaxun Yang Signed-off-by: Huacai Chen Message-Id: <1602831120-3377-4-git-send-email-chenhc@lemote.com> [PMD: Reuse t1 on MIPS32, reintroduce t2/fp0] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/translate.c | 182 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 180 insertions(+), 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index e83954d782f..b335645e03b 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -471,6 +471,19 @@ enum { OPC_GSSHFS =3D OPC_SWC2, }; =20 +/* Loongson EXT shifted load/store opcodes */ +#define MASK_LOONGSON_GSSHFLS(op) (MASK_OP_MAJOR(op) | (op & 0xc03= f)) +enum { + OPC_GSLWLC1 =3D 0x4 | OPC_GSSHFL, + OPC_GSLWRC1 =3D 0x5 | OPC_GSSHFL, + OPC_GSLDLC1 =3D 0x6 | OPC_GSSHFL, + OPC_GSLDRC1 =3D 0x7 | OPC_GSSHFL, + OPC_GSSWLC1 =3D 0x4 | OPC_GSSHFS, + OPC_GSSWRC1 =3D 0x5 | OPC_GSSHFS, + OPC_GSSDLC1 =3D 0x6 | OPC_GSSHFS, + OPC_GSSDRC1 =3D 0x7 | OPC_GSSHFS, +}; + /* BSHFL opcodes */ #define MASK_BSHFL(op) (MASK_SPECIAL3(op) | (op & (0x1F << 6)= )) =20 @@ -5924,12 +5937,13 @@ no_rd: static void gen_loongson_lswc2(DisasContext *ctx, int rt, int rs, int rd) { - TCGv t0; + TCGv t0, t1, t2; + TCGv_i32 fp0; #if defined(TARGET_MIPS64) - TCGv t1; int lsq_rt1 =3D ctx->opcode & 0x1f; int lsq_offset =3D sextract32(ctx->opcode, 6, 9) << 4; #endif + int shf_offset =3D sextract32(ctx->opcode, 6, 8); =20 t0 =3D tcg_temp_new(); =20 @@ -5986,6 +6000,170 @@ static void gen_loongson_lswc2(DisasContext *ctx, i= nt rt, tcg_temp_free(t1); break; #endif + case OPC_GSSHFL: + switch (MASK_LOONGSON_GSSHFLS(ctx->opcode)) { + case OPC_GSLWLC1: + check_cp1_enabled(ctx); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + t1 =3D tcg_temp_new(); + tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); + tcg_gen_andi_tl(t1, t0, 3); +#ifndef TARGET_WORDS_BIGENDIAN + tcg_gen_xori_tl(t1, t1, 3); +#endif + tcg_gen_shli_tl(t1, t1, 3); + tcg_gen_andi_tl(t0, t0, ~3); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEUL); + tcg_gen_shl_tl(t0, t0, t1); + t2 =3D tcg_const_tl(-1); + tcg_gen_shl_tl(t2, t2, t1); + fp0 =3D tcg_temp_new_i32(); + gen_load_fpr32(ctx, fp0, rt); + tcg_gen_ext_i32_tl(t1, fp0); + tcg_gen_andc_tl(t1, t1, t2); + tcg_temp_free(t2); + tcg_gen_or_tl(t0, t0, t1); + tcg_temp_free(t1); +#if defined(TARGET_MIPS64) + tcg_gen_extrl_i64_i32(fp0, t0); +#else + tcg_gen_ext32s_tl(fp0, t0); +#endif + gen_store_fpr32(ctx, fp0, rt); + tcg_temp_free_i32(fp0); + break; + case OPC_GSLWRC1: + check_cp1_enabled(ctx); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + t1 =3D tcg_temp_new(); + tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); + tcg_gen_andi_tl(t1, t0, 3); +#ifdef TARGET_WORDS_BIGENDIAN + tcg_gen_xori_tl(t1, t1, 3); +#endif + tcg_gen_shli_tl(t1, t1, 3); + tcg_gen_andi_tl(t0, t0, ~3); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEUL); + tcg_gen_shr_tl(t0, t0, t1); + tcg_gen_xori_tl(t1, t1, 31); + t2 =3D tcg_const_tl(0xfffffffeull); + tcg_gen_shl_tl(t2, t2, t1); + fp0 =3D tcg_temp_new_i32(); + gen_load_fpr32(ctx, fp0, rt); + tcg_gen_ext_i32_tl(t1, fp0); + tcg_gen_and_tl(t1, t1, t2); + tcg_temp_free(t2); + tcg_gen_or_tl(t0, t0, t1); + tcg_temp_free(t1); +#if defined(TARGET_MIPS64) + tcg_gen_extrl_i64_i32(fp0, t0); +#else + tcg_gen_ext32s_tl(fp0, t0); +#endif + gen_store_fpr32(ctx, fp0, rt); + tcg_temp_free_i32(fp0); + break; +#if defined(TARGET_MIPS64) + case OPC_GSLDLC1: + check_cp1_enabled(ctx); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + t1 =3D tcg_temp_new(); + tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); + tcg_gen_andi_tl(t1, t0, 7); +#ifndef TARGET_WORDS_BIGENDIAN + tcg_gen_xori_tl(t1, t1, 7); +#endif + tcg_gen_shli_tl(t1, t1, 3); + tcg_gen_andi_tl(t0, t0, ~7); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEQ); + tcg_gen_shl_tl(t0, t0, t1); + t2 =3D tcg_const_tl(-1); + tcg_gen_shl_tl(t2, t2, t1); + gen_load_fpr64(ctx, t1, rt); + tcg_gen_andc_tl(t1, t1, t2); + tcg_temp_free(t2); + tcg_gen_or_tl(t0, t0, t1); + tcg_temp_free(t1); + gen_store_fpr64(ctx, t0, rt); + break; + case OPC_GSLDRC1: + check_cp1_enabled(ctx); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + t1 =3D tcg_temp_new(); + tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); + tcg_gen_andi_tl(t1, t0, 7); +#ifdef TARGET_WORDS_BIGENDIAN + tcg_gen_xori_tl(t1, t1, 7); +#endif + tcg_gen_shli_tl(t1, t1, 3); + tcg_gen_andi_tl(t0, t0, ~7); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEQ); + tcg_gen_shr_tl(t0, t0, t1); + tcg_gen_xori_tl(t1, t1, 63); + t2 =3D tcg_const_tl(0xfffffffffffffffeull); + tcg_gen_shl_tl(t2, t2, t1); + gen_load_fpr64(ctx, t1, rt); + tcg_gen_and_tl(t1, t1, t2); + tcg_temp_free(t2); + tcg_gen_or_tl(t0, t0, t1); + tcg_temp_free(t1); + gen_store_fpr64(ctx, t0, rt); + break; +#endif + default: + MIPS_INVAL("loongson_gsshfl"); + generate_exception_end(ctx, EXCP_RI); + break; + } + break; + case OPC_GSSHFS: + switch (MASK_LOONGSON_GSSHFLS(ctx->opcode)) { + case OPC_GSSWLC1: + check_cp1_enabled(ctx); + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + fp0 =3D tcg_temp_new_i32(); + gen_load_fpr32(ctx, fp0, rt); + tcg_gen_ext_i32_tl(t1, fp0); + gen_helper_0e2i(swl, t1, t0, ctx->mem_idx); + tcg_temp_free_i32(fp0); + tcg_temp_free(t1); + break; + case OPC_GSSWRC1: + check_cp1_enabled(ctx); + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + fp0 =3D tcg_temp_new_i32(); + gen_load_fpr32(ctx, fp0, rt); + tcg_gen_ext_i32_tl(t1, fp0); + gen_helper_0e2i(swr, t1, t0, ctx->mem_idx); + tcg_temp_free_i32(fp0); + tcg_temp_free(t1); + break; +#if defined(TARGET_MIPS64) + case OPC_GSSDLC1: + check_cp1_enabled(ctx); + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + gen_load_fpr64(ctx, t1, rt); + gen_helper_0e2i(sdl, t1, t0, ctx->mem_idx); + tcg_temp_free(t1); + break; + case OPC_GSSDRC1: + check_cp1_enabled(ctx); + t1 =3D tcg_temp_new(); + gen_base_offset_addr(ctx, t0, rs, shf_offset); + gen_load_fpr64(ctx, t1, rt); + gen_helper_0e2i(sdr, t1, t0, ctx->mem_idx); + tcg_temp_free(t1); + break; +#endif + default: + MIPS_INVAL("loongson_gsshfs"); + generate_exception_end(ctx, EXCP_RI); + break; + } + break; default: MIPS_INVAL("loongson_gslsq"); generate_exception_end(ctx, EXCP_RI); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) client-ip=209.85.221.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943414; cv=none; d=zohomail.com; s=zohoarc; b=Drft7kjb3goB8nuZEBdvyoxK1pTUBFJqep9J2XptkYRMh7+0MHNsNKTxB6+31tZhTBlaBfPkBiCPqY6WL4dtOoH1rS32XPmFRYMN1wF445HgxO6mn2eb9imfJTxQ2Xn7RSqBnnBGinYRWQI21z4336URlZuhzvsmrsHhnNC/fC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943414; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QDmldNUzpXsh69qJSWtEVYRqvmy07TwwbDHI7HDPp8c=; b=oHyi+MuSKGgLV8Y4aNsMZLUfnvdWMQDfkhHe6x62Z88ekeg6gvSnn8xOxL38QZRGfIm/gupCLojsRYLsRgT3AOOEzbbPl3qUD0wvGwVDhZSUQrOnTWe7TYa39jsfBYYqPtO5Lq7bBEaLOMbbiw85m78A3DXZe4UWQ3wBI17woPw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.zohomail.com with SMTPS id 1602943414586826.9410567120128; Sat, 17 Oct 2020 07:03:34 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id g12so6553360wrp.10 for ; Sat, 17 Oct 2020 07:03:33 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id l26sm7386822wmi.39.2020.10.17.07.03.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QDmldNUzpXsh69qJSWtEVYRqvmy07TwwbDHI7HDPp8c=; b=jbPfoC6dA1Bjamk1sCRktGt27FuUMJVfz/RkwW0kCGNfqQhfSJp5aqV1cKGORorna6 THhbN/G9GpbWyA+ZNR5zwQiGtVeQ2u5to8T2Bdf+ilylDL6UWmufGKBYPofe/XSvsYSP gMxssquvRAQCOhgJrM0jacee8aSRl+BeceeP4J3MplUrwIOXb+EeIFZ6zKkVpkOJd7N2 OXDx5CtCDnS+ok/Sg8GWQE2hGk0VURau9ZY/mqpfrKb5eLEg04ybRqYt9Yt8K8tMk2hx udQi8Ob5+WVp/anHUwrjupa3YTm9WQCw8QMwpU4/UXetzxviQYnkunG0qbv4M/XxTIDn A3qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QDmldNUzpXsh69qJSWtEVYRqvmy07TwwbDHI7HDPp8c=; b=cZ2NYYhqlZCLeZ7jkyssZwppcEy8OLq/RF4T/xZvOODkPqz7+YfuBY++FuQfdsmsVL LAwLswfe4VtBfcq9WzUsSKf8BSXEGv5P0+h2c2LA63O4BHUgkirSdFl3gsXqLHRx7zSu Gn34Asf2fm+UZwDMmK9fPwIXmWdfsrvYFqDNpa+5rYRB3GaRZaixLk2AeLPlzENLT13S 85n3HA506UxE6t73vipWTszs//O6nFsB6vs6+lOM+Ac74FesUh7P3/ar2tBTTVEkcJpt Ax/iw9Bg8Ye1vD4CuDOIvmq7jkqB0hg6POllYppepKo6Vy+zvzVLXh2jOZDhKOT1rLyu DilA== X-Gm-Message-State: AOAM532pQ7jXVbpEHTHWE3S314Iw7T6Ovj9j6FVzCX0QzynSVdsPg/IR PXzZhpZZTb9Y/59soA8gmNE= X-Google-Smtp-Source: ABdhPJzj10hy8UoV/95IIy/SaTspt8k1/znxEVIxqgavBf6QHHUwHOw4Frqavdd+xm6NvbSz+W5NSQ== X-Received: by 2002:adf:c00b:: with SMTP id z11mr9851646wre.320.1602943412680; Sat, 17 Oct 2020 07:03:32 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/44] target/mips: Add loongson-ext lsdc2 group of instructions Date: Sat, 17 Oct 2020 16:02:09 +0200 Message-Id: <20201017140243.1078718-11-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Jiaxun Yang LDC2/SDC2 opcodes have been rewritten as "load & store with offset" group of instructions by loongson-ext ASE. This patch add implementation of these instructions: gslbx: load 1 bytes to GPR gslhx: load 2 bytes to GPR gslwx: load 4 bytes to GPR gsldx: load 8 bytes to GPR gslwxc1: load 4 bytes to FPR gsldxc1: load 8 bytes to FPR gssbx: store 1 bytes from GPR gsshx: store 2 bytes from GPR gsswx: store 4 bytes from GPR gssdx: store 8 bytes from GPR gsswxc1: store 4 bytes from FPR gssdxc1: store 8 bytes from FPR Details of Loongson-EXT is here: https://github.com/FlyGoat/loongson-insn/blob/master/loongson-ext.md Signed-off-by: Jiaxun Yang Signed-off-by: Huacai Chen Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1602831120-3377-5-git-send-email-chenhc@lemote.com> --- target/mips/translate.c | 179 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index b335645e03b..f449758606d 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -484,6 +484,24 @@ enum { OPC_GSSDRC1 =3D 0x7 | OPC_GSSHFS, }; =20 +/* Loongson EXT LDC2/SDC2 opcodes */ +#define MASK_LOONGSON_LSDC2(op) (MASK_OP_MAJOR(op) | (op & 0x7)) + +enum { + OPC_GSLBX =3D 0x0 | OPC_LDC2, + OPC_GSLHX =3D 0x1 | OPC_LDC2, + OPC_GSLWX =3D 0x2 | OPC_LDC2, + OPC_GSLDX =3D 0x3 | OPC_LDC2, + OPC_GSLWXC1 =3D 0x6 | OPC_LDC2, + OPC_GSLDXC1 =3D 0x7 | OPC_LDC2, + OPC_GSSBX =3D 0x0 | OPC_SDC2, + OPC_GSSHX =3D 0x1 | OPC_SDC2, + OPC_GSSWX =3D 0x2 | OPC_SDC2, + OPC_GSSDX =3D 0x3 | OPC_SDC2, + OPC_GSSWXC1 =3D 0x6 | OPC_SDC2, + OPC_GSSDXC1 =3D 0x7 | OPC_SDC2, +}; + /* BSHFL opcodes */ #define MASK_BSHFL(op) (MASK_SPECIAL3(op) | (op & (0x1F << 6)= )) =20 @@ -6172,6 +6190,165 @@ static void gen_loongson_lswc2(DisasContext *ctx, i= nt rt, tcg_temp_free(t0); } =20 +/* Loongson EXT LDC2/SDC2 */ +static void gen_loongson_lsdc2(DisasContext *ctx, int rt, + int rs, int rd) +{ + int offset =3D sextract32(ctx->opcode, 3, 8); + uint32_t opc =3D MASK_LOONGSON_LSDC2(ctx->opcode); + TCGv t0, t1; + TCGv_i32 fp0; + + /* Pre-conditions */ + switch (opc) { + case OPC_GSLBX: + case OPC_GSLHX: + case OPC_GSLWX: + case OPC_GSLDX: + /* prefetch, implement as NOP */ + if (rt =3D=3D 0) { + return; + } + break; + case OPC_GSSBX: + case OPC_GSSHX: + case OPC_GSSWX: + case OPC_GSSDX: + break; + case OPC_GSLWXC1: +#if defined(TARGET_MIPS64) + case OPC_GSLDXC1: +#endif + check_cp1_enabled(ctx); + /* prefetch, implement as NOP */ + if (rt =3D=3D 0) { + return; + } + break; + case OPC_GSSWXC1: +#if defined(TARGET_MIPS64) + case OPC_GSSDXC1: +#endif + check_cp1_enabled(ctx); + break; + default: + MIPS_INVAL("loongson_lsdc2"); + generate_exception_end(ctx, EXCP_RI); + return; + break; + } + + t0 =3D tcg_temp_new(); + + gen_base_offset_addr(ctx, t0, rs, offset); + gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0); + + switch (opc) { + case OPC_GSLBX: + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_SB); + gen_store_gpr(t0, rt); + break; + case OPC_GSLHX: + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TESW | + ctx->default_tcg_memop_mask); + gen_store_gpr(t0, rt); + break; + case OPC_GSLWX: + gen_base_offset_addr(ctx, t0, rs, offset); + if (rd) { + gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0); + } + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TESL | + ctx->default_tcg_memop_mask); + gen_store_gpr(t0, rt); + break; +#if defined(TARGET_MIPS64) + case OPC_GSLDX: + gen_base_offset_addr(ctx, t0, rs, offset); + if (rd) { + gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0); + } + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_store_gpr(t0, rt); + break; +#endif + case OPC_GSLWXC1: + check_cp1_enabled(ctx); + gen_base_offset_addr(ctx, t0, rs, offset); + if (rd) { + gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0); + } + fp0 =3D tcg_temp_new_i32(); + tcg_gen_qemu_ld_i32(fp0, t0, ctx->mem_idx, MO_TESL | + ctx->default_tcg_memop_mask); + gen_store_fpr32(ctx, fp0, rt); + tcg_temp_free_i32(fp0); + break; +#if defined(TARGET_MIPS64) + case OPC_GSLDXC1: + check_cp1_enabled(ctx); + gen_base_offset_addr(ctx, t0, rs, offset); + if (rd) { + gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0); + } + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + gen_store_fpr64(ctx, t0, rt); + break; +#endif + case OPC_GSSBX: + t1 =3D tcg_temp_new(); + gen_load_gpr(t1, rt); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_SB); + tcg_temp_free(t1); + break; + case OPC_GSSHX: + t1 =3D tcg_temp_new(); + gen_load_gpr(t1, rt); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEUW | + ctx->default_tcg_memop_mask); + tcg_temp_free(t1); + break; + case OPC_GSSWX: + t1 =3D tcg_temp_new(); + gen_load_gpr(t1, rt); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEUL | + ctx->default_tcg_memop_mask); + tcg_temp_free(t1); + break; +#if defined(TARGET_MIPS64) + case OPC_GSSDX: + t1 =3D tcg_temp_new(); + gen_load_gpr(t1, rt); + tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + tcg_temp_free(t1); + break; +#endif + case OPC_GSSWXC1: + fp0 =3D tcg_temp_new_i32(); + gen_load_fpr32(ctx, fp0, rt); + tcg_gen_qemu_st_i32(fp0, t0, ctx->mem_idx, MO_TEUL | + ctx->default_tcg_memop_mask); + tcg_temp_free_i32(fp0); + break; +#if defined(TARGET_MIPS64) + case OPC_GSSDXC1: + t1 =3D tcg_temp_new(); + gen_load_fpr64(ctx, t1, rt); + tcg_gen_qemu_st_i64(t1, t0, ctx->mem_idx, MO_TEQ | + ctx->default_tcg_memop_mask); + tcg_temp_free(t1); + break; +#endif + default: + break; + } + + tcg_temp_free(t0); +} + /* Traps */ static void gen_trap(DisasContext *ctx, uint32_t opc, int rs, int rt, int16_t imm) @@ -31055,6 +31232,8 @@ static void decode_opc(CPUMIPSState *env, DisasCont= ext *ctx) /* OPC_JIC, OPC_JIALC */ gen_compute_compact_branch(ctx, op, 0, rt, imm); } + } else if (ctx->insn_flags & ASE_LEXT) { + gen_loongson_lsdc2(ctx, rt, rs, rd); } else { /* OPC_LWC2, OPC_SWC2 */ /* COP2: Not implemented. */ --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) client-ip=209.85.128.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943419; cv=none; d=zohomail.com; s=zohoarc; b=ZO7S0GR7yBrXwu0XPA5XXqrPxxbH0dzg8qZDO5jhM43ih7RHtJ5+nh5VygDeONs8J8/jKZZKMKwXQ7axd823QZZR4+pSKd7nj6zxuRwvkPpJrun1jhKrWmMBfVtkEAypStLTDlyGi1R71+3p+jhVyCPGTn0UTu/PtuTEf+W/17M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943419; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RMjis+VK7lDKD3DwbFfzb5usAINbaM2mLX6bmZd7Xrw=; b=Q2EUpUgoTFw9PvyxvDDnD9jPeFRSkvlybGKhF6PStvntoqxfYPvXxsr7NbkFOIDlEML0hVfgtY+HA7pHcnypqD0cVTcd2yF4d1lWqCepSlwOvoS7x174mI2mW7WbfbBlU8EFZJydHkbhFiOdjT8RaNGznjoN5EUwmOemib0BjTw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.zohomail.com with SMTPS id 1602943419104855.9790085658068; Sat, 17 Oct 2020 07:03:39 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id d81so6154593wmc.1 for ; Sat, 17 Oct 2020 07:03:38 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id x64sm7473502wmg.33.2020.10.17.07.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RMjis+VK7lDKD3DwbFfzb5usAINbaM2mLX6bmZd7Xrw=; b=trlboDlXNf1gimEFX35s1JCnC00DlL6PEhN68ar2a0UBShE3yMlcQjkfhxEpQEwZXP 0/wr0va5xUbh/vUSm5Duger9jcCgX9ERQo0FnwsMkJJf/kvvqmyP08UCnLHPvj42bZJ6 YiJOE4xtaVRv3MN+vjDWeQYsVwKIGocWJBauaCde6FkyDsJ/PwrbvRxrrWsTuM7DSpm9 gIaGjT26nEhUNn93uEWv4n4SWTlR+RLvU8v0++HrKGGJP+RVx4YcEepJlXaB2nU+b/Iy Wo5qn7GVe8tBTiKIIfqbhe8GqMBRLMFzM8/1/IvcFiNAEuuagJ2EObNVm4XAYn6ZhzQn pCCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RMjis+VK7lDKD3DwbFfzb5usAINbaM2mLX6bmZd7Xrw=; b=XkwSf4NjkWiZlT/jREAD4/fMza7U82uz8MYHm0GYn30FW0KoeB2mrvLjxv13ZMga8I KvHFdirfZ/8BTe/7Z3tkPxY0CoQ+0bZ7aTQCukm4jj3t1bI1/BuI3gOAp1K5eLDjlha+ SROgEq0D4DOvQANWZ6YqX8ElOBrf/Phtzl5UXECkKpzA7N7OH0zdN+R8KgdQrJaonnBj DfLCIV1tBVDL8JaZ9YbIYwgtnYsbxHe3ZsYgD+INfrAFKLAMrLy37twXN/3wsZLmjP+X t/QJiBA7Cu0FZY3CD6fo2mqBT5EXbuMUOLuaqKWt7GXnyEwocrMRevuX24y17h83j9Y3 83tg== X-Gm-Message-State: AOAM533E3uH6YA7P5wjZ6aumBmp5XE0P2YHbWEvKLPBOZGTNqEZ+WwDs /Ucy964bZiX1NRQiZR/0bQ8= X-Google-Smtp-Source: ABdhPJxZy3VhV9SIm4UpA36NSI33mMbQr10eFchqpeNlbiEjRZmAHnnAQkI1+9r83ISXP12/krh19Q== X-Received: by 2002:a05:600c:2297:: with SMTP id 23mr9066750wmf.104.1602943417303; Sat, 17 Oct 2020 07:03:37 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 11/44] target/mips/op_helper: Convert multiple if() to switch case Date: Sat, 17 Oct 2020 16:02:10 +0200 Message-Id: <20201017140243.1078718-12-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The cache operation is encoded in bits [20:18] of the instruction. The 'op' argument of helper_cache() contains the bits [20:16]. Extract the 3 bits and parse them using a switch case. This allow us to handle multiple cache types (the cache type is encoded in bits [17:16]). Previously the if() block was only checking the D-Cache (Primary Data or Unified Primary). Now we also handle the I-Cache (Primary Instruction), S-Cache (Secondary) and T-Cache (Terciary). Reported-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Message-Id: <20200813181527.22551-2-f4bug@amsat.org> --- target/mips/op_helper.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 9552b280e07..c15f5c07761 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -1574,15 +1574,20 @@ void helper_msa_st_d(CPUMIPSState *env, uint32_t wd, void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op) { #ifndef CONFIG_USER_ONLY + uint32_t cache_operation =3D extract32(op, 2, 3); target_ulong index =3D addr & 0x1fffffff; - if (op =3D=3D 9) { - /* Index Store Tag */ + + switch (cache_operation) { + case 0b010: /* Index Store Tag */ memory_region_dispatch_write(env->itc_tag, index, env->CP0_TagLo, MO_64, MEMTXATTRS_UNSPECIFIED); - } else if (op =3D=3D 5) { - /* Index Load Tag */ + break; + case 0b001: /* Index Load Tag */ memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo, MO_64, MEMTXATTRS_UNSPECIFIED); + break; + default: + break; } #endif } --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) client-ip=209.85.128.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943423; cv=none; d=zohomail.com; s=zohoarc; b=kWydJlzr/hDBcG53z/uKwyYdG4MyaT3inoxaMtHlVGzjst2Zxf1NOh1mdDGzow50dgDj7VGRiOVQy11oaCnbfDiaazEImcwIJ2ujUTEumOh8wtT55sSLYMqN7G7MRYifRi6IxYDR6GYvtbbGz9Uu9ITmEOlSj4MCVvNTRyMwBnM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943423; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LfhnJlD5ICt8SM68uBqo2cJX//28deS2z59iVNfu0PI=; b=K5MUd9VctJifnaQiMjPGBszV5T2jr/xjLTRiHhUHGTLbprfQhgNnY6YPVjiL5hsnjObytIiNrSBtM2eq1uE0YeiQc1VEwPw4+S5EQdGgsTPY50VVGYT7yEE6u09yMIHQXKucBGHVwAshY5cP+zDWpx6nOCNjglIRcDdA4tVXgIw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.zohomail.com with SMTPS id 1602943423770775.1044647150131; Sat, 17 Oct 2020 07:03:43 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id e23so6138374wme.2 for ; Sat, 17 Oct 2020 07:03:43 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id e11sm3013725wrj.75.2020.10.17.07.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LfhnJlD5ICt8SM68uBqo2cJX//28deS2z59iVNfu0PI=; b=JfYiAQd/bhekY/nPqLmhS0HWkfBC73prgWUMUtFgcG4iQaQtgGhh9z06CeSeIKwJrv 4JeTvDoqmZs66JC5j46jngl0fj7oaCR+OwxONsXdAKCTY+itW4wk9i1Ehz/5ayI3vIiR 7eUDp4LUnwnzpSZIV8QHMdsmdoIMMyfLcsSK0O1X2tpK3AO1rVWIjkBrETRBcECJv0l8 yigZyxjky+3UXCX5+TXJdd2zRx/jZm15csBXKvSvpZD6J4Mvvsxlg7yDs6d9+GcSwFiw ayWWTxhxJ5HsLX6R64kmMWJAMoyfemq9LxzdAWI7yrhQUG7Rtp2WHw1hQaYUcyi2hG9Q irRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LfhnJlD5ICt8SM68uBqo2cJX//28deS2z59iVNfu0PI=; b=ViaOUgoXtKqwQjz5TKpyAbtnZ1AsPeQgysHc1cb0MgTjxKMBMMQbMnu4tyrqn1nqR/ oZ5My/qcKAFzUSeWfOeiA2drLMrku3ZsaAOhraOXtL7JuiXiWZrxJ6KIND+jLaNd/KAP pr0CKJ1TY3am9ER5fJqCNxwAr/kbhb+jhIA1bjaY7HchbzowlyPpSaKIKr0eNpX4GGtq 9S9y0X0iG12KqWki2lCXcgG378kJtC1mWVWHk3VbTTmtxkrajC+Kont1r7uPjm8Y+Duf c0bdDoXHbxB7qGKrJpx1CYuAmu3pCiSNVDBNLCtx0dNNRFe8t1GcExu41NsUUlsrLnX+ 3/cw== X-Gm-Message-State: AOAM530L0HFSJQfAiilPhuuKy0g9LN3jPJoHXTRDF+xgz1RBNACRYdpZ GX8Obzy/OK3SfYCVdlblzVg= X-Google-Smtp-Source: ABdhPJxuGE3erFN1R3CnyNhjkcDeOQbvlhsJ6lxe8pRD9gkn5Yeqh/ay8KId3J23Shb40JAI+v/zlw== X-Received: by 2002:a1c:bb06:: with SMTP id l6mr8944254wmf.40.1602943421884; Sat, 17 Oct 2020 07:03:41 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 12/44] target/mips/op_helper: Document Invalidate/Writeback opcodes as no-op Date: Sat, 17 Oct 2020 16:02:11 +0200 Message-Id: <20201017140243.1078718-13-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) QEMU does not model caches, so there is not much to do with the Invalidate/Writeback opcodes. Make it explicit adding a comment. Suggested-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Message-Id: <20200813181527.22551-3-f4bug@amsat.org> --- target/mips/op_helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index c15f5c07761..2496d1dd718 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -1586,6 +1586,11 @@ void helper_cache(CPUMIPSState *env, target_ulong ad= dr, uint32_t op) memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo, MO_64, MEMTXATTRS_UNSPECIFIED); break; + case 0b000: /* Index Invalidate */ + case 0b100: /* Hit Invalidate */ + case 0b110: /* Hit Writeback */ + /* no-op */ + break; default: break; } --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) client-ip=209.85.221.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943428; cv=none; d=zohomail.com; s=zohoarc; b=FEyMuMxlWbYFQ7zOPAa2/F9bRO9uQeT3gdwXe4Oh2+YIWzc6kEn3XCxZAd7E3YqMP6OIplZVczzSNOMJ+iZTrCFBI2dECWODW2j/Bx2HOZLTDnD/0hDTm4HeuPqXZZKq6f/DrcgZG2lRNXmdN6II8OzAHfoi1ldBud7H4mEg/rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943428; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QVmCBzAijqIxVbHfMUmSPN/CpI6hZqRTxfcmVPbu0NA=; b=Du7IziyCJasBJGFMeBoP7iGlsol9SY7fscxQxAqpTvhKn79NJBnOb/8xL81cSddbSM6YrZ/ulF6099xDqTMA/HSei0VKQJciPJ3L+uu/A2a1RivlR88xPdrLnJNUMDFdBgXrmWdToXUD4a5stzK3E4r45nRBYvvBEmExftG5TVE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.zohomail.com with SMTPS id 1602943428413732.3781174082479; Sat, 17 Oct 2020 07:03:48 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id j7so2485924wrt.9 for ; Sat, 17 Oct 2020 07:03:47 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id g5sm7492870wmi.4.2020.10.17.07.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QVmCBzAijqIxVbHfMUmSPN/CpI6hZqRTxfcmVPbu0NA=; b=KVCEkciRTE7Jpa3bDmrfXZ/fBHouFmR5oJYG38COqNnNBEapA9epwsy0rUjWswoVYL e9YMWblt3k8VPQpZz6uSdVhzuxAcxuMjfhgBKvvSSGwOH2Wb5G01+T6nxWxTipPopDlu cNP+73uG1Hlwsho26PBRvlVXk8BCtgK4B2RAWFx0P3H7KqzHGZNtWwnfOeDdk5d0IfoG AHafDmTQazEMecfOwTa8gQM9XllRjYTfvBMaPxM7Ri3D2+WyJ6uos/cO9DSh0nF5wBzp tPAr3xEYFH5BaRWlOQqxOMJG/uBfecbF+ZHpb3HtIZ2BsCuBLQ+eCHoIbVT9H/qh4Nix 9rJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QVmCBzAijqIxVbHfMUmSPN/CpI6hZqRTxfcmVPbu0NA=; b=C6OU9YPmiiC6PqFF34Eqd3zeueeNiaYRrhUVV50/LvJbPgdnlvG848/IEveJCFsfSl 770Pd8isF5LmNWBnQ0ZqD5ROPFkxZ9s2B1PDX5ldAI4ByseLY/dBl1w9+lG2FzLXgXMF OwlQI9lfjn6WvQLcpvC+r6NPinZ9I4b4FmSL+HGgKnnejti4AuSvstxBI1QRjiCvB/bB mI5PvYPXaIxyWzE32qYej3A7pGm+kgaSIYLQZ+vNLIglI3VHuLnKQaHB2306eL1p10qQ qPZm7y3Y5IKhD3eKDxwn7R/Yh2ZbyA+3Fbrdbin7MHPKsourucIOetKCuIMo/Q14x5A1 CqLA== X-Gm-Message-State: AOAM532IWFRvplBEJhd1EVm6soQbqTN12Z6d+YiK4bt4vp4cJIXrBiol BNrMvNpPOD9jS4DC2M/5VpQ= X-Google-Smtp-Source: ABdhPJwkqIqa9dMANp6emE7laWWkLuj4iweTq0EA3lDHIX8v+ibZe5ZSK5KwjUqTxFZhzfUKIxZDwQ== X-Received: by 2002:adf:e3cb:: with SMTP id k11mr10346246wrm.341.1602943426613; Sat, 17 Oct 2020 07:03:46 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 13/44] target/mips/op_helper: Log unimplemented cache opcode Date: Sat, 17 Oct 2020 16:02:12 +0200 Message-Id: <20201017140243.1078718-14-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) In case the guest uses a cache opcode we are not expecting, log it to give us a chance to notice it, in case we should actually do something. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Message-Id: <20200813181527.22551-4-f4bug@amsat.org> --- target/mips/op_helper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 2496d1dd718..0050d0616b6 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -1574,6 +1574,13 @@ void helper_msa_st_d(CPUMIPSState *env, uint32_t wd, void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op) { #ifndef CONFIG_USER_ONLY + static const char *const type_name[] =3D { + "Primary Instruction", + "Primary Data or Unified Primary", + "Tertiary", + "Secondary" + }; + uint32_t cache_type =3D extract32(op, 0, 2); uint32_t cache_operation =3D extract32(op, 2, 3); target_ulong index =3D addr & 0x1fffffff; =20 @@ -1592,6 +1599,8 @@ void helper_cache(CPUMIPSState *env, target_ulong add= r, uint32_t op) /* no-op */ break; default: + qemu_log_mask(LOG_UNIMP, "cache operation:%u (type: %s cache)\n", + cache_operation, type_name[cache_type]); break; } #endif --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943433; cv=none; d=zohomail.com; s=zohoarc; b=d5qa/A3YYOQvR+v/rbjtFaytKrk9m47mWqbAjbSzeVlGSg1SZ5s5WpPz2WNNHrvj2vtvOVNYdPtYNZKJD4vi5+sUGSKpiuUTiMSHkavY/6ArJjCkspWpKXZhYLKcjFnfpo/cPTt1Q+6al8kmHSK4ojMxgo4OE72HQI8VuFKUeHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943433; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NCF5wa/3qOXXh6lH3vb50TSlF2Pm3DCj19abyPtcLXk=; b=RhP20m4kr0T66DGgoRCA6njhqLn4jLMJDFxgWzPC/5yg6p2C+fQyJjZr6V5H00odkxCmUO3mR5usgYSYVVyScjkLbcT4dRNIXQ8/j5FCB6UR31IJGjfw0LWh019bwB39j6v7IUO8F4pbrENZl5audHfkEV9dvR7sYCso6YyORvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1602943433030932.2272537901472; Sat, 17 Oct 2020 07:03:53 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id d81so6154930wmc.1 for ; Sat, 17 Oct 2020 07:03:52 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id g125sm2882531wme.33.2020.10.17.07.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NCF5wa/3qOXXh6lH3vb50TSlF2Pm3DCj19abyPtcLXk=; b=suumtwTAQbeubki8d5Fe1JXlQKCnhl75w6nufIOL78DUyxW0/kkfnoeJEHkSaK/4V0 SsNU1HvPXcnqhkSiPuKJvmGcEGj6FCMS5fhFM1Mq1jpsuV7ri11oDh4lsSklPNmzauwB q53xt8u8siGkKIKH8K0uhJIbRAUfyZEO9sxptf41l2UuSpNyrPq5RMitg7bhYxT4S85H 9cyGsr1YFigKBPMfLxSaoU1CYLKHVwkCXpo1uOxbcLKrMh1E5MVT+jnj5vceC0VE0j6a FRT5zXuzhFlG0tVNbU24S3FKr4puadQvwgPnT1G0IqisorFfra+6uy3SgGbb8J1saV8I Ji/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NCF5wa/3qOXXh6lH3vb50TSlF2Pm3DCj19abyPtcLXk=; b=fz1T0P26EeflXGVxvKiNhz1Hcp59cTEdXAGXidGia79J79SoaS+kb80IpAoAUOxUvr O+NebfF/927pCmm3Ogb6m9E1FjEo795JN4lBYPTRnU8Geud2wh7QPU5r2gle1HMOLYmr WRsLwVHu2lJOKwKf5JCPK8yk6Iv/SAU2ntDHUUV89QJd885o+4no6ZG/29Hx++U/9CIO svqlm3Y2Ha6VzJ2aVGI6oLHb9BE2/ULe4vZ9boiNdtrzhiTV/iJwzK+HcRKZ1c+8ZIco sBozd4NSf9QiKgPbJMWhtTxw2VN6QKPhK9ASqF+dFjP+inZdzwpldAykPlWeBvsqrAIo rjUw== X-Gm-Message-State: AOAM53286G9yC8DroMl9tLRH44aOaCvsAxD/yCnYexLSXXKuwZL2883x bA2QtuzrLe1GDJcO21xg7HQ= X-Google-Smtp-Source: ABdhPJzcmYUUe4a7IEoN+3u18Uyyy2HBRzuoh1SaEuYDLu8X86t3dC9rXyIjzmVEPiUJSm95oclDSw== X-Received: by 2002:a1c:7c12:: with SMTP id x18mr8894969wmc.107.1602943431162; Sat, 17 Oct 2020 07:03:51 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Luc Michel Subject: [PULL 14/44] target/mips: Move cpu_mips_get_random() with CP0 helpers Date: Sat, 17 Oct 2020 16:02:13 +0200 Message-Id: <20201017140243.1078718-15-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The get_random() helper uses the CP0_Wired register, which is unrelated to the CP0_Count register used as timer. Commit e16fe40c872 ("Move the MIPS CPU timer in a separate file") incorrectly moved this get_random() helper with timer specific code. Move it back to generic CP0 helpers. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Aleksandar Markovic Reviewed-by: Luc Michel Message-Id: <20201012095804.3335117-6-f4bug@amsat.org> --- target/mips/internal.h | 2 +- target/mips/cp0_helper.c | 25 +++++++++++++++++++++++++ target/mips/cp0_timer.c | 25 ------------------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index b811f547f38..dd8a7809b64 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -144,6 +144,7 @@ void r4k_helper_tlbr(CPUMIPSState *env); void r4k_helper_tlbinv(CPUMIPSState *env); void r4k_helper_tlbinvf(CPUMIPSState *env); void r4k_invalidate_tlb(CPUMIPSState *env, int idx, int use_extra); +uint32_t cpu_mips_get_random(CPUMIPSState *env); =20 void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, @@ -209,7 +210,6 @@ void cpu_state_reset(CPUMIPSState *s); void cpu_mips_realize_env(CPUMIPSState *env); =20 /* cp0_timer.c */ -uint32_t cpu_mips_get_random(CPUMIPSState *env); uint32_t cpu_mips_get_count(CPUMIPSState *env); void cpu_mips_store_count(CPUMIPSState *env, uint32_t value); void cpu_mips_store_compare(CPUMIPSState *env, uint32_t value); diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c index de64add038b..12143ac55b9 100644 --- a/target/mips/cp0_helper.c +++ b/target/mips/cp0_helper.c @@ -203,6 +203,31 @@ static void sync_c0_entryhi(CPUMIPSState *cpu, int tc) *tcst |=3D asid; } =20 +/* XXX: do not use a global */ +uint32_t cpu_mips_get_random(CPUMIPSState *env) +{ + static uint32_t seed =3D 1; + static uint32_t prev_idx; + uint32_t idx; + uint32_t nb_rand_tlb =3D env->tlb->nb_tlb - env->CP0_Wired; + + if (nb_rand_tlb =3D=3D 1) { + return env->tlb->nb_tlb - 1; + } + + /* Don't return same value twice, so get another value */ + do { + /* + * Use a simple algorithm of Linear Congruential Generator + * from ISO/IEC 9899 standard. + */ + seed =3D 1103515245 * seed + 12345; + idx =3D (seed >> 16) % nb_rand_tlb + env->CP0_Wired; + } while (idx =3D=3D prev_idx); + prev_idx =3D idx; + return idx; +} + /* CP0 helpers */ target_ulong helper_mfc0_mvpcontrol(CPUMIPSState *env) { diff --git a/target/mips/cp0_timer.c b/target/mips/cp0_timer.c index bd7efb152dd..9c38e9da1c8 100644 --- a/target/mips/cp0_timer.c +++ b/target/mips/cp0_timer.c @@ -29,31 +29,6 @@ =20 #define TIMER_PERIOD 10 /* 10 ns period for 100 Mhz frequency */ =20 -/* XXX: do not use a global */ -uint32_t cpu_mips_get_random(CPUMIPSState *env) -{ - static uint32_t seed =3D 1; - static uint32_t prev_idx =3D 0; - uint32_t idx; - uint32_t nb_rand_tlb =3D env->tlb->nb_tlb - env->CP0_Wired; - - if (nb_rand_tlb =3D=3D 1) { - return env->tlb->nb_tlb - 1; - } - - /* Don't return same value twice, so get another value */ - do { - /* - * Use a simple algorithm of Linear Congruential Generator - * from ISO/IEC 9899 standard. - */ - seed =3D 1103515245 * seed + 12345; - idx =3D (seed >> 16) % nb_rand_tlb + env->CP0_Wired; - } while (idx =3D=3D prev_idx); - prev_idx =3D idx; - return idx; -} - /* MIPS R4K timer */ static void cpu_mips_timer_update(CPUMIPSState *env) { --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943437; cv=none; d=zohomail.com; s=zohoarc; b=PQFwTmHmd9byx9TK5c+bwVlPIOdd/oGDlqEFYnFOGe0vrk7RnX7A8l990ZpHyNjE8kJs/jkqF4FzxXTklWKZ2evK67rcMT15ZAXnykJnasWI8WUMWy15hs3M19zipd6hxt8HYzPPRoEPCqQ01mzx0v3t5AmhnAGfit19fzGaUfs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943437; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aXyjLY13V+nekeG3vOBz5nLcikYdxrMvA83lBS/TJQg=; b=LkIQP7sjivQhg0G4hT4Z+vEPGZnccAlHPclIVfSvjXNyhzKZfrFWPg9PRBFRr8IGTvcfdDqSi3lff2KCwsvY+EOBTKrtlao9Z++2z9nPcBCMg30kqZnwIhGlDg7OXanwiEP7Lr878LqH0C3nwYqfzBzXWXUA9GuyST5kCO2rgTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 1602943437745544.9824267861329; Sat, 17 Oct 2020 07:03:57 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id 13so6155490wmf.0 for ; Sat, 17 Oct 2020 07:03:57 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id p9sm7542621wma.12.2020.10.17.07.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aXyjLY13V+nekeG3vOBz5nLcikYdxrMvA83lBS/TJQg=; b=uWEl5lH+/ghH1iLYgNFh7PkEInKgeOE/u4LGKtFZmNaJrd8m8/jIgfuNaQNQlXrciV qHejafDKTKRq426DLhcNAEcCwaZ2DEiNpKojFndGqu8kckHBsckqu3v+UZFaIp68UGMq 1wtNuAmVgps/ejYzU2UfEQzyuckzxDdrxtAy1Sit65yLVdF6haRsWMkPcdzgnvmtgqkg waMLAlgvwqinGT+YJefGdtfuVWLzJ6iSI6fMnvr5wpBLZYiDVMZRQrnM3/r+Csp6X1rf N+/fj02m9zCqC+sb4W7fcCiFxE7XwVnEdeU6r/Q7Ri0N4z7+RXdiA0FaKi9i0E3oR8qC f1Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aXyjLY13V+nekeG3vOBz5nLcikYdxrMvA83lBS/TJQg=; b=Kgti0U+SGGH3fLQrO88wW9xp4K6tD9jbb5soQbvHY4NKVSeMxhEvdyrvv2MKOdnVhK xApbXFi0MW7cBiOJ152LcYQ07P6L+qeMl3JOdlh2EVgfxBrJ1ObrOSFX1e4qE4QqVhxR xRsnpnIpMpwLsCY77rGQthTjvzk1+6W9cqA0VdHt7uu+W55hUuGnvdBBE30Bwk80Ok1/ oE9d0vwX4Tq4mrrceIsXyAFYLx6QLSmfaXAWIM3pFHUN78sCkzZzW9A/BCBkYrPuDuDX q7OhNfjuVDZGwaj0QpMMKLHeAXrVYr77j9VQMUDUX/jFooIgIXkvVuTnSw8MFdtOCKFj jqGA== X-Gm-Message-State: AOAM531MuQWcm/0u955uOnHvSQQA2CsIgLUCyhQYbCYglkFk2NSIDwWz A4KxlocJtCsWKk2YVpKjRUo= X-Google-Smtp-Source: ABdhPJzwhW4mVi+f5x9wTnteifaIaWY7KcxpRoe6uMfIps/QYOVtdq/BcMmkU6mlXFvML8NSqsAC1A== X-Received: by 2002:a1c:7707:: with SMTP id t7mr9214439wmi.54.1602943435807; Sat, 17 Oct 2020 07:03:55 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic Subject: [PULL 15/44] target/mips/cp0_timer: Explicit unit in variable name Date: Sat, 17 Oct 2020 16:02:14 +0200 Message-Id: <20201017140243.1078718-16-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Name variables holding nanoseconds with the '_ns' suffix. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Aleksandar Markovic Message-Id: <20201012095804.3335117-7-f4bug@amsat.org> --- target/mips/cp0_timer.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/target/mips/cp0_timer.c b/target/mips/cp0_timer.c index 9c38e9da1c8..5194c967ae3 100644 --- a/target/mips/cp0_timer.c +++ b/target/mips/cp0_timer.c @@ -32,13 +32,14 @@ /* MIPS R4K timer */ static void cpu_mips_timer_update(CPUMIPSState *env) { - uint64_t now, next; + uint64_t now_ns, next_ns; uint32_t wait; =20 - now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - wait =3D env->CP0_Compare - env->CP0_Count - (uint32_t)(now / TIMER_PE= RIOD); - next =3D now + (uint64_t)wait * TIMER_PERIOD; - timer_mod(env->timer, next); + now_ns =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + wait =3D env->CP0_Compare - env->CP0_Count - + (uint32_t)(now_ns / TIMER_PERIOD); + next_ns =3D now_ns + (uint64_t)wait * TIMER_PERIOD; + timer_mod(env->timer, next_ns); } =20 /* Expire the timer. */ @@ -56,16 +57,16 @@ uint32_t cpu_mips_get_count(CPUMIPSState *env) if (env->CP0_Cause & (1 << CP0Ca_DC)) { return env->CP0_Count; } else { - uint64_t now; + uint64_t now_ns; =20 - now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + now_ns =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); if (timer_pending(env->timer) - && timer_expired(env->timer, now)) { + && timer_expired(env->timer, now_ns)) { /* The timer has already expired. */ cpu_mips_timer_expire(env); } =20 - return env->CP0_Count + (uint32_t)(now / TIMER_PERIOD); + return env->CP0_Count + (uint32_t)(now_ns / TIMER_PERIOD); } } =20 --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) client-ip=209.85.221.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943442; cv=none; d=zohomail.com; s=zohoarc; b=IA+v3DO8kgEiTuGfptPNVUmRDAtuWgtcsLxsTB81jDq/WPs2j7iHLO66xBjMVgdoMtno0IYvnB6UT5uDD8Zb/BWbFuGRX+iGlAm0w7pXzrl5twmfpMRO+rgaAyTsI7yD1+djHhZmv17/Z2/NANGkWqBKBB213qtTS+ej+Rmczvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943442; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2FVvaalxt9KuyVeDEZxGfM43cusXrs9xwV/O2dDwsxY=; b=Ka7HssjV14YamU/2gd6XsJbzYqao8oqRRfDZFVbZHC7a6f0z8MFMHptJxDA/NVXDdtAsY4GV5OBfcpiNBga0+pBalBa1tOLKRCA1+f5PpXR3UGd7xJssMeZIdc44Vxi9RGsk88gsmR3sd3j6GxFhKn9PDvt2rlajHXAVSUW6qmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.zohomail.com with SMTPS id 1602943442424668.8491645048199; Sat, 17 Oct 2020 07:04:02 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id y12so6584046wrp.6 for ; Sat, 17 Oct 2020 07:04:01 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id v6sm2513056wrp.69.2020.10.17.07.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2FVvaalxt9KuyVeDEZxGfM43cusXrs9xwV/O2dDwsxY=; b=NKou7XW2LX2dAxn4rUen0yaVzk6YArYrWPmqTWKPE1ItLr9udQ6PRnYFz9roqCbLWe E8PCFZeIX4IsehVtuO7bOfY+XBgr8B+35b4wo/NIibDIlScQmQVMD9kzVsgLSWAQUmVS ZOGsXbybCNO6gf/e+o97fk1+pebkIm4KQZnR6D3/b9gVUjKC/HNTOgR04FQTh1Vbu2xH bjJlUaIXTrMeqQXnvPEnxlCnSI0DXFR3AXkp50r272vnG1WsAzxKvX7MoCNxpA9XgZTx DXe03O9z4sfVjb705JYK1OV0eewgFZZI1KNS2GlA9lPr0QuLjAIb1JNncx7b6rEzy/tN N9Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2FVvaalxt9KuyVeDEZxGfM43cusXrs9xwV/O2dDwsxY=; b=iUpur9xXKBexjpALo8ppgVCZ66tyizw5gll0b7ia6B/VNn8tStDyj2Frb/QRoOB/ET 1VvT1Cv97B73jVvUww5JUFZnjd3/gsz5fSevlEeNMQBdNLaKjT6a6+AZSIm1a+eOCj/N RWpc4HWx91s/+EcPhfKLlV+c9GFW0BmcUwn+YwE8b/YRMf4NRfNMl8P1bBVFfClgih4n BDzMp2KawkKW93D2jvFSU6yNvlmh0NLlV3bIn3Bir+jpAcjvF7yjBtinb8YTV2katp62 WW9ibUn5PKi0ZS5VNg/lHUhYG/OsJy+olIO7z2wYrnEu2gAYuH+MSl3ZLxluOtRkKz1d zeLQ== X-Gm-Message-State: AOAM530IBh2ibOvUHBkGFaFfKMgtCjWfW8i4cbeTvBcEumRsehnRhgCK SmCrnvf9ToOVDMEvVyPe9Bc= X-Google-Smtp-Source: ABdhPJwaxVpBDw5kswerHJ3ikoQELPQx9A8fgB9uFCVmxntpUPa0jEEdvKD70zdGvuCCyVjKNmAXig== X-Received: by 2002:adf:84a5:: with SMTP id 34mr10949494wrg.152.1602943440609; Sat, 17 Oct 2020 07:04:00 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 16/44] target/mips/cp0_timer: Document TIMER_PERIOD origin Date: Sat, 17 Oct 2020 16:02:15 +0200 Message-Id: <20201017140243.1078718-17-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) TIMER_PERIOD value of '10 ns' can be explained looking at commit 6af0bf9c7c3doc, where the CPU frequency is 200 MHz and CP0 default count rate is half the frequency of the CPU. Document that. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-8-f4bug@amsat.org> --- target/mips/cp0_timer.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/mips/cp0_timer.c b/target/mips/cp0_timer.c index 5194c967ae3..6fec5fe0ff7 100644 --- a/target/mips/cp0_timer.c +++ b/target/mips/cp0_timer.c @@ -27,7 +27,17 @@ #include "sysemu/kvm.h" #include "internal.h" =20 -#define TIMER_PERIOD 10 /* 10 ns period for 100 Mhz frequency */ +/* + * Since commit 6af0bf9c7c3 this model assumes a CPU clocked at 200MHz + * and a CP0 timer running at half the clock of the CPU (cp0_count_rate = =3D 2). + * + * TIMER_FREQ_HZ =3D CPU_FREQ_HZ / CP0_COUNT_RATE =3D 200 MHz / 2 =3D 100 = MHz + * + * TIMER_PERIOD_NS =3D 1 / TIMER_FREQ_HZ =3D 10 ns + */ +#define CPU_FREQ_HZ_DEFAULT 200000000 +#define CP0_COUNT_RATE_DEFAULT 2 +#define TIMER_PERIOD 10 /* 1 / (CPU_FREQ_HZ / CP0_COUNT_RATE) = */ =20 /* MIPS R4K timer */ static void cpu_mips_timer_update(CPUMIPSState *env) --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943447; cv=none; d=zohomail.com; s=zohoarc; b=O4t1q7G8QHWvJ/IGZTJpn2c0jwrjkBdtjMEtNE+k8uaXIqFAxPOv/lj9C1buZsPnuR5OFTwCoKBJEvlVGqzHtV5VZV7FEcpK4kgLKKn/3qClPrgn0kBkE8afaRypFJ76K23aYLjc4LtHFecv7XZhutoqp/N8FUpUZIgAmYc4DrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943447; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sUvsBgE8lqeGgpqBP2TiIkm6s4bhzj/3ycAdv64yLQA=; b=ABs2nOW/mJFzGZdEjQNjQBF555AmEjwGV/hyJKgrPsVyZTfXJJ3jIcI1/i+dlXndqW/3SRoKfOWsT8HHeLDPIHU+75OKwuQ5XRiSwdUvrjm9eD2JEjXoVKztvC+NensRF7nLE13ccQ8y4PqHC0aeKPT7tIKDYS83XAja+3jssik= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1602943447199340.17219349219215; Sat, 17 Oct 2020 07:04:07 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id h7so6603007wre.4 for ; Sat, 17 Oct 2020 07:04:06 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id z11sm8559575wrh.70.2020.10.17.07.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sUvsBgE8lqeGgpqBP2TiIkm6s4bhzj/3ycAdv64yLQA=; b=Pp7diaAgsS4FJ7mRd+CTmuBBGj9+4eZFWSgA7UjfBNWwNRCjejmzgKhcTs4FopZmFI q57zf1mmSZB1FSB5rgr0/H6XPskLG6qyKl+CXIrtY5AcAjJCF9MC6bZUsgOoBMFJjrlE iSZVbizlXj+CO5aYYq1RJzpPwqUeCnFXTaATcCyZbL/syGmtMhiZcifm5yE4ZLQFxOuN CqrqSwHxolrTTsvvwLjUMwYfLcGvXPIO1hYoRMQTQLvyeF53a9zAhQkdRhZSZlGV/R8I lSlW5pdVdr8Cy3a6K7xTplCE78lVyJ7cChNNj+d6TTUX/S6i/2YLIkp5qUlqdNbVzpbZ SFkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sUvsBgE8lqeGgpqBP2TiIkm6s4bhzj/3ycAdv64yLQA=; b=Y8AYkj1Gou95LFobXGrjjcyfNQFKlPFAQv/MbDd5rVdC6nmyZKqy1PLm/+PfIZoXEI v8eVA8UV4ub1vSm75EQNctzQNYObwlDF3kW9Ni3P8txBTTICqtW2XRdXGx1wNp6rAY4Q vhJ9+ngfXBUfjEylJvvJCprZGns4LWbHbij+grCZq4ZIqyyPZxEsgihLrEftvVXAkD02 bYeLg7P/p7HeAd0Alxz+3SIY/nv08u91Ic3bkCRvq4pDPI+O912oBPJ8Pb0NOi0Z1Ra3 tfIxxmJJQjcsgP0Ojs4UVy9qWGrzz1KmYIt4clS5SgxXMn8HFfqYqrGF7jBK+mhpgYCz r1XA== X-Gm-Message-State: AOAM530G3iZ3AOWc9JFEuOpO2rFNX2eTRqXBLWsXZ41LC/buPftLb2z1 eC3uRMdmwRZYmVukt1egFQI= X-Google-Smtp-Source: ABdhPJxsueWVIAKlVmpmTj2PWDv7ldxqtapggtb6nMpfS2wwKjTxCzVRsLtXL0K1ofNTwSlCh/Z0Vw== X-Received: by 2002:adf:84a5:: with SMTP id 34mr10949869wrg.152.1602943445414; Sat, 17 Oct 2020 07:04:05 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 17/44] target/mips: Move cp0_count_ns to CPUMIPSState Date: Sat, 17 Oct 2020 16:02:16 +0200 Message-Id: <20201017140243.1078718-18-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Currently the CP0 timer period is fixed at 10 ns, corresponding to a fixed CPU frequency of 200 MHz (using half the speed of the CPU). In few commits we will be able to use a different CPU frequency. In preparation, move the cp0_count_ns variable to CPUMIPSState so we can modify it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Message-Id: <20201012095804.3335117-9-f4bug@amsat.org> --- target/mips/cpu.h | 1 + target/mips/cp0_timer.c | 23 ++++++----------------- target/mips/cpu.c | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 7cf7f5239f7..085a88e9550 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1145,6 +1145,7 @@ struct CPUMIPSState { struct MIPSITUState *itu; MemoryRegion *itc_tag; /* ITC Configuration Tags */ target_ulong exception_base; /* ExceptionBase input to the core */ + uint64_t cp0_count_ns; /* CP0_Count clock period (in nanoseconds) */ }; =20 /** diff --git a/target/mips/cp0_timer.c b/target/mips/cp0_timer.c index 6fec5fe0ff7..5ec0d6249e9 100644 --- a/target/mips/cp0_timer.c +++ b/target/mips/cp0_timer.c @@ -27,18 +27,6 @@ #include "sysemu/kvm.h" #include "internal.h" =20 -/* - * Since commit 6af0bf9c7c3 this model assumes a CPU clocked at 200MHz - * and a CP0 timer running at half the clock of the CPU (cp0_count_rate = =3D 2). - * - * TIMER_FREQ_HZ =3D CPU_FREQ_HZ / CP0_COUNT_RATE =3D 200 MHz / 2 =3D 100 = MHz - * - * TIMER_PERIOD_NS =3D 1 / TIMER_FREQ_HZ =3D 10 ns - */ -#define CPU_FREQ_HZ_DEFAULT 200000000 -#define CP0_COUNT_RATE_DEFAULT 2 -#define TIMER_PERIOD 10 /* 1 / (CPU_FREQ_HZ / CP0_COUNT_RATE) = */ - /* MIPS R4K timer */ static void cpu_mips_timer_update(CPUMIPSState *env) { @@ -47,8 +35,8 @@ static void cpu_mips_timer_update(CPUMIPSState *env) =20 now_ns =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); wait =3D env->CP0_Compare - env->CP0_Count - - (uint32_t)(now_ns / TIMER_PERIOD); - next_ns =3D now_ns + (uint64_t)wait * TIMER_PERIOD; + (uint32_t)(now_ns / env->cp0_count_ns); + next_ns =3D now_ns + (uint64_t)wait * env->cp0_count_ns; timer_mod(env->timer, next_ns); } =20 @@ -76,7 +64,7 @@ uint32_t cpu_mips_get_count(CPUMIPSState *env) cpu_mips_timer_expire(env); } =20 - return env->CP0_Count + (uint32_t)(now_ns / TIMER_PERIOD); + return env->CP0_Count + (uint32_t)(now_ns / env->cp0_count_ns); } } =20 @@ -92,7 +80,8 @@ void cpu_mips_store_count(CPUMIPSState *env, uint32_t cou= nt) } else { /* Store new count register */ env->CP0_Count =3D count - - (uint32_t)(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) / TIMER_PE= RIOD); + (uint32_t)(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) / + env->cp0_count_ns); /* Update timer timer */ cpu_mips_timer_update(env); } @@ -119,7 +108,7 @@ void cpu_mips_stop_count(CPUMIPSState *env) { /* Store the current value */ env->CP0_Count +=3D (uint32_t)(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) / - TIMER_PERIOD); + env->cp0_count_ns); } =20 static void mips_timer_cb(void *opaque) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index e86cd065483..84b727fefa8 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -134,6 +134,25 @@ static void mips_cpu_disas_set_info(CPUState *s, disas= semble_info *info) } } =20 +/* + * Since commit 6af0bf9c7c3 this model assumes a CPU clocked at 200MHz + * and a CP0 timer running at half the clock of the CPU (cp0_count_rate = =3D 2). + * + * TIMER_FREQ_HZ =3D CPU_FREQ_HZ / CP0_COUNT_RATE =3D 200 MHz / 2 =3D 100 = MHz + * + * TIMER_PERIOD_NS =3D 1 / TIMER_FREQ_HZ =3D 10 ns + */ +#define CPU_FREQ_HZ_DEFAULT 200000000 +#define CP0_COUNT_RATE_DEFAULT 2 +#define TIMER_PERIOD_DEFAULT 10 /* 1 / (CPU_FREQ_HZ / CP0_COUNT_RATE) = */ + +static void mips_cp0_period_set(MIPSCPU *cpu) +{ + CPUMIPSState *env =3D &cpu->env; + + env->cp0_count_ns =3D TIMER_PERIOD_DEFAULT; +} + static void mips_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs =3D CPU(dev); @@ -141,6 +160,8 @@ static void mips_cpu_realizefn(DeviceState *dev, Error = **errp) MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 + mips_cp0_period_set(cpu); + cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) client-ip=209.85.221.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943452; cv=none; d=zohomail.com; s=zohoarc; b=SRJhPGzn/ZuKvJQhOC5beLxHxyZ0DOa5ovpF2Im26nD8F3aBgPrtuDaaSRhBYttFR0d1nD0mjMiVRH+TJcFXJYZzDlD5SJWiHRX8H8EWRkKb9A8x1tSdaTTgIlZmIQzmLAL1ACXyy699eOq5SUw+CKxTWA0xMk24NkDWP+SLRMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943452; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EoLM8gvWk7ZVJDk5Ugq+9PdMiF3+TcSdw5xHGqfrZN8=; b=L4Utyr6Bejp1zY/cDVGpj6Uw7J/VMQjNy2VYh+A2Uiina7SkBGt9K/AxxCvwvRplClKA+AR/4tCDp6eyKZfjpk8ieBfIyvZ7WqsYSArUAbWsGmRxS3AQpXNa3FO7+C+FLqQq264V37o/QDSZu7jiFuCR/HLTkk/D1SBWy+Dd9Hw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.zohomail.com with SMTPS id 1602943452005202.70741559609985; Sat, 17 Oct 2020 07:04:12 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id j7so2486752wrt.9 for ; Sat, 17 Oct 2020 07:04:11 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id b63sm7974074wme.9.2020.10.17.07.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EoLM8gvWk7ZVJDk5Ugq+9PdMiF3+TcSdw5xHGqfrZN8=; b=rOGUa/GVpWMOcktgSkuB/yxzdAsyiHmH8WeRr+G42/91mqh/buduQj09nZvxup5et1 u/qTkDklO+uWDOA1MhcvHXo4gAo4TSZmQtgFYVcP1faOWampFErDr4Yga1mBdyUj3l1o GXa7Nn3Q6DsWux6hfvKDwuCF7feok3AUiLxLQoW7jFS25wnlVordSOa/o5PRkUC73+fN jA4Mpcf0WK3hFb6yEvtnbQYlEELkn2NxCdKiJWY7yozxppBcrpFtAShVTq5UwIu+ptyR ZuXDZMPsq2k8pK8ZeXkLOqjL8tsRiq0/lRXd7EvTXWqrsvN5ofEVKBQpNkt5xkTHSDnB MEqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=EoLM8gvWk7ZVJDk5Ugq+9PdMiF3+TcSdw5xHGqfrZN8=; b=s2H24un5mO5yFaE4ijL3RG8rj/1jlhJfDFaabXOTS/9c8oMovPqlkY/BJi6SLHRj6i AEhsjjwnvJDGYvTleDbvbvQH0aeuaz8WNcoNnQNhAf2Hfnr2pEbia4K0lZwhMRVAI+4k vEPYzrzK0INF0eIea2VBtlNcqv8jrnpM4vhtuTTsdEUQb0k+ihXttVctpJAIEsAy7Azu 724QWRb++VbixBZAuR+QU4n8YE9zlNAO8mVZvlaOXvIpWnsFFKEaW80IXjk5g9JnPhPm Mxc/ycXZ+84ocUepyY1clVveUFhMBoUMo8Pa7NDLIMBkY2EcmePUav2k5IdIjiHggP/E Wmjg== X-Gm-Message-State: AOAM533rLSacxUNPCl2sz2xJ7k3aoVpH9RDgJ4eq7E618qhsy9Gk42Rc 3l0R/jmwVuLwtig9+4m/0Rc= X-Google-Smtp-Source: ABdhPJxwfyxk+TXFvJ3itVfPw2N+gSVgFd4s6tmT4v7nboGFj6/glGu27R2NZAZZuC37M5cJK+kqQw== X-Received: by 2002:adf:e94b:: with SMTP id m11mr10140558wrn.35.1602943450064; Sat, 17 Oct 2020 07:04:10 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 18/44] target/mips/cpu: Calculate the CP0 timer period using the CPU frequency Date: Sat, 17 Oct 2020 16:02:17 +0200 Message-Id: <20201017140243.1078718-19-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The CP0 timer period is a function of the CPU frequency. Start using the default values, which will be replaced by properties in the next commits. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Message-Id: <20201012095804.3335117-10-f4bug@amsat.org> --- target/mips/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 84b727fefa8..46188139b7b 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -144,13 +144,13 @@ static void mips_cpu_disas_set_info(CPUState *s, disa= ssemble_info *info) */ #define CPU_FREQ_HZ_DEFAULT 200000000 #define CP0_COUNT_RATE_DEFAULT 2 -#define TIMER_PERIOD_DEFAULT 10 /* 1 / (CPU_FREQ_HZ / CP0_COUNT_RATE) = */ =20 static void mips_cp0_period_set(MIPSCPU *cpu) { CPUMIPSState *env =3D &cpu->env; =20 - env->cp0_count_ns =3D TIMER_PERIOD_DEFAULT; + env->cp0_count_ns =3D muldiv64(NANOSECONDS_PER_SECOND, CP0_COUNT_RATE_= DEFAULT, + CPU_FREQ_HZ_DEFAULT); } =20 static void mips_cpu_realizefn(DeviceState *dev, Error **errp) --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) client-ip=209.85.221.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943456; cv=none; d=zohomail.com; s=zohoarc; b=mfLy5aEkPiZUHnWrk0rohAm4O4U8+1Nkl8JeIVk+AnM5keBcV5MRyB417KFT4yvs2AhA2UhT6M0calK+qr+oXcPnHGSQDEB6WlyFhQIQOmQhuA712TUnp3k2f/znOE/pAWUv3ADPrgvsfH4vZHdq2SnK+sSAkrVrJEjG8ZeH8B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943456; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gcSFIGw0lHwM+wP/lVQPID0kXeFa2b1r5NkvHKAKJbE=; b=C4nvUJDZ3FuMkEfhSigx54T2/MATPnVxG4gGb/m605hUlU7ZnnqHlWBMUWCrFPVNGV4FyZqbtFEgiEbjIDjqVAE5KUa4vs84AIptaD4ilgg5zycdQhMJCVJbLm8xUxtFS9i8WNs3naP1de1ONOW2cofGszW/osYTU+W4OlLN9Y0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.zohomail.com with SMTPS id 1602943456501615.8941275577398; Sat, 17 Oct 2020 07:04:16 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id t9so6551861wrq.11 for ; Sat, 17 Oct 2020 07:04:15 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id t12sm8996734wrm.25.2020.10.17.07.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gcSFIGw0lHwM+wP/lVQPID0kXeFa2b1r5NkvHKAKJbE=; b=MpwL15+QPtIZ6xCu9ADESAqOwHrqfRTIZdDmRTaFxyMJUMPCzJnwXCMdYuYQUH4sRD AQYDr0mxi0MePgS2QoZYDvVa8jepqDiH6nYmxJo6DkWQep9nHkjBKkuYk417keIAL+z7 mGz/oWrNdG0wzGvx38Dds5ERj5vv0noEls5of+E6bepKb1T6kiSnTvQhA/7HHnyw+Gtu 9YufzxmlUA6fOrM64zj5JIASKnfE3hb/7F1/+BYQdLlUXG1Tx8C1r2seCxfa7xJNlMyx kr8jTeN+s0NB9Zwy3mHOv9F/gMGXurpkGoBxrR6hlTAgJ9tRZUdEBcjPOafFJf1pomhs l8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gcSFIGw0lHwM+wP/lVQPID0kXeFa2b1r5NkvHKAKJbE=; b=eDnTKsV81kON2T6fGHOP+igdSCgT3nqBwnBgtEptr6os+iNSnk1X7ucp393kjaJYt5 nS3dTdOyVTcx6mxTGnH3PehZLzuvchoqjyYTuvLoFxt1SNM+GG8d/+mZNyRbQn2+jT/Y K5OidhFGqpCuWkzRdEsbw3y1yiZuKShuT63kJOKnDmaL8jnXqVYuyuGUQi2QhtpLxCbl 5LSULMsXVwWY2N8Lt+EV0AHaItLzW1aP4ONM1dNn7Q2sJaK5nUocKNLFY6IXOLxEny+1 gmIwKbOGD0nh5evIaQQlSxV6DrRxYMrmYxx45MTxWVcsjGcUBFlrA2JAWg5fSn1PLBdV iNog== X-Gm-Message-State: AOAM533WP48WEmXoPyV0zUcrDy88YFHaOIiKKJL6Awapq/wtf9JDviVE GWq49RQXOOsaKMPxNwQvii8= X-Google-Smtp-Source: ABdhPJzRtyBDoPYqNfT0aWPyzm/wJqvJoIlqEmjN9V64pFenmfVscg+msq3e/MvC4ANacWN21ug0Rw== X-Received: by 2002:a05:6000:1112:: with SMTP id z18mr10086418wrw.3.1602943454712; Sat, 17 Oct 2020 07:04:14 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 19/44] target/mips/cpu: Make cp0_count_rate a property Date: Sat, 17 Oct 2020 16:02:18 +0200 Message-Id: <20201017140243.1078718-20-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Since not all CPU implementations use a cores use a CP0 timer at half the frequency of the CPU, make this variable a property. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-11-f4bug@amsat.org> --- target/mips/cpu.h | 9 +++++++++ target/mips/cpu.c | 19 +++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 085a88e9550..baeceb892ef 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1151,6 +1151,7 @@ struct CPUMIPSState { /** * MIPSCPU: * @env: #CPUMIPSState + * @cp0_count_rate: rate at which the coprocessor 0 counter increments * * A MIPS CPU. */ @@ -1161,6 +1162,14 @@ struct MIPSCPU { =20 CPUNegativeOffsetState neg; CPUMIPSState env; + /* + * The Count register acts as a timer, incrementing at a constant rate, + * whether or not an instruction is executed, retired, or any forward + * progress is made through the pipeline. The rate at which the counter + * increments is implementation dependent, and is a function of the + * pipeline clock of the processor, not the issue width of the process= or. + */ + unsigned cp0_count_rate; }; =20 =20 diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 46188139b7b..461edfe22b7 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -26,7 +26,7 @@ #include "qemu/module.h" #include "sysemu/kvm.h" #include "exec/exec-all.h" - +#include "hw/qdev-properties.h" =20 static void mips_cpu_set_pc(CPUState *cs, vaddr value) { @@ -135,12 +135,7 @@ static void mips_cpu_disas_set_info(CPUState *s, disas= semble_info *info) } =20 /* - * Since commit 6af0bf9c7c3 this model assumes a CPU clocked at 200MHz - * and a CP0 timer running at half the clock of the CPU (cp0_count_rate = =3D 2). - * - * TIMER_FREQ_HZ =3D CPU_FREQ_HZ / CP0_COUNT_RATE =3D 200 MHz / 2 =3D 100 = MHz - * - * TIMER_PERIOD_NS =3D 1 / TIMER_FREQ_HZ =3D 10 ns + * Since commit 6af0bf9c7c3 this model assumes a CPU clocked at 200MHz. */ #define CPU_FREQ_HZ_DEFAULT 200000000 #define CP0_COUNT_RATE_DEFAULT 2 @@ -149,7 +144,7 @@ static void mips_cp0_period_set(MIPSCPU *cpu) { CPUMIPSState *env =3D &cpu->env; =20 - env->cp0_count_ns =3D muldiv64(NANOSECONDS_PER_SECOND, CP0_COUNT_RATE_= DEFAULT, + env->cp0_count_ns =3D muldiv64(NANOSECONDS_PER_SECOND, cpu->cp0_count_= rate, CPU_FREQ_HZ_DEFAULT); } =20 @@ -202,6 +197,13 @@ static ObjectClass *mips_cpu_class_by_name(const char = *cpu_model) return oc; } =20 +static Property mips_cpu_properties[] =3D { + /* CP0 timer running at half the clock of the CPU */ + DEFINE_PROP_UINT32("cp0-count-rate", MIPSCPU, cp0_count_rate, + CP0_COUNT_RATE_DEFAULT), + DEFINE_PROP_END_OF_LIST() +}; + static void mips_cpu_class_init(ObjectClass *c, void *data) { MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(c); @@ -211,6 +213,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *d= ata) device_class_set_parent_realize(dc, mips_cpu_realizefn, &mcc->parent_realize); device_class_set_parent_reset(dc, mips_cpu_reset, &mcc->parent_reset); + device_class_set_props(dc, mips_cpu_properties); =20 cc->class_by_name =3D mips_cpu_class_by_name; cc->has_work =3D mips_cpu_has_work; --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) client-ip=209.85.221.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943461; cv=none; d=zohomail.com; s=zohoarc; b=FuoBuMRob8Ea6pQCa9W+soFF7opzCEDxMg/oZ4+C+yRF+HEOHB+u5UusEIF4OB4w3teIwh82Ws0/2Rsgaov+ldHWgyGzv/kTUJotjM67qQDWaPBSp29D2gz3mvzWgE6AJlx4yrIun1V/7khzVewkSECcPh6i8w18IqLombx9byE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943461; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W1xmpo/5MfSfKCcSEfsWJ/X7/um0Ds1jiMaA9HUX9Bo=; b=MLHo2gdCUC3IhJVzVO9xx4FWDrvI8+ExhN8lJ8PZIwUUR9uRak+uwYUYZNwT3wrnjwgzbFnaHDzvTQQFSJBZTDsVDw9VtDI+pD8tHX5Wz2TvCBbMZ1MJUPEkAiiFaVBCFLbWnwvlXQmmMW8sjqijzEJ8jAuGlbWmsWZLyyHcUvA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.zohomail.com with SMTPS id 1602943461200825.7693581741448; Sat, 17 Oct 2020 07:04:21 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id g12so6554933wrp.10 for ; Sat, 17 Oct 2020 07:04:20 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id a5sm8534104wrt.80.2020.10.17.07.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W1xmpo/5MfSfKCcSEfsWJ/X7/um0Ds1jiMaA9HUX9Bo=; b=KtOnN8dKwibawyLQvWOSFczv1Fl0qnl9KUyyzxbdNuCofXQdOKlZ4HoFUramyVFwXT NYGTTGzwxvDIvBx8Z5pwEkXVy0i79W+sI072U0gecAa5QBy1pYGzw4MJZ94C/MBDEXhC btfczzsVLmv0a+IT4P7cNGZlto0QJmrkFC5bmAxEi/Iker7gR05388smKHyY97rT0thA n3Z0xu8oQZt+EVuNa3FK459czh4DGYGst6feyW+N9/yBUSYgKKBYciGpf+8Q1nb5DQsr qkxyKawsnI0Cj4vjM2p0f311IXE3wtBBCUrhUE5FbmrPerfX4M8wI7YYxHqIHQWX8tWt L6fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=W1xmpo/5MfSfKCcSEfsWJ/X7/um0Ds1jiMaA9HUX9Bo=; b=NoK+3inU8Ae2qRHfFw6y4M+g7f/DZBTVUZxcN/tP1OIrdJFfXt2LNXpbOeJ0YmZ9qn B9D1gRJ+CACss9x5t8RMaoxDcdzaowclgwj7dTPJgE3GrSlxOFpEdZxRNyoRA5jWaaq4 QBup/lP/zeuQA7WEDQrNCCCZTbYVT76IPcxiEMPQLU9xf2Sk7eNXSZ53ByqDeWY89Py0 hlFszDMrOymEKtM+EZnCmb4P2cWFZPaPfQgPNM0tz4x7fX+p3FyO0bVvuMtq1SdDOXOS COTVOIaCJhXCuyWVk7zgDEDSAf7XiJ3IaUIrzQzu1NjUKfxrIOHD30GNGUYMDmHQbHT3 mkAA== X-Gm-Message-State: AOAM533heCHwD3lgqEH7XnJUwXLX0q3DcHCEa29hk24wCK93i5p4EeLB l8mCI/xhTKUNgc64B7U64wI= X-Google-Smtp-Source: ABdhPJxUlnucNXeT2QVKz5gX2ey58V5Rifh27Yz6DKm8DXt+w271KKAGtptfKQ52Tk/5KYkPYijy8w== X-Received: by 2002:adf:f212:: with SMTP id p18mr10624065wro.386.1602943459329; Sat, 17 Oct 2020 07:04:19 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 20/44] target/mips/cpu: Allow the CPU to use dynamic frequencies Date: Sat, 17 Oct 2020 16:02:19 +0200 Message-Id: <20201017140243.1078718-21-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Use the Clock API and let the CPU object have an input clock. If no clock is connected, keep using the default frequency of 200 MHz used since the introduction of the 'r4k' machine in commit 6af0bf9c7c3. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-12-f4bug@amsat.org> --- target/mips/cpu.h | 4 ++++ target/mips/cpu.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index baeceb892ef..062a4ba6225 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -4,6 +4,7 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat-types.h" +#include "hw/clock.h" #include "mips-defs.h" =20 #define TCG_GUEST_DEFAULT_MO (0) @@ -1151,6 +1152,8 @@ struct CPUMIPSState { /** * MIPSCPU: * @env: #CPUMIPSState + * @clock: this CPU input clock (may be connected + * to an output clock from another device). * @cp0_count_rate: rate at which the coprocessor 0 counter increments * * A MIPS CPU. @@ -1160,6 +1163,7 @@ struct MIPSCPU { CPUState parent_obj; /*< public >*/ =20 + Clock *clock; CPUNegativeOffsetState neg; CPUMIPSState env; /* diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 461edfe22b7..2a6f4840e20 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -27,6 +27,7 @@ #include "sysemu/kvm.h" #include "exec/exec-all.h" #include "hw/qdev-properties.h" +#include "hw/qdev-clock.h" =20 static void mips_cpu_set_pc(CPUState *cs, vaddr value) { @@ -144,8 +145,9 @@ static void mips_cp0_period_set(MIPSCPU *cpu) { CPUMIPSState *env =3D &cpu->env; =20 - env->cp0_count_ns =3D muldiv64(NANOSECONDS_PER_SECOND, cpu->cp0_count_= rate, - CPU_FREQ_HZ_DEFAULT); + env->cp0_count_ns =3D cpu->cp0_count_rate + * clock_get_ns(MIPS_CPU(cpu)->clock); + assert(env->cp0_count_ns); } =20 static void mips_cpu_realizefn(DeviceState *dev, Error **errp) @@ -155,6 +157,10 @@ static void mips_cpu_realizefn(DeviceState *dev, Error= **errp) MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 + if (!clock_get(cpu->clock)) { + /* Initialize the frequency in case the clock remains unconnected.= */ + clock_set_hz(cpu->clock, CPU_FREQ_HZ_DEFAULT); + } mips_cp0_period_set(cpu); =20 cpu_exec_realizefn(cs, &local_err); @@ -178,6 +184,7 @@ static void mips_cpu_initfn(Object *obj) MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(obj); =20 cpu_set_cpustate_pointers(cpu); + cpu->clock =3D qdev_init_clock_in(DEVICE(obj), "clk-in", NULL, cpu); env->cpu_model =3D mcc->cpu_def; } =20 --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) client-ip=209.85.128.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943466; cv=none; d=zohomail.com; s=zohoarc; b=PGoIfXJe03DjveDZ+FA+zQrtwVKAy6YZGfse+mJQovHhbuGN94+mhszL2qwjBfRI+FVZIu/6s/9WuLPM+H3DHLDjz++x13+yJ0XL7gaQWLwGw8r1AIMP9TA4F+/Zsfg/q/lcPuTMeqXxd5HyfC6a6CeuaQir9Sx2y4zd7Pc7jz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BklhIgKFSOdOqleMIJMmYJg6l2FwjmXRFUfsBtmjdmE=; b=JAwmsn4jL8lbNZYz68SsN581U47vtJ8Cuuz66C1q68g2mJmQ7zNL3A1KD+1McDzukaXte9HrkB2yGvKCCVE+Q8FDGF5zHE9HDPBgOFAK/HKcKoPXJCQoouSUYcDm1K+A1hJq9Ntqfh6M23mOykKJ6PbJcUqL1DxdcLV3y/InaAw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.zohomail.com with SMTPS id 1602943466056652.7649511119557; Sat, 17 Oct 2020 07:04:26 -0700 (PDT) Received: by mail-wm1-f50.google.com with SMTP id j136so8389532wmj.2 for ; Sat, 17 Oct 2020 07:04:25 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id 71sm9193904wrm.20.2020.10.17.07.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BklhIgKFSOdOqleMIJMmYJg6l2FwjmXRFUfsBtmjdmE=; b=Q+JCPHlq/DYZLexc9+fHEYfpRGQNJw8PQC6wSfH5S6T84aziVpx/nfirns0LvCF/qk NnkhymGy8S06n4Yq2JPIqOuH/+o+qMpcvBjKKfxSZu7GRqfjSBJsBfAr6THdI19jpKED GeiQyJnvdiaJnJLi2kiBrZdIovPpLR3/IvrBEl40ig9u71M/3Zj5uoCOnrBgmHy7n+hu 8/9iVR+y0hZII057IO3rJhGWTadq6ML9mlf3EQS2mn5UWsEjvVz5er93Ovkc3P4wjt0U tOclgZ5jlsVodXEZZHE1NGLzjolUPI9nxi3jD6nKr55SHBLmhvB16uebwtR3XvV99tUb A+Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BklhIgKFSOdOqleMIJMmYJg6l2FwjmXRFUfsBtmjdmE=; b=EuQYbmGq5dCPcyJiiI7WHHwYFIpHQ3LCQga5Djz8ypoLvpbTXhI8kHTbvlBJYReyab XU6t4i2X/qOP819DpV5ncOOvT7D2xG7wYdQDTxBJ2ybhpb97m05Pz8bpCT44RnnUhzxa mgiCnblDsHN8NZtKYUAc9HqqUlPX7Q9FsMB2+v2AUUf1ls8zWCeVhgS3KEv/kNrrei0v o480FNIKH04OmYd+MOhii5nWHuJyzDE3FXANr68bt6TE5XMLCMj29kxT5AQSIFOFvwLd Oprp+R6GZm/CMS4XeA2p6J1C4XIFK/RkXqNB6n4C7e1zdYTh9iiBvA1FMBKMrMvLm86S DRqg== X-Gm-Message-State: AOAM533Dyf5AFXQSA4pHGxAKzwq1WZ0Jwh5HXR9nVSTZiuimEACKeF4i dliTVez3hqQV+J6u4X+58hw= X-Google-Smtp-Source: ABdhPJzXyK1avxdHsbndLdHh941AUxk1D1c7y/P6+Iq/2yxN8Ku+TGv/VivFYJUXrevw74OlJ2j6+A== X-Received: by 2002:a1c:d5:: with SMTP id 204mr8879191wma.56.1602943464152; Sat, 17 Oct 2020 07:04:24 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Huacai Chen Subject: [PULL 21/44] target/mips/cpu: Introduce mips_cpu_create_with_clock() helper Date: Sat, 17 Oct 2020 16:02:20 +0200 Message-Id: <20201017140243.1078718-22-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Introduce an helper to create a MIPS CPU and connect it to a reference clock. This helper is not MIPS specific, but so far only MIPS CPUs need it. Suggested-by: Huacai Chen Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-13-f4bug@amsat.org> --- target/mips/cpu.h | 12 ++++++++++++ target/mips/cpu.c | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 062a4ba6225..d41579d44ae 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1307,4 +1307,16 @@ static inline void cpu_get_tb_cpu_state(CPUMIPSState= *env, target_ulong *pc, MIPS_HFLAG_HWRENA_ULR); } =20 +/** + * mips_cpu_create_with_clock: + * @typename: a MIPS CPU type. + * @cpu_refclk: this cpu input clock (an output clock of another device) + * + * Instantiates a MIPS CPU, set the input clock of the CPU to @cpu_refclk, + * then realizes the CPU. + * + * Returns: A #CPUState or %NULL if an error occurred. + */ +MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refcl= k); + #endif /* MIPS_CPU_H */ diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 2a6f4840e20..33a9ed5c24b 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -288,3 +288,15 @@ static void mips_cpu_register_types(void) } =20 type_init(mips_cpu_register_types) + +/* Could be used by generic CPU object */ +MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refcl= k) +{ + DeviceState *cpu; + + cpu =3D DEVICE(object_new(cpu_type)); + qdev_connect_clock_in(cpu, "clk-in", cpu_refclk); + qdev_realize(cpu, NULL, &error_abort); + + return MIPS_CPU(cpu); +} --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) client-ip=209.85.221.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943470; cv=none; d=zohomail.com; s=zohoarc; b=JkuhvA5ydGHgzW/019d4TTbSJHYt8mFO2DV17gXAAHq2LMqXpTSXXMboHGm3XzxjpWZsrdajSYPus6VsCORor7zGbUT01H4WEnWjhOO1CUHOEGnEg0NhLjW6P9xujJM3lvor5HAMLcJm/cUxo+pih3trIurQ6BCowrSUouU5Tc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943470; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JLqgqbu6mCeu1jSTXbJurpmL7Y1M4T4XCrJGTCpmUp4=; b=Q3QHvBMT517vlF29/kfC2FexFbPP2kj+Eytxpzw2FplxltFMQuDWXPdmhLq3zPtqU7T16n5R+APgMaMwwgYyvEHVy/o/Ta2ZvTARRhuQ8TLwxv6uPxmqUvvYIhLs0I2/hX8TlOBSxdSKvBdQyrCWK8Mo4fyWsr7rGXfTDNdey4U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.zohomail.com with SMTPS id 1602943470475627.9110890353527; Sat, 17 Oct 2020 07:04:30 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id t9so6552303wrq.11 for ; Sat, 17 Oct 2020 07:04:29 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id s11sm8853952wrm.56.2020.10.17.07.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JLqgqbu6mCeu1jSTXbJurpmL7Y1M4T4XCrJGTCpmUp4=; b=QpSQevVZUtIiqmG2Ftmfz6mCK/Q5bS1BCmBiXIYM6R3YIaopkI5gfx4sr18xw5mbQ8 fRRbLKW2yUypz4GvfhXjLfVEwihacOlFe1V+38uIZDKZVVHijB8ejfxR02135A5x3aST gwhK3iyDldh99ovkiYUyWMPM/oxmSIKvB2PKFMt8PWYHpo5YWI7sZlTdmrM7Z5DZiUcr 2iXiibWQxrhIWZZSSDdws4yKKkNKdklki7VJ0fB4y4Osail5hHhmxwhuQq7mQ3FpYQYp 9b85chWBuk2Z/XsW0fpYIh9AlX71DpNDxWtrXr0MQuLDfVu+9eUbidSueg+TU54EszpS qkHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JLqgqbu6mCeu1jSTXbJurpmL7Y1M4T4XCrJGTCpmUp4=; b=jzQF7It+svoyJyAqgudNwTm2ci9C1Ht3YjC7PsrxwlE3q4zprxo5vEv+7IAgrgXXZN xVhSDzsqVx3egid6Z6PUUY3CGLicaLqolIH/kBzqMLAUdNQ3Duhf5xninuREPJBR2ogH BibYTRjJfcCYyXjz72xdsX4uSP9nKZ+qRotdSYmvysMJXeiWXvdd5kDjkugWjCd6OJAU U5IT1Jp8krcbpcHmqzWjd8v4n4fP3zO4jE8Wuov5Kw6v9+E+RtRL3dNWy7KlfhsRC0Pl LZDOMkU7ObEiu4Ma0wpLhpySfNrrMZi6vZ1qWmFXAVhMD+c57Rpiv4cA84TkV4M05oKZ kqMQ== X-Gm-Message-State: AOAM531cUxWD4OXkMzUhoDISmsYL0a5GFZ7l7cKxOr5sGj5qXLVBZSSq 3M5RoZb5pgNtlh+0OJFfoxkOf9LCDO0= X-Google-Smtp-Source: ABdhPJwUC01eHf5jX2kvTvmW6gS3Icm+qqw5GMPL29mMR43//3XsrFJa7bS7LD/T1DQP9IuiD34w8A== X-Received: by 2002:adf:ec50:: with SMTP id w16mr10241641wrn.265.1602943468726; Sat, 17 Oct 2020 07:04:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 22/44] hw/mips/r4k: Explicit CPU frequency is 200 MHz Date: Sat, 17 Oct 2020 16:02:21 +0200 Message-Id: <20201017140243.1078718-23-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Since its introduction in commit 6af0bf9c7c3, the 'r4k' machine runs at 200 MHz. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-14-f4bug@amsat.org> --- hw/mips/r4k.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/mips/r4k.c b/hw/mips/r4k.c index 3487013a4a1..39bc626e7c5 100644 --- a/hw/mips/r4k.c +++ b/hw/mips/r4k.c @@ -13,6 +13,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" +#include "hw/clock.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/intc/i8259.h" @@ -182,6 +183,7 @@ void mips_r4k_init(MachineState *machine) MemoryRegion *isa_io =3D g_new(MemoryRegion, 1); MemoryRegion *isa_mem =3D g_new(MemoryRegion, 1); int bios_size; + Clock *cpuclk; MIPSCPU *cpu; CPUMIPSState *env; ResetData *reset_info; @@ -192,8 +194,11 @@ void mips_r4k_init(MachineState *machine) DriveInfo *dinfo; int be; =20 + cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); + clock_set_hz(cpuclk, 200000000); /* 200 MHz */ + /* init CPUs */ - cpu =3D MIPS_CPU(cpu_create(machine->cpu_type)); + cpu =3D mips_cpu_create_with_clock(machine->cpu_type, cpuclk); env =3D &cpu->env; =20 reset_info =3D g_malloc0(sizeof(ResetData)); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943475; cv=none; d=zohomail.com; s=zohoarc; b=Bj60RjYyxNBn2U5g985AQ3cm5zS4DEq7r7FCF2YYV4EQ482yE0z8UTvQFXqGLKUmv/mYJhPntMu+7tR5CWrg1ibvQdcMX+Sw0t+JO0JKifQ+ffkeLKOMUKKmnXovAHQ11cDa0/JNdbUpMVqx8YFso1AndHDP0IvLmMPh0605J2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943475; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2du0I+yb+HwbuymUy7ZKJilfZng7wrSnlIMlk5mAbJI=; b=dyE1OBlgeJsHCHhda4bf4F9SIelttCfc8AamP2WiepC3ewDpCG5BwPzQgrq+CL31+eu3Fa8LG9rAD0jUZKoHoGkAAEjFeamHvOAHXHaG7v/1loOI+96EbvDNn1rtWKrF74fW6XJtG15GQmy6/Ru4FDxze/RpIhPGNeqgPs8NrDI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1602943475257812.2483491547339; Sat, 17 Oct 2020 07:04:35 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id d3so8367788wma.4 for ; Sat, 17 Oct 2020 07:04:34 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id i33sm9106111wri.79.2020.10.17.07.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2du0I+yb+HwbuymUy7ZKJilfZng7wrSnlIMlk5mAbJI=; b=iEPscC/Krn7YrA07zMjweZVyt0/W+ECwh9ZMJRBs2yXBAANa9yUZ6Hf2H+Ab3fWR0W oK+jne/InRQHMFjtMLRHAIXX5V82fJRj14ekuqSzzYg2uj1oLMOgJNHThBYjNpWwjc1N E1zbC9k1vy9DWuyyy9k5a/LPDb19nAXUV1zGJNxMETd1L9+6PYLiNv+xGlq/S6t8pMqr vmPhgzD6EzqPy29EtS04Fbb9++Ey4cBI+flF2vrUSKcj/whDZAyUfokz4lc3QRymgRnT 2eLryTNVFUD7N88MUXd9KZ/bdogPy1DGKTK3aV9WuQzn0OT3rQubBv3MG3yWQL63vvMH zOxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2du0I+yb+HwbuymUy7ZKJilfZng7wrSnlIMlk5mAbJI=; b=jDnkRtDh02lZWKaBLF/VjumFkfRyiwyZuGxUNbdS0UHS+Ui5OAs9XYWZQ4lXCAJFkl nfVmxLqoN4w+zjslYHMUs59d9G3nO0MrSdZGhWrM/U2WRVb87dGWrATOChogc9XyCA8K xqNOP4US9kKdBqAG64uSThZ1hRrebPnHbcFSw3ikopvOojzmSu1kAsBIBfBkZ7eIhiWt pZUYDv3qm4S9pl6IWd3oFpODv5n9nBi1Z0+9Dbk3fH7dxiv5V0QiBDm3FsWMXB3wY6nJ XOc3CP6LFXkONh8A4eLVFCctd/YVxhXXRSftIsEAzOy6LBvfBO79BLzjq+TB52aYDSei jftA== X-Gm-Message-State: AOAM531mxDpljfcumWL8+x+DMUzcNMWsb2XKmh4lvb1AoSKjEM089kK0 ZmQ1ZP1Sdb89yATzC05Bh00= X-Google-Smtp-Source: ABdhPJwJ6w2hjGX0HLJUBBmgfA1ehblMkszC93hdqLx70HXtb52c+i1jH/5ZIw+SVPzXwxhLZqleEA== X-Received: by 2002:a1c:7d54:: with SMTP id y81mr8342558wmc.114.1602943473422; Sat, 17 Oct 2020 07:04:33 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 23/44] hw/mips/fuloong2e: Set CPU frequency to 533 MHz Date: Sat, 17 Oct 2020 16:02:22 +0200 Message-Id: <20201017140243.1078718-24-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The CPU frequency is normally provided by the firmware in the "cpuclock" environment variable. The 2E board can handles up to 660MHz, but be conservative and take the same value used by the Linux kernel: 533 MHz. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Message-Id: <20201012095804.3335117-15-f4bug@amsat.org> --- hw/mips/fuloong2e.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index b000ed1d7f7..b8234f61083 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -23,6 +23,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" +#include "hw/clock.h" #include "hw/intc/i8259.h" #include "hw/dma/i8257.h" #include "hw/isa/superio.h" @@ -298,12 +299,16 @@ static void mips_fuloong2e_init(MachineState *machine) PCIBus *pci_bus; ISABus *isa_bus; I2CBus *smbus; + Clock *cpuclk; MIPSCPU *cpu; CPUMIPSState *env; DeviceState *dev; =20 + cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); + clock_set_hz(cpuclk, 533080000); /* ~533 MHz */ + /* init CPUs */ - cpu =3D MIPS_CPU(cpu_create(machine->cpu_type)); + cpu =3D mips_cpu_create_with_clock(machine->cpu_type, cpuclk); env =3D &cpu->env; =20 qemu_register_reset(main_cpu_reset, cpu); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) client-ip=209.85.221.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943479; cv=none; d=zohomail.com; s=zohoarc; b=CBKUxS4uvECDm0S58Q4HuXP2ebgrnNAITMw+eHhhhttUnEdJjmUUj1jf3ikskTOLDAQymp1HYlBhhWIViVTSHfdj97KzS/cuhON4yEPuG6dGh26/0zBPJUb/nuK//MQZG0Mxoqhu//PjOuEfSLbaikGGLXrbfwIIbatNFg3JS3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943479; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RVpDTlE+erpFb5VKlsMSt7Bi8xmM/yPxH3xBl9KpxtU=; b=oLHBtuvmutu3l+jIp6412OL0zewMmmUOKtaPIrXh7+8dadqOX/o/5JBTKvjzgk7zMTsIWpmuuxm6cSomwPeAfZ8AKdZrxFccGjEuBh8hpaZxhfbsuaopD9GtbJfDK+Cys62fQjomtFMxoDXmusHxnKTPCtBELgdo8Z41+g9yypo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.zohomail.com with SMTPS id 1602943479725822.1292978583592; Sat, 17 Oct 2020 07:04:39 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id e17so6543607wru.12 for ; Sat, 17 Oct 2020 07:04:39 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id t10sm7295832wmf.46.2020.10.17.07.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RVpDTlE+erpFb5VKlsMSt7Bi8xmM/yPxH3xBl9KpxtU=; b=olCb6qduyY2UmWFDxguyfTzByj/6QvaiOGVCBu865dPC+977VUl7fUVGoiawDwdrmW K1Bfp1QjlK4oSazp7MbC6Y+C9M+uDAhl3D7x73RM6V/ZJuewdkTnx6d80OOsIuqXyB3j wJ62YtXUPuR7MiDci2gYUuP59TFRf3kmtvKiqJ3Pp9S/fcnHkw7Z8xZ9TSfSOtnogj82 EMEQWSzVAvLD1FdiMMwuzWKK5wRD+xgb5hmumLkvcN2E+kZH3LmwGJ4otE9loNp9qwkD 3qkVy5BtPzmda1PFVVz7BKcV9k0284cEJ4N9edrj9oKLfVQxDYjrsPKmII9ruUkqAcZz f47Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RVpDTlE+erpFb5VKlsMSt7Bi8xmM/yPxH3xBl9KpxtU=; b=MDOSoDPyz1UNXGhTB+ZyUqqwa2m1SYxv8Mu6WteRNBsso2S7VMG8VYSbzWOj4w3Vs7 poaiVJVUIlOLUiEERuJieo18+HV5b6zkxo5RVcpl6O+P6OwoEI/q+PMhb10H/bmKZim3 NFg7h2I7o60KZnbqd6YqJ53j4vbJbepuLJDHiRLoe7TTIvqBOcZrW32QEK8MpOTelF4s McTzQaIImJAKIQOqWm2jSzgS3bzB7LecMXtXxZ6+lXb+a6LH2FkzTtHxCBpfPU0+RD9S xzuAx4sEx32ZIH6vZ1xUprhPapbCYqd5lAnkmnln90z2usHhXmjAZOeHrTSQnqX75B0E ir4A== X-Gm-Message-State: AOAM530ASjVKlyO50eTN9ZRJRbnUrfOZevcHFkZS+B+OTE5iHr5WMZtg yPjtLLmeOCUItBID0/FoWUk= X-Google-Smtp-Source: ABdhPJzd2DPD4PRYqXoc5mdju30MlEtlO79KZdouSZdk5Fqvu0EWZNaaFsacCDeiWyqDDClemqW2fg== X-Received: by 2002:adf:f3c7:: with SMTP id g7mr10869289wrp.394.1602943477938; Sat, 17 Oct 2020 07:04:37 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 24/44] hw/mips/mipssim: Correct CPU frequency Date: Sat, 17 Oct 2020 16:02:23 +0200 Message-Id: <20201017140243.1078718-25-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The MIPSsim machine CPU frequency is too fast running at 200 MHz, while it should be 12 MHz for the 24K and 6 MHz for the 5K core. Ref: Linux commit c78cbf49c4ed ("Support for MIPSsim, the cycle accurate MIPS simulator.") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-16-f4bug@amsat.org> --- hw/mips/mipssim.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index 5d4ad74828d..f0042f7f436 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -29,6 +29,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" +#include "hw/clock.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/char/serial.h" @@ -150,13 +151,21 @@ mips_mipssim_init(MachineState *machine) MemoryRegion *address_space_mem =3D get_system_memory(); MemoryRegion *isa =3D g_new(MemoryRegion, 1); MemoryRegion *bios =3D g_new(MemoryRegion, 1); + Clock *cpuclk; MIPSCPU *cpu; CPUMIPSState *env; ResetData *reset_info; int bios_size; =20 + cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); +#ifdef TARGET_MIPS64 + clock_set_hz(cpuclk, 6000000); /* 6 MHz */ +#else + clock_set_hz(cpuclk, 12000000); /* 12 MHz */ +#endif + /* Init CPUs. */ - cpu =3D MIPS_CPU(cpu_create(machine->cpu_type)); + cpu =3D mips_cpu_create_with_clock(machine->cpu_type, cpuclk); env =3D &cpu->env; =20 reset_info =3D g_malloc0(sizeof(ResetData)); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943484; cv=none; d=zohomail.com; s=zohoarc; b=ZR6DrYE7Gs+3dbQJgoZDRorfCiKofnpey8RlOYIi1el9+orZhZPrq85mdo2vzVZfydXMzD+UMEa+ugTMQ8tTye5ISYbVR0P6Ck1zyKKgZDCAGx8wq8c57lqawdcYktXF21cJkhtzCDcIY3hZddhhhBNLQ8hJfcFZ9wcAenEwbP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943484; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XmLmCuW1uC91Ho4Ow45XNevc9vvm/zFFsaaxmUUiG5M=; b=dcUqx/iFv86JxnHDEm77Y51GGomCkD9AVIeUqXpueP1Bzarw4orEqG90X7ai7KUtTgpw9NoTsSshZnEmOLtn+zPb2Eq4GyzEd3Ee5jTJ4A63C7SVgR1LsJLQoc9pAawP99wJf6cCiEkYcWWhfVnKXZGTJsRCjUZwGTRV2dXc4PY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1602943484571655.791692394343; Sat, 17 Oct 2020 07:04:44 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id a72so6126503wme.5 for ; Sat, 17 Oct 2020 07:04:43 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id j7sm9226923wrn.81.2020.10.17.07.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XmLmCuW1uC91Ho4Ow45XNevc9vvm/zFFsaaxmUUiG5M=; b=mqHNvVO2fTMeS3nBKdm4vhleFvgihW6QRu3mUkC5imATa2QZ2zKtKNyFHkR6Ccot2+ +md8ipYIZm57WNnUPBgSfgg9qi0E0jD6oE295Y8MBqzt7v9H9IOzbWJvyhk7Oud/oc1X eMoib9l90CxJtzMpG/VAALC0aK5FkBi8eRG956I5ayjrpZk2UuIQrWfPeVJ40bR+70yV BGpXsPc3eTxE5jLjTAeUqUamkjgNgR7Y35CdAoCm8Zzyg5JPXo1+rmfe4tcOY7AZPbmO CcjGQmcGwLqSMRQHzqsJ6lCivTjtnw2LmJBf+qzUaNHoHCR79B+k7YbLyoVL1DUSck4s HVBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XmLmCuW1uC91Ho4Ow45XNevc9vvm/zFFsaaxmUUiG5M=; b=UvlwJGIdbRH3aRp364Q0psnzKrFZk5DLObxnJmF+ig9pYnNrzn2MDXyH95p0rr/qQk NfOwLYyYW/VMViuJHY/q4Rm05G6T4QBzAAXwxDlXQCQdFGkqzQBW9La//77jlzv1xwpJ lP6Dqa+YMMQCA+M9duKsAukBX+GLTt528XE/YAhh6mL+zfG/UdKDG8oLx9bW5h/iGEwb bV1YAD9HFO+DEoVvE3mHX28ZoCNYIA/noMU3o5iW+AtzQTye7dZJwRJHmBMvb2qDrGl3 sStsNtYCnDMnanJWbqXyxtZy9gU3c17ZwYTZJHADrW61T67JgpY1U4xZaJcHkwAIJ1VP fqOw== X-Gm-Message-State: AOAM5334+MPuaC+3n/tno5ih7X81eKmUaN3EV21cl5jNwJ2nWluvlDkS 1mroLJ7ueyi+GwfRft+WQvc= X-Google-Smtp-Source: ABdhPJwj01yC179U9DYlynyObToIbQeXqwPVrPV5r+USZE7Ridb8rpPYLCwGaZB60dbFY1V2tyOFSw== X-Received: by 2002:a05:600c:2144:: with SMTP id v4mr8603091wml.172.1602943482716; Sat, 17 Oct 2020 07:04:42 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 25/44] hw/mips/jazz: Correct CPU frequencies Date: Sat, 17 Oct 2020 16:02:24 +0200 Message-Id: <20201017140243.1078718-26-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The Magnum 4000PC CPU runs at 100 MHz, and the Acer PICA-61 CPU at ~134 MHz. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-17-f4bug@amsat.org> --- hw/mips/jazz.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 47723093b63..8f1ad55ba34 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "hw/clock.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/intc/i8259.h" @@ -142,6 +143,7 @@ static void mips_jazz_init(MachineState *machine, MemoryRegion *address_space =3D get_system_memory(); char *filename; int bios_size, n; + Clock *cpuclk; MIPSCPU *cpu; CPUClass *cc; CPUMIPSState *env; @@ -163,14 +165,25 @@ static void mips_jazz_init(MachineState *machine, MemoryRegion *bios2 =3D g_new(MemoryRegion, 1); SysBusESPState *sysbus_esp; ESPState *esp; + static const struct { + unsigned freq_hz; + unsigned pll_mult; + } ext_clk[] =3D { + [JAZZ_MAGNUM] =3D {50000000, 2}, + [JAZZ_PICA61] =3D {33333333, 4}, + }; =20 if (machine->ram_size > 256 * MiB) { error_report("RAM size more than 256Mb is not supported"); exit(EXIT_FAILURE); } =20 + cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); + clock_set_hz(cpuclk, ext_clk[jazz_model].freq_hz + * ext_clk[jazz_model].pll_mult); + /* init CPUs */ - cpu =3D MIPS_CPU(cpu_create(machine->cpu_type)); + cpu =3D mips_cpu_create_with_clock(machine->cpu_type, cpuclk); env =3D &cpu->env; qemu_register_reset(main_cpu_reset, cpu); =20 --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943489; cv=none; d=zohomail.com; s=zohoarc; b=cfhDlbQu842p4BUR0QaIZvo4RMCGdWINf82nJ0szHmVmhRk++NheRwOtY0DX8+8ylO5I7+r63aGocofP3v0hDz6jB7ow5Ss/giO2IF61YKNKUhKz9pRfr9Ks9gLy3vBu11LhCwJkh5fBnBODZ8mfAzLCk3Qw5F2A6WN0zLllL4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943489; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r9DIlhS/zwAECFf9vZAtbGMbBBzzJfBM2jPK1vmGZTU=; b=MLM9D5T7A4K1Vd+8V6IvwbA1CUxRXeIXsrr8GrrQeUsC/errlGKzG9s6ROL66MKaC0nnqUV6wHtsUyUiLuo7XiIyMApURu0yOVk+mwfHFpBaD0xqZNT5mCEffoB91WrR202TDupvAGZyB+dMCpw7pqLssPhDokXE3k8R82FRRCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 1602943489143249.82606147347371; Sat, 17 Oct 2020 07:04:49 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id i1so6608323wro.1 for ; Sat, 17 Oct 2020 07:04:48 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id x3sm7544780wmi.45.2020.10.17.07.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r9DIlhS/zwAECFf9vZAtbGMbBBzzJfBM2jPK1vmGZTU=; b=PQ/2WKzi2E0RbWQLOhNCp3J7+V7Gb4+mNhk/HK3t5XL9mpHIEBbQCR7UH7CgGfd2Bp EZUhCsIVUNY2ofVooNeduCrPTKxwQs0/QJtH9Urf5Rm46IfJulnhWwle4eWu1Faofk+i OfxsnirTQV8bOJPdsgjVAWckPEgzcAE8MOPbcjrdosniAIKeMrwz2K3m7tY5D1vex7pL aQ4d8qFaxxlJZQAyEKpS6klWmqayrHPrs3fduSSDRZ/7pWFwN2284B0A3bCrGoQlMzWC bYdYN/MkzcSjfZniiH558W1rs4eEHiHlT7QdKXMopK0WHC8NbDyKusBmkOjpwdBqNzz5 MIDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=r9DIlhS/zwAECFf9vZAtbGMbBBzzJfBM2jPK1vmGZTU=; b=ZCUE7ghCtBPucf3HeNrISk+Cl8YFCSYgQhZnwfrwPjt82oDzvpRma/H1ppKWWwW3Co ODF7+NUwgEXKvUUFPpdSBWyeuwNQ0/9McWE6hWG789qTCkjL/drmugBru3cj9J2STROZ 0pWn3ZZzgiyGJ+2lhmM+EnNmACKF2nQSeacbQ4utCfKPSpY8DD/k74CXIngWBpKIytw+ aV1Y9AHdmT1hdBE0O9ypVG5NR1tjgOacBwrO3+B+auy4I+s1DKgvTQUB9LQrrBVh2zGM Jpu1mZER7ikHFIo9C+SCizhbRER7LPXhWbe1a+F/BpLbVJEi5cL4YNvDOoKDfqHiTsIM +vyQ== X-Gm-Message-State: AOAM531+Z6Q40JA1lOZOnueW9uS6P5VeApJi6WMBLDREdwDVmzj5xyql Z9iphXzD2/vrpBZLoyGpDRY= X-Google-Smtp-Source: ABdhPJyA6DQC9L5VQ0mmac/gAzSetbtYjAFC97JTI3WDSlzcYQ06mrWC3sMTCgYK1XNbj6mw18h+YA== X-Received: by 2002:adf:dd8f:: with SMTP id x15mr10897534wrl.124.1602943487274; Sat, 17 Oct 2020 07:04:47 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 26/44] hw/mips/cps: Expose input clock and connect it to CPU cores Date: Sat, 17 Oct 2020 16:02:25 +0200 Message-Id: <20201017140243.1078718-27-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Expose a qdev input clock named 'clk-in', and connect it to each core to forward-propagate the clock. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-18-f4bug@amsat.org> --- include/hw/mips/cps.h | 2 ++ hw/mips/cps.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h index 9e35a881366..859a8d4a674 100644 --- a/include/hw/mips/cps.h +++ b/include/hw/mips/cps.h @@ -21,6 +21,7 @@ #define MIPS_CPS_H =20 #include "hw/sysbus.h" +#include "hw/clock.h" #include "hw/misc/mips_cmgcr.h" #include "hw/intc/mips_gic.h" #include "hw/misc/mips_cpc.h" @@ -43,6 +44,7 @@ struct MIPSCPSState { MIPSGICState gic; MIPSCPCState cpc; MIPSITUState itu; + Clock *clock; }; =20 qemu_irq get_cps_irq(MIPSCPSState *cps, int pin_number); diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 23c0f87e41a..af7b58c4bdd 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -22,6 +22,7 @@ #include "qemu/module.h" #include "hw/mips/cps.h" #include "hw/mips/mips.h" +#include "hw/qdev-clock.h" #include "hw/qdev-properties.h" #include "hw/mips/cpudevs.h" #include "sysemu/kvm.h" @@ -38,6 +39,7 @@ static void mips_cps_init(Object *obj) SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); MIPSCPSState *s =3D MIPS_CPS(obj); =20 + s->clock =3D qdev_init_clock_in(DEVICE(obj), "clk-in", NULL, NULL); /* * Cover entire address space as there do not seem to be any * constraints for the base address of CPC and GIC. @@ -80,6 +82,8 @@ static void mips_cps_realize(DeviceState *dev, Error **er= rp) errp)) { return; } + /* All cores use the same clock tree */ + qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); =20 if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { return; --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943493; cv=none; d=zohomail.com; s=zohoarc; b=aZ3GDoZSKPgMvgGPdFhFhfx7RoLc6I+FzBv0a9kwtJZAe6nj5UBxuxYbvnkkqWNvQQRn+hDMGYCX1SIlcDQwQ0pASOjVO/Rtb+Yui5H9dy32j9OIOGfgydArvm/qxgmaiIwnvZykM3opqQYm+SFRe+LaAGITs/bFKmOj+8dp5Rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943493; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pk7ivm07JttABN6WhHIewfEZwDkoRMEO3KDnJXLnE38=; b=aIUdPdkg2VSmpwcrAg7rmMHQuCAZtQFMo/vYep/KmJoF/COJhA369phLXVoS5R9r9GvO0nbZJiEifhIYYtwmBBLlfzCzbrm1c6nvJ1fGKHI/8gM1O9ZAwrkLKvTBFiGAHsq5hUVGbdQlIPWHejHX9/BId905+3RUbzhMxalVH8w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 1602943493659853.0016324742795; Sat, 17 Oct 2020 07:04:53 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id y12so6585737wrp.6 for ; Sat, 17 Oct 2020 07:04:53 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id m11sm7619662wmf.10.2020.10.17.07.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pk7ivm07JttABN6WhHIewfEZwDkoRMEO3KDnJXLnE38=; b=q2XkE/zhdvB/kGUH2WLI7AY5nHqrlS8rSDTHpRMu3OS5mnfu7OiIS6yvMD2mzv/cC8 p6mk5cdWNUq5yL0BOI0sZZdzzvDhwEmPyBBnkuMoFmWbWRuGGwXUP8GFxE9rkLmxGr0m newEAn06KGnXDbh8fE3wN21dBpHz3ky7yzL1i1NIlfQisXIs/yjVypw2l6yyPEGompRn HFqwR4PyY+8KOTcL7Fh68GHvWyNXuNyHOPDdL+HxycgUP/ACibbLcDP6B0WIMBJfENgF o05HaJ8Wi4sQ1Zi9jfr6QCRKo2+avhMmKmgbDxVXdQFVCCDQUQTwxNhYSeXKRuylZkhu 2I0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pk7ivm07JttABN6WhHIewfEZwDkoRMEO3KDnJXLnE38=; b=M5V1eARKm41mEf30qsgk2Epf6flSyPoKKWWTgry8qL3SIfJ0So6iengTezDsjAosEI tVB1WnpaabPgC85+GBNMnXfRmulMscMbfK/XtwynWdYTeXiNNbAQWlKtGPC1D7A5K0n1 aT1uO1VgiZfBLm0XPDrZbR6z8Aqw61Q4e+2d/v85R77NCOjb1YkxlDy2ayI81VG1oweH tNfn/eDJaw1gVpdsgTUfZL5Tvl11JMH7cFLpQJaHVX6yDnSsat/Rd0FZ2mLxsRZQEzsN VffkR5IpVy7+1QpvAkdmL6uK6oX9K0p0XmqxlbdWC4iIULgyBSuvM2PsL2+utQTRm1hL 0OWw== X-Gm-Message-State: AOAM530tD5CM0r5ltHA/Iy2uo6UjuB/TfvS//C/XKKZj5v4Mw8sIE352 WUeBuMEipLXFwAH4IYI+Ghs= X-Google-Smtp-Source: ABdhPJxUx1B0eOR4U1/f2dhFaqbJZKKN5dPzToUzHYMYR4CNS8o62qXs2hWqy3zXjm7aJIwFZ+utHg== X-Received: by 2002:adf:e8cf:: with SMTP id k15mr10260053wrn.262.1602943491792; Sat, 17 Oct 2020 07:04:51 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 27/44] hw/mips/boston: Set CPU frequency to 1 GHz Date: Sat, 17 Oct 2020 16:02:26 +0200 Message-Id: <20201017140243.1078718-28-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The I6400 can run at 1 GHz or more. Create a 'cpuclk' output clock and connect it to the CPU input clock. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-19-f4bug@amsat.org> --- hw/mips/boston.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 1b3f69e949c..cf2296f4488 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -30,6 +30,7 @@ #include "hw/mips/cps.h" #include "hw/mips/cpudevs.h" #include "hw/pci-host/xilinx-pcie.h" +#include "hw/qdev-clock.h" #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" @@ -54,6 +55,7 @@ struct BostonState { MachineState *mach; MIPSCPSState cps; SerialMM *uart; + Clock *cpuclk; =20 CharBackend lcd_display; char lcd_content[8]; @@ -251,10 +253,19 @@ static const MemoryRegionOps boston_platreg_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 +static void mips_boston_instance_init(Object *obj) +{ + BostonState *s =3D BOSTON(obj); + + s->cpuclk =3D qdev_init_clock_out(DEVICE(obj), "cpu-refclk"); + clock_set_hz(s->cpuclk, 1000000000); /* 1 GHz */ +} + static const TypeInfo boston_device =3D { .name =3D TYPE_MIPS_BOSTON, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(BostonState), + .instance_init =3D mips_boston_instance_init, }; =20 static void boston_register_types(void) @@ -462,6 +473,8 @@ static void boston_mach_init(MachineState *machine) &error_fatal); object_property_set_int(OBJECT(&s->cps), "num-vp", machine->smp.cpus, &error_fatal); + qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", + qdev_get_clock_out(dev, "cpu-refclk")); sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal); =20 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943498; cv=none; d=zohomail.com; s=zohoarc; b=VWIJ2pcsO+sHb8yWuu1U/ubphBCeT8s9i7m5Cp9FBmBEqw3qPCZpCab+HMfofG4s4C4o0MYxIZYcw32hV1ZlwRs+NqMNFtSu/o2qrPBfxz7M3oF3Z4iyfhQb2ufXni8UtVVMDsM8NXrUZrrL35TVHP7T7JT1N7tIK419Nz37sSY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943498; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TadARjLJ/nsMStaSHgFw9Eo2VdlMk7HODNJ8C7SZvtU=; b=XG+B6JIBrBRQcmSO8zyhkk6zKrB461OQvGtVUDr36KVkdRzaXwtUyjM7FURRZ+kCkZbRInSIkuflBmpetSF+c3by62ujtXvp4J9Tp3UifBE3jL1XXSsQxmj+wWYEB/nU3Ak6EUS1slfVS3FyFRJ4Ww67zDAFgf/apuI8Iudf+4A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 1602943498291154.94910951692873; Sat, 17 Oct 2020 07:04:58 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id d3so8368501wma.4 for ; Sat, 17 Oct 2020 07:04:57 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id x21sm8374368wmi.3.2020.10.17.07.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TadARjLJ/nsMStaSHgFw9Eo2VdlMk7HODNJ8C7SZvtU=; b=bBTJltPSYyk6fzuDWmONLzc21U0QmrLswc5nggfsj6YJElBYXQw6qQSZcseJpxlVG1 FOEF9amcoRivMQL0RXSfsF26Jx8op1ar8r9VwvxMpNq3qBcMftULSX+Ugsy0QW9v6TOR RDZNVhl6mNfdND1SJi94fOb3oYqykTKowMo/IO9JrzFZWzR/VM40NBZ44lgwjYkqtSu0 qW0+IPW9wfUplCE9djOMnV2/SNLT68yI3kMGyZqVs3WMTu/rbQHaHtX05q5VTpyGjx09 UxVxnn0NTfa/jHQWuH8/aj3jstFIt1lZ3ENsCjHEsR8FGqcrfKGMKhTBuw4FCk4Ps+Ns TI5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TadARjLJ/nsMStaSHgFw9Eo2VdlMk7HODNJ8C7SZvtU=; b=myCA9PHpecFtObpzws376adfC+A1NmKQ60X7v9C8wUSawg8Nqi7dMjclLorgdw94Bw /VNkUXCT/gCqynDzgDNU6lk1w8mGnR+a25qS+Fa42/7/Ceupny3v6KaD1C48i6vzpVWb 6XEegdHlbeaM8QChwFjlZ1kxLpMOB42No209EQXC5J1TKvxLFoPoHtKGOwe5cuwzYJ3i qCdfkzMa77RBy2oDKjuvtH2mpbbI/3XVNWsDLtw99ZjD/JyzULqvzRvqhBjM9PJHbpOI bE10H6bULmU/qCFR+5GVpaxllzpcQHGS+NEBSS5f3sHhcOQvT5HcJ5/+xBEBozqqKekr RpHQ== X-Gm-Message-State: AOAM530enoAW80z9NeUJFo78+iWZphBSPuBPsRgSwyq6PV37dxTH2XKZ NIWYrEnr85417NlYbarpyHo= X-Google-Smtp-Source: ABdhPJyMLICiN8XfsjOPCptb8uC0gmIw7ENPj+i9oQvsXHoqAtdc0o1ikPhnrAV+YT1Um3mGFvtNjQ== X-Received: by 2002:a1c:63c3:: with SMTP id x186mr9070526wmb.66.1602943496369; Sat, 17 Oct 2020 07:04:56 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 28/44] hw/mips/malta: Set CPU frequency to 320 MHz Date: Sat, 17 Oct 2020 16:02:27 +0200 Message-Id: <20201017140243.1078718-29-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The CoreLV card with ID 0x420's CPU clocked at 320 MHz. Create a 'cpuclk' output clock and connect it to the CPU input clock. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-20-f4bug@amsat.org> --- hw/mips/malta.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 4019c9dc1a8..1e2b750719e 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -26,6 +26,7 @@ #include "qemu/units.h" #include "qemu-common.h" #include "cpu.h" +#include "hw/clock.h" #include "hw/southbridge/piix.h" #include "hw/isa/superio.h" #include "hw/char/serial.h" @@ -57,6 +58,7 @@ #include "sysemu/kvm.h" #include "hw/semihosting/semihost.h" #include "hw/mips/cps.h" +#include "hw/qdev-clock.h" =20 #define ENVP_ADDR 0x80002000l #define ENVP_NB_ENTRIES 16 @@ -94,6 +96,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(MaltaState, MIPS_MALTA) struct MaltaState { SysBusDevice parent_obj; =20 + Clock *cpuclk; MIPSCPSState cps; qemu_irq i8259[ISA_NUM_IRQS]; }; @@ -1159,7 +1162,7 @@ static void main_cpu_reset(void *opaque) } } =20 -static void create_cpu_without_cps(MachineState *ms, +static void create_cpu_without_cps(MachineState *ms, MaltaState *s, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { CPUMIPSState *env; @@ -1167,7 +1170,7 @@ static void create_cpu_without_cps(MachineState *ms, int i; =20 for (i =3D 0; i < ms->smp.cpus; i++) { - cpu =3D MIPS_CPU(cpu_create(ms->cpu_type)); + cpu =3D mips_cpu_create_with_clock(ms->cpu_type, s->cpuclk); =20 /* Init internal devices */ cpu_mips_irq_init_cpu(cpu); @@ -1189,6 +1192,7 @@ static void create_cps(MachineState *ms, MaltaState *= s, &error_fatal); object_property_set_int(OBJECT(&s->cps), "num-vp", ms->smp.cpus, &error_fatal); + qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", s->cpuclk); sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal); =20 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); @@ -1203,7 +1207,7 @@ static void mips_create_cpu(MachineState *ms, MaltaSt= ate *s, if ((ms->smp.cpus > 1) && cpu_supports_cps_smp(ms->cpu_type)) { create_cps(ms, s, cbus_irq, i8259_irq); } else { - create_cpu_without_cps(ms, cbus_irq, i8259_irq); + create_cpu_without_cps(ms, s, cbus_irq, i8259_irq); } } =20 @@ -1421,10 +1425,19 @@ void mips_malta_init(MachineState *machine) pci_vga_init(pci_bus); } =20 +static void mips_malta_instance_init(Object *obj) +{ + MaltaState *s =3D MIPS_MALTA(obj); + + s->cpuclk =3D qdev_init_clock_out(DEVICE(obj), "cpu-refclk"); + clock_set_hz(s->cpuclk, 320000000); /* 320 MHz */ +} + static const TypeInfo mips_malta_device =3D { .name =3D TYPE_MIPS_MALTA, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(MaltaState), + .instance_init =3D mips_malta_instance_init, }; =20 static void mips_malta_machine_init(MachineClass *mc) --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943502; cv=none; d=zohomail.com; s=zohoarc; b=nPvCtXGLmSgD29fCk3oK1zNnDDakoooQSv6sf3DpJvV168Ifj4PZXPeGIJjbSbCK3m/CF5LHw6Yfa1y+FdVJa8k2WxV4iivCp7U4bcI+UyHxIj89I/LVV0z25G99ZDsZ8S843cMLMXI85bWMRXUwBsCkKFtazNGxAioafsTu8t4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943502; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MrdAokW/C4AyEAhV1+Tvr+zY4ZVMVcUDy6Uk4AJ14vA=; b=G+OxreR0d6s9tf7FouGM0APonMraSRmzVvqGadOahBIOzlGEJC8igOJGRY6VtIpmpbS1+fVMLWGHWOZN6LEX6+2dsaUki4YCX0yDEQiEvlj9T4795nVtUFN2J0YHZHpChGFT9XHPctsNenHTmyVRqn4wKphObJW97T+vw8H2DV8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 1602943502952742.7727378519448; Sat, 17 Oct 2020 07:05:02 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id e17so6544328wru.12 for ; Sat, 17 Oct 2020 07:05:02 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id z6sm8889134wrm.33.2020.10.17.07.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MrdAokW/C4AyEAhV1+Tvr+zY4ZVMVcUDy6Uk4AJ14vA=; b=Ji2rC32Y2ZhtUQDPGgnqxT/A56h/CA+3sa7py4H/Hg2PojiWS/T569JE/dwXmnLis+ p0fMGb0QWXM2huk0m6JAIlUSccFH+a3wX90S83DsQWNExFaH0X7n57a7pdVvY+Ac6nRk INjNWQGzyQYx0afrb3hZSbUnQX8gK5VsjmpBQ4LL94KIw4nNl26tI7qNCc2okaxJcptX rWfqJIm0Yvctm5PI0QMDS5L3Sh0pOu6L+vTAmLz4AFoV86KlnDoRejh5FqHm8guUlpR4 wg67i4qzocBg2NOUAFhD8Aomo7pBB1l0zsKRYsGfOJAI++1KwD3BQoEl/zjqVwPCxOyH d15A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MrdAokW/C4AyEAhV1+Tvr+zY4ZVMVcUDy6Uk4AJ14vA=; b=fens984B+SqZeDRNLv6EP8nPWIyL7/Imo7CPfb/275fIZD/8pfth6PLIuQq9d4Gs4J YYSzc8NvAO/s4KwitkWMEWW7OuRnoykItPmQyZeQ2rd4mx+nwZ69XsOOu+TCumXVmiT+ 75jLop4/6LTvQUPkUMOXde7+CEC3LKol5s8ZdLi2bqZwp2mcoKMHCnSqLGOkwwqVUMdf 5nwLF7xsrwqHjhlBXySmiE52DqlJda4qlSODJt1orU7mMnV/isg/+Xe1hbOgKzZL9u+u 0f4sRPlRj4GnWO8sNxD3J9Qz0DFt+k7hZu+sUrMvwjt2hvDMs/o7h3a3/PAP7XtuaIEm 6OdA== X-Gm-Message-State: AOAM533Nn3hh8SVMyVfQR6Is+XX6GkwDYoVp0s8uuq9bAMRBiQTGMJwu wloESYROdYEt/7b24b0XGRs= X-Google-Smtp-Source: ABdhPJyB10aovnv031nwtdowCH9lRTV13eAP3rPKsY/3S2axFbiCqtIBImIbjgg3GtbtSA4ksdZuRQ== X-Received: by 2002:adf:fb8b:: with SMTP id a11mr10129084wrr.407.1602943501126; Sat, 17 Oct 2020 07:05:01 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 29/44] hw/mips/cps: Do not allow use without input clock Date: Sat, 17 Oct 2020 16:02:28 +0200 Message-Id: <20201017140243.1078718-30-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Now than all QOM users provides the input clock, do not allow using a CPS without input clock connected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-21-f4bug@amsat.org> --- hw/mips/cps.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index af7b58c4bdd..c624821315a 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -74,6 +74,11 @@ static void mips_cps_realize(DeviceState *dev, Error **e= rrp) bool itu_present =3D false; bool saar_present =3D false; =20 + if (!clock_get(s->clock)) { + error_setg(errp, "CPS input clock is not connected to an output cl= ock"); + return; + } + for (i =3D 0; i < s->num_vp; i++) { cpu =3D MIPS_CPU(object_new(s->cpu_type)); =20 --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943507; cv=none; d=zohomail.com; s=zohoarc; b=gEOBrvDqWqgikFed0pJrydQhrGXMTV2fohsIqTsEhtIllbco5h+N7ubxyQGnD0wjxouX9nJWiFk/yyXOXopqQvuv9+CCQdomuDX+O4swvBeyWX+5LK3XqQQHmnSWdcKWTADW6fIVwufkaVuXcnqYWjm6utdsKH981xuAfcHHym4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943507; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iLy9KPPIH/IaR0EvDlMGJ9V0mA4+5oswM3SWnu1jL9U=; b=i8aCIH/3Dd5X2kALvtmXpim9AEK+wHI8Dtg9Q1QjpF/Y8FnprsEljiMHB67BJkSoYeUilwWohkKSR7b8NeEjS++ec1a4f1pH6rV5xuymalrLJ1RnYWIVvjJ/rSudveMJzwyitS8d0e4BzGmQpL5cPV7whAK01pv1AIcr7apKkEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 1602943507800350.73168033870684; Sat, 17 Oct 2020 07:05:07 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id a72so6127142wme.5 for ; Sat, 17 Oct 2020 07:05:07 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id n5sm8920455wrm.2.2020.10.17.07.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iLy9KPPIH/IaR0EvDlMGJ9V0mA4+5oswM3SWnu1jL9U=; b=SGTBbSiXbW9YLOK7kkSjYZ6om3fWfJYG/10jwtHMmJOtCUuOesQiFjCefKFKWNCyId kE/2D/EV2AaZppTg3YITIUdnBfJdqV/ZDuB7B9lfYwsvWVXxO+1/FDw4kWrJEMKVYB3G WtE5TudopTS7w1pyObY7jzoKiJ/ePPGApm/q3yF5+JQgI1cbaLM+y/MamyyBhivkvE8t fD5lrlUY/qmXcoLb5dpqcSKB+6E4WZlTTLVjgAFzL4wnHJoSI+tZhIzuW926A6k9xq8s f327sQ3y40/j80SdTn1XTe28FnbOzQYwAuAqfGFMOxbT4ixDnhJ1R+cG4rstGL+ahn2Z +D4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iLy9KPPIH/IaR0EvDlMGJ9V0mA4+5oswM3SWnu1jL9U=; b=AelooykMwJHYoWDgcUB0TYd6e8vZeqgHrcmUDPuYOKuZhwYNWdFpptrLK8j0a5qGJ6 0z77Q2aDn97DXV3/GmTauvMni7EGHECoDF71ldRBFC0EGqxwnYXRaGb/LjZLuakPqCBU 3lf2kXFXL04mQLE5skHjf8QcAxGkF0pMIc0lg5OgFAPoRlk9Z8JDtyGaGrytP1ZYFHbE bGBNuXasLUhPU80ZjwK9aOBZIuvt4zaRNsAq7Yx6UPZCrCYYrsgTjAcG0qqSIHu8h6D2 +RhARm70kW0nd//78iPwUbLngajIUeg/ADlNgYjVZJlF3SFFqbqgC6tlF/EiunUmYqKP X3mA== X-Gm-Message-State: AOAM530M2xqdZNPUHrxojIlQyzIj9wUqorW6AbYIgOAYJXU5FYQ3x/TT RFHkQghqgdBHs7WJYu4ZWHM= X-Google-Smtp-Source: ABdhPJxZdWzeM2W3p56t8YM+Id/2hJtkmh3nJiJP4T26fcY+JVdpepPFWV8jt97BlY3BWaoDCQcWQw== X-Received: by 2002:a1c:6302:: with SMTP id x2mr9141898wmb.121.1602943505962; Sat, 17 Oct 2020 07:05:05 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 30/44] target/mips/cpu: Display warning when CPU is used without input clock Date: Sat, 17 Oct 2020 16:02:29 +0200 Message-Id: <20201017140243.1078718-31-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) All our QOM users provides an input clock. In order to avoid avoid future machines added without clock, display a warning. User-mode emulation use the CP0 timer with the RDHWR instruction (see commit cdfcad788394) so keep using the fixed 200 MHz clock without diplaying any warning. Only display it in system-mode emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-22-f4bug@amsat.org> --- target/mips/cpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 33a9ed5c24b..76d50b00b42 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -19,12 +19,14 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "qapi/error.h" #include "cpu.h" #include "internal.h" #include "kvm_mips.h" #include "qemu/module.h" #include "sysemu/kvm.h" +#include "sysemu/qtest.h" #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" @@ -158,6 +160,14 @@ static void mips_cpu_realizefn(DeviceState *dev, Error= **errp) Error *local_err =3D NULL; =20 if (!clock_get(cpu->clock)) { +#ifndef CONFIG_USER_ONLY + if (!qtest_enabled()) { + g_autofree char *cpu_freq_str =3D freq_to_str(CPU_FREQ_HZ_DEFA= ULT); + + warn_report("CPU input clock is not connected to any output cl= ock, " + "using default frequency of %s.", cpu_freq_str); + } +#endif /* Initialize the frequency in case the clock remains unconnected.= */ clock_set_hz(cpu->clock, CPU_FREQ_HZ_DEFAULT); } --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943512; cv=none; d=zohomail.com; s=zohoarc; b=egr4zzoxC6reZPF3/E6yWCEVIfzKk6qZ7W6s3PlisEDzbWDDSKa+/rQHQ4Zlyq4WF1W5xaUw5g1YuO5DMv4VIQeGsAftz07Pk68cyFo44zyyHWHrKDk0rAhru94kCA/FeJJfmPnzT7lz1/4BVMPCNQaItyII8yJv5OkaBiYGNPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943512; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wDo4Ac8Bvr/h/F3tHmitZ/IsFCAT0CVJ5bwb+MZqKJo=; b=QSsTXYGgPewkgYQpj25XYXhjvHCkygyVnDDV21KEtwwyQxopsD6pkcBiQUCXKnh4zysGoRELQcy/cK7leBACPgYfw5cNuX8HkCbeeIAxE9wS/c64/t6bxJMCNHEfqluHWgHfaHppXdFjqYnRdTFN96GokOi09Lz+PnaTSXE6tnk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 1602943512586491.55752493606224; Sat, 17 Oct 2020 07:05:12 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id e17so6544670wru.12 for ; Sat, 17 Oct 2020 07:05:11 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id p13sm7844630wmb.5.2020.10.17.07.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wDo4Ac8Bvr/h/F3tHmitZ/IsFCAT0CVJ5bwb+MZqKJo=; b=Ox3HtYJ77Ug7pnxuU5PZM59OE9hh3Os3xaqCyy/nJp+kjOJMh/FFrvAI1EqDx8v4RJ +XQVjOST/ZFTKpY5mhivLhnzeqqIew6LpQ1AvEedsKpbsWNuRElOsExiBG88wJZDQGqB xke3KR1EIuiP/ZEaKoPbzCsoebpCnOoTTp0WrNcbSTIo9c9VxnTuV0slpHTFxbQ2K4YX 04dqHRwg8ucFzgJazm0V/RjByyPkXk1bPZNqWsPdatkXDWA5JyjKpKBtAawbQWVIUq9Q 1pulf/z3jl8XCHyYLbYMnRV9uT656dN3/xmN6b3V2MF0KrcOGSfELp/qJR36uASfOkY0 6IhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wDo4Ac8Bvr/h/F3tHmitZ/IsFCAT0CVJ5bwb+MZqKJo=; b=fg+RVq6td4ju5KtdVPsa5NIOGWB5l9enBNBdCbFhpbqVCA1C5tjyGaUzOCHAXcomUT d2MaMDuGLr2jshQGONEQrPCuU4i1B4ZDE89PnghOgo4oQNChpOuaoBlbPN2n0VKo9Dtm HUkQvvWkQIaxVf2rqYWek2BpouYQmlhs6WyL9uemetixlBuvujPKObcrq8uGjkVCWP4k asJuZfDeIpV9vusYaHANr2QwUYTmKlnvPYQOTcvD6lNkw+pe4sin70CQBBMjcIG8fAT5 qJl8A5ZBB4j6UbAOvboBjdLyPYjQ9kCAD4L33k2KI4WBhk/FcUWsimAZMyAfgvEyvgKx J1rA== X-Gm-Message-State: AOAM530zmyVsnDZiukdZcI+C0OOu5/NrJuLwUZkkpFsU+2redJniuv6B NVScjBf+AYngu9Ge80oG2ww= X-Google-Smtp-Source: ABdhPJws1PIRtLZP1SPD/bJsJ3x0MEWSUD5aSYA4lJ0GnS05y4Gvxe0Oih/urz67IjnMoFgbQ6Sx0g== X-Received: by 2002:adf:a50e:: with SMTP id i14mr10379247wrb.121.1602943510674; Sat, 17 Oct 2020 07:05:10 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 31/44] hw/mips/malta: Fix FPGA I/O region size Date: Sat, 17 Oct 2020 16:02:30 +0200 Message-Id: <20201017140243.1078718-32-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The FPGA present on the CoreCard has an I/O region 1MiB wide. Refs: - Atlas User=E2=80=99s Manual (Document Number: MD00005) - Malta User=E2=80=99s Manual (Document Number: MD00048) Fixes: ea85df72b60 ("mips_malta: convert to memory API") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200905213049.761949-1-f4bug@amsat.org> --- hw/mips/malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 1e2b750719e..a4a4c386268 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -578,7 +578,7 @@ static MaltaFPGAState *malta_fpga_init(MemoryRegion *ad= dress_space, memory_region_init_alias(&s->iomem_lo, NULL, "malta-fpga", &s->iomem, 0, 0x900); memory_region_init_alias(&s->iomem_hi, NULL, "malta-fpga", - &s->iomem, 0xa00, 0x10000 - 0xa00); + &s->iomem, 0xa00, 0x100000 - 0xa00); =20 memory_region_add_subregion(address_space, base, &s->iomem_lo); memory_region_add_subregion(address_space, base + 0xa00, &s->iomem_hi); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) client-ip=209.85.221.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943517; cv=none; d=zohomail.com; s=zohoarc; b=icnXr46MNsJJcuAzOHub75GWxQB+N+sz39VpHB5pqjMC+66h8FNqPxrREXfVLU6wh1jS8L/UtY8f4EXLcgQWoH7EzBEZIIlXyqY+PoFzdwm75TjhENeFTXnySd3mSArmEh9F9GNxJWarp82Amh/k3L3ku/8IYOXz7/En3gnWeaI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943517; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8Ewc141UoMMZXp239BJOBQyclagaXr5vDLAwNvdaTwE=; b=ampNWfTJR6UQW2I+6Ke57OEdOf7XMY+zjH7eQBMbA5TAc1Lq96uaWU3P1l+S0XtMqxaf+m7O5hAJyqlaXZR9MvUN/2DeJORQe25Ragj/S/oJ7KNUUmNpvjf/m6ye8rZRfy9gYYaWjiOjDUNzS/lTseVppSHLmVu6/HYBhYaPLgA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.zohomail.com with SMTPS id 1602943517278349.2204247476517; Sat, 17 Oct 2020 07:05:17 -0700 (PDT) Received: by mail-wr1-f65.google.com with SMTP id h5so6579376wrv.7 for ; Sat, 17 Oct 2020 07:05:16 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id j9sm9162391wrp.59.2020.10.17.07.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Ewc141UoMMZXp239BJOBQyclagaXr5vDLAwNvdaTwE=; b=Pt8GE+Kbr0H46mFNuSl9XlxOxkatk5AliYhHgOlEhrZxzYWPRG2CKoYh5zcJ4OqCu1 CRJWpZeL2NHOVONLBicrH87Oxp82a96RXzauCM9wHi59d9WCNQ+vi8BmNibFg+YF50Pv t/ni+OoQQ25DtIl34g1PHDYuucJctuXQN6/6ko20ZN/Gb9w0t2FfPLtAfsrgGlyXLW4N 2r+aPb7H65N3hHElfkBHecHhE0xfw+0njbmRcsIAZbiqA4zHzYCLVeEDWHPnIY8aWUdv U9pt8qJQc8XiAD6t225kUqDSIH4WAAkNiJMkQB57Wj9QLsPr6Qn8YQkkM4P+nRZMHrO/ zC3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8Ewc141UoMMZXp239BJOBQyclagaXr5vDLAwNvdaTwE=; b=ABQJINZktOZeT01BBY94ljJwHtmPkzcmyuUTFpE7GcVaNSb1QS0YOE0chbvYVK7ZDP u9tCFZUUFpRgBKsABAVpYxsQzsfFdRrCdymiEX31PUl9BnA+u+Exl1zjFeLRY22KHKg2 8WEwFfbyRPJGMOvIUXi/NE9A57ja1EDVzhnRyvVz942GJSzhh6h+eMqmMUdRcab5UUpl f/7Ge4uC4A+Uxs96YuisYci+mZzF45UGJN98eFjcewSeedI2greQK3hXSlLYBV8jPzzT VowbJ4s+aHP+o70MfLGqPu1Wf8Qm0J4Mwl76w+aJqUVJQX/uDow0lvyuLwTmCHT0TB3Y XYUg== X-Gm-Message-State: AOAM531e/+Mmqi4KyTyMfM8bSinAk/izgbvsWNee/gS2PKYlW2TthgtV ocqTSzVDW6rMjM8EFTArtNc= X-Google-Smtp-Source: ABdhPJyCR3LaJnL3t89ztgrWpjhTPSzEmSGQFl+sk2JmpxBE8Yf6K5RXwxvyi0kx8U94dqtYmbeDJg== X-Received: by 2002:a05:6000:81:: with SMTP id m1mr10518028wrx.67.1602943515522; Sat, 17 Oct 2020 07:05:15 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 32/44] hw/mips/malta: Move gt64120 related code together Date: Sat, 17 Oct 2020 16:02:31 +0200 Message-Id: <20201017140243.1078718-33-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The 'empty_slot' region created is related to the gt64120. Move its creation close to the gt64120 instance creation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201012160503.3472140-2-f4bug@amsat.org> --- hw/mips/malta.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index a4a4c386268..944045d7701 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1239,13 +1239,6 @@ void mips_malta_init(MachineState *machine) DeviceState *dev =3D qdev_new(TYPE_MIPS_MALTA); MaltaState *s =3D MIPS_MALTA(dev); =20 - /* - * The whole address space decoded by the GT-64120A doesn't generate - * exception when accessing invalid memory. Create an empty slot to - * emulate this feature. - */ - empty_slot_init("GT64120", 0, 0x20000000); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 /* create CPU */ @@ -1399,6 +1392,12 @@ void mips_malta_init(MachineState *machine) =20 /* Northbridge */ pci_bus =3D gt64120_register(s->i8259); + /* + * The whole address space decoded by the GT-64120A doesn't generate + * exception when accessing invalid memory. Create an empty slot to + * emulate this feature. + */ + empty_slot_init("GT64120", 0, 0x20000000); =20 /* Southbridge */ dev =3D piix4_create(pci_bus, &isa_bus, &smbus); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) client-ip=209.85.221.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943522; cv=none; d=zohomail.com; s=zohoarc; b=OawC26QS5CQIU3Q3UE0YCSZ57Qv2JuYQ7gRrgXUXucZ8u+atSrssZC92m1M7mW282GayJgbEhRFv3TDKSphWW/YAPBuPm3g/4VhJ9/5JgJ+0IL2BMl+4AYX+9TxtJ+SXQRGttEBBT4DLRyf72/4CwybTReWWqh3t7P31AFp4h1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943522; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KkzjSFScIeOvIHF/kF8jPGG8E3yTqTBPtxI+D53JLeI=; b=RRGYDPY1S18VXWkY+guXlWLCDDZmz2OqlME5CHwFhsJFFP08Ke5CZhxS8wqDueygy7jED0qDWjaGmJ4JrcDP0oMAvyr/CHeio4mLPk772HJsmKcq7n2kUZWgXyeiIx0yqWgAk/fDLzeS5A5ZUk9hi7RbRODZxDE8WTDgvz/xOrc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.zohomail.com with SMTPS id 1602943522056695.7793824643601; Sat, 17 Oct 2020 07:05:22 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id y12so6586690wrp.6 for ; Sat, 17 Oct 2020 07:05:21 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id g83sm7477018wmf.15.2020.10.17.07.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KkzjSFScIeOvIHF/kF8jPGG8E3yTqTBPtxI+D53JLeI=; b=jYBQ4BEKTh8kCYMjdPjLZtmWcnRefWvp967sxK+tfjl5IesMkqw+W7FOJFsq+rlUL8 f/oJHwXi/9bmDDKaYJovE3iCFhFNbWVAjg8zR44xlG5Pb54d8BN1C7bqY6Ye2idfX1bt LBEGW0gAQenLHdHub7sr1n7c4UdQ4OPALLRKAHz5KEKhqvNSoP/+JazgPUh4/snXeSz3 v6Lc3VVNMlTc5nDi6AQCzYPjY0GdWaZ0Rs7yIC4X2qLdncwhtpm0F/7Q0bWs0j6L5qQm 2w3BdTcKa6zz0RGUpGnWTzyGniiqoPWmamjE1JK7RWgqyY11lgaWcQXsu0vdkJm9k/Y/ srKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KkzjSFScIeOvIHF/kF8jPGG8E3yTqTBPtxI+D53JLeI=; b=JcZLHzz/2HuDyhdfvjGCAjbNxtePe1l5uaH/q2HMTiQI6qd+bxtiWjnMrhN2PyzY/g 9lJslKatmATWoclPXbqmz+FzkA5Rdw6ppdDF4q/MPkB5xoOfmnDWQX4mGRyXcBFB9pWQ /KUZRNt+MLOpExjkndxAH+vWMwcQs+he0p4Uo7Rn1Z9cmsyrkVb8oFhm5Ty4C4B/f1WL /yAlR/Je1Ljg5jAbSApZr204jITckI5WLuXSx39hDesbylD7yaJgCIj9yIOp7g7BGOg3 mTRrJ+3rCiMZ4/g5qgg/eLSuQlY8HT3YoUBCUf10/Inbl+wwcngWI6wUqi4Mt8bRq1UG +uMw== X-Gm-Message-State: AOAM533X29Fwe7vSZNYP1J6FSMTAWfoE7/Sb6oQEudzPYMfo5JB1Ww5F nEySH5ENmFzmwo4UqRUChx8= X-Google-Smtp-Source: ABdhPJxKQFboNrStLicnmTgxcUWCi3KKpX6hw+lzpcdgj432g7otPb4sAUn78h0+StCYZz0lWiOtAg== X-Received: by 2002:adf:e5cf:: with SMTP id a15mr9917414wrn.186.1602943520242; Sat, 17 Oct 2020 07:05:20 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 33/44] hw/mips/malta: Use clearer qdev style Date: Sat, 17 Oct 2020 16:02:32 +0200 Message-Id: <20201017140243.1078718-34-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) In order to be consistent with the other code base uses, rewrite slightly how the MIPS_MALTA object is created. No logical change. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201012160503.3472140-3-f4bug@amsat.org> --- hw/mips/malta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 944045d7701..ff3225bb8e3 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1235,11 +1235,11 @@ void mips_malta_init(MachineState *machine) DriveInfo *dinfo; int fl_idx =3D 0; int be; + MaltaState *s; + DeviceState *dev; =20 - DeviceState *dev =3D qdev_new(TYPE_MIPS_MALTA); - MaltaState *s =3D MIPS_MALTA(dev); - - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + s =3D MIPS_MALTA(qdev_new(TYPE_MIPS_MALTA)); + sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); =20 /* create CPU */ mips_create_cpu(machine, s, &cbus_irq, &i8259_irq); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) client-ip=209.85.221.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943526; cv=none; d=zohomail.com; s=zohoarc; b=d7dwDuIb+DLlYrYAL33mFuSTt+1FnOT/pJLxZACyuAHHZb7RhoeMSUgkYRC0ZM6nw5kEjryWHx1GXgtPxt3ZLPU5HAzhL66y6EC1tzMv3DYcF5TK0+zus0WZHMlwXbWuxhnabaGZKAlFIDDbqkd2aJe1nKpG9aqKn3EexV5WDUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943526; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4E8kG4ILRSk7MsJbvzjJRPB5rdnj2Bu4UJI6JB3HuIQ=; b=AA0La7PSywFzSVK3+gF28h39J8szgce0PgerJl/wTb9tZmITAHGXfuJe/OTulIXDjwdqAwSCZ2M44GrlbcOHQFdcPaxUjZ+FhnF12f06Lh0bq/dbCLnxgGpIsn2BASO04GQqZbwyzdmq1YZ1IKPDGkIiKVTxgfTRF1BEnUxa+D0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.zohomail.com with SMTPS id 1602943526706499.0736603588192; Sat, 17 Oct 2020 07:05:26 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id h5so6579668wrv.7 for ; Sat, 17 Oct 2020 07:05:26 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id o129sm7229274wmb.25.2020.10.17.07.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4E8kG4ILRSk7MsJbvzjJRPB5rdnj2Bu4UJI6JB3HuIQ=; b=iUcTr3z67+6NWNFjA7GDPK4xAEXZT/ImzFGxJEiBeQOurmkUgkmsPOWlluFg2sbsPG VqUWHPP4OREMQW2mq0vwsBeN9TE0zcRMpNaN7K8A5aPKUxiyUJBZc5e1aMnQQyjPK0p5 GeR2S7KF+7KuBNxNNteu8BiX8nx7VHAtNq8e2MRpWoL9bhrV9Mn3IvyXVy/63g9lXpPW KEFdkiofDn3rETSsX1BGkFTQy2Fu4z8bJ3yML1eDTIrJErAmDR0OJADK2pyAFsdi2B1h Ett0+KMx2mJ3FPobFrXvSZ3sFziHSz0p+ez1+gxUc6A/41KBXsCs1MWyGGdeJjeLgAou q99Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4E8kG4ILRSk7MsJbvzjJRPB5rdnj2Bu4UJI6JB3HuIQ=; b=K15RU5JS8wKoN500aMrCiNgvjQ6XYRwOfoDzVS1XdopUuUXAG4PLBjx62JZteY3sKZ Gxp9HYzfq1Ef+cx1ezv4KBJrG+87Zin8iSu3+i5bH3VTMnqsP6XVXvCkA+AC14D6rrLz JKvrDTx9BndUZQASrkjoIHW3KXyaP5z0RzPhrHtUTARjAEXux4QOkI3gm1Od6LVk4gTz kX8RET448qMQX6+HX71VI7a1/akiDOywdmNm4QcK1pxQy965qF4Hi8sQLTFLAsE1u/48 r92SxeFw+OLqYnftd27BgcX7GTjNePqmVG1QYjlcZC0U1yxFFE3u1px1VRapRRreddEl InEg== X-Gm-Message-State: AOAM532vAlHRjcHhWRzcW9fhruxLRTCTYV+9Flc2MSGpR4shCjhPQXpl gce+bO9LYXMTMIR+NeyGVDI= X-Google-Smtp-Source: ABdhPJy062B0Et3e5Fm/WJ0XhHay2TILDCL+FijssvofiueYvzkbfq5IOZb5gfP7smUTo1VQpn3VNQ== X-Received: by 2002:adf:f3cb:: with SMTP id g11mr10886090wrp.210.1602943524903; Sat, 17 Oct 2020 07:05:24 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 34/44] hw/mips: Simplify loading 64-bit ELF kernels Date: Sat, 17 Oct 2020 16:02:33 +0200 Message-Id: <20201017140243.1078718-35-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Since 82790064116 ("Cast ELF datatypes properly to host 64bit types") we don't need to sign-extend the entry_point address. Remove this unnecessary code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200927163943.614604-2-f4bug@amsat.org> --- hw/mips/mipssim.c | 6 +----- hw/mips/r4k.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index f0042f7f436..afef4f2e77a 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -77,11 +77,7 @@ static int64_t load_kernel(void) (uint64_t *)&entry, NULL, (uint64_t *)&kernel_high, NULL, big_endian, EM_MIPS, 1, 0); - if (kernel_size >=3D 0) { - if ((entry & ~0x7fffffffULL) =3D=3D 0x80000000) { - entry =3D (int32_t)entry; - } - } else { + if (kernel_size < 0) { error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); diff --git a/hw/mips/r4k.c b/hw/mips/r4k.c index 39bc626e7c5..7ee37c49689 100644 --- a/hw/mips/r4k.c +++ b/hw/mips/r4k.c @@ -102,11 +102,7 @@ static int64_t load_kernel(void) (uint64_t *)&entry, NULL, (uint64_t *)&kernel_high, NULL, big_endian, EM_MIPS, 1, 0); - if (kernel_size >=3D 0) { - if ((entry & ~0x7fffffffULL) =3D=3D 0x80000000) { - entry =3D (int32_t)entry; - } - } else { + if (kernel_size < 0) { error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943531; cv=none; d=zohomail.com; s=zohoarc; b=X6UWI8zVRh1FQ0h5UtKjJK72DetrEssCl8JCOEziQuUESDpn0mjpQ19g8a5VwaKxUYeSEMZd/j7/TBeG6GITUxx5OVxewy6B1wxD/t7QF70o5FYQNK5fR+TvEn8ogT3cmYhdOA654fHHQO/knxedeTgUnHJqkpSKp0K8GUNHdZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943531; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Bt4oVFiiKF8ndprKkDoZPz+ozlge1hSxtT3OwSh/bHU=; b=EVgwrsF1KFLSKTjE1pYccr7z1b7h9vEM21qj+6pK/vwkmBkZSRYkqMJLz8uohH1tpaJCWEv/FajDsiMBZ6nekT5DSZRrAr6lHx4ZvVJFDBpXgaZEa3E648NJ7EcesEPqG2kwjKg2BzPoFdHPq/qE1eHUM9IPj4gpX5Bea/TsLGg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 16029435315171.3466278333229411; Sat, 17 Oct 2020 07:05:31 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id q5so8402260wmq.0 for ; Sat, 17 Oct 2020 07:05:30 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id c18sm8821587wrt.10.2020.10.17.07.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bt4oVFiiKF8ndprKkDoZPz+ozlge1hSxtT3OwSh/bHU=; b=dj1g7CUaMqX1C9a9Dv6DxW9I6/lfX6YWm4e1j8eV0sM4WoSB7umnyUa8ZFJkGx+UI0 ZR6XFCJGOBAOQXHpkc7zg5F0Rlzu6gLXnQgGihXHW8YOF3Ey3xtme6dmfjm3xaGN4A3F xNODDjq/5FjX71Z2/Zl9MY2UF2Ae8EuN9Pg74bhiMp+NtErQ8y8Yl5KoEmcKR6f/Egxt jZ53ej5Ib9EPTEmB5ZWjtncMEIgKhh+F6gu9i3dTrK7COyJayZNSvlWgyplVfTOT4uqB 6W6qzSdK9tou4X0l/MpdTlnS6CWI5G+4c18uWc38294G1Z/dU/lomMXUkRlDnBnBbioL RLKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Bt4oVFiiKF8ndprKkDoZPz+ozlge1hSxtT3OwSh/bHU=; b=G52XwadEY8WN+IRb0PFORgw4+z8Pu9Y2r3CsSdvZN18uYJ/DdD8v5vPxF0+6NwRW7R KXZT/jF6uAJzoCM2iU3OH5b/gR1SZOzQh7Z7VvXkTmTxnWElLZCaG/WFyH274TAJLf35 VCVJCCuP8meRt9fEHOl1untp1hXauhm3y8p/6MPVvEHYMVbzDLAS6qSIOLcGfSMK7Zy/ 8ShRBtwgYIVwUItc8y/U1ZfyKW9Wefa4LU1ROIfgtJFPZ4k0715pwYMONQF8Jzvib8PT YYA7l0q9pEAuwdNzZn7cODIyh8eBqK6sGjKtKfXwhhgwoamz7lRsU3uWtUQDikwMMTm8 OxqA== X-Gm-Message-State: AOAM531Yxmhq9e2XZilQlElG5Hvtw8NLogr7CdWrA6bMV53XJv0HU4+w u/qb8R3N9yAHpGLRDC2W7EU= X-Google-Smtp-Source: ABdhPJw+zfUVnonjZrl9qJe5J05dKOVnePJdxGV9kyOZYKmqTxzOeg9qFj7gFA3cPHB7VEQMN1wasQ== X-Received: by 2002:a1c:4006:: with SMTP id n6mr8459943wma.46.1602943529605; Sat, 17 Oct 2020 07:05:29 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 35/44] hw/mips: Simplify code using ROUND_UP(INITRD_PAGE_SIZE) Date: Sat, 17 Oct 2020 16:02:34 +0200 Message-Id: <20201017140243.1078718-36-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Instead of using a INITRD_PAGE_MASK definition, use the simpler INITRD_PAGE_SIZE one which allows us to simplify the code by using directly the self-explicit ROUND_UP() macro. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200927163943.614604-3-f4bug@amsat.org> --- include/hw/mips/mips.h | 4 +++- hw/mips/fuloong2e.c | 3 +-- hw/mips/malta.c | 6 +++--- hw/mips/mipssim.c | 3 +-- hw/mips/r4k.c | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h index 0af4c3d5d74..6c9c8805f3f 100644 --- a/include/hw/mips/mips.h +++ b/include/hw/mips/mips.h @@ -2,8 +2,10 @@ #define HW_MIPS_H /* Definitions for mips board emulation. */ =20 +#include "qemu/units.h" + /* Kernels can be configured with 64KB pages */ -#define INITRD_PAGE_MASK (~((1 << 16) - 1)) +#define INITRD_PAGE_SIZE (64 * KiB) =20 #include "exec/memory.h" =20 diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index b8234f61083..de66215f95f 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -133,8 +133,7 @@ static int64_t load_kernel(CPUMIPSState *env) if (loaderparams.initrd_filename) { initrd_size =3D get_image_size(loaderparams.initrd_filename); if (initrd_size > 0) { - initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & - INITRD_PAGE_MASK; + initrd_offset =3D ROUND_UP(kernel_high, INITRD_PAGE_SIZE); if (initrd_offset + initrd_size > ram_size) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); diff --git a/hw/mips/malta.c b/hw/mips/malta.c index ff3225bb8e3..beb0f43941a 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1077,9 +1077,9 @@ static int64_t load_kernel(void) * the initrd. It takes at most 128kiB for 2GB RAM and 4kiB * pages. */ - initrd_offset =3D (loaderparams.ram_low_size - initrd_size - - (128 * KiB) - - ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; + initrd_offset =3D ROUND_UP(loaderparams.ram_low_size + - (initrd_size + 128 * KiB), + INITRD_PAGE_SIZE); if (kernel_high >=3D initrd_offset) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index afef4f2e77a..97dcc232476 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -90,8 +90,7 @@ static int64_t load_kernel(void) if (loaderparams.initrd_filename) { initrd_size =3D get_image_size(loaderparams.initrd_filename); if (initrd_size > 0) { - initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & - INITRD_PAGE_MASK; + initrd_offset =3D ROUND_UP(kernel_high, INITRD_PAGE_SIZE); if (initrd_offset + initrd_size > loaderparams.ram_size) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); diff --git a/hw/mips/r4k.c b/hw/mips/r4k.c index 7ee37c49689..38308543421 100644 --- a/hw/mips/r4k.c +++ b/hw/mips/r4k.c @@ -115,8 +115,7 @@ static int64_t load_kernel(void) if (loaderparams.initrd_filename) { initrd_size =3D get_image_size(loaderparams.initrd_filename); if (initrd_size > 0) { - initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & - INITRD_PAGE_MASK; + initrd_offset =3D ROUND_UP(kernel_high, INITRD_PAGE_SIZE); if (initrd_offset + initrd_size > ram_size) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943536; cv=none; d=zohomail.com; s=zohoarc; b=bUFB+M8fDh6t4d5tZjkYW92sNOwFZZuN4kEcoH9GMwN0BthSd+5plVJisqO7mb8gHTLq4Qu8YaCQvakWJ+d9czq8+KDAtRKMdgTxJGhX1i89rf0l6sIEq+wUsy3pIOHDWLTte0+8bnD+arVUXzI6oq9BA3kZD3YbYwizOk9PN4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943536; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=caX0J3KNwUejhzwLnMOSmDSfVNvC5iRRJWagljbsOKk=; b=fAlQ4/re4rRovL9Q7J1qaNwWeibb2Q8ESh4mltQTkVZuc9sMf5B4KOAtoVE+42QcublE9xqruDfmHS4kEh7t0WoLgBi3sGkdTQB7h0bzrMr23e3See935sFZuq2KQyd6Gi1NAK5W4BFFrDbd8Lw4F4hcX4OtPcutz8tXLyIyZdg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 1602943536167175.0100237421998; Sat, 17 Oct 2020 07:05:36 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id s9so6562095wro.8 for ; Sat, 17 Oct 2020 07:05:35 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id v189sm7976153wmg.14.2020.10.17.07.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=caX0J3KNwUejhzwLnMOSmDSfVNvC5iRRJWagljbsOKk=; b=ck0FbkPUrdz4mwnnM3EyhjmHiIqnhCR5WdHBavj8JPCjQ/3/gyGW7PeeeHLN2/0Ihk bKAKMOTxbMPVlVOABagTYXeMr40766AtyMHUwqKH7ufnmgOH24zVseMgDavPxTksZMQg bEZD2/O1RQvZAUyCmRa92uXxmckx3d9rnKSc9ZWVXcmKDZdD3fgGXA5le3NFxw9m5uYU bZ7rhIH8kIiUoMD2q/umODCgrbVlltEDAOEjJ1XRwlLg1TPh+No9+V6aLmzXkv8ZyqBq 6JJB8MurPVsiI+WK8D2STzSD9MTmfNqogPmEKykNsnxxWJIge0jFX4hq7DlpsL1S7Afb OqSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=caX0J3KNwUejhzwLnMOSmDSfVNvC5iRRJWagljbsOKk=; b=DDbZRGaiFNk0wxn0ruxeO/tMDcbqcdAWv/g4c6F4pFm80t83J3dU3pw/Xy8DRg2erM CBYWRpEjx52wr8fNBQJBYGd05J6NtYxHF9IDxeTvciHZ1RhD8Ltl1vtEfc4cobKY7yO2 5W2aufe79TDJ1mH/BfD6XjlHXwGiHcMm1TVXbPcbjOUF0mMzw8BNTF8I9hwxM8PFecFr nczSIQTGU3PKxVASA0PdyIaVGXdjjOd6FGc8Lno79Csi+3dWQoQSRbKO2qIB1OnhG489 RulyDs8er5mIG+PDg1Pj/Mf8BqbdEjH0jP4XUFeiwOa778PO/g+BrzIbw+yfNSN8eGkS VkOQ== X-Gm-Message-State: AOAM533dFm4KIvqmDkktiDWnpjOpOKBBlVultQiEVjh4iHVsDllqm7yA ke3DtdIpV0os3va6cnzON4M= X-Google-Smtp-Source: ABdhPJz9AuRcxJaUzRsYHKt34wzsz1mIZOJ47V5Ha8DNGC4cmMEEQAKetV/nq2Xab+fEQMZtTU7uog== X-Received: by 2002:a5d:4409:: with SMTP id z9mr10121883wrq.236.1602943534305; Sat, 17 Oct 2020 07:05:34 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 36/44] hw/mips: Rename TYPE_MIPS_BOSTON to TYPE_BOSTON Date: Sat, 17 Oct 2020 16:02:35 +0200 Message-Id: <20201017140243.1078718-37-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Eduardo Habkost This will make the type name constant consistent with the name of the type checking macro. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200902224311.1321159-19-ehabkost@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/boston.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index cf2296f4488..74c18edbb34 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -44,10 +44,10 @@ #include #include "qom/object.h" =20 -#define TYPE_MIPS_BOSTON "mips-boston" +#define TYPE_BOSTON "mips-boston" typedef struct BostonState BostonState; DECLARE_INSTANCE_CHECKER(BostonState, BOSTON, - TYPE_MIPS_BOSTON) + TYPE_BOSTON) =20 struct BostonState { SysBusDevice parent_obj; @@ -262,7 +262,7 @@ static void mips_boston_instance_init(Object *obj) } =20 static const TypeInfo boston_device =3D { - .name =3D TYPE_MIPS_BOSTON, + .name =3D TYPE_BOSTON, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(BostonState), .instance_init =3D mips_boston_instance_init, @@ -455,7 +455,7 @@ static void boston_mach_init(MachineState *machine) exit(1); } =20 - dev =3D qdev_new(TYPE_MIPS_BOSTON); + dev =3D qdev_new(TYPE_BOSTON); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 s =3D BOSTON(dev); --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) client-ip=209.85.128.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943541; cv=none; d=zohomail.com; s=zohoarc; b=Up9TBWZsMsHoYC6AaT/AqXxFTN8mwVgP0uH0d7p7jjD+yGO0VRRXPq+3LAdbTfAxO9tox6lPxQc+w+U0ar67kkK+8Glf+wZbcyOWZXrRx4rKhiv9A1DopQsqpBSUshgPuPLcsicuHaTDVmf6gvpW/TPvlfEfiznmgL7xtQNaiyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943541; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AHKgFTwyonlJMqUSo/VQEjDBt8yNtjw9Fbnqm+Zig2A=; b=VWrq+/KlU3Y/63Dkc1ueFOkLUDEp96BhdxUAFEWX4iw5idjYYFpG9ooPctjKB7FHcU3exoujp1y3ApEe9hIm0Km6xgQesPt/jKzxOoxucBaOtrk2fFMLuCpsir2oeFZ2RM0q/1jzLATrKIHbIcsK9J+Vu8FsioFellM6v04p2m4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.zohomail.com with SMTPS id 1602943541138361.5244150734484; Sat, 17 Oct 2020 07:05:41 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id j136so8391881wmj.2 for ; Sat, 17 Oct 2020 07:05:40 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id r1sm9098034wro.18.2020.10.17.07.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AHKgFTwyonlJMqUSo/VQEjDBt8yNtjw9Fbnqm+Zig2A=; b=JKUc/F0ME2xaE+SsbpW6aq8Xb+cFkNBz4zNuxePa3VgSfgTvGOtbB0gYRaqFxY0JxT dFPWcXYNCNAo1kc/iH+W58i2WF86sYEZxrYCnus9T2SW9ii/YdAAzzp9eipL3Hpv++lY uW2M0hx2IekSLiWSOhoapNFdJ6pcvdBBaqr3HO65sQKULRjwNoP4ahcoQGVaOL+Eq3sm ZP0UztDTu/4WT7QEYCJM7iBmosYxBRFo/o8BCdfLjDVD8WlfpxHJYuN4uE1VXxQzB+ru tAtNESc+MxzsTcHSPFzLhCZQb4asPUF5z+cS4U5x5fwUGcuQZ/Xw4p8lHdOWqX7GNMqx kZsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AHKgFTwyonlJMqUSo/VQEjDBt8yNtjw9Fbnqm+Zig2A=; b=ge4HOgchJ7cQKR9njR6a68imxzHeOkq+kxK2V01fqBmrQELICrIqkvzavy7auG8a7o 9vP2pbmhIyyXyiwc6+uh8esvF+LMfiZCueDMkgT/GS+Ly7u6wsiQqI/JwEofaahapCKF RajvezDtPh9Qgo3oX6MS/Up7OSgHozLgIXHB/68NVrNoXQlMyVZV1shRVHbQfMp7duJ4 C2A8/+Na2djPKQPRVbYo2sf2sui4RGCeqv7KLciXun02aHJq6lIo6LdUsgxL3N/wTM7W zcvqfHFJfim5x9Mrq08OczufJjWTjnAJ+4PUO5KCCPR3jiNWJRuZC/+R7fKIGk9OYL60 gWaA== X-Gm-Message-State: AOAM530yTwiicdhfd0+Mjn9FQRzvkmObc3+Sgn7PIFxQB1mCHTJ3Vfbd ujoCrUf2p09VIGVN79TxADQ= X-Google-Smtp-Source: ABdhPJziIqazOQvmXQvGUIrrm0X3L/uh1C92KlG2t5MI5XxWjIevMoNtG4CJvuHoiZ9Cf7pBWDT73Q== X-Received: by 2002:a1c:bc03:: with SMTP id m3mr8929428wmf.171.1602943539165; Sat, 17 Oct 2020 07:05:39 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Pavel Dovgalyuk , Pavel Dovgalyuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 37/44] hw/mips: Remove exit(1) in case of missing ROM Date: Sat, 17 Oct 2020 16:02:36 +0200 Message-Id: <20201017140243.1078718-38-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Pavel Dovgalyuk This patch updates MIPS-based machines to allow starting them without ROM. In this case CPU starts to execute instructions from the empty memory, but QEMU allows introspecting the machine configuration. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <159531210571.24117.231100997794891819.stgit@pasha-ThinkPad-X28= 0> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/fuloong2e.c | 8 +++----- hw/mips/jazz.c | 8 +++----- hw/mips/malta.c | 11 ++++------- hw/mips/mipssim.c | 10 +++------- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index de66215f95f..a9e0c2f8d30 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -337,10 +337,8 @@ static void mips_fuloong2e_init(MachineState *machine) kernel_entry =3D load_kernel(env); write_bootloader(env, memory_region_get_ram_ptr(bios), kernel_entr= y); } else { - if (bios_name =3D=3D NULL) { - bios_name =3D FULOONG_BIOSNAME; - } - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, + bios_name ?: FULOONG_BIOSNAME); if (filename) { bios_size =3D load_image_targphys(filename, 0x1fc00000LL, BIOS_SIZE); @@ -350,7 +348,7 @@ static void mips_fuloong2e_init(MachineState *machine) } =20 if ((bios_size < 0 || bios_size > BIOS_SIZE) && - !kernel_filename && !qtest_enabled()) { + bios_name && !qtest_enabled()) { error_report("Could not load MIPS bios '%s'", bios_name); exit(1); } diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 8f1ad55ba34..71448f72ac9 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -218,10 +218,7 @@ static void mips_jazz_init(MachineState *machine, memory_region_add_subregion(address_space, 0xfff00000LL, bios2); =20 /* load the BIOS image. */ - if (bios_name =3D=3D NULL) { - bios_name =3D BIOS_FILENAME; - } - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name ?: BIOS_FIL= ENAME); if (filename) { bios_size =3D load_image_targphys(filename, 0xfff00000LL, MAGNUM_BIOS_SIZE); @@ -229,7 +226,8 @@ static void mips_jazz_init(MachineState *machine, } else { bios_size =3D -1; } - if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) && !qtest_enabled(= )) { + if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) + && bios_name && !qtest_enabled()) { error_report("Could not load MIPS bios '%s'", bios_name); exit(1); } diff --git a/hw/mips/malta.c b/hw/mips/malta.c index beb0f43941a..9d1a3b50b7a 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1332,10 +1332,8 @@ void mips_malta_init(MachineState *machine) /* Load firmware from flash. */ if (!dinfo) { /* Load a BIOS image. */ - if (bios_name =3D=3D NULL) { - bios_name =3D BIOS_FILENAME; - } - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, + bios_name ?: BIOS_FILENAME); if (filename) { bios_size =3D load_image_targphys(filename, FLASH_ADDRESS, BIOS_SIZE); @@ -1344,9 +1342,8 @@ void mips_malta_init(MachineState *machine) bios_size =3D -1; } if ((bios_size < 0 || bios_size > BIOS_SIZE) && - !kernel_filename && !qtest_enabled()) { - error_report("Could not load MIPS bios '%s', and no " - "-kernel argument was specified", bios_name); + bios_name && !qtest_enabled()) { + error_report("Could not load MIPS bios '%s'", bios_name); exit(1); } } diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index 97dcc232476..aaa62a0f4b7 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -177,10 +177,7 @@ mips_mipssim_init(MachineState *machine) /* Map the BIOS / boot exception handler. */ memory_region_add_subregion(address_space_mem, 0x1fc00000LL, bios); /* Load a BIOS / boot exception handler image. */ - if (bios_name =3D=3D NULL) { - bios_name =3D BIOS_FILENAME; - } - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name ?: BIOS_FIL= ENAME); if (filename) { bios_size =3D load_image_targphys(filename, 0x1fc00000LL, BIOS_SIZ= E); g_free(filename); @@ -188,10 +185,9 @@ mips_mipssim_init(MachineState *machine) bios_size =3D -1; } if ((bios_size < 0 || bios_size > BIOS_SIZE) && - !kernel_filename && !qtest_enabled()) { + bios_name && !qtest_enabled()) { /* Bail out if we have neither a kernel image nor boot vector code= . */ - error_report("Could not load MIPS bios '%s', and no " - "-kernel argument was specified", bios_name); + error_report("Could not load MIPS bios '%s'", bios_name); exit(1); } else { /* We have a boot vector start address. */ --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943545; cv=none; d=zohomail.com; s=zohoarc; b=GKw9Qj0/UtY8bQo9ESwTD+r+Ed1HhI4tH+XdkEQRYQWqFSYZTpP774y56iTPFWsqBkje9kFhsNX/RSNRfxXgw0anxQ6dCG4wJsmfYkUHGomRoXiE7tkHR1WQlZfvcQzsGW/DFEnTcjgcVazsK+71KceE9zrsWo8fyvfvroYyI4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943545; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+CYvCstImxcfpk9WSA/eu2edNWlMFkElf3HOFbRFB8Q=; b=A9R/sPASDqZ0mfpDE6WNNPZ91E3PP3Ycs4z17Z7NjHbaBpsstXQVHPinfqw4PVsMlbz9t6THU9NWTqP2GC+4lJbYrpoQfrwFHSil7Wng1PHmn3lEzmGIqBmhnIapRAc0VPv2IjNfs6DTzaDpB7wDP20JLTDbPkyRM89KZOIQidE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 1602943545756550.0919002739646; Sat, 17 Oct 2020 07:05:45 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id b127so8382524wmb.3 for ; Sat, 17 Oct 2020 07:05:45 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id v189sm7976682wmg.14.2020.10.17.07.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+CYvCstImxcfpk9WSA/eu2edNWlMFkElf3HOFbRFB8Q=; b=He7LeuuO51+0FOFN4RPJwc5R2TPcnWiO0ewnOLhBPrvQRJLA0UPiXlDv6xO8b4Shg2 6KAivlYovZ8vkRniVPJsZen1PFJjOSux9pd0ueGQ8KxiLjjsY2tvz74orVPCcHlb2VQS pUp9PSxNYtiuloAHS45SfwcWl/RR8UGKWpEVCZ3Ffm3KCLbfq+g6ukzYGXlgof4W8qq5 eiLkUgaR+8yfDDSuDYCWzkugKEurK/1YuHWjlQQncGe2uLIkrIY/1UqyN5Dx0XLpN6ox IGsje0gffSQtnUfQQ5ms9fM4YciIjQdeqbPBPxXwdBwerKloxVvnuPpwOHzHS+2ryb8U xVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+CYvCstImxcfpk9WSA/eu2edNWlMFkElf3HOFbRFB8Q=; b=WRp9lPEbf4fEoX8MmkJPyNB6U0rbfMkM+efBxPHI/brmgZWCQm16oXAPQQe7qdB2Yw t85+p+zGKCdaJDHv1vQHwjB/v52+KlAtyYMGJmyZoYMfNLgZkFjr60HSkmAaGuTBwVrf N+Bjl+Z4637rzyY3MsU18lWMmL1coUef2YN62BtCCs5dK9yJySLEdi3TEDY53BBq2thS cHcmoz/3FvlWR0FZiNkpWjADPyyWSwTZowxMCqVhvcLJxJ8vbjm8Q9fd6XVvFKIZJ99a pHRRO9ZSVdaMnI/nMq7U/IaGtWEHhXsFej9qA1L0/Xmq7pvY0FlbK9NBHF6nl11I5QZZ hE1w== X-Gm-Message-State: AOAM533JrEnQLp2MH3lYeh03zLlQgB241oRxrJ3aXgaNW0qqBg5Z6jcD fxVmesLXgrT4nRt/dXNGBAc= X-Google-Smtp-Source: ABdhPJxaKmYnXhgRz2xaCxe5BFX1wlLJUsKi1/Z7gZWEPeO9SoYbF0bzZ5Cd87e7hvq7nHXbmgZkkw== X-Received: by 2002:a1c:e309:: with SMTP id a9mr9150648wmh.90.1602943543780; Sat, 17 Oct 2020 07:05:43 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Pavel Dovgalyuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 38/44] tests/acceptance: Add MIPS record/replay tests Date: Sat, 17 Oct 2020 16:02:37 +0200 Message-Id: <20201017140243.1078718-39-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Pavel Dovgalyuk This patch adds MIPS-targeted acceptance tests for record/replay functions. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <160276110297.2705.10918105269658307206.stgit@pasha-ThinkPad-X2= 80> [PMD: Moved 'override timeout' comment from instance to class, moved nanomips tests to ReplayKernelSlow class, tagged ReplayKernelSlow class with AVOCADO_TIMEOUT_EXPECTED] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/replay_kernel.py | 167 +++++++++++++++++++++++++++++- 1 file changed, 166 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 952f429cace..00c228382bd 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -9,6 +9,8 @@ # later. See the COPYING file in the top-level directory. =20 import os +import lzma +import shutil import logging import time =20 @@ -19,7 +21,7 @@ from avocado.utils import process from boot_linux_console import LinuxKernelTest =20 -class ReplayKernel(LinuxKernelTest): +class ReplayKernelBase(LinuxKernelTest): """ Boots a Linux kernel in record mode and checks that the console is operational and the kernel command line is properly passed @@ -74,6 +76,7 @@ def run_rr(self, kernel_path, kernel_command_line, consol= e_pattern, logger =3D logging.getLogger('replay') logger.info('replay overhead {:.2%}'.format(t2 / t1 - 1)) =20 +class ReplayKernelNormal(ReplayKernelBase): @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') def test_x86_64_pc(self): """ @@ -91,6 +94,51 @@ def test_x86_64_pc(self): =20 self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5) =20 + def test_mips_malta(self): + """ + :avocado: tags=3Darch:mips + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:big + """ + deb_url =3D ('http://snapshot.debian.org/archive/debian/' + '20130217T032700Z/pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb') + deb_hash =3D 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinux-2.6.32-5-4kc-ma= lta') + kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE + 'console= =3DttyS0' + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + + self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5) + + def test_mips64el_malta(self): + """ + This test requires the ar tool to extract "data.tar.gz" from + the Debian package. + + The kernel can be rebuilt using this Debian kernel source [1] and + following the instructions on [2]. + + [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/ + #linux-source-2.6.32_2.6.32-48 + [2] https://kernel-team.pages.debian.net/kernel-handbook/ + ch-common-tasks.html#s-common-official + + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:malta + """ + deb_url =3D ('http://snapshot.debian.org/archive/debian/' + '20130217T032700Z/pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb') + deb_hash =3D '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinux-2.6.32-5-5kc-ma= lta') + kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE + 'console= =3DttyS0' + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5) + def test_aarch64_virt(self): """ :avocado: tags=3Darch:aarch64 @@ -302,3 +350,120 @@ def test_xtensa_lx60(self): file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) self.do_test_advcal_2018(file_path, 'santas-sleigh-ride.elf', args=3D('-cpu', 'dc233c')) + +@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') +class ReplayKernelSlow(ReplayKernelBase): + # Override the timeout, because this kernel includes an inner + # loop which is executed with TB recompilings during replay, + # making it very slow. + timeout =3D 180 + + def test_mips_malta_cpio(self): + """ + :avocado: tags=3Darch:mips + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:big + :avocado: tags=3Dslowness:high + """ + deb_url =3D ('http://snapshot.debian.org/archive/debian/' + '20160601T041800Z/pool/main/l/linux/' + 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb') + deb_hash =3D 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinux-4.5.0-2-4kc-mal= ta') + initrd_url =3D ('https://github.com/groeck/linux-build-test/raw/' + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/' + 'mips/rootfs.cpio.gz') + initrd_hash =3D 'bf806e17009360a866bf537f6de66590de349a99' + initrd_path_gz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) + initrd_path =3D self.workdir + "rootfs.cpio" + archive.gzip_uncompress(initrd_path_gz, initrd_path) + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 console=3Dtty ' + 'rdinit=3D/sbin/init noreboot') + console_pattern =3D 'Boot successful.' + self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5, + args=3D('-initrd', initrd_path)) + + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + def test_mips64el_malta_5KEc_cpio(self): + """ + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:little + :avocado: tags=3Dslowness:high + """ + kernel_url =3D ('https://github.com/philmd/qemu-testing-blob/' + 'raw/9ad2df38/mips/malta/mips64el/' + 'vmlinux-3.19.3.mtoman.20150408') + kernel_hash =3D '00d1d268fb9f7d8beda1de6bebcc46e884d71754' + kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) + initrd_url =3D ('https://github.com/groeck/linux-build-test/' + 'raw/8584a59e/rootfs/' + 'mipsel64/rootfs.mipsel64r1.cpio.gz') + initrd_hash =3D '1dbb8a396e916847325284dbe2151167' + initrd_path_gz =3D self.fetch_asset(initrd_url, algorithm=3D'md5', + asset_hash=3Dinitrd_hash) + initrd_path =3D self.workdir + "rootfs.cpio" + archive.gzip_uncompress(initrd_path_gz, initrd_path) + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 console=3Dtty ' + 'rdinit=3D/sbin/init noreboot') + console_pattern =3D 'Boot successful.' + self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5, + args=3D('-initrd', initrd_path, '-cpu', '5KEc')) + + def do_test_mips_malta32el_nanomips(self, kernel_path_xz): + kernel_path =3D self.workdir + "kernel" + with lzma.open(kernel_path_xz, 'rb') as f_in: + with open(kernel_path, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'mem=3D256m@@0x0 ' + 'console=3DttyS0') + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5, + args=3D('-cpu', 'I7200')) + + def test_mips_malta32el_nanomips_4k(self): + """ + :avocado: tags=3Darch:mipsel + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:little + """ + kernel_url =3D ('https://mipsdistros.mips.com/LinuxDistro/nanomips= /' + 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' + 'generic_nano32r6el_page4k.xz') + kernel_hash =3D '477456aafd2a0f1ddc9482727f20fe9575565dd6' + kernel_path_xz =3D self.fetch_asset(kernel_url, asset_hash=3Dkerne= l_hash) + self.do_test_mips_malta32el_nanomips(kernel_path_xz) + + def test_mips_malta32el_nanomips_16k_up(self): + """ + :avocado: tags=3Darch:mipsel + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:little + """ + kernel_url =3D ('https://mipsdistros.mips.com/LinuxDistro/nanomips= /' + 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' + 'generic_nano32r6el_page16k_up.xz') + kernel_hash =3D 'e882868f944c71c816e832e2303b7874d044a7bc' + kernel_path_xz =3D self.fetch_asset(kernel_url, asset_hash=3Dkerne= l_hash) + self.do_test_mips_malta32el_nanomips(kernel_path_xz) + + def test_mips_malta32el_nanomips_64k_dbg(self): + """ + :avocado: tags=3Darch:mipsel + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:little + """ + kernel_url =3D ('https://mipsdistros.mips.com/LinuxDistro/nanomips= /' + 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' + 'generic_nano32r6el_page64k_dbg.xz') + kernel_hash =3D '18d1c68f2e23429e266ca39ba5349ccd0aeb7180' + kernel_path_xz =3D self.fetch_asset(kernel_url, asset_hash=3Dkerne= l_hash) + self.do_test_mips_malta32el_nanomips(kernel_path_xz) --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) client-ip=209.85.221.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943550; cv=none; d=zohomail.com; s=zohoarc; b=iHYGTWgIe3x/jCCTG6mwz6gJa/xisl3790LujnC4Q98SrsR4v8OToVvGF0ffwJZlh280D7mudreEQdFsjCQV3LXf2/A62nRbcGGd4SrgjpfP5Ull+uhBaNAzJt2yZuRLUaID/papSuWp/yy6W8yh3WL9MaPuqk0rQS/kwKMcafw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943550; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dSahlHdpw0kcXQSlWWNINDnUw99PjFmYJxHiZAKo1Pg=; b=ZHA/ztkOsqjJrTbJ4Mcc+pETZ4sOrdC3uSA7KU4sk6u7edt0sj6OgxYbpsiRJNEMTccnwFAYezuF//o6Am7bNRtq2gLT+sXcq4nOU2wUe+EJGD4Uh+/JYlt4I7C9wu435w1YuTkitKKoZsUXgxWQYBwwcSo7QYEyB1UkeVYVKDU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.zohomail.com with SMTPS id 1602943550142779.5848255271568; Sat, 17 Oct 2020 07:05:50 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id n6so6533896wrm.13 for ; Sat, 17 Oct 2020 07:05:49 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id u195sm7587193wmu.18.2020.10.17.07.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dSahlHdpw0kcXQSlWWNINDnUw99PjFmYJxHiZAKo1Pg=; b=NouoASfGbmVP+SVsMkd1NA62REnHgBgetI9QIRqqpZcdxRlZ3m9sbBDecTPK7kS9sa YFgE1tfFNZ/ddcrlMRhZalz4rsFPxLLltjZWBAngTH62m5QiZKje5+yTeT1tnvC/fct2 kPS2S/cG2H00sIZXpJRq9qsMuVwrbeKma12hWhI6VlCezRXr8BED3tG8jsrrRDRUr1zy lrUf76QYG95HGpSIGEAIN9HaZZdhaRqdcMDEL6xvlxtutz91W31O1e+EMLhcQAm4Mscr 65GkGB3f+ta/e3GzzRbvs0xhpN/PTl5wTQNn33RIfJtRh8j7c+xw38R2tT1UBvo99b6J CidA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dSahlHdpw0kcXQSlWWNINDnUw99PjFmYJxHiZAKo1Pg=; b=tA8w/+g7thYrVouJGlbuEFQUSxgPf4+uPz+HgQzhJtl7bqD9Kumk1b8j/MHgfTK0wM 8aych57NEZlPxasScyf/yxJrj2p6rm6+yiSyjlD7MvzucidxfTN5kjRTQNg7Ani42yec fUUcG86dj8sQ0FNaexyk4NO7kzhzrAGrnoAeal1ORs9eruepqrLvNBpjp2urFB3wcTB2 EC89kWEHbyEqrUlTNwtWm4aytTsI6xhb6LPqe9mU/mJXTIeXBDA3y5+FNqrPbzNH6EU0 DBbmBSSgEJwQEgoZ/Vpxp1MGlJLK5Xlw1JQJHFK43qZutgMxVPeRImAMlpun+SscNafJ lCDA== X-Gm-Message-State: AOAM530EHWMrP5bGeSZq8e+UTtqsxOvrgbjC9S0mfcPxtR9RJ1wtK6XK J9TuNKXcr65JE9LjvA2pd+g= X-Google-Smtp-Source: ABdhPJyLV7kknIDPho83bmmh68fhgs0vu8dzV8XoNcvbAXAnrA3PIH82Ft4ylENI4Vt3+JfkXeiNZQ== X-Received: by 2002:adf:ef06:: with SMTP id e6mr10176502wro.397.1602943548359; Sat, 17 Oct 2020 07:05:48 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 39/44] docs/system: Update MIPS CPU documentation Date: Sat, 17 Oct 2020 16:02:38 +0200 Message-Id: <20201017140243.1078718-40-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Huacai Chen Add Loongson-3A CPU models description. Signed-off-by: Huacai Chen Message-Id: <1602059975-10115-10-git-send-email-chenhc@lemote.com> [PMD: Split patch in 2: CPU / machine] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/system/cpu-models-mips.rst.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/system/cpu-models-mips.rst.inc b/docs/system/cpu-models-m= ips.rst.inc index 499b5b6fedb..02cc4bb884c 100644 --- a/docs/system/cpu-models-mips.rst.inc +++ b/docs/system/cpu-models-mips.rst.inc @@ -48,11 +48,17 @@ across all desired hosts. ``I6400`` MIPS64 Processor (Release 6, 2014) =20 +``Loongson-2E`` + MIPS64 Processor (Loongson 2, 2006) + ``Loongson-2F`` MIPS64 Processor (Loongson 2, 2008) =20 -``Loongson-2E`` - MIPS64 Processor (Loongson 2, 2006) +``Loongson-3A1000`` + MIPS64 Processor (Loongson 3, 2010) + +``Loongson-3A4000`` + MIPS64 Processor (Loongson 3, 2018) =20 ``mips64dspr2`` MIPS64 Processor (Release 2, 2006) --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) client-ip=209.85.128.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943554; cv=none; d=zohomail.com; s=zohoarc; b=GpIReJOm3ieJSCKR1KQD7D+nX3hasEVDHfvt1fFYjQXtySLdmqk+61CqWrSr+a7X3gpBVbqx/iOVguJ+TPesaZQ6uvXSG/tqbjnkdqj3By5IUAZRaZRtsOzrCbyRSwBboIqhk5szSr60uuogSvopeucWOT0sW/5NJ/B+0J56BUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943554; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iuO8xvBpXep6eLb/F7St0rc68Indv4ZsZQ0L+M/FNuI=; b=eg9sDxpE6vql1p5+8YGpeuqEhcblxW2Q/GmPCqT1uIQBUtos2VmfXoqSpKghh1/yvRH5RbxMkUFNhQGVXUaX2sw97VcfZ2JCwGfF1hIPcRV7fs6QeIztXLbllUAVEG7Lpbw+f1k/mRqnSOepCa65DYsjhdQIkD0nolESN11f4M8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.zohomail.com with SMTPS id 1602943554675891.5131480315957; Sat, 17 Oct 2020 07:05:54 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id 13so6158753wmf.0 for ; Sat, 17 Oct 2020 07:05:54 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id g125sm2890034wme.33.2020.10.17.07.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iuO8xvBpXep6eLb/F7St0rc68Indv4ZsZQ0L+M/FNuI=; b=P7XiCO+Oetyfs+aDoX6OecYt24LulPbyceXndHiTY11Mdg6H2DnGpYcELidRXH4+Y+ 7N+TbKu0NFoCkVYVNWbvNlrGd2RfpG9rI4vHv1j53lx1Ts7KsNzY3d14ABLVbk2/+YxC cNPLAs0PP4X7cbRecK2aWDVg0WzGUyBtclJTQ44jneI2IA+E645sMxye0pkTOn/4Io6M NbjFDFU0tbQRVf8WO1XaScl8NWExdkLZPyhBTSkxPmaRlYoqKxo+wTf0aysCktAobQSo G3PfYbsPg/L/lHrILoQgv9yPUzkMR3wmkd7HZ73VUaPWPSW0wH2TMkRBWJ7RXNpWT7Vj cYxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iuO8xvBpXep6eLb/F7St0rc68Indv4ZsZQ0L+M/FNuI=; b=t25crU5/5KTrzJ0XdJ/FN3bO8ABHPvlEfM97FbtPMPP+5dWMBoWDvUbbtb8Biwrx5m oEtB7/0e/x62d6UmojblC9dzW2bqXlr9VJI3RAsc5qJRaKGSWQRsN28dTtGcHRpYOS7V odKaPyD/VG9zVCUltk8j2PpMpMjZweYSqLNg/JaKv985jL94mflFT0ZrrrwpHh86vgbj IbHdZKhz+RnWTMKaWSPSOZwSkKoumyUQhkjPpctDKIDhyVgIgRIcXPPa5su+pHCqTWwm 2LJCuLNg8n0QOCKsPx8S+6p1Fs9kP5eSi6T8j3fCM8UukArrX9dGkwCZHxZWYbCN/m1M 0s2g== X-Gm-Message-State: AOAM531GtCRP9K4miSNwM2ZBrzDMVbCaWmEk6Gk+RUhivYGEtCXyOB04 21wOic5FGHwTQhT1fGVtppo= X-Google-Smtp-Source: ABdhPJxykTBXGwmq/YYhM5dLoMcVfRHRm4PsTDJT3jMl89PfESvOBCH29BIUSv144QGxxtKYuUSQ4Q== X-Received: by 2002:a05:600c:2905:: with SMTP id i5mr8712893wmd.9.1602943552836; Sat, 17 Oct 2020 07:05:52 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 40/44] MAINTAINERS: Remove myself Date: Sat, 17 Oct 2020 16:02:39 +0200 Message-Id: <20201017140243.1078718-41-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From: Aleksandar Markovic I have been working on project other than QEMU for some time, and would like to devote myself to that project. It is impossible for me to find enough time to perform maintainer's duties with needed meticulousness and patience. I wish prosperous future to QEMU and all colleagues in QEMU community. Signed-off-by: Aleksandar Markovic Message-Id: <1602103041-32017-6-git-send-email-aleksandar.qemu.devel@gmail.= com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 99ab02bbab3..b91bd754d16 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -220,11 +220,10 @@ F: hw/microblaze/ F: disas/microblaze.c =20 MIPS TCG CPUs -M: Aleksandar Markovic R: Aurelien Jarno R: Jiaxun Yang R: Aleksandar Rikalo -S: Maintained +S: Orphaned F: target/mips/ F: default-configs/*mips* F: disas/*mips* @@ -386,7 +385,6 @@ F: target/arm/kvm.c =20 MIPS KVM CPUs M: Huacai Chen -M: Aleksandar Markovic S: Odd Fixes F: target/mips/kvm.c =20 @@ -1123,10 +1121,9 @@ F: hw/display/jazz_led.c F: hw/dma/rc4030.c =20 Malta -M: Aleksandar Markovic M: Philippe Mathieu-Daud=C3=A9 R: Aurelien Jarno -S: Maintained +S: Odd Fixes F: hw/isa/piix4.c F: hw/acpi/piix4.c F: hw/mips/malta.c @@ -1136,14 +1133,12 @@ F: tests/acceptance/linux_ssh_mips_malta.py F: tests/acceptance/machine_mips_malta.py =20 Mipssim -M: Aleksandar Markovic R: Aleksandar Rikalo -S: Odd Fixes +S: Orphaned F: hw/mips/mipssim.c F: hw/net/mipsnet.c =20 R4000 -M: Aleksandar Markovic R: Aurelien Jarno R: Aleksandar Rikalo S: Obsolete @@ -1152,7 +1147,6 @@ F: hw/mips/r4k.c Fuloong 2E M: Huacai Chen M: Philippe Mathieu-Daud=C3=A9 -M: Aleksandar Markovic R: Jiaxun Yang S: Odd Fixes F: hw/mips/fuloong2e.c @@ -2823,12 +2817,11 @@ F: tcg/i386/ F: disas/i386.c =20 MIPS TCG target -M: Aleksandar Markovic R: Aurelien Jarno R: Huacai Chen R: Jiaxun Yang R: Aleksandar Rikalo -S: Maintained +S: Orphaned F: tcg/mips/ =20 PPC TCG target @@ -3169,7 +3162,7 @@ S: Odd Fixes F: scripts/git-submodule.sh =20 UI translations -M: Aleksandar Markovic +S: Orphaned F: po/*.po =20 Sphinx documentation configuration and build machinery --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) client-ip=209.85.221.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943559; cv=none; d=zohomail.com; s=zohoarc; b=hq1fELzBctyi5VU79UokRRMyfKnvmGcmQCCqe3j0kqc4OO4ZD1dh8H/B/tTGviz7M+pzncs+JJ9INuVSJu9DkUolt4Tmpe6vPWoRw5gRQQZwvVYwkTM+bWKMpx4aORuETmKArleYydp7zkFnMPVAa47IXEA8Ki9jFaq3iSfx40A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943559; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=R9s97XnziS84CJxznkT3kO4RYyRvIgTfNhbxkGtnHzo=; b=HDQrSZWdg8CLoqWSl/i/iNsqQyMXQZxPIwoP/hTrUPdKvl0da0BXDBj/EH4F6bzjY9vyqjvUOBBv8rPgfN1Ku8zIrVx6GysdrWeIHPqjA92+4fyDVj+28Akn0ci+TvjRIGg6qD4t/Z5xg2Hekloor+spteDRDv9rDd+i3dcc3/Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.zohomail.com with SMTPS id 1602943559125849.5912554300331; Sat, 17 Oct 2020 07:05:59 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id n18so6594756wrs.5 for ; Sat, 17 Oct 2020 07:05:58 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id m1sm7386347wmm.34.2020.10.17.07.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R9s97XnziS84CJxznkT3kO4RYyRvIgTfNhbxkGtnHzo=; b=hG4eVTOk6zCSy18itUnW6ZxoR+0pESltx329gRiPl46Lcw7JCaC6Un2mW08yfvptZ/ XkBwYkHzggsj6hWAsNzQreCJW9XUQCEbcUu6quxdKm9NAdvzN645J+j/ZrCRG0BSwENo FPKmIv61NXdZQ3VSqjEl/lr40VHOmvUr998cqTjZ5MThJyoYEAPvEvVcnlG/xawXTkfP wUZlSOeEFM2XCgQfXuW4vu/iTlcE/TARubHOY92xeibjCEogB+9epT66QH4rLKNwwcSq P1EhG/fRtN1iF4qtr4pnubLFxJj1wGU96krIrJG6CrYMl4FztLWMAvnIgt9WRG7+v+HF Sbrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R9s97XnziS84CJxznkT3kO4RYyRvIgTfNhbxkGtnHzo=; b=t9aPaKRNkz48jL88xw1qymvhWANKe2dqBYDLsWssIH5VL8Qmzb5SXdkNXhF8daiCid YrDGgta6GjjpV3Rqtmgkg0Ft4iHpTAeG1fRC/ivOgJq1LlR5DIzZrqC9VAnHe1UnL4mb 2Tu/HWDrheMOUzo6cF9sLGFR7ZZVzjo6zj+n+vKwcIdn2ZzNBvWdenULGK1qzMOAZAiR HN7lBhRxeyCpD66zEaMm5DDX5sMVWStX+r4bRm1RE8nnNkHha9QUA2Bm7TPnuWZNBX9v RYYWkX8fIGg3jcuLkIQgT8lc74BfzaZ5W/x84tcHQBiVVt+ixUJKGOiF2wVdJefMEHGJ Uo2Q== X-Gm-Message-State: AOAM5336PAgvnN92sMsY5ZZJqKRpXtlhDyPxMBGL0rRuaI0ooCwWzsSE i39lA+GF3B3DIVF6rS/P2WA= X-Google-Smtp-Source: ABdhPJz2rhwkZtWTcrx1wuwnvRrMbVqU9sV+wM14dQmGQLencTRZKYVhefo8rWyE0T78eDVCuUtSog== X-Received: by 2002:adf:e8c7:: with SMTP id k7mr10265454wrn.102.1602943557355; Sat, 17 Oct 2020 07:05:57 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 41/44] MAINTAINERS: Put myself forward for MIPS target Date: Sat, 17 Oct 2020 16:02:40 +0200 Message-Id: <20201017140243.1078718-42-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) To avoid the MIPS target being orphan, volunteer to keep an eye on it and put together pull requests. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Thomas Huth Message-Id: <20201013101659.3557154-2-f4bug@amsat.org> --- MAINTAINERS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b91bd754d16..50fb9fda34d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -220,10 +220,11 @@ F: hw/microblaze/ F: disas/microblaze.c =20 MIPS TCG CPUs +M: Philippe Mathieu-Daud=C3=A9 R: Aurelien Jarno R: Jiaxun Yang R: Aleksandar Rikalo -S: Orphaned +S: Odd Fixes F: target/mips/ F: default-configs/*mips* F: disas/*mips* @@ -2817,11 +2818,12 @@ F: tcg/i386/ F: disas/i386.c =20 MIPS TCG target +M: Philippe Mathieu-Daud=C3=A9 R: Aurelien Jarno R: Huacai Chen R: Jiaxun Yang R: Aleksandar Rikalo -S: Orphaned +S: Odd Fixes F: tcg/mips/ =20 PPC TCG target --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) client-ip=209.85.221.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943563; cv=none; d=zohomail.com; s=zohoarc; b=Y6xaGwV9hQtR/zshklyMltWVGiH8EdDhqx3We7K9+6Ajc3pB4na9t1bs/KJOEpOCrJHOBod8Gnwki5qTkdiHMmrnHlQDqL0dpGicoCfSBhJKHA4c+JcpjVDzIHNh4raA/bl+jSTWhtxd8fjo8W409K+hD8O4A9eaE3XXMsbs18o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943563; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K4I6rKlRV5CwkXwi1bhz1e4ZJqjshXMHPloXxAGf1Gs=; b=A/T9pCa2HTfo4n8x6QRDzjWFPYdDoLVxOdW0M7YgCFldxmEzBdGnt9sg/jPGFUox9CQbbbhSGi8hW5HA00hXCl76DwmhiQDOsUNDr6agheTbXe+qd1ZN+E/cXXr5GbQE2z5p/GAaQNF3P/OIO0Fse5EtD/75rs+3w03gquc3mXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.zohomail.com with SMTPS id 1602943563718347.4050936527344; Sat, 17 Oct 2020 07:06:03 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id y12so6588051wrp.6 for ; Sat, 17 Oct 2020 07:06:03 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id b189sm7292068wmb.37.2020.10.17.07.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K4I6rKlRV5CwkXwi1bhz1e4ZJqjshXMHPloXxAGf1Gs=; b=f5advx1zgDfzeVwXM7qs/p/Ay06yMXHouCwif8kW3SK93qbRcRCb4drq5pO6ECTlYV 0a3PqW+zA0AWf/qWBU8kJPbPj3961C/F7gUPx/rov56AIOvkwXcYxjVij1fjMnPhuKDg c2pxCzg8TSV2dtcH80rIm9RI/jHJPr7LHX8lzStlwM4dArT5JQIQoGkMJR1HVJ1IU3de RMYaC4c5bJ4ILHKSeUxMuxBOtmnsey1PGaLCHoVog1bH1U5LMLc+/Kntzg1K5ooq809Q 1D/VdGA6uQ/BeXVB4xnh1RwMq7iiWcaEiuNIVBHM1nWdAlow/pwRbvsmGS0OqZNSOuUw rv/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K4I6rKlRV5CwkXwi1bhz1e4ZJqjshXMHPloXxAGf1Gs=; b=kXgMn4E9AMvo3klkqnsjtrPeLW9ylbWuYr94PukgZQw0wl0rQ92OS5yHRavCeu0ypJ YVWCNXHHtLigSYEHC+AtXMqKh8O+giU7dpOZLN6M1piHsAu2xxntyhbyH74qT25k8Bdq AwoGkRz/+tswWIxjHGiGxxjWnPu1fUjE9JeQY41lJ63vq9QlXNVxlvAfki2KGmCMMpvH qWWvLJ6Xu6Z/eTT408hZPXZpZq+oiell5fc7hLJl930kpejHbhPFPkpR32YGjHL/mlkX +/QGSCf0/ZsqG7V9TrYCKzoYSbmH7ZFTvQ46gA3XLqlKkKkjzLkUmevMP/ssMVtUfrD+ GLUg== X-Gm-Message-State: AOAM532aUAaSstnvAU7BIssnG7r/Mf7yIwuar2u7ePPqRoelaO9tL6TF Q7Oh9J4DC0Ur2m5iDo2t/O4= X-Google-Smtp-Source: ABdhPJzCxUSgdlziZfXv4uD1ng0gnQ2iPCuCmjbBBcyBT/XlH5ugoZcR1gpvUyx8zmP7Yez1X1Wypg== X-Received: by 2002:a5d:6cad:: with SMTP id a13mr11099223wra.347.1602943561904; Sat, 17 Oct 2020 07:06:01 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 42/44] MAINTAINERS: Downgrade MIPS Boston to 'Odd Fixes', fix Paul Burton mail Date: Sat, 17 Oct 2020 16:02:41 +0200 Message-Id: <20201017140243.1078718-43-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Paul's Wavecomp email has been bouncing for months. He told us he "no longer has access to modern MIPS CPUs or Boston hardware, and wouldn't currently have time to spend on them if he did." [1] but "perhaps that might change in the future." [2]. Be fair and downgrade the status of the Boston board to "Odd Fixes" (has a maintainer but they don't have time to do much other). Similarly to commit 2b107c2c1c (".mailmap: Update Paul Burton email address"), update his email address here too. [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg718739.html [2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg728605.html Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <20201013101659.3557154-4-f4bug@amsat.org> --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 50fb9fda34d..8770cd6d05a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1162,9 +1162,9 @@ S: Maintained F: hw/intc/loongson_liointc.c =20 Boston -M: Paul Burton +M: Paul Burton R: Aleksandar Rikalo -S: Maintained +S: Odd Fixes F: hw/core/loader-fit.c F: hw/mips/boston.c F: hw/pci-host/xilinx-pcie.c --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) client-ip=209.85.128.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943568; cv=none; d=zohomail.com; s=zohoarc; b=NcL0vTgD0KwZQA2W+dHl+GEHKfZK0MqqVzJ1mn9TbhMWJa1RcrvzxNOHxDWwnDTF6H4kYxmvob6sq+0sXrCoCFhS2WIXzEarHuLaKBItTxoXO8DIfTEmY70QCf+F1QTLzWr84BAqEhnI9UaBVbkyqPZrOm9iON7XZo3sPhsj1dE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943568; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gN5fG1W2a6ABvVlFISLEsEnU3++HZ+v2I6FNfu0op4U=; b=CuTNlydb0KmejD0Tc6A4wfDUhnPxDtKj5LVVkzImXILafwBFVYCpNR8HKpP66ydr/fwfGNskLmI3ZAPlGsKeNyya57ks7T4rLx5SIopuCKEbZkDm1G73zIre/ZAXTZQjUDev9nQq5Oyzj3sleDHvn0wkWlGJPiCUzXQYXT65Oko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.zohomail.com with SMTPS id 160294356831078.31897059569349; Sat, 17 Oct 2020 07:06:08 -0700 (PDT) Received: by mail-wm1-f50.google.com with SMTP id a72so6128897wme.5 for ; Sat, 17 Oct 2020 07:06:07 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id c15sm3534613wmb.27.2020.10.17.07.06.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gN5fG1W2a6ABvVlFISLEsEnU3++HZ+v2I6FNfu0op4U=; b=d5diqqeFh0UWzD1oEGPFGSH0Vp0hsp93siVOISRezbTjupm2MDl/aOiNULYOztM0x8 NLUx1EJkE1CIobTOmhdv1Zd6reVXZ0gqbgaKGnI2okhSyyHqsJFGHXClD5dOVfs6iaoP e/VJWs/dRaRGP7XYDqbmwLbg3Mqk/pn3CbwD5XWvMzECTkl+Ri9DGcBPgNkvgt9UOQko AFn0+kmKtqVl9DGaEOhi+Pb3kWlRZZfA/XmNEDIFFN/FZDwf2tGEHHU+RXAdpl03DylS bTwFR6Eh3gyWuxhIC47VvvARTwRd2WvEl7T877v7yUzP9l23wV7/Hh6TcwxWaF+mh7UD +8RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gN5fG1W2a6ABvVlFISLEsEnU3++HZ+v2I6FNfu0op4U=; b=LdQ338sr0yRUgLzcMxzNRnxb6wOsn7ThXAHx1Is/gsMwyx5OF//gMxw9X8DzTeY4Ci e+VsFANDH+M/5ziiEWoaEYyYG0TJwrZU9mr6yjCHUbX8dxoWtZ9d10KlX/RLcOydYYLJ IfgDUhPGShBaPw9jVkTAbHAGe7ACH1cVWiM/DyODQZrC28OJCjPJdKwF1LtIUUAW+zro hVHQ3iKx/7JMXiSCKTfrfntd7UwYCONlB4b0zqBwKaknKxdkCkqqTr3yZOSIkQwNgT6U wzGdJOhQCMxfBj9XeviBm4GkMNffcIALAr5pbRudts11ues+riSDKJgUgJDqgcilxXVR Fw4w== X-Gm-Message-State: AOAM533kWcQjWBfBaYHmQ7p/l6lz7tjtg3eOZrFSMF2wwJD5IAXoaYOu WaSu3BL4Pt9kaRhtnq4lq4g= X-Google-Smtp-Source: ABdhPJwGri4MKQExmjGpd06cO0csoTaEcETa7dJ3YVIlJrW+leo6QafUYzIIaCgC5+79Ae4JAFESiw== X-Received: by 2002:a1c:6788:: with SMTP id b130mr9265405wmc.91.1602943566495; Sat, 17 Oct 2020 07:06:06 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 43/44] MAINTAINERS: Remove duplicated Malta test entries Date: Sat, 17 Oct 2020 16:02:42 +0200 Message-Id: <20201017140243.1078718-44-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The Malta tests are already covered in the Malta section. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <20201013101659.3557154-3-f4bug@amsat.org> --- MAINTAINERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 8770cd6d05a..a7f0acf8663 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -237,8 +237,6 @@ F: include/hw/intc/mips_gic.h F: include/hw/mips/ F: include/hw/misc/mips_* F: include/hw/timer/mips_gictimer.h -F: tests/acceptance/linux_ssh_mips_malta.py -F: tests/acceptance/machine_mips_malta.py F: tests/tcg/mips/ K: ^Subject:.*(?i)mips =20 --=20 2.26.2 From nobody Thu Apr 25 02:26:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) client-ip=209.85.221.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943573; cv=none; d=zohomail.com; s=zohoarc; b=QhUCyWo82hqZbwe/aY1BK5A84wRMB5GSpe/0C/qXPZ1VVmOLECUrqwcQQh0IJ5fgBjb/B3HfEmXF+9L2fe79lOblXCPToJnoxpx9xXl93iAWJJXFuPunFIh1aI/V6Upg2fAAtnIPadpuLBaRiBJo5+4DkRevWk82ReVEWqmVVfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7NPFG3sCe3Q0DWcvvpgh0QRrJIh4WkqraUDSbppp/5Q=; b=DLKtCJxLJq+RDjHfxBB+E28qLHhWusVpkJ44GpKNFc8KDqjP9PfZs4w/LwnUQihAco0v+jP7j9nSn6EO6cAvCaE0S2S0KLLWrTZvrZeVkCeee7xJ+2IDdqdFsC5HhgthGovL9gc3PF5RNoameDVtV82wZQ7W5RwTGUgOYid8aXw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.zohomail.com with SMTPS id 1602943573094133.57912395446567; Sat, 17 Oct 2020 07:06:13 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id h5so6581067wrv.7 for ; Sat, 17 Oct 2020 07:06:12 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id y5sm8845509wrw.52.2020.10.17.07.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7NPFG3sCe3Q0DWcvvpgh0QRrJIh4WkqraUDSbppp/5Q=; b=BlVy2jYZOLpKi+x8pl78DPw4PuPFNK5Hr9hii+HYldLiagJTlC0DDGRy7zPWkJs6V3 ibVI2ftO1N+gt7++lwBGO/Q4pfFz67tJf8/1lom2sc9nmN+VSWw5pKqlYobRAqPoCO2K +WMHc9bC2Ysxhl9FINkqzJcMZoZUqkPgzWrAAMgdenB0cxRJhNTKR/yGUFD1hvhdmxDG tcPdZMtRE5YtTgG4SNrIlXrjLOmBCsX1oAduAOrBFBIgBG/66SrZXxEiwGuOkJtn1rlc FntM/3Xcf2wYrC3zyqe54H7rernF6exXQpT96pyHzSEeWWDdx3obTfl+lAIv1F71RkMd dXpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7NPFG3sCe3Q0DWcvvpgh0QRrJIh4WkqraUDSbppp/5Q=; b=XUyoreoIFA71yPuzvaG2onZKDsP6e+mzBi14M44AyIRf/Au92xdrsSPIZDRUVztjT4 jaRuFbTt5AUksAL5Q2In6zMba0zflnBFFgp2RFmH80qPwClHMHjvqm7xL+pt7PRby8Bo VWLr/2QuSA+MLlL7XJN2bIqwcpX3MwhmDKcKrg/NFcTCmUzHK9GVYtqkfIl72WWOjMwJ VT1SJBTlanMNCgVqZCRSJeyKGUwz8c7cfbvPsPy33oJDy9WOuJzbx9XDg34qfi/oAGuH DEkdu+B2n5uZipG1WrDaP2a+o1YxMgjd1EmQVsHqTeud3RsnQLr9Hs4WuSpFcnMvOkb+ LRWg== X-Gm-Message-State: AOAM530OyIyEURYZ9kbzZg5dnOYaqdlq2qrLwsJitdJNnDvZiC91hrsP o3c++VJ46ECfABQym9tMkRY= X-Google-Smtp-Source: ABdhPJwvjfQ7VDOjq7eWWyfNjaZNjJPALCxXvEfbifxYhb2RhMAky8HIvmkfSnFx3t13BMNPBposZg== X-Received: by 2002:a5d:4051:: with SMTP id w17mr10218317wrp.24.1602943571161; Sat, 17 Oct 2020 07:06:11 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Victor Kamensky , Richard Henderson Subject: [PULL 44/44] target/mips: Increase number of TLB entries on the 34Kf core (16 -> 64) Date: Sat, 17 Oct 2020 16:02:43 +0200 Message-Id: <20201017140243.1078718-45-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Per "MIPS32 34K Processor Core Family Software User's Manual, Revision 01.13" page 8 in "Joint TLB (JTLB)" section: "The JTLB is a fully associative TLB cache containing 16, 32, or 64-dual-entries mapping up to 128 virtual pages to their corresponding physical addresses." There is no particular reason to restrict the 34Kf core model to 16 TLB entries, so raise its config to 64. This is helpful for other projects, in particular the Yocto Project: Yocto Project uses qemu-system-mips 34Kf cpu model, to run 32bit MIPS CI loop. It was observed that in this case CI test execution time was almost twice longer than 64bit MIPS variant that runs under MIPS64R2-generic model. It was investigated and concluded that the difference in number of TLBs 16 in 34Kf case vs 64 in MIPS64R2-generic is responsible for most of CI real time execution difference. Because with 16 TLBs linux user-land trashes TLB more and it needs to execute more instructions in TLB refill handler calls, as result it runs much longer. (https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg03428.html) Buglink: https://bugzilla.yoctoproject.org/show_bug.cgi?id=3D13992 Reported-by: Victor Kamensky Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201016133317.553068-1-f4bug@amsat.org> --- target/mips/translate_init.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/translate_init.c.inc b/target/mips/translate_init.= c.inc index c735b2bf667..fb5a9b38e5d 100644 --- a/target/mips/translate_init.c.inc +++ b/target/mips/translate_init.c.inc @@ -254,7 +254,7 @@ const mips_def_t mips_defs[] =3D .CP0_PRid =3D 0x00019500, .CP0_Config0 =3D MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (MMU_TYPE_R4000 << CP0C0_MT), - .CP0_Config1 =3D MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU= ) | + .CP0_Config1 =3D MIPS_CONFIG1 | (1 << CP0C1_FP) | (63 << CP0C1_MMU= ) | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA)= | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA)= | (1 << CP0C1_CA), --=20 2.26.2