1 | The following changes since commit 262312d7ba6e2966acedb4f9c134fd19176b4083: | 1 | The following changes since commit 38d0939b86e2eef6f6a622c6f1f7befda0146595: |
---|---|---|---|
2 | 2 | ||
3 | Merge tag 'pull-testing-next-010323-1' of https://gitlab.com/stsquad/qemu into staging (2023-03-02 13:02:53 +0000) | 3 | Merge tag 'pull-vfio-20241226' of https://github.com/legoater/qemu into staging (2024-12-26 04:38:38 -0500) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20230303 | 7 | https://gitlab.com/bibo-mao/qemu.git tags/pull-loongarch-20241227 |
8 | 8 | ||
9 | for you to fetch changes up to 0d588c4f999699a430b32c563fe9ccc1710b8fd7: | 9 | for you to fetch changes up to 5e360dabedb1ab1f15cce27a134ccbe4b8e18424: |
10 | 10 | ||
11 | hw/loongarch/virt: add system_powerdown hmp command support (2023-03-03 09:37:30 +0800) | 11 | target/loongarch: Use auto method with LASX feature (2024-12-27 11:33:06 +0800) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | pull-loongarch-20230303 | 14 | pull-loongarch-20241227 |
15 | v1 ... v2 | ||
16 | 1. Modify patch auther inconsistent with SOB | ||
15 | 17 | ||
16 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
17 | Bibo Mao (1): | 19 | Bibo Mao (5): |
18 | hw/loongarch/virt: rename PCH_PIC_IRQ_OFFSET with VIRT_GSI_BASE | 20 | target/loongarch: Use actual operand size with vbsrl check |
21 | hw/loongarch/virt: Create fdt table on machine creation done notification | ||
22 | hw/loongarch/virt: Improve fdt table creation for CPU object | ||
23 | target/loongarch: Use auto method with LSX feature | ||
24 | target/loongarch: Use auto method with LASX feature | ||
19 | 25 | ||
20 | Song Gao (4): | 26 | Guo Hongyu (1): |
21 | loongarch: Add smbios command line option. | 27 | target/loongarch: Fix vldi inst |
22 | docs/system/loongarch: update loongson3.rst and rename it to virt.rst | ||
23 | target/loongarch: Implement Chip Configuraiton Version Register(0x0000) | ||
24 | hw/loongarch/virt: add system_powerdown hmp command support | ||
25 | 28 | ||
26 | docs/system/loongarch/{loongson3.rst => virt.rst} | 97 +++++++++-------------- | 29 | hw/loongarch/virt.c | 142 ++++++++++++++---------- |
27 | hw/loongarch/acpi-build.c | 3 +- | 30 | target/loongarch/cpu.c | 86 ++++++++------ |
28 | hw/loongarch/virt.c | 20 ++++- | 31 | target/loongarch/cpu.h | 4 + |
29 | include/hw/loongarch/virt.h | 1 + | 32 | target/loongarch/kvm/kvm.c | 107 ++++++++++++++++++ |
30 | include/hw/pci-host/ls7a.h | 17 ++-- | 33 | target/loongarch/tcg/insn_trans/trans_vec.c.inc | 4 +- |
31 | qemu-options.hx | 2 +- | 34 | 5 files changed, 249 insertions(+), 94 deletions(-) |
32 | target/loongarch/cpu.c | 2 + | ||
33 | target/loongarch/cpu.h | 1 + | ||
34 | 8 files changed, 70 insertions(+), 73 deletions(-) | ||
35 | rename docs/system/loongarch/{loongson3.rst => virt.rst} (51%) | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Guo Hongyu <guohongyu24@mails.ucas.ac.cn> | ||
1 | 2 | ||
3 | Refer to the link below for a description of the vldi instructions: | ||
4 | https://jia.je/unofficial-loongarch-intrinsics-guide/lsx/misc/#synopsis_88 | ||
5 | Fixed errors in vldi instruction implementation. | ||
6 | |||
7 | Signed-off-by: Guo Hongyu <guohongyu24@mails.ucas.ac.cn> | ||
8 | Tested-by: Xianglai Li <lixianglai@loongson.cn> | ||
9 | Signed-off-by: Xianglai Li <lixianglai@loongson.cn> | ||
10 | Reviewed-by: Bibo Mao <maobibo@loongson.cn> | ||
11 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> | ||
12 | --- | ||
13 | target/loongarch/tcg/insn_trans/trans_vec.c.inc | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc | ||
19 | +++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc | ||
20 | @@ -XXX,XX +XXX,XX @@ static uint64_t vldi_get_value(DisasContext *ctx, uint32_t imm) | ||
21 | break; | ||
22 | case 1: | ||
23 | /* data: {2{16'0, imm[7:0], 8'0}} */ | ||
24 | - data = (t << 24) | (t << 8); | ||
25 | + data = (t << 40) | (t << 8); | ||
26 | break; | ||
27 | case 2: | ||
28 | /* data: {2{8'0, imm[7:0], 16'0}} */ | ||
29 | -- | ||
30 | 2.43.5 | diff view generated by jsdifflib |
1 | LoongArch has enabled CONFIG_SMBIOS, but didn't enable CLI '-smbios'. | 1 | Hardcoded 32 bytes is used for vbsrl emulation check, there is |
---|---|---|---|
2 | problem when options lsx=on,lasx=off is used for vbsrl.v instruction | ||
3 | in TCG mode. It injects LASX exception rather LSX exception. | ||
2 | 4 | ||
3 | Fixes: 3efa6fa1e629 ("hw/loongarch: Add smbios support") | 5 | Here actual operand size is used. |
4 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | 6 | |
5 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | 7 | Cc: qemu-stable@nongnu.org |
8 | Fixes: df97f338076 ("target/loongarch: Implement xvreplve xvinsve0 xvpickve") | ||
9 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> | ||
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Signed-off-by: Song Gao <gaosong@loongson.cn> | 11 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Message-Id: <20230227035905.1290953-2-gaosong@loongson.cn> | ||
9 | --- | 12 | --- |
10 | qemu-options.hx | 2 +- | 13 | target/loongarch/tcg/insn_trans/trans_vec.c.inc | 2 +- |
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
12 | 15 | ||
13 | diff --git a/qemu-options.hx b/qemu-options.hx | 16 | diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc |
14 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/qemu-options.hx | 18 | --- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc |
16 | +++ b/qemu-options.hx | 19 | +++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc |
17 | @@ -XXX,XX +XXX,XX @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, | 20 | @@ -XXX,XX +XXX,XX @@ static bool do_vbsrl_v(DisasContext *ctx, arg_vv_i *a, uint32_t oprsz) |
18 | " specify SMBIOS type 17 fields\n" | 21 | { |
19 | "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n" | 22 | int i, ofs; |
20 | " specify SMBIOS type 41 fields\n", | 23 | |
21 | - QEMU_ARCH_I386 | QEMU_ARCH_ARM) | 24 | - if (!check_vec(ctx, 32)) { |
22 | + QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH) | 25 | + if (!check_vec(ctx, oprsz)) { |
23 | SRST | 26 | return true; |
24 | ``-smbios file=binary`` | 27 | } |
25 | Load SMBIOS entry from binary file. | 28 | |
26 | -- | 29 | -- |
27 | 2.31.1 | 30 | 2.43.5 |
31 | |||
32 | diff view generated by jsdifflib |
1 | From: Bibo Mao <maobibo@loongson.cn> | 1 | The same with ACPI table, fdt table is created on machine done |
---|---|---|---|
2 | 2 | notification. Some objects like CPU objects can be created with cold-plug | |
3 | In theory gsi base can start from 0 on loongarch virt machine, | 3 | method with command such as -smp x, -device la464-loongarch-cpu, so all |
4 | however gsi base is hard-coded in linux kernel loongarch system, | 4 | objects finish to create when machine is done. |
5 | else system fails to boot. | ||
6 | |||
7 | This patch renames macro PCH_PIC_IRQ_OFFSET with VIRT_GSI_BASE, | ||
8 | keeps value unchanged. GSI base is common concept in acpi spec | ||
9 | and easy to understand. | ||
10 | 5 | ||
11 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> | 6 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> |
12 | Reviewed-by: Song Gao <gaosong@loongson.cn> | 7 | Reviewed-by: Bibo Mao <maobibo@loongson.cn> |
13 | Message-Id: <20221228030719.991878-1-maobibo@loongson.cn> | ||
14 | Signed-off-by: Song Gao <gaosong@loongson.cn> | ||
15 | --- | 8 | --- |
16 | hw/loongarch/acpi-build.c | 2 +- | 9 | hw/loongarch/virt.c | 103 ++++++++++++++++++++++++-------------------- |
17 | hw/loongarch/virt.c | 8 ++++---- | 10 | 1 file changed, 57 insertions(+), 46 deletions(-) |
18 | include/hw/pci-host/ls7a.h | 17 +++++++++-------- | ||
19 | 3 files changed, 14 insertions(+), 13 deletions(-) | ||
20 | 11 | ||
21 | diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/hw/loongarch/acpi-build.c | ||
24 | +++ b/hw/loongarch/acpi-build.c | ||
25 | @@ -XXX,XX +XXX,XX @@ static void build_pci_device_aml(Aml *scope, LoongArchMachineState *lams) | ||
26 | .pio.size = VIRT_PCI_IO_SIZE, | ||
27 | .ecam.base = VIRT_PCI_CFG_BASE, | ||
28 | .ecam.size = VIRT_PCI_CFG_SIZE, | ||
29 | - .irq = PCH_PIC_IRQ_OFFSET + VIRT_DEVICE_IRQS, | ||
30 | + .irq = VIRT_GSI_BASE + VIRT_DEVICE_IRQS, | ||
31 | .bus = lams->pci_bus, | ||
32 | }; | ||
33 | |||
34 | diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c | 12 | diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c |
35 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
36 | --- a/hw/loongarch/virt.c | 14 | --- a/hw/loongarch/virt.c |
37 | +++ b/hw/loongarch/virt.c | 15 | +++ b/hw/loongarch/virt.c |
38 | @@ -XXX,XX +XXX,XX @@ static DeviceState *create_acpi_ged(DeviceState *pch_pic, LoongArchMachineState | 16 | @@ -XXX,XX +XXX,XX @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms) |
39 | sysbus_mmio_map(SYS_BUS_DEVICE(dev), 2, VIRT_GED_REG_ADDR); | 17 | } |
40 | 18 | } | |
41 | sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, | 19 | |
42 | - qdev_get_gpio_in(pch_pic, VIRT_SCI_IRQ - PCH_PIC_IRQ_OFFSET)); | 20 | +static void virt_fdt_setup(LoongArchVirtMachineState *lvms) |
43 | + qdev_get_gpio_in(pch_pic, VIRT_SCI_IRQ - VIRT_GSI_BASE)); | 21 | +{ |
44 | sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); | 22 | + MachineState *machine = MACHINE(lvms); |
45 | return dev; | 23 | + uint32_t cpuintc_phandle, eiointc_phandle, pch_pic_phandle, pch_msi_phandle; |
46 | } | 24 | + int i; |
25 | + | ||
26 | + create_fdt(lvms); | ||
27 | + fdt_add_cpu_nodes(lvms); | ||
28 | + fdt_add_memory_nodes(machine); | ||
29 | + fdt_add_fw_cfg_node(lvms); | ||
30 | + fdt_add_flash_node(lvms); | ||
31 | + | ||
32 | + /* Add cpu interrupt-controller */ | ||
33 | + fdt_add_cpuic_node(lvms, &cpuintc_phandle); | ||
34 | + /* Add Extend I/O Interrupt Controller node */ | ||
35 | + fdt_add_eiointc_node(lvms, &cpuintc_phandle, &eiointc_phandle); | ||
36 | + /* Add PCH PIC node */ | ||
37 | + fdt_add_pch_pic_node(lvms, &eiointc_phandle, &pch_pic_phandle); | ||
38 | + /* Add PCH MSI node */ | ||
39 | + fdt_add_pch_msi_node(lvms, &eiointc_phandle, &pch_msi_phandle); | ||
40 | + /* Add pcie node */ | ||
41 | + fdt_add_pcie_node(lvms, &pch_pic_phandle, &pch_msi_phandle); | ||
42 | + | ||
43 | + /* | ||
44 | + * Create uart fdt node in reverse order so that they appear | ||
45 | + * in the finished device tree lowest address first | ||
46 | + */ | ||
47 | + for (i = VIRT_UART_COUNT; i-- > 0;) { | ||
48 | + hwaddr base = VIRT_UART_BASE + i * VIRT_UART_SIZE; | ||
49 | + int irq = VIRT_UART_IRQ + i - VIRT_GSI_BASE; | ||
50 | + fdt_add_uart_node(lvms, &pch_pic_phandle, base, irq, i == 0); | ||
51 | + } | ||
52 | + | ||
53 | + fdt_add_rtc_node(lvms, &pch_pic_phandle); | ||
54 | + fdt_add_ged_reset(lvms); | ||
55 | + platform_bus_add_all_fdt_nodes(machine->fdt, "/platic", | ||
56 | + VIRT_PLATFORM_BUS_BASEADDRESS, | ||
57 | + VIRT_PLATFORM_BUS_SIZE, | ||
58 | + VIRT_PLATFORM_BUS_IRQ); | ||
59 | + | ||
60 | + /* | ||
61 | + * Since lowmem region starts from 0 and Linux kernel legacy start address | ||
62 | + * at 2 MiB, FDT base address is located at 1 MiB to avoid NULL pointer | ||
63 | + * access. FDT size limit with 1 MiB. | ||
64 | + * Put the FDT into the memory map as a ROM image: this will ensure | ||
65 | + * the FDT is copied again upon reset, even if addr points into RAM. | ||
66 | + */ | ||
67 | + qemu_fdt_dumpdtb(machine->fdt, lvms->fdt_size); | ||
68 | + rom_add_blob_fixed_as("fdt", machine->fdt, lvms->fdt_size, FDT_BASE, | ||
69 | + &address_space_memory); | ||
70 | + qemu_register_reset_nosnapshotload(qemu_fdt_randomize_seeds, | ||
71 | + rom_ptr_for_as(&address_space_memory, FDT_BASE, lvms->fdt_size)); | ||
72 | +} | ||
73 | + | ||
74 | static void virt_done(Notifier *notifier, void *data) | ||
75 | { | ||
76 | LoongArchVirtMachineState *lvms = container_of(notifier, | ||
77 | LoongArchVirtMachineState, machine_done); | ||
78 | virt_build_smbios(lvms); | ||
79 | loongarch_acpi_setup(lvms); | ||
80 | + virt_fdt_setup(lvms); | ||
81 | } | ||
82 | |||
83 | static void virt_powerdown_req(Notifier *notifier, void *opaque) | ||
47 | @@ -XXX,XX +XXX,XX @@ static DeviceState *create_platform_bus(DeviceState *pch_pic) | 84 | @@ -XXX,XX +XXX,XX @@ static DeviceState *create_platform_bus(DeviceState *pch_pic) |
48 | 85 | } | |
49 | sysbus = SYS_BUS_DEVICE(dev); | 86 | |
50 | for (i = 0; i < VIRT_PLATFORM_BUS_NUM_IRQS; i++) { | 87 | static void virt_devices_init(DeviceState *pch_pic, |
51 | - irq = VIRT_PLATFORM_BUS_IRQ - PCH_PIC_IRQ_OFFSET + i; | 88 | - LoongArchVirtMachineState *lvms, |
52 | + irq = VIRT_PLATFORM_BUS_IRQ - VIRT_GSI_BASE + i; | 89 | - uint32_t *pch_pic_phandle, |
53 | sysbus_connect_irq(sysbus, i, qdev_get_gpio_in(pch_pic, irq)); | 90 | - uint32_t *pch_msi_phandle) |
54 | } | 91 | + LoongArchVirtMachineState *lvms) |
55 | 92 | { | |
56 | @@ -XXX,XX +XXX,XX @@ static void loongarch_devices_init(DeviceState *pch_pic, LoongArchMachineState * | 93 | MachineClass *mc = MACHINE_GET_CLASS(lvms); |
57 | 94 | DeviceState *gpex_dev; | |
58 | serial_mm_init(get_system_memory(), VIRT_UART_BASE, 0, | 95 | @@ -XXX,XX +XXX,XX @@ static void virt_devices_init(DeviceState *pch_pic, |
59 | qdev_get_gpio_in(pch_pic, | 96 | gpex_set_irq_num(GPEX_HOST(gpex_dev), i, 16 + i); |
60 | - VIRT_UART_IRQ - PCH_PIC_IRQ_OFFSET), | 97 | } |
61 | + VIRT_UART_IRQ - VIRT_GSI_BASE), | 98 | |
62 | 115200, serial_hd(0), DEVICE_LITTLE_ENDIAN); | 99 | - /* Add pcie node */ |
63 | fdt_add_uart_node(lams); | 100 | - fdt_add_pcie_node(lvms, pch_pic_phandle, pch_msi_phandle); |
64 | 101 | - | |
65 | @@ -XXX,XX +XXX,XX @@ static void loongarch_devices_init(DeviceState *pch_pic, LoongArchMachineState * | 102 | /* |
66 | create_unimplemented_device("pci-dma-cfg", 0x1001041c, 0x4); | 103 | * Create uart fdt node in reverse order so that they appear |
104 | * in the finished device tree lowest address first | ||
105 | @@ -XXX,XX +XXX,XX @@ static void virt_devices_init(DeviceState *pch_pic, | ||
106 | serial_mm_init(get_system_memory(), base, 0, | ||
107 | qdev_get_gpio_in(pch_pic, irq), | ||
108 | 115200, serial_hd(i), DEVICE_LITTLE_ENDIAN); | ||
109 | - fdt_add_uart_node(lvms, pch_pic_phandle, base, irq, i == 0); | ||
110 | } | ||
111 | |||
112 | /* Network init */ | ||
113 | @@ -XXX,XX +XXX,XX @@ static void virt_devices_init(DeviceState *pch_pic, | ||
67 | sysbus_create_simple("ls7a_rtc", VIRT_RTC_REG_BASE, | 114 | sysbus_create_simple("ls7a_rtc", VIRT_RTC_REG_BASE, |
68 | qdev_get_gpio_in(pch_pic, | 115 | qdev_get_gpio_in(pch_pic, |
69 | - VIRT_RTC_IRQ - PCH_PIC_IRQ_OFFSET)); | 116 | VIRT_RTC_IRQ - VIRT_GSI_BASE)); |
70 | + VIRT_RTC_IRQ - VIRT_GSI_BASE)); | 117 | - fdt_add_rtc_node(lvms, pch_pic_phandle); |
71 | fdt_add_rtc_node(lams); | 118 | - fdt_add_ged_reset(lvms); |
72 | 119 | ||
73 | pm_mem = g_new(MemoryRegion, 1); | 120 | /* acpi ged */ |
74 | diff --git a/include/hw/pci-host/ls7a.h b/include/hw/pci-host/ls7a.h | 121 | lvms->acpi_ged = create_acpi_ged(pch_pic, lvms); |
75 | index XXXXXXX..XXXXXXX 100644 | 122 | @@ -XXX,XX +XXX,XX @@ static void virt_irq_init(LoongArchVirtMachineState *lvms) |
76 | --- a/include/hw/pci-host/ls7a.h | 123 | CPULoongArchState *env; |
77 | +++ b/include/hw/pci-host/ls7a.h | 124 | CPUState *cpu_state; |
78 | @@ -XXX,XX +XXX,XX @@ | 125 | int cpu, pin, i, start, num; |
79 | #define VIRT_PCH_MSI_ADDR_LOW 0x2FF00000UL | 126 | - uint32_t cpuintc_phandle, eiointc_phandle, pch_pic_phandle, pch_msi_phandle; |
80 | 127 | ||
81 | /* | 128 | /* |
82 | - * According to the kernel pch irq start from 64 offset | 129 | * Extended IRQ model. |
83 | - * 0 ~ 16 irqs used for non-pci device while 16 ~ 64 irqs | 130 | @@ -XXX,XX +XXX,XX @@ static void virt_irq_init(LoongArchVirtMachineState *lvms) |
84 | - * used for pci device. | 131 | memory_region_add_subregion(&lvms->system_iocsr, MAIL_SEND_ADDR, |
85 | + * GSI_BASE is hard-coded with 64 in linux kernel, else kernel fails to boot | 132 | sysbus_mmio_get_region(SYS_BUS_DEVICE(ipi), 1)); |
86 | + * 0 - 15 GSI for ISA devices even if there is no ISA devices | 133 | |
87 | + * 16 - 63 GSI for CPU devices such as timers/perf monitor etc | 134 | - /* Add cpu interrupt-controller */ |
88 | + * 64 - GSI for external devices | 135 | - fdt_add_cpuic_node(lvms, &cpuintc_phandle); |
89 | */ | 136 | - |
90 | #define VIRT_PCH_PIC_IRQ_NUM 32 | 137 | for (cpu = 0; cpu < ms->smp.cpus; cpu++) { |
91 | -#define PCH_PIC_IRQ_OFFSET 64 | 138 | cpu_state = qemu_get_cpu(cpu); |
92 | +#define VIRT_GSI_BASE 64 | 139 | cpudev = DEVICE(cpu_state); |
93 | #define VIRT_DEVICE_IRQS 16 | 140 | @@ -XXX,XX +XXX,XX @@ static void virt_irq_init(LoongArchVirtMachineState *lvms) |
94 | -#define VIRT_UART_IRQ (PCH_PIC_IRQ_OFFSET + 2) | 141 | } |
95 | +#define VIRT_UART_IRQ (VIRT_GSI_BASE + 2) | 142 | } |
96 | #define VIRT_UART_BASE 0x1fe001e0 | 143 | |
97 | #define VIRT_UART_SIZE 0X100 | 144 | - /* Add Extend I/O Interrupt Controller node */ |
98 | -#define VIRT_RTC_IRQ (PCH_PIC_IRQ_OFFSET + 3) | 145 | - fdt_add_eiointc_node(lvms, &cpuintc_phandle, &eiointc_phandle); |
99 | +#define VIRT_RTC_IRQ (VIRT_GSI_BASE + 3) | 146 | - |
100 | #define VIRT_MISC_REG_BASE (VIRT_PCH_REG_BASE + 0x00080000) | 147 | pch_pic = qdev_new(TYPE_LOONGARCH_PIC); |
101 | #define VIRT_RTC_REG_BASE (VIRT_MISC_REG_BASE + 0x00050100) | 148 | num = VIRT_PCH_PIC_IRQ_NUM; |
102 | #define VIRT_RTC_LEN 0x100 | 149 | qdev_prop_set_uint32(pch_pic, "pch_pic_irq_num", num); |
103 | -#define VIRT_SCI_IRQ (PCH_PIC_IRQ_OFFSET + 4) | 150 | @@ -XXX,XX +XXX,XX @@ static void virt_irq_init(LoongArchVirtMachineState *lvms) |
104 | +#define VIRT_SCI_IRQ (VIRT_GSI_BASE + 4) | 151 | qdev_connect_gpio_out(DEVICE(d), i, qdev_get_gpio_in(extioi, i)); |
105 | 152 | } | |
106 | #define VIRT_PLATFORM_BUS_BASEADDRESS 0x16000000 | 153 | |
107 | #define VIRT_PLATFORM_BUS_SIZE 0x2000000 | 154 | - /* Add PCH PIC node */ |
108 | #define VIRT_PLATFORM_BUS_NUM_IRQS 2 | 155 | - fdt_add_pch_pic_node(lvms, &eiointc_phandle, &pch_pic_phandle); |
109 | -#define VIRT_PLATFORM_BUS_IRQ 69 | 156 | - |
110 | +#define VIRT_PLATFORM_BUS_IRQ (VIRT_GSI_BASE + 5) | 157 | pch_msi = qdev_new(TYPE_LOONGARCH_PCH_MSI); |
111 | #endif | 158 | start = num; |
159 | num = EXTIOI_IRQS - start; | ||
160 | @@ -XXX,XX +XXX,XX @@ static void virt_irq_init(LoongArchVirtMachineState *lvms) | ||
161 | qdev_get_gpio_in(extioi, i + start)); | ||
162 | } | ||
163 | |||
164 | - /* Add PCH MSI node */ | ||
165 | - fdt_add_pch_msi_node(lvms, &eiointc_phandle, &pch_msi_phandle); | ||
166 | - | ||
167 | - virt_devices_init(pch_pic, lvms, &pch_pic_phandle, &pch_msi_phandle); | ||
168 | + virt_devices_init(pch_pic, lvms); | ||
169 | } | ||
170 | |||
171 | static void virt_firmware_init(LoongArchVirtMachineState *lvms) | ||
172 | @@ -XXX,XX +XXX,XX @@ static void virt_init(MachineState *machine) | ||
173 | cpu_model = LOONGARCH_CPU_TYPE_NAME("la464"); | ||
174 | } | ||
175 | |||
176 | - create_fdt(lvms); | ||
177 | - | ||
178 | /* Create IOCSR space */ | ||
179 | memory_region_init_io(&lvms->system_iocsr, OBJECT(machine), NULL, | ||
180 | machine, "iocsr", UINT64_MAX); | ||
181 | @@ -XXX,XX +XXX,XX @@ static void virt_init(MachineState *machine) | ||
182 | lacpu = LOONGARCH_CPU(cpu); | ||
183 | lacpu->phy_id = machine->possible_cpus->cpus[i].arch_id; | ||
184 | } | ||
185 | - fdt_add_cpu_nodes(lvms); | ||
186 | - fdt_add_memory_nodes(machine); | ||
187 | fw_cfg_add_memory(machine); | ||
188 | |||
189 | /* Node0 memory */ | ||
190 | @@ -XXX,XX +XXX,XX @@ static void virt_init(MachineState *machine) | ||
191 | memmap_table, | ||
192 | sizeof(struct memmap_entry) * (memmap_entries)); | ||
193 | } | ||
194 | - fdt_add_fw_cfg_node(lvms); | ||
195 | - fdt_add_flash_node(lvms); | ||
196 | |||
197 | /* Initialize the IO interrupt subsystem */ | ||
198 | virt_irq_init(lvms); | ||
199 | - platform_bus_add_all_fdt_nodes(machine->fdt, "/platic", | ||
200 | - VIRT_PLATFORM_BUS_BASEADDRESS, | ||
201 | - VIRT_PLATFORM_BUS_SIZE, | ||
202 | - VIRT_PLATFORM_BUS_IRQ); | ||
203 | lvms->machine_done.notify = virt_done; | ||
204 | qemu_add_machine_init_done_notifier(&lvms->machine_done); | ||
205 | /* connect powerdown request */ | ||
206 | lvms->powerdown_notifier.notify = virt_powerdown_req; | ||
207 | qemu_register_powerdown_notifier(&lvms->powerdown_notifier); | ||
208 | |||
209 | - /* | ||
210 | - * Since lowmem region starts from 0 and Linux kernel legacy start address | ||
211 | - * at 2 MiB, FDT base address is located at 1 MiB to avoid NULL pointer | ||
212 | - * access. FDT size limit with 1 MiB. | ||
213 | - * Put the FDT into the memory map as a ROM image: this will ensure | ||
214 | - * the FDT is copied again upon reset, even if addr points into RAM. | ||
215 | - */ | ||
216 | - qemu_fdt_dumpdtb(machine->fdt, lvms->fdt_size); | ||
217 | - rom_add_blob_fixed_as("fdt", machine->fdt, lvms->fdt_size, FDT_BASE, | ||
218 | - &address_space_memory); | ||
219 | - qemu_register_reset_nosnapshotload(qemu_fdt_randomize_seeds, | ||
220 | - rom_ptr_for_as(&address_space_memory, FDT_BASE, lvms->fdt_size)); | ||
221 | - | ||
222 | lvms->bootinfo.ram_size = ram_size; | ||
223 | loongarch_load_kernel(machine, &lvms->bootinfo); | ||
224 | } | ||
112 | -- | 225 | -- |
113 | 2.31.1 | 226 | 2.43.5 | diff view generated by jsdifflib |
1 | For loongarch virt machine, add powerdown notification callback | 1 | For CPU object, possible_cpu_arch_ids() function is used rather than |
---|---|---|---|
2 | and send ACPI_POWER_DOWN_STATUS event by acpi ged. Also add | 2 | smp.cpus. With command -smp x, -device la464-loongarch-cpu, smp.cpus |
3 | acpi dsdt table for ACPI_POWER_BUTTON_DEVICE device in this | 3 | is not accurate for all possible CPU objects, possible_cpu_arch_ids() |
4 | patch. | 4 | is used here. |
5 | 5 | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 6 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> |
7 | Signed-off-by: Song Gao <gaosong@loongson.cn> | 7 | Reviewed-by: Bibo Mao <maobibo@loongson.cn> |
8 | Message-Id: <20230303010548.295580-1-gaosong@loongson.cn> | ||
9 | --- | 8 | --- |
10 | hw/loongarch/acpi-build.c | 1 + | 9 | hw/loongarch/virt.c | 39 +++++++++++++++++++++++++-------------- |
11 | hw/loongarch/virt.c | 12 ++++++++++++ | 10 | 1 file changed, 25 insertions(+), 14 deletions(-) |
12 | include/hw/loongarch/virt.h | 1 + | ||
13 | 3 files changed, 14 insertions(+) | ||
14 | 11 | ||
15 | diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/loongarch/acpi-build.c | ||
18 | +++ b/hw/loongarch/acpi-build.c | ||
19 | @@ -XXX,XX +XXX,XX @@ build_la_ged_aml(Aml *dsdt, MachineState *machine) | ||
20 | AML_SYSTEM_MEMORY, | ||
21 | VIRT_GED_MEM_ADDR); | ||
22 | } | ||
23 | + acpi_dsdt_add_power_button(dsdt); | ||
24 | } | ||
25 | |||
26 | static void build_pci_device_aml(Aml *scope, LoongArchMachineState *lams) | ||
27 | diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c | 12 | diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c |
28 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
29 | --- a/hw/loongarch/virt.c | 14 | --- a/hw/loongarch/virt.c |
30 | +++ b/hw/loongarch/virt.c | 15 | +++ b/hw/loongarch/virt.c |
31 | @@ -XXX,XX +XXX,XX @@ static void virt_machine_done(Notifier *notifier, void *data) | 16 | @@ -XXX,XX +XXX,XX @@ static void create_fdt(LoongArchVirtMachineState *lvms) |
32 | loongarch_acpi_setup(lams); | 17 | static void fdt_add_cpu_nodes(const LoongArchVirtMachineState *lvms) |
18 | { | ||
19 | int num; | ||
20 | - const MachineState *ms = MACHINE(lvms); | ||
21 | - int smp_cpus = ms->smp.cpus; | ||
22 | + MachineState *ms = MACHINE(lvms); | ||
23 | + MachineClass *mc = MACHINE_GET_CLASS(ms); | ||
24 | + const CPUArchIdList *possible_cpus; | ||
25 | + LoongArchCPU *cpu; | ||
26 | + CPUState *cs; | ||
27 | + char *nodename, *map_path; | ||
28 | |||
29 | qemu_fdt_add_subnode(ms->fdt, "/cpus"); | ||
30 | qemu_fdt_setprop_cell(ms->fdt, "/cpus", "#address-cells", 0x1); | ||
31 | qemu_fdt_setprop_cell(ms->fdt, "/cpus", "#size-cells", 0x0); | ||
32 | |||
33 | /* cpu nodes */ | ||
34 | - for (num = smp_cpus - 1; num >= 0; num--) { | ||
35 | - char *nodename = g_strdup_printf("/cpus/cpu@%d", num); | ||
36 | - LoongArchCPU *cpu = LOONGARCH_CPU(qemu_get_cpu(num)); | ||
37 | - CPUState *cs = CPU(cpu); | ||
38 | + possible_cpus = mc->possible_cpu_arch_ids(ms); | ||
39 | + for (num = 0; num < possible_cpus->len; num++) { | ||
40 | + cs = possible_cpus->cpus[num].cpu; | ||
41 | + if (cs == NULL) { | ||
42 | + continue; | ||
43 | + } | ||
44 | + | ||
45 | + nodename = g_strdup_printf("/cpus/cpu@%d", num); | ||
46 | + cpu = LOONGARCH_CPU(cs); | ||
47 | |||
48 | qemu_fdt_add_subnode(ms->fdt, nodename); | ||
49 | qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "cpu"); | ||
50 | qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", | ||
51 | cpu->dtb_compatible); | ||
52 | - if (ms->possible_cpus->cpus[cs->cpu_index].props.has_node_id) { | ||
53 | + if (possible_cpus->cpus[num].props.has_node_id) { | ||
54 | qemu_fdt_setprop_cell(ms->fdt, nodename, "numa-node-id", | ||
55 | - ms->possible_cpus->cpus[cs->cpu_index].props.node_id); | ||
56 | + possible_cpus->cpus[num].props.node_id); | ||
57 | } | ||
58 | qemu_fdt_setprop_cell(ms->fdt, nodename, "reg", num); | ||
59 | qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", | ||
60 | @@ -XXX,XX +XXX,XX @@ static void fdt_add_cpu_nodes(const LoongArchVirtMachineState *lvms) | ||
61 | |||
62 | /*cpu map */ | ||
63 | qemu_fdt_add_subnode(ms->fdt, "/cpus/cpu-map"); | ||
64 | + for (num = 0; num < possible_cpus->len; num++) { | ||
65 | + cs = possible_cpus->cpus[num].cpu; | ||
66 | + if (cs == NULL) { | ||
67 | + continue; | ||
68 | + } | ||
69 | |||
70 | - for (num = smp_cpus - 1; num >= 0; num--) { | ||
71 | - char *cpu_path = g_strdup_printf("/cpus/cpu@%d", num); | ||
72 | - char *map_path; | ||
73 | - | ||
74 | + nodename = g_strdup_printf("/cpus/cpu@%d", num); | ||
75 | if (ms->smp.threads > 1) { | ||
76 | map_path = g_strdup_printf( | ||
77 | "/cpus/cpu-map/socket%d/core%d/thread%d", | ||
78 | @@ -XXX,XX +XXX,XX @@ static void fdt_add_cpu_nodes(const LoongArchVirtMachineState *lvms) | ||
79 | num % ms->smp.cores); | ||
80 | } | ||
81 | qemu_fdt_add_path(ms->fdt, map_path); | ||
82 | - qemu_fdt_setprop_phandle(ms->fdt, map_path, "cpu", cpu_path); | ||
83 | + qemu_fdt_setprop_phandle(ms->fdt, map_path, "cpu", nodename); | ||
84 | |||
85 | g_free(map_path); | ||
86 | - g_free(cpu_path); | ||
87 | + g_free(nodename); | ||
88 | } | ||
33 | } | 89 | } |
34 | 90 | ||
35 | +static void virt_powerdown_req(Notifier *notifier, void *opaque) | ||
36 | +{ | ||
37 | + LoongArchMachineState *s = container_of(notifier, | ||
38 | + LoongArchMachineState, powerdown_notifier); | ||
39 | + | ||
40 | + acpi_send_event(s->acpi_ged, ACPI_POWER_DOWN_STATUS); | ||
41 | +} | ||
42 | + | ||
43 | struct memmap_entry { | ||
44 | uint64_t address; | ||
45 | uint64_t length; | ||
46 | @@ -XXX,XX +XXX,XX @@ static void loongarch_init(MachineState *machine) | ||
47 | VIRT_PLATFORM_BUS_IRQ); | ||
48 | lams->machine_done.notify = virt_machine_done; | ||
49 | qemu_add_machine_init_done_notifier(&lams->machine_done); | ||
50 | + /* connect powerdown request */ | ||
51 | + lams->powerdown_notifier.notify = virt_powerdown_req; | ||
52 | + qemu_register_powerdown_notifier(&lams->powerdown_notifier); | ||
53 | + | ||
54 | fdt_add_pcie_node(lams); | ||
55 | /* | ||
56 | * Since lowmem region starts from 0 and Linux kernel legacy start address | ||
57 | diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h | ||
58 | index XXXXXXX..XXXXXXX 100644 | ||
59 | --- a/include/hw/loongarch/virt.h | ||
60 | +++ b/include/hw/loongarch/virt.h | ||
61 | @@ -XXX,XX +XXX,XX @@ struct LoongArchMachineState { | ||
62 | /* State for other subsystems/APIs: */ | ||
63 | FWCfgState *fw_cfg; | ||
64 | Notifier machine_done; | ||
65 | + Notifier powerdown_notifier; | ||
66 | OnOffAuto acpi; | ||
67 | char *oem_id; | ||
68 | char *oem_table_id; | ||
69 | -- | 91 | -- |
70 | 2.31.1 | 92 | 2.43.5 |
71 | |||
72 | diff view generated by jsdifflib |
1 | Since the EDK2 had already support LoongArch, update build bios, | 1 | Like LBT feature, add type OnOffAuto for LSX feature setting. Also |
---|---|---|---|
2 | and update cpu type, cross-tools. | 2 | add LSX feature detection with new VM ioctl command, fallback to old |
3 | method if it is not supported. | ||
3 | 4 | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> |
5 | Signed-off-by: Song Gao <gaosong@loongson.cn> | 6 | Reviewed-by: Bibo Mao <maobibo@loongson.cn> |
6 | Message-Id: <20230227035905.1290953-1-gaosong@loongson.cn> | ||
7 | --- | 7 | --- |
8 | .../loongarch/{loongson3.rst => virt.rst} | 97 ++++++++----------- | 8 | target/loongarch/cpu.c | 38 +++++++++++++++------------ |
9 | 1 file changed, 38 insertions(+), 59 deletions(-) | 9 | target/loongarch/cpu.h | 2 ++ |
10 | rename docs/system/loongarch/{loongson3.rst => virt.rst} (51%) | 10 | target/loongarch/kvm/kvm.c | 54 ++++++++++++++++++++++++++++++++++++++ |
11 | 3 files changed, 77 insertions(+), 17 deletions(-) | ||
11 | 12 | ||
12 | diff --git a/docs/system/loongarch/loongson3.rst b/docs/system/loongarch/virt.rst | 13 | diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c |
13 | similarity index 51% | ||
14 | rename from docs/system/loongarch/loongson3.rst | ||
15 | rename to docs/system/loongarch/virt.rst | ||
16 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/docs/system/loongarch/loongson3.rst | 15 | --- a/target/loongarch/cpu.c |
18 | +++ b/docs/system/loongarch/virt.rst | 16 | +++ b/target/loongarch/cpu.c |
19 | @@ -XXX,XX +XXX,XX @@ The ``virt`` machine supports: | 17 | @@ -XXX,XX +XXX,XX @@ static void loongarch_la464_initfn(Object *obj) |
20 | - Fw_cfg device | 18 | { |
21 | - PCI/PCIe devices | 19 | LoongArchCPU *cpu = LOONGARCH_CPU(obj); |
22 | - Memory device | 20 | CPULoongArchState *env = &cpu->env; |
23 | -- CPU device. Type: la464-loongarch-cpu. | 21 | + uint32_t data = 0; |
24 | +- CPU device. Type: la464. | 22 | int i; |
25 | 23 | ||
26 | CPU and machine Type | 24 | for (i = 0; i < 21; i++) { |
27 | -------------------- | 25 | @@ -XXX,XX +XXX,XX @@ static void loongarch_la464_initfn(Object *obj) |
28 | 26 | cpu->dtb_compatible = "loongarch,Loongson-3A5000"; | |
29 | The ``qemu-system-loongarch64`` provides emulation for virt | 27 | env->cpucfg[0] = 0x14c010; /* PRID */ |
30 | machine. You can specify the machine type ``virt`` and | 28 | |
31 | -cpu type ``la464-loongarch-cpu``. | 29 | - uint32_t data = 0; |
32 | +cpu type ``la464``. | 30 | data = FIELD_DP32(data, CPUCFG1, ARCH, 2); |
33 | 31 | data = FIELD_DP32(data, CPUCFG1, PGMMU, 1); | |
34 | Boot options | 32 | data = FIELD_DP32(data, CPUCFG1, IOCSR, 1); |
35 | ------------ | 33 | @@ -XXX,XX +XXX,XX @@ static void loongarch_la132_initfn(Object *obj) |
36 | @@ -XXX,XX +XXX,XX @@ We can boot the LoongArch virt machine by specifying the uefi bios, | 34 | { |
37 | initrd, and linux kernel. And those source codes and binary files | 35 | LoongArchCPU *cpu = LOONGARCH_CPU(obj); |
38 | can be accessed by following steps. | 36 | CPULoongArchState *env = &cpu->env; |
39 | |||
40 | -(1) booting command: | ||
41 | +(1) Build qemu-system-loongarch64: | ||
42 | |||
43 | .. code-block:: bash | ||
44 | |||
45 | - $ qemu-system-loongarch64 -machine virt -m 4G -cpu la464-loongarch-cpu \ | ||
46 | - -smp 1 -bios QEMU_EFI.fd -kernel vmlinuz.efi -initrd initrd.img \ | ||
47 | - -append "root=/dev/ram rdinit=/sbin/init console=ttyS0,115200" \ | ||
48 | - --nographic | ||
49 | - | 37 | - |
50 | -Note: The running speed may be a little slow, as the performance of our | 38 | + uint32_t data = 0; |
51 | -qemu and uefi bios is not perfect, and it is being fixed. | 39 | int i; |
40 | |||
41 | for (i = 0; i < 21; i++) { | ||
42 | @@ -XXX,XX +XXX,XX @@ static void loongarch_la132_initfn(Object *obj) | ||
43 | cpu->dtb_compatible = "loongarch,Loongson-1C103"; | ||
44 | env->cpucfg[0] = 0x148042; /* PRID */ | ||
45 | |||
46 | - uint32_t data = 0; | ||
47 | data = FIELD_DP32(data, CPUCFG1, ARCH, 1); /* LA32 */ | ||
48 | data = FIELD_DP32(data, CPUCFG1, PGMMU, 1); | ||
49 | data = FIELD_DP32(data, CPUCFG1, IOCSR, 1); | ||
50 | @@ -XXX,XX +XXX,XX @@ static void loongarch_cpu_realizefn(DeviceState *dev, Error **errp) | ||
51 | |||
52 | static bool loongarch_get_lsx(Object *obj, Error **errp) | ||
53 | { | ||
54 | - LoongArchCPU *cpu = LOONGARCH_CPU(obj); | ||
55 | - bool ret; | ||
52 | - | 56 | - |
53 | -(2) cross compiler tools: | 57 | - if (FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LSX)) { |
54 | - | 58 | - ret = true; |
55 | -.. code-block:: bash | 59 | - } else { |
56 | - | 60 | - ret = false; |
57 | - wget https://github.com/loongson/build-tools/releases/download/ \ | 61 | - } |
58 | - 2022.05.29/loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz | 62 | - return ret; |
59 | - | 63 | + return LOONGARCH_CPU(obj)->lsx != ON_OFF_AUTO_OFF; |
60 | - tar -vxf loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz | 64 | } |
61 | - | 65 | |
62 | -(3) qemu compile configure option: | 66 | static void loongarch_set_lsx(Object *obj, bool value, Error **errp) |
63 | - | 67 | { |
64 | -.. code-block:: bash | 68 | LoongArchCPU *cpu = LOONGARCH_CPU(obj); |
65 | - | 69 | + uint32_t val; |
66 | - ./configure --disable-rdma --disable-pvrdma --prefix=usr \ | 70 | |
67 | + ./configure --disable-rdma --disable-pvrdma --prefix=/usr \ | 71 | - if (value) { |
68 | --target-list="loongarch64-softmmu" \ | 72 | - cpu->env.cpucfg[2] = FIELD_DP32(cpu->env.cpucfg[2], CPUCFG2, LSX, 1); |
69 | --disable-libiscsi --disable-libnfs --disable-libpmem \ | 73 | - } else { |
70 | --disable-glusterfs --enable-libusb --enable-usb-redir \ | 74 | - cpu->env.cpucfg[2] = FIELD_DP32(cpu->env.cpucfg[2], CPUCFG2, LSX, 0); |
71 | --disable-opengl --disable-xen --enable-spice \ | 75 | - cpu->env.cpucfg[2] = FIELD_DP32(cpu->env.cpucfg[2], CPUCFG2, LASX, 0); |
72 | --enable-debug --disable-capstone --disable-kvm \ | 76 | + cpu->lsx = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF; |
73 | --enable-profiler | 77 | + if (kvm_enabled()) { |
74 | - make | 78 | + /* kvm feature detection in function kvm_arch_init_vcpu */ |
75 | + make -j8 | 79 | + return; |
76 | 80 | } | |
77 | -(4) uefi bios source code and compile method: | 81 | + |
78 | +(2) Set cross tools: | 82 | + /* LSX feature detection in TCG mode */ |
79 | 83 | + val = cpu->env.cpucfg[2]; | |
80 | .. code-block:: bash | 84 | + if (cpu->lsx == ON_OFF_AUTO_ON) { |
81 | 85 | + if (FIELD_EX32(val, CPUCFG2, LSX) == 0) { | |
82 | - git clone https://github.com/loongson/edk2-LoongarchVirt.git | 86 | + error_setg(errp, "Failed to enable LSX in TCG mode"); |
83 | - | 87 | + return; |
84 | - cd edk2-LoongarchVirt | 88 | + } |
85 | - | 89 | + } |
86 | - git submodule update --init | 90 | + |
87 | - | 91 | + cpu->env.cpucfg[2] = FIELD_DP32(val, CPUCFG2, LSX, value); |
88 | - export PATH=$YOUR_COMPILER_PATH/bin:$PATH | 92 | } |
89 | - | 93 | |
90 | - export WORKSPACE=`pwd` | 94 | static bool loongarch_get_lasx(Object *obj, Error **errp) |
91 | + wget https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz | 95 | @@ -XXX,XX +XXX,XX @@ void loongarch_cpu_post_init(Object *obj) |
92 | 96 | { | |
93 | - export PACKAGES_PATH=$WORKSPACE/edk2-LoongarchVirt | 97 | LoongArchCPU *cpu = LOONGARCH_CPU(obj); |
94 | + tar -vxf loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz -C /opt | 98 | |
95 | 99 | + cpu->lsx = ON_OFF_AUTO_AUTO; | |
96 | - export GCC5_LOONGARCH64_PREFIX=loongarch64-unknown-linux-gnu- | 100 | object_property_add_bool(obj, "lsx", loongarch_get_lsx, |
97 | + export PATH=/opt/cross-tools/bin:$PATH | 101 | loongarch_set_lsx); |
98 | + export LD_LIBRARY_PATH=/opt/cross-tools/lib:$LD_LIBRARY_PATH | 102 | object_property_add_bool(obj, "lasx", loongarch_get_lasx, |
99 | + export LD_LIBRARY_PATH=/opt/cross-tools/loongarch64-unknown-linux-gnu/lib/:$LD_LIBRARY_PATH | 103 | @@ -XXX,XX +XXX,XX @@ void loongarch_cpu_post_init(Object *obj) |
100 | 104 | ||
101 | - edk2-LoongarchVirt/edksetup.sh | 105 | } else { |
102 | +Note: You need get the latest cross-tools at https://github.com/loongson/build-tools | 106 | cpu->lbt = ON_OFF_AUTO_OFF; |
103 | 107 | + cpu->pmu = ON_OFF_AUTO_OFF; | |
104 | - make -C edk2-LoongarchVirt/BaseTools | 108 | } |
105 | +(3) Build BIOS: | 109 | } |
106 | 110 | ||
107 | - build --buildtarget=DEBUG --tagname=GCC5 --arch=LOONGARCH64 --platform=OvmfPkg/LoongArchQemu/Loongson.dsc | 111 | diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h |
108 | + See: https://github.com/tianocore/edk2-platforms/tree/master/Platform/Loongson/LoongArchQemuPkg#readme | 112 | index XXXXXXX..XXXXXXX 100644 |
109 | 113 | --- a/target/loongarch/cpu.h | |
110 | - build --buildtarget=RELEASE --tagname=GCC5 --arch=LOONGARCH64 --platform=OvmfPkg/LoongArchQemu/Loongson.dsc | 114 | +++ b/target/loongarch/cpu.h |
111 | +Note: To build the release version of the bios, set --buildtarget=RELEASE, | 115 | @@ -XXX,XX +XXX,XX @@ typedef struct LoongArchTLB LoongArchTLB; |
112 | + the bios file path: Build/LoongArchQemu/RELEASE_GCC5/FV/QEMU_EFI.fd | 116 | #endif |
113 | 117 | ||
114 | -The efi binary file path: | 118 | enum loongarch_features { |
115 | - | 119 | + LOONGARCH_FEATURE_LSX, |
116 | - Build/LoongArchQemu/DEBUG_GCC5/FV/QEMU_EFI.fd | 120 | LOONGARCH_FEATURE_LBT, /* loongson binary translation extension */ |
117 | - | 121 | LOONGARCH_FEATURE_PMU, |
118 | - Build/LoongArchQemu/RELEASE_GCC5/FV/QEMU_EFI.fd | 122 | }; |
119 | - | 123 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { |
120 | -(5) linux kernel source code and compile method: | 124 | uint32_t phy_id; |
121 | +(4) Build kernel: | 125 | OnOffAuto lbt; |
122 | 126 | OnOffAuto pmu; | |
123 | .. code-block:: bash | 127 | + OnOffAuto lsx; |
124 | 128 | ||
125 | git clone https://github.com/loongson/linux.git | 129 | /* 'compatible' string for this CPU for Linux device trees */ |
126 | 130 | const char *dtb_compatible; | |
127 | - export PATH=$YOUR_COMPILER_PATH/bin:$PATH | 131 | diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c |
128 | - | 132 | index XXXXXXX..XXXXXXX 100644 |
129 | - export LD_LIBRARY_PATH=$YOUR_COMPILER_PATH/lib:$LD_LIBRARY_PATH | 133 | --- a/target/loongarch/kvm/kvm.c |
130 | + cd linux | 134 | +++ b/target/loongarch/kvm/kvm.c |
131 | 135 | @@ -XXX,XX +XXX,XX @@ static bool kvm_feature_supported(CPUState *cs, enum loongarch_features feature) | |
132 | - export LD_LIBRARY_PATH=$YOUR_COMPILER_PATH/loongarch64-unknown-linux-gnu/lib/:$LD_LIBRARY_PATH | 136 | { |
133 | + git checkout loongarch-next | 137 | int ret; |
134 | 138 | struct kvm_device_attr attr; | |
135 | make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- loongson3_defconfig | 139 | + uint64_t val; |
136 | 140 | ||
137 | - make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- | 141 | switch (feature) { |
138 | - | 142 | + case LOONGARCH_FEATURE_LSX: |
139 | - make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- install | 143 | + attr.group = KVM_LOONGARCH_VM_FEAT_CTRL; |
140 | - | 144 | + attr.attr = KVM_LOONGARCH_VM_FEAT_LSX; |
141 | - make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- modules_install | 145 | + ret = kvm_vm_ioctl(kvm_state, KVM_HAS_DEVICE_ATTR, &attr); |
142 | + make ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- -j32 | 146 | + if (ret == 0) { |
143 | 147 | + return true; | |
144 | Note: The branch of linux source code is loongarch-next. | 148 | + } |
145 | + the kernel file: arch/loongarch/boot/vmlinuz.efi | 149 | + |
146 | 150 | + /* Fallback to old kernel detect interface */ | |
147 | -(6) initrd file: | 151 | + val = 0; |
148 | +(5) Get initrd: | 152 | + attr.group = KVM_LOONGARCH_VCPU_CPUCFG; |
149 | 153 | + /* Cpucfg2 */ | |
150 | You can use busybox tool and the linux modules to make a initrd file. Or you can access the | 154 | + attr.attr = 2; |
151 | binary files: https://github.com/yangxiaojuan-loongson/qemu-binary | 155 | + attr.addr = (uint64_t)&val; |
152 | + | 156 | + ret = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, &attr); |
153 | +.. code-block:: bash | 157 | + if (!ret) { |
154 | + | 158 | + ret = kvm_vcpu_ioctl(cs, KVM_GET_DEVICE_ATTR, &attr); |
155 | + git clone https://github.com/yangxiaojuan-loongson/qemu-binary | 159 | + if (ret) { |
156 | + | 160 | + return false; |
157 | +Note: the initrd file is ramdisk | 161 | + } |
158 | + | 162 | + |
159 | +(6) Booting LoongArch: | 163 | + ret = FIELD_EX32((uint32_t)val, CPUCFG2, LSX); |
160 | + | 164 | + return (ret != 0); |
161 | +.. code-block:: bash | 165 | + } |
162 | + | 166 | + return false; |
163 | + $ ./build/qemu-system-loongarch64 -machine virt -m 4G -cpu la464 \ | 167 | + |
164 | + -smp 1 -bios QEMU_EFI.fd -kernel vmlinuz.efi -initrd ramdisk \ | 168 | case LOONGARCH_FEATURE_LBT: |
165 | + -serial stdio -monitor telnet:localhost:4495,server,nowait \ | 169 | /* |
166 | + -append "root=/dev/ram rdinit=/sbin/init console=ttyS0,115200" \ | 170 | * Return all if all the LBT features are supported such as: |
167 | + --nographic | 171 | @@ -XXX,XX +XXX,XX @@ static bool kvm_feature_supported(CPUState *cs, enum loongarch_features feature) |
172 | return false; | ||
173 | } | ||
174 | |||
175 | +static int kvm_cpu_check_lsx(CPUState *cs, Error **errp) | ||
176 | +{ | ||
177 | + CPULoongArchState *env = cpu_env(cs); | ||
178 | + LoongArchCPU *cpu = LOONGARCH_CPU(cs); | ||
179 | + bool kvm_supported; | ||
180 | + | ||
181 | + kvm_supported = kvm_feature_supported(cs, LOONGARCH_FEATURE_LSX); | ||
182 | + env->cpucfg[2] = FIELD_DP32(env->cpucfg[2], CPUCFG2, LSX, 0); | ||
183 | + if (cpu->lsx == ON_OFF_AUTO_ON) { | ||
184 | + if (kvm_supported) { | ||
185 | + env->cpucfg[2] = FIELD_DP32(env->cpucfg[2], CPUCFG2, LSX, 1); | ||
186 | + } else { | ||
187 | + error_setg(errp, "'lsx' feature not supported by KVM on this host"); | ||
188 | + return -ENOTSUP; | ||
189 | + } | ||
190 | + } else if ((cpu->lsx == ON_OFF_AUTO_AUTO) && kvm_supported) { | ||
191 | + env->cpucfg[2] = FIELD_DP32(env->cpucfg[2], CPUCFG2, LSX, 1); | ||
192 | + } | ||
193 | + | ||
194 | + return 0; | ||
195 | +} | ||
196 | + | ||
197 | static int kvm_cpu_check_lbt(CPUState *cs, Error **errp) | ||
198 | { | ||
199 | CPULoongArchState *env = cpu_env(cs); | ||
200 | @@ -XXX,XX +XXX,XX @@ int kvm_arch_init_vcpu(CPUState *cs) | ||
201 | brk_insn = val; | ||
202 | } | ||
203 | |||
204 | + ret = kvm_cpu_check_lsx(cs, &local_err); | ||
205 | + if (ret < 0) { | ||
206 | + error_report_err(local_err); | ||
207 | + } | ||
208 | + | ||
209 | ret = kvm_cpu_check_lbt(cs, &local_err); | ||
210 | if (ret < 0) { | ||
211 | error_report_err(local_err); | ||
168 | -- | 212 | -- |
169 | 2.31.1 | 213 | 2.43.5 | diff view generated by jsdifflib |
1 | According to the 3A5000 manual 4.1 implement Chip Configuration | 1 | Like LSX feature, add type OnOffAuto for LASX feature setting. |
---|---|---|---|
2 | Version Register(0x0000). | ||
3 | 2 | ||
4 | Signed-off-by: Song Gao <gaosong@loongson.cn> | 3 | Signed-off-by: Bibo Mao <maobibo@loongson.cn> |
5 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Reviewed-by: Bibo Mao <maobibo@loongson.cn> |
6 | Message-Id: <20230227071046.1445572-1-gaosong@loongson.cn> | ||
7 | --- | 5 | --- |
8 | target/loongarch/cpu.c | 2 ++ | 6 | target/loongarch/cpu.c | 50 +++++++++++++++++++++++------------ |
9 | target/loongarch/cpu.h | 1 + | 7 | target/loongarch/cpu.h | 2 ++ |
10 | 2 files changed, 3 insertions(+) | 8 | target/loongarch/kvm/kvm.c | 53 ++++++++++++++++++++++++++++++++++++++ |
9 | 3 files changed, 89 insertions(+), 16 deletions(-) | ||
11 | 10 | ||
12 | diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c | 11 | diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c |
13 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/loongarch/cpu.c | 13 | --- a/target/loongarch/cpu.c |
15 | +++ b/target/loongarch/cpu.c | 14 | +++ b/target/loongarch/cpu.c |
16 | @@ -XXX,XX +XXX,XX @@ static void loongarch_qemu_write(void *opaque, hwaddr addr, | 15 | @@ -XXX,XX +XXX,XX @@ static void loongarch_set_lsx(Object *obj, bool value, Error **errp) |
17 | static uint64_t loongarch_qemu_read(void *opaque, hwaddr addr, unsigned size) | 16 | uint32_t val; |
17 | |||
18 | cpu->lsx = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF; | ||
19 | + if (cpu->lsx == ON_OFF_AUTO_OFF) { | ||
20 | + cpu->lasx = ON_OFF_AUTO_OFF; | ||
21 | + if (cpu->lasx == ON_OFF_AUTO_ON) { | ||
22 | + error_setg(errp, "Failed to disable LSX since LASX is enabled"); | ||
23 | + return; | ||
24 | + } | ||
25 | + } | ||
26 | + | ||
27 | if (kvm_enabled()) { | ||
28 | /* kvm feature detection in function kvm_arch_init_vcpu */ | ||
29 | return; | ||
30 | @@ -XXX,XX +XXX,XX @@ static void loongarch_set_lsx(Object *obj, bool value, Error **errp) | ||
31 | error_setg(errp, "Failed to enable LSX in TCG mode"); | ||
32 | return; | ||
33 | } | ||
34 | + } else { | ||
35 | + cpu->env.cpucfg[2] = FIELD_DP32(val, CPUCFG2, LASX, 0); | ||
36 | + val = cpu->env.cpucfg[2]; | ||
37 | } | ||
38 | |||
39 | cpu->env.cpucfg[2] = FIELD_DP32(val, CPUCFG2, LSX, value); | ||
40 | @@ -XXX,XX +XXX,XX @@ static void loongarch_set_lsx(Object *obj, bool value, Error **errp) | ||
41 | |||
42 | static bool loongarch_get_lasx(Object *obj, Error **errp) | ||
18 | { | 43 | { |
19 | switch (addr) { | 44 | - LoongArchCPU *cpu = LOONGARCH_CPU(obj); |
20 | + case VERSION_REG: | 45 | - bool ret; |
21 | + return 0x11ULL; | 46 | - |
22 | case FEATURE_REG: | 47 | - if (FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LASX)) { |
23 | return 1ULL << IOCSRF_MSI | 1ULL << IOCSRF_EXTIOI | | 48 | - ret = true; |
24 | 1ULL << IOCSRF_CSRIPI; | 49 | - } else { |
50 | - ret = false; | ||
51 | - } | ||
52 | - return ret; | ||
53 | + return LOONGARCH_CPU(obj)->lasx != ON_OFF_AUTO_OFF; | ||
54 | } | ||
55 | |||
56 | static void loongarch_set_lasx(Object *obj, bool value, Error **errp) | ||
57 | { | ||
58 | LoongArchCPU *cpu = LOONGARCH_CPU(obj); | ||
59 | + uint32_t val; | ||
60 | |||
61 | - if (value) { | ||
62 | - if (!FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LSX)) { | ||
63 | - cpu->env.cpucfg[2] = FIELD_DP32(cpu->env.cpucfg[2], CPUCFG2, LSX, 1); | ||
64 | - } | ||
65 | - cpu->env.cpucfg[2] = FIELD_DP32(cpu->env.cpucfg[2], CPUCFG2, LASX, 1); | ||
66 | - } else { | ||
67 | - cpu->env.cpucfg[2] = FIELD_DP32(cpu->env.cpucfg[2], CPUCFG2, LASX, 0); | ||
68 | + cpu->lasx = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF; | ||
69 | + if ((cpu->lsx == ON_OFF_AUTO_OFF) && (cpu->lasx == ON_OFF_AUTO_ON)) { | ||
70 | + error_setg(errp, "Failed to enable LASX since lSX is disabled"); | ||
71 | + return; | ||
72 | + } | ||
73 | + | ||
74 | + if (kvm_enabled()) { | ||
75 | + /* kvm feature detection in function kvm_arch_init_vcpu */ | ||
76 | + return; | ||
77 | } | ||
78 | + | ||
79 | + /* LASX feature detection in TCG mode */ | ||
80 | + val = cpu->env.cpucfg[2]; | ||
81 | + if (cpu->lasx == ON_OFF_AUTO_ON) { | ||
82 | + if (FIELD_EX32(val, CPUCFG2, LASX) == 0) { | ||
83 | + error_setg(errp, "Failed to enable LASX in TCG mode"); | ||
84 | + return; | ||
85 | + } | ||
86 | + } | ||
87 | + | ||
88 | + cpu->env.cpucfg[2] = FIELD_DP32(val, CPUCFG2, LASX, value); | ||
89 | } | ||
90 | |||
91 | static bool loongarch_get_lbt(Object *obj, Error **errp) | ||
92 | @@ -XXX,XX +XXX,XX @@ void loongarch_cpu_post_init(Object *obj) | ||
93 | LoongArchCPU *cpu = LOONGARCH_CPU(obj); | ||
94 | |||
95 | cpu->lsx = ON_OFF_AUTO_AUTO; | ||
96 | + cpu->lasx = ON_OFF_AUTO_AUTO; | ||
97 | object_property_add_bool(obj, "lsx", loongarch_get_lsx, | ||
98 | loongarch_set_lsx); | ||
99 | object_property_add_bool(obj, "lasx", loongarch_get_lasx, | ||
25 | diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h | 100 | diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h |
26 | index XXXXXXX..XXXXXXX 100644 | 101 | index XXXXXXX..XXXXXXX 100644 |
27 | --- a/target/loongarch/cpu.h | 102 | --- a/target/loongarch/cpu.h |
28 | +++ b/target/loongarch/cpu.h | 103 | +++ b/target/loongarch/cpu.h |
29 | @@ -XXX,XX +XXX,XX @@ | 104 | @@ -XXX,XX +XXX,XX @@ typedef struct LoongArchTLB LoongArchTLB; |
30 | #define IOCSRF_GMOD 9 | 105 | |
31 | #define IOCSRF_VM 11 | 106 | enum loongarch_features { |
32 | 107 | LOONGARCH_FEATURE_LSX, | |
33 | +#define VERSION_REG 0x0 | 108 | + LOONGARCH_FEATURE_LASX, |
34 | #define FEATURE_REG 0x8 | 109 | LOONGARCH_FEATURE_LBT, /* loongson binary translation extension */ |
35 | #define VENDOR_REG 0x10 | 110 | LOONGARCH_FEATURE_PMU, |
36 | #define CPUNAME_REG 0x20 | 111 | }; |
112 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
113 | OnOffAuto lbt; | ||
114 | OnOffAuto pmu; | ||
115 | OnOffAuto lsx; | ||
116 | + OnOffAuto lasx; | ||
117 | |||
118 | /* 'compatible' string for this CPU for Linux device trees */ | ||
119 | const char *dtb_compatible; | ||
120 | diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c | ||
121 | index XXXXXXX..XXXXXXX 100644 | ||
122 | --- a/target/loongarch/kvm/kvm.c | ||
123 | +++ b/target/loongarch/kvm/kvm.c | ||
124 | @@ -XXX,XX +XXX,XX @@ static bool kvm_feature_supported(CPUState *cs, enum loongarch_features feature) | ||
125 | } | ||
126 | return false; | ||
127 | |||
128 | + case LOONGARCH_FEATURE_LASX: | ||
129 | + attr.group = KVM_LOONGARCH_VM_FEAT_CTRL; | ||
130 | + attr.attr = KVM_LOONGARCH_VM_FEAT_LASX; | ||
131 | + ret = kvm_vm_ioctl(kvm_state, KVM_HAS_DEVICE_ATTR, &attr); | ||
132 | + if (ret == 0) { | ||
133 | + return true; | ||
134 | + } | ||
135 | + | ||
136 | + /* Fallback to old kernel detect interface */ | ||
137 | + val = 0; | ||
138 | + attr.group = KVM_LOONGARCH_VCPU_CPUCFG; | ||
139 | + /* Cpucfg2 */ | ||
140 | + attr.attr = 2; | ||
141 | + attr.addr = (uint64_t)&val; | ||
142 | + ret = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, &attr); | ||
143 | + if (!ret) { | ||
144 | + ret = kvm_vcpu_ioctl(cs, KVM_GET_DEVICE_ATTR, &attr); | ||
145 | + if (ret) { | ||
146 | + return false; | ||
147 | + } | ||
148 | + | ||
149 | + ret = FIELD_EX32((uint32_t)val, CPUCFG2, LASX); | ||
150 | + return (ret != 0); | ||
151 | + } | ||
152 | + return false; | ||
153 | + | ||
154 | case LOONGARCH_FEATURE_LBT: | ||
155 | /* | ||
156 | * Return all if all the LBT features are supported such as: | ||
157 | @@ -XXX,XX +XXX,XX @@ static int kvm_cpu_check_lsx(CPUState *cs, Error **errp) | ||
158 | return 0; | ||
159 | } | ||
160 | |||
161 | +static int kvm_cpu_check_lasx(CPUState *cs, Error **errp) | ||
162 | +{ | ||
163 | + CPULoongArchState *env = cpu_env(cs); | ||
164 | + LoongArchCPU *cpu = LOONGARCH_CPU(cs); | ||
165 | + bool kvm_supported; | ||
166 | + | ||
167 | + kvm_supported = kvm_feature_supported(cs, LOONGARCH_FEATURE_LASX); | ||
168 | + env->cpucfg[2] = FIELD_DP32(env->cpucfg[2], CPUCFG2, LASX, 0); | ||
169 | + if (cpu->lasx == ON_OFF_AUTO_ON) { | ||
170 | + if (kvm_supported) { | ||
171 | + env->cpucfg[2] = FIELD_DP32(env->cpucfg[2], CPUCFG2, LASX, 1); | ||
172 | + } else { | ||
173 | + error_setg(errp, "'lasx' feature not supported by KVM on host"); | ||
174 | + return -ENOTSUP; | ||
175 | + } | ||
176 | + } else if ((cpu->lasx == ON_OFF_AUTO_AUTO) && kvm_supported) { | ||
177 | + env->cpucfg[2] = FIELD_DP32(env->cpucfg[2], CPUCFG2, LASX, 1); | ||
178 | + } | ||
179 | + | ||
180 | + return 0; | ||
181 | +} | ||
182 | + | ||
183 | static int kvm_cpu_check_lbt(CPUState *cs, Error **errp) | ||
184 | { | ||
185 | CPULoongArchState *env = cpu_env(cs); | ||
186 | @@ -XXX,XX +XXX,XX @@ int kvm_arch_init_vcpu(CPUState *cs) | ||
187 | error_report_err(local_err); | ||
188 | } | ||
189 | |||
190 | + ret = kvm_cpu_check_lasx(cs, &local_err); | ||
191 | + if (ret < 0) { | ||
192 | + error_report_err(local_err); | ||
193 | + } | ||
194 | + | ||
195 | ret = kvm_cpu_check_lbt(cs, &local_err); | ||
196 | if (ret < 0) { | ||
197 | error_report_err(local_err); | ||
37 | -- | 198 | -- |
38 | 2.31.1 | 199 | 2.43.5 | diff view generated by jsdifflib |