Skip to contentSkip to conversation

Revert "qemumips: use 34Kf-64tlb CPU emulation"

PATCH In review Victor Kamensky 3 participants 5 messages Oct 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Revert "qemumips: use 34Kf-64tlb CPU emulation"

This reverts commit 6a9568401cbf8bed89d1f63dae61a07a83a20b50.

Will be replaced with upstreamed solution instead, that just bumped number of TLBs to 64 in original 34Kf CPU model.

---
 meta/conf/machine/qemumips.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/machine/qemumips.conf +1 -1
index b8c80f02ef..1373e4cba0 100644
@@ -15,4 +15,4 @@ SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
 
 QB_SYSTEM_NAME = "qemu-system-mips"
 
-QB_CPU = "-cpu 34Kf-64tlb"
+QB_CPU = "-cpu 34Kf"
Signature · 1 line
2.14.5
#1 lore raw

PATCH 2/3 Revert "qemu: add 34Kf-64tlb fictitious cpu type"

This reverts commit 4470a04943352224955f17e004962f0f9e1c9b0c.

Will be replaced with upstreamed solution instead, that just bumped number of TLBs to 64 in original 34Kf CPU model.

---
 meta/recipes-devtools/qemu/qemu.inc                |   1 -
 ...Kf-64tlb-fictitious-cpu-type-like-34Kf-bu.patch | 118 ---------------------
 2 files changed, 119 deletions(-)
 delete mode 100644 meta/recipes-devtools/qemu/qemu/0001-mips-add-34Kf-64tlb-fictitious-cpu-type-like-34Kf-bu.patch
meta/recipes-devtools/qemu/qemu.inc +0 -1
index 6c0edcb706..bbb9038961 100644
@@ -31,7 +31,6 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://0001-qemu-Do-not-include-file-if-not-exists.patch \
            file://find_datadir.patch \
            file://usb-fix-setup_len-init.patch \
-           file://0001-mips-add-34Kf-64tlb-fictitious-cpu-type-like-34Kf-bu.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/0001-mips-add-34Kf-64tlb-fictitious-cpu-type-like-34Kf-bu.patch deleted +0 -118

118 lines not on this page · raw message

Signature · 1 line
2.14.5
#2 lore raw

PATCH 3/3 qemu: change TLBs number to 64 in 34Kf mips cpu model

In reply to Victor Kamensky

Replace OE private qemu patch with one that got upstreamed and solves the same problem: increase qemumips CI performance by increasing number of TLBs in CPU model and reduce need to run software TLB refill code.

---
 meta/recipes-devtools/qemu/qemu.inc                |  1 +
 ...-Increase-number-of-TLB-entries-on-the-34.patch | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch
meta/recipes-devtools/qemu/qemu.inc +1 -0
index bbb9038961..84f600cec0 100644
@@ -31,6 +31,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://0001-qemu-Do-not-include-file-if-not-exists.patch \
            file://find_datadir.patch \
            file://usb-fix-setup_len-init.patch \
+           file://0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.14.5
#3 lore raw

Re: [PATCH 3/3] qemu: change TLBs number to 64 in 34Kf mips cpu model

this looks good to me.

Quoted 93 lines · Victor Kamensky

Replace OE private qemu patch with one that got upstreamed and solves the same problem: increase qemumips CI performance by increasing number of TLBs in CPU model and reduce need to run software TLB refill code.

---
 meta/recipes-devtools/qemu/qemu.inc                |  1 +
 ...-Increase-number-of-TLB-entries-on-the-34.patch | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch
meta/recipes-devtools/qemu/qemu.inc +1 -0
index bbb9038961..84f600cec0 100644
@@ -31,6 +31,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://0001-qemu-Do-not-include-file-if-not-exists.patch \
            file://find_datadir.patch \
            file://usb-fix-setup_len-init.patch \
+           file://0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch new file +59 -1
new file mode 100644
index 0000000000..5227b7cbd2
@@ -0,0 +1,59 @@
+From 68fa519a6cb455005317bd61f95214b58b2f1e69 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <[email protected]>
+Date: Fri, 16 Oct 2020 15:20:37 +0200
+Subject: [PATCH] target/mips: Increase number of TLB entries on the 34Kf core
+ (16 -> 64)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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=13992
+Reported-by: Victor Kamensky <[email protected]>
+Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
+Reviewed-by: Richard Henderson <[email protected]>
+Message-Id: <[email protected]>
+
+Upstream-Status: Backport [https://github.com/qemu/qemu/commit/68fa519a6cb455005317bd61f95214b58b2f1e69]
+Signed-off-by: Victor Kamensky <[email protected]>
+
+---
+ target/mips/translate_init.c.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: qemu-5.1.0/target/mips/translate_init.inc.c
+===================================================================
+--- qemu-5.1.0.orig/target/mips/translate_init.inc.c
++++ qemu-5.1.0/target/mips/translate_init.inc.c
+@@ -254,7 +254,7 @@ const mips_def_t mips_defs[] =
+         .CP0_PRid = 0x00019500,
+         .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) |
+                        (MMU_TYPE_R4000 << CP0C0_MT),
+-        .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) |
++        .CP0_Config1 = 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),
--

2.14.5

#4 lore raw

Re: [PATCH 3/3] qemu: change TLBs number to 64 in 34Kf mips cpu model

In reply to Victor Kamensky
Quoted 6 lines · Victor Kamensky

Replace OE private qemu patch with one that got upstreamed and solves the same problem: increase qemumips CI performance by increasing number of TLBs in CPU model and reduce need to run software TLB refill code.

Thanks, its amazing how simple this is in the end but very worthwhile!

Steve: This one should backport to dunfell without the rest of the history once it makes master.

Cheers,

Richard