Skip to contentSkip to conversation

hw/riscv: Post-review cleanups

PATCH Applied Joel Stanley 4 participants 16 messages Aug 24 – Aug 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover hw/riscv: Post-review cleanups

Phil made a bunch of suggestions during the Atlantis review for things to clean up afterwards. Here are those cleanups. The patches are otherwise unrelated.

Joel Stanley (4):
hw/riscv/boot: Make RISCVBootInfo const where possible hw/riscv/virt: Use hwaddr for IMSIC device tree address tests/functional: Avoid unnecessary removal of scratch files hw/riscv/atlantis: Document QEMU-only I2C device tree nodes

 include/hw/riscv/boot.h                   |  6 +++---
 hw/riscv/boot.c                           |  6 +++---
 hw/riscv/tt_atlantis.c                    |  1 +
 hw/riscv/virt.c                           |  5 +++--
 tests/functional/arm/test_bpim2u.py       | 11 -----------
 tests/functional/arm/test_orangepi.py     |  9 ---------
 tests/functional/riscv64/test_sifive_u.py |  4 ----
 7 files changed, 10 insertions(+), 32 deletions(-)
Signature · 1 line
2.47.3
#1 lore raw

PATCH 1/4 hw/riscv/boot: Make RISCVBootInfo const where possible

As with riscv_load_firmware, take a const pointer in functions that reads the structure without writing.

---
 include/hw/riscv/boot.h | 6 +++---
 hw/riscv/boot.c         | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/riscv/boot.h +3 -3
index 4e7bd9a225ef..d23f45d78077 100644
@@ -50,10 +50,10 @@ void riscv_boot_info_init(RISCVBootInfo *info, RISCVHartArrayState *harts);
 void riscv_boot_info_init_discontig_mem(RISCVBootInfo *info,
                                         RISCVHartArrayState *harts,
                                         hwaddr low_start, hwaddr low_size);
-vaddr riscv_calc_kernel_start_addr(RISCVBootInfo *info,
+vaddr riscv_calc_kernel_start_addr(const RISCVBootInfo *info,
                                    hwaddr firmware_end_addr);
 hwaddr riscv_find_and_load_firmware(MachineState *machine,
-                                    RISCVBootInfo *info,
+                                    const RISCVBootInfo *info,
                                     const char *default_machine_firmware,
                                     hwaddr *firmware_load_addr,
                                     symbol_fn_t sym_cb);
@@ -71,7 +71,7 @@ void riscv_load_kernel(MachineState *machine,
                        bool load_initrd,
                        symbol_fn_t sym_cb);
 uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
-                                MachineState *ms, RISCVBootInfo *info);
+                                MachineState *ms, const RISCVBootInfo *info);
 void riscv_load_fdt(hwaddr fdt_addr, void *fdt);
 void riscv_setup_rom_reset_vec(MachineState *machine, RISCVHartArrayState *harts,
                                hwaddr saddr,
hw/riscv/boot.c +3 -3
index 5e2dfa091a13..4ac0b8ef6581 100644
@@ -91,7 +91,7 @@ void riscv_boot_info_init_discontig_mem(RISCVBootInfo *info,
     info->ram_low_size = low_size;
 }
 
-vaddr riscv_calc_kernel_start_addr(RISCVBootInfo *info,
+vaddr riscv_calc_kernel_start_addr(const RISCVBootInfo *info,
                                    hwaddr firmware_end_addr) {
     if (info->is_32bit) {
         return QEMU_ALIGN_UP(firmware_end_addr, 4 * MiB);
@@ -151,7 +151,7 @@ char *riscv_find_firmware(const char *firmware_filename,
 }
 
 hwaddr riscv_find_and_load_firmware(MachineState *machine,
-                                    RISCVBootInfo *info,
+                                    const RISCVBootInfo *info,
                                     const char *default_machine_firmware,
                                     hwaddr *firmware_load_addr,
                                     symbol_fn_t sym_cb)
@@ -348,7 +348,7 @@ out:
  * The FDT is fdt_packed() during the calculation.
  */
 uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
-                                MachineState *ms, RISCVBootInfo *info)
+                                MachineState *ms, const RISCVBootInfo *info)
 {
     int ret = fdt_pack(ms->fdt);
     hwaddr dram_end, temp;
Signature · 1 line
2.47.3
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] hw/riscv/boot: Make RISCVBootInfo const where possible

Quoted 9 lines · Joel Stanley

As with riscv_load_firmware, take a const pointer in functions that reads the structure without writing.

---
  include/hw/riscv/boot.h | 6 +++---
  hw/riscv/boot.c         | 6 +++---
  2 files changed, 6 insertions(+), 6 deletions(-)
Reviewed-by on v1 1/4
#3 lore raw

Re: [PATCH 1/4] hw/riscv/boot: Make RISCVBootInfo const where possible

In reply to Joel Stanley
Quoted 9 lines · Joel Stanley

As with riscv_load_firmware, take a const pointer in functions that reads the structure without writing.

---
  include/hw/riscv/boot.h | 6 +++---
  hw/riscv/boot.c         | 6 +++---
  2 files changed, 6 insertions(+), 6 deletions(-)
Quoted 58 lines
include/hw/riscv/boot.h +3 -3
index 4e7bd9a225ef..d23f45d78077 100644
@@ -50,10 +50,10 @@ void riscv_boot_info_init(RISCVBootInfo *info, RISCVHartArrayState *harts);
  void riscv_boot_info_init_discontig_mem(RISCVBootInfo *info,
                                          RISCVHartArrayState *harts,
                                          hwaddr low_start, hwaddr low_size);
-vaddr riscv_calc_kernel_start_addr(RISCVBootInfo *info,
+vaddr riscv_calc_kernel_start_addr(const RISCVBootInfo *info,
                                     hwaddr firmware_end_addr);
  hwaddr riscv_find_and_load_firmware(MachineState *machine,
-                                    RISCVBootInfo *info,
+                                    const RISCVBootInfo *info,
                                      const char *default_machine_firmware,
                                      hwaddr *firmware_load_addr,
                                      symbol_fn_t sym_cb);
@@ -71,7 +71,7 @@ void riscv_load_kernel(MachineState *machine,
                         bool load_initrd,
                         symbol_fn_t sym_cb);
  uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
-                                MachineState *ms, RISCVBootInfo *info);
+                                MachineState *ms, const RISCVBootInfo *info);
  void riscv_load_fdt(hwaddr fdt_addr, void *fdt);
  void riscv_setup_rom_reset_vec(MachineState *machine, RISCVHartArrayState *harts,
                                 hwaddr saddr,
hw/riscv/boot.c +3 -3
index 5e2dfa091a13..4ac0b8ef6581 100644
@@ -91,7 +91,7 @@ void riscv_boot_info_init_discontig_mem(RISCVBootInfo *info,
      info->ram_low_size = low_size;
  }
 
-vaddr riscv_calc_kernel_start_addr(RISCVBootInfo *info,
+vaddr riscv_calc_kernel_start_addr(const RISCVBootInfo *info,
                                     hwaddr firmware_end_addr) {
      if (info->is_32bit) {
          return QEMU_ALIGN_UP(firmware_end_addr, 4 * MiB);
@@ -151,7 +151,7 @@ char *riscv_find_firmware(const char *firmware_filename,
  }
 
  hwaddr riscv_find_and_load_firmware(MachineState *machine,
-                                    RISCVBootInfo *info,
+                                    const RISCVBootInfo *info,
                                      const char *default_machine_firmware,
                                      hwaddr *firmware_load_addr,
                                      symbol_fn_t sym_cb)
@@ -348,7 +348,7 @@ out:
   * The FDT is fdt_packed() during the calculation.
   */
  uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
-                                MachineState *ms, RISCVBootInfo *info)
+                                MachineState *ms, const RISCVBootInfo *info)
  {
      int ret = fdt_pack(ms->fdt);
      hwaddr dram_end, temp;
Reviewed-by on v1 1/4
#4 lore raw

Re: [PATCH 1/4] hw/riscv/boot: Make RISCVBootInfo const where possible

In reply to Joel Stanley
Quoted 5 lines · Joel Stanley

As with riscv_load_firmware, take a const pointer in functions that reads the structure without writing.

Alistair

Quoted 73 lines

---
 include/hw/riscv/boot.h | 6 +++---
 hw/riscv/boot.c         | 6 +++---

 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/riscv/boot.h +0 -0
index 4e7bd9a225ef..d23f45d78077 100644
@@ -50,10 +50,10 @@ void riscv_boot_info_init(RISCVBootInfo *info,
 RISCVHartArrayState *harts);
  void riscv_boot_info_init_discontig_mem(RISCVBootInfo *info,
                                          RISCVHartArrayState *harts,

                                         hwaddr low_start, hwaddr low_size);

include/hw/riscv/boot.h +1 -1
-vaddr riscv_calc_kernel_start_addr(RISCVBootInfo *info,
+vaddr riscv_calc_kernel_start_addr(const RISCVBootInfo *info,

                                    hwaddr firmware_end_addr); hwaddr riscv_find_and_load_firmware(MachineState *machine, -                                    RISCVBootInfo *info, +                                    const RISCVBootInfo *info, const char *default_machine_firmware,
                                     hwaddr *firmware_load_addr, symbol_fn_t sym_cb);

include/hw/riscv/boot.h +1 -1
@@ -71,7 +71,7 @@ void riscv_load_kernel(MachineState *machine,
                         bool load_initrd,
                         symbol_fn_t sym_cb);
  uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
-                                MachineState *ms, RISCVBootInfo
 *info);
+                                MachineState *ms, const
 RISCVBootInfo *info);
  void riscv_load_fdt(hwaddr fdt_addr, void *fdt);

 void riscv_setup_rom_reset_vec(MachineState *machine, RISCVHartArrayState *harts,
                                hwaddr saddr,

hw/riscv/boot.c +0 -0
index 5e2dfa091a13..4ac0b8ef6581 100644
@@ -91,7 +91,7 @@ void
 riscv_boot_info_init_discontig_mem(RISCVBootInfo *info,
      info->ram_low_size = low_size;
  }

hw/riscv/boot.c +1 -1
-vaddr riscv_calc_kernel_start_addr(RISCVBootInfo *info,
+vaddr riscv_calc_kernel_start_addr(const RISCVBootInfo *info,

                                    hwaddr firmware_end_addr) { if (info->is_32bit) {
         return QEMU_ALIGN_UP(firmware_end_addr, 4 * MiB);

hw/riscv/boot.c +0 -0
@@ -151,7 +151,7 @@ char *riscv_find_firmware(const char
 *firmware_filename,
  }


 hwaddr riscv_find_and_load_firmware(MachineState *machine, -                                    RISCVBootInfo *info, +                                    const RISCVBootInfo *info, const char *default_machine_firmware,
                                     hwaddr *firmware_load_addr, symbol_fn_t sym_cb)

hw/riscv/boot.c +1 -1
@@ -348,7 +348,7 @@ out:
   * The FDT is fdt_packed() during the calculation.
   */
  uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
-                                MachineState *ms, RISCVBootInfo
 *info)
+                                MachineState *ms, const
 RISCVBootInfo *info)
  {

     int ret = fdt_pack(ms->fdt);
     hwaddr dram_end, temp;

#5 lore raw

PATCH 2/4 hw/riscv/virt: Use hwaddr for IMSIC device tree address

In reply to Joel Stanley

create_fdt_one_imsic() hard codes the top 32 bits to zero. Instead take a hwaddr and populate both the high and low cell.

---
 hw/riscv/virt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/riscv/virt.c +3 -2
index d58656f70d1b..b91d5066d8ad 100644
@@ -383,7 +383,8 @@ static void create_fdt_one_imsic(RISCVVirtState *s, hwaddr base_addr,
     g_autofree char *imsic_name = NULL;
     MachineState *ms = MACHINE(s);
     int socket_count = riscv_socket_count(ms);
-    uint32_t imsic_max_hart_per_socket, imsic_addr, imsic_size;
+    uint32_t imsic_max_hart_per_socket, imsic_size;
+    hwaddr imsic_addr;
     g_autofree uint32_t *imsic_cells = NULL;
     g_autofree uint32_t *imsic_regs = NULL;
     static const char * const imsic_compat[2] = {
@@ -403,7 +404,7 @@ static void create_fdt_one_imsic(RISCVVirtState *s, hwaddr base_addr,
         imsic_addr = base_addr + socket * VIRT_IMSIC_GROUP_MAX_SIZE;
         imsic_size = IMSIC_HART_SIZE(imsic_guest_bits) *
                      s->soc[socket].num_harts;
-        imsic_regs[socket * 4 + 0] = 0;
+        imsic_regs[socket * 4 + 0] = cpu_to_be32(imsic_addr >> 32);
         imsic_regs[socket * 4 + 1] = cpu_to_be32(imsic_addr);
         imsic_regs[socket * 4 + 2] = 0;
         imsic_regs[socket * 4 + 3] = cpu_to_be32(imsic_size);
Signature · 1 line
2.47.3
Reviewed-by on v1 2/4
#6 lore raw

Re: [PATCH 2/4] hw/riscv/virt: Use hwaddr for IMSIC device tree address

Quoted 8 lines · Joel Stanley

create_fdt_one_imsic() hard codes the top 32 bits to zero. Instead take a hwaddr and populate both the high and low cell.

---
  hw/riscv/virt.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 16 lines
hw/riscv/virt.c +2 -1
index d58656f70d1b..b91d5066d8ad 100644
@@ -383,7 +383,8 @@ static void create_fdt_one_imsic(RISCVVirtState *s, hwaddr base_addr,
      g_autofree char *imsic_name = NULL;
      MachineState *ms = MACHINE(s);
      int socket_count = riscv_socket_count(ms);
-    uint32_t imsic_max_hart_per_socket, imsic_addr, imsic_size;
+    uint32_t imsic_max_hart_per_socket, imsic_size;
+    hwaddr imsic_addr;
      g_autofree uint32_t *imsic_cells = NULL;
      g_autofree uint32_t *imsic_regs = NULL;
      static const char * const imsic_compat[2] = {

hw/riscv/virt.c static void create_fdt_one_imsic(RISCVVirtState *s, hwaddr base_addr, · line 409

Quoted 7 lines
hw/riscv/virt.c +1 -1
@@ -403,7 +404,7 @@ static void create_fdt_one_imsic(RISCVVirtState *s, hwaddr base_addr,
          imsic_addr = base_addr + socket * VIRT_IMSIC_GROUP_MAX_SIZE;
          imsic_size = IMSIC_HART_SIZE(imsic_guest_bits) *
                       s->soc[socket].num_harts;
-        imsic_regs[socket * 4 + 0] = 0;
+        imsic_regs[socket * 4 + 0] = cpu_to_be32(imsic_addr >> 32);
          imsic_regs[socket * 4 + 1] = cpu_to_be32(imsic_addr);
          imsic_regs[socket * 4 + 2] = 0;

I assume the imsic size cannot be greater than 32-bits.

Quoted 1 line
hw/riscv/virt.c +0 -0
          imsic_regs[socket * 4 + 3] = cpu_to_be32(imsic_size);
Reviewed-by on v1 2/4
#7 lore raw

Re: [PATCH 2/4] hw/riscv/virt: Use hwaddr for IMSIC device tree address

In reply to Joel Stanley
Quoted 6 lines · Joel Stanley

create_fdt_one_imsic() hard codes the top 32 bits to zero. Instead take
a hwaddr and populate both the high and low cell.

Alistair

Quoted 29 lines

---
 hw/riscv/virt.c | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
hw/riscv/virt.c +2 -1
index d58656f70d1b..b91d5066d8ad 100644
@@ -383,7 +383,8 @@ static void create_fdt_one_imsic(RISCVVirtState
 *s, hwaddr base_addr,
      g_autofree char *imsic_name = NULL;
      MachineState *ms = MACHINE(s);
      int socket_count = riscv_socket_count(ms);
-    uint32_t imsic_max_hart_per_socket, imsic_addr, imsic_size;
+    uint32_t imsic_max_hart_per_socket, imsic_size;
+    hwaddr imsic_addr;
      g_autofree uint32_t *imsic_cells = NULL;
      g_autofree uint32_t *imsic_regs = NULL;

     static const char * const imsic_compat[2] = {

hw/riscv/virt.c +0 -0
@@ -403,7 +404,7 @@ static void create_fdt_one_imsic(RISCVVirtState
 *s, hwaddr base_addr,
          imsic_addr = base_addr + socket * VIRT_IMSIC_GROUP_MAX_SIZE;

         imsic_size = IMSIC_HART_SIZE(imsic_guest_bits) * s->soc[socket].num_harts;
-        imsic_regs[socket * 4 + 0] = 0;
+        imsic_regs[socket * 4 + 0] = cpu_to_be32(imsic_addr >> 32); imsic_regs[socket * 4 + 1] = cpu_to_be32(imsic_addr); imsic_regs[socket * 4 + 2] = 0; imsic_regs[socket * 4 + 3] = cpu_to_be32(imsic_size);

#8 lore raw

PATCH 3/4 tests/functional: Avoid unnecessary removal of scratch files

In reply to Joel Stanley

Files written by uncompress() and archive_extract() are placed in a temporary directory that is cleaned up when the test exits, making os.remove() redundant. Drop it and the unused os import.

---
 tests/functional/arm/test_bpim2u.py       | 11 -----------
 tests/functional/arm/test_orangepi.py     |  9 ---------
 tests/functional/riscv64/test_sifive_u.py |  4 ----
 3 files changed, 24 deletions(-)
tests/functional/arm/test_bpim2u.py +0 -11
index 8bed64b702fe..9192a2fbec45 100755
@@ -5,8 +5,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
-
 from qemu_test import LinuxKernelTest, exec_command_and_wait_for_pattern
 from qemu_test import Asset, interrupt_interactive_console_until_pattern
 from qemu_test import skipBigDataTest
@@ -54,8 +52,6 @@ def test_arm_bpim2u(self):
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
-        os.remove(kernel_path)
-        os.remove(dtb_path)
 
     def test_arm_bpim2u_initrd(self):
         self.set_machine('bpim2u')
@@ -86,9 +82,6 @@ def test_arm_bpim2u_initrd(self):
                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully
         self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(initrd_path)
 
     def test_arm_bpim2u_gmac(self):
         self.set_machine('bpim2u')
@@ -133,9 +126,6 @@ def test_arm_bpim2u_gmac(self):
                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully
         self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(rootfs_path)
 
     @skipBigDataTest()
     def test_arm_bpim2u_openwrt_22_03_3(self):
@@ -174,7 +164,6 @@ def test_arm_bpim2u_openwrt_22_03_3(self):
                                                 'Allwinner sun8i Family')
         exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
                                                 'system-control@1c00000')
-        os.remove(image_path)
 
 if __name__ == '__main__':
     LinuxKernelTest.main()
tests/functional/arm/test_orangepi.py +0 -9
index f9bfa8c78d99..09780236553f 100755
@@ -5,7 +5,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
 import shutil
 
 from qemu_test import LinuxKernelTest, exec_command_and_wait_for_pattern
@@ -65,8 +64,6 @@ def test_arm_orangepi(self):
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
-        os.remove(kernel_path)
-        os.remove(dtb_path)
 
     def test_arm_orangepi_initrd(self):
         self.set_machine('orangepi-pc')
@@ -97,9 +94,6 @@ def test_arm_orangepi_initrd(self):
                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully
         self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(initrd_path)
 
     def test_arm_orangepi_sd(self):
         self.set_machine('orangepi-pc')
@@ -140,9 +134,6 @@ def test_arm_orangepi_sd(self):
                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully
         self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(rootfs_path)
 
     @skipBigDataTest()
     def test_arm_orangepi_armbian(self):
tests/functional/riscv64/test_sifive_u.py +0 -4
index 54a0f9c64845..6bf5be15f93a 100755
@@ -10,8 +10,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
-
 from qemu_test import Asset, LinuxKernelTest
 
 
@@ -49,8 +47,6 @@ def do_test_riscv64_sifive_u_mmc_spi(self, connect_card):
         self.vm.launch()
         self.wait_for_console_pattern(pattern)
 
-        os.remove(rootfs_path)
-
     def test_riscv64_sifive_u_nommc_spi(self):
         self.do_test_riscv64_sifive_u_mmc_spi(False)
 
Signature · 1 line
2.47.3
Reviewed-by on v1 3/4
#9 lore raw

Re: [PATCH 3/4] tests/functional: Avoid unnecessary removal of scratch files

Quoted 11 lines · Joel Stanley

Files written by uncompress() and archive_extract() are placed in a temporary directory that is cleaned up when the test exits, making os.remove() redundant. Drop it and the unused os import.

---
  tests/functional/arm/test_bpim2u.py       | 11 -----------
  tests/functional/arm/test_orangepi.py     |  9 ---------
  tests/functional/riscv64/test_sifive_u.py |  4 ----
  3 files changed, 24 deletions(-)
Reviewed-by on v1 3/4
#10 lore raw

Re: [PATCH 3/4] tests/functional: Avoid unnecessary removal of scratch files

In reply to Joel Stanley
Quoted 6 lines · Joel Stanley

Files written by uncompress() and archive_extract() are placed in a temporary directory that is cleaned up when the test exits, making os.remove() redundant. Drop it and the unused os import.

Alistair

Quoted 134 lines

---
 tests/functional/arm/test_bpim2u.py       | 11 ----------- tests/functional/arm/test_orangepi.py     |  9 --------- tests/functional/riscv64/test_sifive_u.py |  4 ----

 3 files changed, 24 deletions(-)
tests/functional/arm/test_bpim2u.py +0 -0
index 8bed64b702fe..9192a2fbec45 100755
@@ -5,8 +5,6 @@
  #
  # SPDX-License-Identifier: GPL-2.0-or-later

tests/functional/arm/test_bpim2u.py +0 -2
-import os
-

 from qemu_test import LinuxKernelTest,
exec_command_and_wait_for_pattern
 from qemu_test import Asset,
interrupt_interactive_console_until_pattern
 from qemu_test import skipBigDataTest

tests/functional/arm/test_bpim2u.py +0 -0
@@ -54,8 +52,6 @@ def test_arm_bpim2u(self):
          self.vm.launch()

         console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) -        os.remove(kernel_path)
-        os.remove(dtb_path)

     def test_arm_bpim2u_initrd(self):
         self.set_machine('bpim2u')

tests/functional/arm/test_bpim2u.py +0 -0
@@ -86,9 +82,6 @@ def test_arm_bpim2u_initrd(self):

                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(initrd_path)

     def test_arm_bpim2u_gmac(self):
         self.set_machine('bpim2u')

tests/functional/arm/test_bpim2u.py +0 -0
@@ -133,9 +126,6 @@ def test_arm_bpim2u_gmac(self):

                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(rootfs_path)

     @skipBigDataTest()
     def test_arm_bpim2u_openwrt_22_03_3(self):

tests/functional/arm/test_bpim2u.py +0 -0
@@ -174,7 +164,6 @@ def test_arm_bpim2u_openwrt_22_03_3(self):

                                                 'Allwinner sun8i Family')
         exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
'system-control@1c00000')
-        os.remove(image_path)

 if __name__ == '__main__':
     LinuxKernelTest.main()

tests/functional/arm/test_orangepi.py +0 -0
index f9bfa8c78d99..09780236553f 100755
@@ -5,7 +5,6 @@
  #
  # SPDX-License-Identifier: GPL-2.0-or-later


-import os
 import shutil

 from qemu_test import LinuxKernelTest,
exec_command_and_wait_for_pattern

tests/functional/arm/test_orangepi.py +0 -0
@@ -65,8 +64,6 @@ def test_arm_orangepi(self):
          self.vm.launch()

         console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) -        os.remove(kernel_path)
-        os.remove(dtb_path)

     def test_arm_orangepi_initrd(self):
         self.set_machine('orangepi-pc')

tests/functional/arm/test_orangepi.py +0 -0
@@ -97,9 +94,6 @@ def test_arm_orangepi_initrd(self):

                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(initrd_path)

     def test_arm_orangepi_sd(self):
         self.set_machine('orangepi-pc')

tests/functional/arm/test_orangepi.py +0 -0
@@ -140,9 +134,6 @@ def test_arm_orangepi_sd(self):

                                                 'reboot: Restarting system')
         # Wait for VM to shut down gracefully self.vm.wait()
-        os.remove(kernel_path)
-        os.remove(dtb_path)
-        os.remove(rootfs_path)

     @skipBigDataTest()
     def test_arm_orangepi_armbian(self):

tests/functional/riscv64/test_sifive_u.py +0 -0
index 54a0f9c64845..6bf5be15f93a 100755
@@ -10,8 +10,6 @@
  #
  # SPDX-License-Identifier: GPL-2.0-or-later

tests/functional/riscv64/test_sifive_u.py +0 -2
-import os
-

 from qemu_test import Asset, LinuxKernelTest

tests/functional/riscv64/test_sifive_u.py +0 -0
@@ -49,8 +47,6 @@ def do_test_riscv64_sifive_u_mmc_spi(self,

connect_card):
         self.vm.launch() self.wait_for_console_pattern(pattern)
-        os.remove(rootfs_path)
-
     def test_riscv64_sifive_u_nommc_spi(self):
         self.do_test_riscv64_sifive_u_mmc_spi(False)

#11 lore raw

PATCH 4/4 hw/riscv/atlantis: Document QEMU-only I2C device tree nodes

In reply to Joel Stanley

The QEMU only I2C devices have a comment next to them, do the same for the corresponding device tree entries.

---
 hw/riscv/tt_atlantis.c | 1 +
 1 file changed, 1 insertion(+)
hw/riscv/tt_atlantis.c +1 -0
index d808bcc11c34..82f087c836da 100644
@@ -356,6 +356,7 @@ static void finalize_fdt(TTAtlantisState *s)
                        aplic_s_phandle, periph_clk_phandle);
     }
 
+    /* I2C peripherals: qemu specific */
     create_fdt_i2c_device(s, 0, "dallas,ds1338", 0x6f);
     create_fdt_i2c_device(s, 4, "ti,tmp105", 0x48);
 }
Signature · 1 line
2.47.3
Reviewed-by on v1 4/4
#12 lore raw

Re: [PATCH 4/4] hw/riscv/atlantis: Document QEMU-only I2C device tree nodes

Quoted 8 lines · Joel Stanley

The QEMU only I2C devices have a comment next to them, do the same for the corresponding device tree entries.

---
  hw/riscv/tt_atlantis.c | 1 +
  1 file changed, 1 insertion(+)
Reviewed-by on v1 4/4
#13 lore raw

Re: [PATCH 4/4] hw/riscv/atlantis: Document QEMU-only I2C device tree nodes

In reply to Joel Stanley
Quoted 6 lines · Joel Stanley

The QEMU only I2C devices have a comment next to them, do the same for
the corresponding device tree entries.

Alistair

Quoted 16 lines

---
 hw/riscv/tt_atlantis.c | 1 +

 1 file changed, 1 insertion(+)
hw/riscv/tt_atlantis.c +0 -0
index d808bcc11c34..82f087c836da 100644
@@ -356,6 +356,7 @@ static void finalize_fdt(TTAtlantisState *s)
                         aplic_s_phandle, periph_clk_phandle);
      }


+    /* I2C peripherals: qemu specific */ create_fdt_i2c_device(s, 0, "dallas,ds1338", 0x6f); create_fdt_i2c_device(s, 4, "ti,tmp105", 0x48); }

#14 lore raw
In reply to Joel Stanley
Quoted 4 lines · Joel Stanley

Phil made a bunch of suggestions during the Atlantis review for things to clean up afterwards. Here are those cleanups. The patches are otherwise unrelated.

Doh, sorry, patches went to Phil's old address. Adding him to cc here.

Cheers,

Joel

#15 lore raw
In reply to Joel Stanley
Quoted 10 lines · Joel Stanley

Phil made a bunch of suggestions during the Atlantis review for things
to clean up afterwards. Here are those cleanups. The patches are otherwise unrelated.

Joel Stanley (4):
  hw/riscv/boot: Make RISCVBootInfo const where possible hw/riscv/virt: Use hwaddr for IMSIC device tree address tests/functional: Avoid unnecessary removal of scratch files hw/riscv/atlantis: Document QEMU-only I2C device tree nodes

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 9 lines

 include/hw/riscv/boot.h                   |  6 +++--- hw/riscv/boot.c                           |  6 +++--- hw/riscv/tt_atlantis.c                    |  1 + hw/riscv/virt.c                           |  5 +++-- tests/functional/arm/test_bpim2u.py       | 11 ----------- tests/functional/arm/test_orangepi.py     |  9 --------- tests/functional/riscv64/test_sifive_u.py |  4 ----

 7 files changed, 10 insertions(+), 32 deletions(-)