 8046759201
			
		
	
	
		8046759201
		
	
	
	
	
		
			
			There is a bug in the process of resolving the serial port base address in the fdt of the loongarch VM UEFI. When both serial port information and rng-seed information are chosen in the fdt, there is a probability that the serial port base address cannot be resolved correctly. This problem can be fixed by updating UEFI. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2686 Signed-off-by: Xianglai Li <lixianglai@loongson.cn> Message-ID: <20241127013438.2206426-1-lixianglai@loongson.cn> Tested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
		
			
				
	
	
		
			63 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env python3
 | |
| #
 | |
| # SPDX-License-Identifier: GPL-2.0-or-later
 | |
| #
 | |
| # LoongArch virt test.
 | |
| #
 | |
| # Copyright (c) 2023 Loongson Technology Corporation Limited
 | |
| #
 | |
| 
 | |
| from qemu_test import QemuSystemTest, Asset
 | |
| from qemu_test import exec_command_and_wait_for_pattern
 | |
| from qemu_test import wait_for_console_pattern
 | |
| 
 | |
| class LoongArchMachine(QemuSystemTest):
 | |
|     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 | |
| 
 | |
|     timeout = 120
 | |
| 
 | |
|     ASSET_KERNEL = Asset(
 | |
|         ('https://github.com/yangxiaojuan-loongson/qemu-binary/'
 | |
|          'releases/download/2024-11-26/vmlinuz.efi'),
 | |
|         '08b88a45f48a5fd92260bae895be4e5175be2397481a6f7821b9f39b2965b79e')
 | |
|     ASSET_INITRD = Asset(
 | |
|         ('https://github.com/yangxiaojuan-loongson/qemu-binary/'
 | |
|          'releases/download/2024-11-26/ramdisk'),
 | |
|         '03d6fb6f8ee64ecac961120a0bdacf741f17b3bee2141f17fa01908c8baf176a')
 | |
|     ASSET_BIOS = Asset(
 | |
|         ('https://github.com/yangxiaojuan-loongson/qemu-binary/'
 | |
|          'releases/download/2024-11-26/QEMU_EFI.fd'),
 | |
|         'f55fbf5d92e885844631ae9bfa8887f659bbb4f6ef2beea9e9ff8bc0603b6697')
 | |
| 
 | |
|     def wait_for_console_pattern(self, success_message, vm=None):
 | |
|         wait_for_console_pattern(self, success_message,
 | |
|                                  failure_message='Kernel panic - not syncing',
 | |
|                                  vm=vm)
 | |
| 
 | |
|     def test_loongarch64_devices(self):
 | |
| 
 | |
|         self.set_machine('virt')
 | |
| 
 | |
|         kernel_path = self.ASSET_KERNEL.fetch()
 | |
|         initrd_path = self.ASSET_INITRD.fetch()
 | |
|         bios_path = self.ASSET_BIOS.fetch()
 | |
| 
 | |
|         self.vm.set_console()
 | |
|         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
 | |
|                                'root=/dev/ram rdinit=/sbin/init console=ttyS0,115200')
 | |
|         self.vm.add_args('-nographic',
 | |
|                          '-smp', '4',
 | |
|                          '-m', '1024',
 | |
|                          '-cpu', 'la464',
 | |
|                          '-kernel', kernel_path,
 | |
|                          '-initrd', initrd_path,
 | |
|                          '-bios', bios_path,
 | |
|                          '-append', kernel_command_line)
 | |
|         self.vm.launch()
 | |
|         self.wait_for_console_pattern('Run /sbin/init as init process')
 | |
|         exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
 | |
|                                           'processor		: 3')
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     QemuSystemTest.main()
 |