Skip to contentSkip to conversation

Xilinx queue 2020-08-14

GIT PULL Applied Edgar E. Iglesias 2 participants 10 messages Aug 24, 2020

lore
Share & tools
lore
#0 lore raw

From: "Edgar E. Iglesias" <[email protected]>

The following changes since commit 8367a77c4d3f6e1e60890f5510304feb2c621611:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.2-pull-request' into staging (2020-08-23 16:34:43 +0100)

are available in the Git repository at:

[email protected]:edgarigl/qemu.git tags/edgar/xilinx-next-2020-08-24.for-upstream

for you to fetch changes up to 43f4e3d4fa2f9dba6bd68452a3380864ad9453c1:

microblaze: petalogix-s3adsp1800: Add device-tree source (2020-08-24 10:47:27 +0200)

----------------------------------------------------------------
For upstream.

----------------------------------------------------------------
Edgar E. Iglesias (8):
target/microblaze: mbar: Transfer dc->rd to mbar_imm target/microblaze: mbar: Move LOG_DIS to before sleep target/microblaze: mbar: Add support for data-access barriers target/microblaze: swx: Use atomic_cmpxchg
configure: microblaze: Enable mttcg target/microblaze: mbar: Trap sleeps from user-space
microblaze: petalogix-ml605: Add device-tree source
microblaze: petalogix-s3adsp1800: Add device-tree source

 configure                        |   1 +
 target/microblaze/translate.c    |  38 +++--
 pc-bios/petalogix-ml605.dtb      | Bin 9982 -> 9882 bytes
 pc-bios/petalogix-ml605.dts      | 350 +++++++++++++++++++++++++++++++++++++++
 pc-bios/petalogix-s3adsp1800.dtb | Bin 8259 -> 8161 bytes
 pc-bios/petalogix-s3adsp1800.dts | 282 +++++++++++++++++++++++++++++++
 6 files changed, 661 insertions(+), 10 deletions(-)
 create mode 100644 pc-bios/petalogix-ml605.dts
 create mode 100644 pc-bios/petalogix-s3adsp1800.dts
Signature · 1 line
2.25.1
#1 lore raw

[PULL v1 1/8] target/microblaze: mbar: Transfer dc->rd to mbar_imm

From: "Edgar E. Iglesias" <[email protected]>

Transfer dc->rd to mbar_imm to improve the readability when comparing to the specs.

No functional change.

---
 target/microblaze/translate.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
target/microblaze/translate.c +4 -2
index f6ff2591c3..47637f152b 100644
@@ -1229,8 +1229,10 @@ static void dec_br(DisasContext *dc)
     /* Memory barrier.  */
     mbar = (dc->ir >> 16) & 31;
     if (mbar == 2 && dc->imm == 4) {
+        uint16_t mbar_imm = dc->rd;
+
         /* mbar IMM & 16 decodes to sleep.  */
-        if (dc->rd & 16) {
+        if (mbar_imm & 16) {
             TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT);
             TCGv_i32 tmp_1 = tcg_const_i32(1);
 
@@ -1246,7 +1248,7 @@ static void dec_br(DisasContext *dc)
             tcg_temp_free_i32(tmp_1);
             return;
         }
-        LOG_DIS("mbar %d\n", dc->rd);
+        LOG_DIS("mbar %d\n", mbar_imm);
         /* Break the TB.  */
         dc->cpustate_changed = 1;
         return;
Signature · 1 line
2.25.1
#2 lore raw

[PULL v1 2/8] target/microblaze: mbar: Move LOG_DIS to before sleep

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Move LOG_DIS log to before sleeping handling so that it logs for sleep instructions aswell.

---
 target/microblaze/translate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
target/microblaze/translate.c +2 -1
index 47637f152b..c1be76d4c8 100644
@@ -1231,6 +1231,8 @@ static void dec_br(DisasContext *dc)
     if (mbar == 2 && dc->imm == 4) {
         uint16_t mbar_imm = dc->rd;
 
+        LOG_DIS("mbar %d\n", mbar_imm);
+
         /* mbar IMM & 16 decodes to sleep.  */
         if (mbar_imm & 16) {
             TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT);
@@ -1248,7 +1250,6 @@ static void dec_br(DisasContext *dc)
             tcg_temp_free_i32(tmp_1);
             return;
         }
-        LOG_DIS("mbar %d\n", mbar_imm);
         /* Break the TB.  */
         dc->cpustate_changed = 1;
         return;
Signature · 1 line
2.25.1
#3 lore raw

[PULL v1 5/8] configure: microblaze: Enable mttcg

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

---
 configure | 1 +
 1 file changed, 1 insertion(+)
configure +1 -0
index 67832e3bab..b8f5b81a67 100755
@@ -7782,6 +7782,7 @@ case "$target_name" in
   microblaze|microblazeel)
     TARGET_ARCH=microblaze
     TARGET_SYSTBL_ABI=common
+    mttcg="yes"
     bflt="yes"
     echo "TARGET_ABI32=y" >> $config_target_mak
   ;;
Signature · 1 line
2.25.1
#4 lore raw

[PULL v1 4/8] target/microblaze: swx: Use atomic_cmpxchg

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Use atomic_cmpxchg to implement the atomic cmpxchg sequence.

---
 target/microblaze/translate.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
target/microblaze/translate.c +13 -8
index c58f334a0f..530c15e5ad 100644
@@ -1075,14 +1075,16 @@ static void dec_store(DisasContext *dc)
         swx_skip = gen_new_label();
         tcg_gen_brcond_tl(TCG_COND_NE, env_res_addr, addr, swx_skip);
 
-        /* Compare the value loaded at lwx with current contents of
-           the reserved location.
-           FIXME: This only works for system emulation where we can expect
-           this compare and the following write to be atomic. For user
-           emulation we need to add atomicity between threads.  */
+        /*
+         * Compare the value loaded at lwx with current contents of
+         * the reserved location.
+         */
         tval = tcg_temp_new_i32();
-        tcg_gen_qemu_ld_i32(tval, addr, cpu_mmu_index(&dc->cpu->env, false),
-                            MO_TEUL);
+
+        tcg_gen_atomic_cmpxchg_i32(tval, addr, env_res_val,
+                                   cpu_R[dc->rd], mem_index,
+                                   mop);
+
         tcg_gen_brcond_i32(TCG_COND_NE, env_res_val, tval, swx_skip);
         write_carryi(dc, 0);
         tcg_temp_free_i32(tval);
@@ -1108,7 +1110,10 @@ static void dec_store(DisasContext *dc)
                 break;
         }
     }
-    tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop);
+
+    if (!ex) {
+        tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop);
+    }
 
     /* Verify alignment if needed.  */
     if (dc->cpu->cfg.unaligned_exceptions && size > 1) {
Signature · 1 line
2.25.1
#5 lore raw

[PULL v1 3/8] target/microblaze: mbar: Add support for data-access barriers

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add support for data-access barriers.

---
 target/microblaze/translate.c | 5 +++++
 1 file changed, 5 insertions(+)
target/microblaze/translate.c +5 -0
index c1be76d4c8..c58f334a0f 100644
@@ -1233,6 +1233,11 @@ static void dec_br(DisasContext *dc)
 
         LOG_DIS("mbar %d\n", mbar_imm);
 
+        /* Data access memory barrier.  */
+        if ((mbar_imm & 2) == 0) {
+            tcg_gen_mb(TCG_BAR_SC | TCG_MO_ALL);
+        }
+
         /* mbar IMM & 16 decodes to sleep.  */
         if (mbar_imm & 16) {
             TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT);
Signature · 1 line
2.25.1
#6 lore raw

[PULL v1 8/8] microblaze: petalogix-s3adsp1800: Add device-tree source

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add a device-tree source for petalogix-s3adsp1800 and recompile the DTB.

This also removes the unused mpmc node which causes compilation warnings.

---
 pc-bios/petalogix-s3adsp1800.dtb | Bin 8259 -> 8161 bytes
 pc-bios/petalogix-s3adsp1800.dts | 282 +++++++++++++++++++++++++++++++
 2 files changed, 282 insertions(+)
 create mode 100644 pc-bios/petalogix-s3adsp1800.dts
pc-bios/petalogix-s3adsp1800.dtb binary +0 -0
index 8ac80f2f2d191a8491b71182be50b3df2989551d..2513599438bffca96a93e877a1981efdd1a91115 100644
GIT binary patch
pc-bios/petalogix-s3adsp1800.dts new file +282 -0

282 lines not on this page · raw message

Signature · 1 line
2.25.1
#7 lore raw

[PULL v1 7/8] microblaze: petalogix-ml605: Add device-tree source

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add a device-tree source for petalogix-ml605 and recompile the DTB.

---
 pc-bios/petalogix-ml605.dtb | Bin 9982 -> 9882 bytes
 pc-bios/petalogix-ml605.dts | 350 ++++++++++++++++++++++++++++++++++++
 2 files changed, 350 insertions(+)
 create mode 100644 pc-bios/petalogix-ml605.dts
pc-bios/petalogix-ml605.dtb binary +0 -0
index fbbd45fdad06489c6333b6de868f44dfaed405bf..9a05434db7f622d1b598d2cf1415c867cf7f5cc6 100644
GIT binary patch
pc-bios/petalogix-ml605.dts new file +350 -0

350 lines not on this page · raw message

Signature · 1 line
2.25.1
#8 lore raw

[PULL v1 6/8] target/microblaze: mbar: Trap sleeps from user-space

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Trap mbar-sleeps from user-space.

---
 target/microblaze/translate.c | 5 +++++
 1 file changed, 5 insertions(+)
target/microblaze/translate.c +5 -0
index 530c15e5ad..a96cb21d96 100644
@@ -1250,6 +1250,11 @@ static void dec_br(DisasContext *dc)
 
             LOG_DIS("sleep\n");
 
+            if (trap_userspace(dc, true)) {
+                /* Sleep is a privileged instruction.  */
+                return;
+            }
+
             t_sync_flags(dc);
             tcg_gen_st_i32(tmp_1, cpu_env,
                            -offsetof(MicroBlazeCPU, env)
Signature · 1 line
2.25.1
#9 lore raw
In reply to Edgar E. Iglesias
Quoted 9 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

The following changes since commit 8367a77c4d3f6e1e60890f5510304feb2c621611:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.2-pull-request' into staging (2020-08-23 16:34:43 +0100)

are available in the Git repository at:

Quoted 9 lines

[email protected]:edgarigl/qemu.git tags/edgar/xilinx-next-2020-08-24.for-upstream

for you to fetch changes up to 43f4e3d4fa2f9dba6bd68452a3380864ad9453c1:

microblaze: petalogix-s3adsp1800: Add device-tree source (2020-08-24 10:47:27 +0200)

----------------------------------------------------------------
For upstream.

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM