From 9864e564cb2a59a93286ec140190ee566fbf49b4 Mon Sep 17 00:00:00 2001 From: Jiabo Feng Date: Fri, 21 Feb 2025 14:57:01 +0800 Subject: [PATCH] QEMU update to version 8.2.0-28: - hw/misc/mos6522: Fix bad class definition of the MOS6522 device - target/i386: Fix minor typo in NO_NESTED_DATA_BP feature bit - cpu: ensure we don't call start_exclusive from cpu_exec - Avoid unaligned fetch in ladr_match() - audio/audio.c: remove trailing newline in error_setg - acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM - linux-user: Tolerate CONFIG_LSM_MMAP_MIN_ADDR - accel/tcg: Fix user-only probe_access_internal plugin - linux-user: Honor elf alignment when placing images - Reserve address for MSI mapping in the CVM scenario. Signed-off-by: Jiabo Feng --- Avoid-unaligned-fetch-in-ladr_match.patch | 37 ++++++ ...-for-MSI-mapping-in-the-CVM-scenario.patch | 41 +++++++ ...er-only-probe_access_internal-plugin.patch | 42 +++++++ ...do-bits-wait-for-200-seconds-for-SHU.patch | 66 +++++++++++ ...emove-trailing-newline-in-error_setg.patch | 36 ++++++ ...n-t-call-start_exclusive-from-cpu_ex.patch | 37 ++++++ ...Fix-bad-class-definition-of-the-MOS6.patch | 49 ++++++++ ...or-elf-alignment-when-placing-images.patch | 105 ++++++++++++++++++ ...er-Tolerate-CONFIG_LSM_MMAP_MIN_ADDR.patch | 52 +++++++++ qemu.spec | 24 +++- ...minor-typo-in-NO_NESTED_DATA_BP-feat.patch | 50 +++++++++ 11 files changed, 538 insertions(+), 1 deletion(-) create mode 100644 Avoid-unaligned-fetch-in-ladr_match.patch create mode 100644 Reserve-address-for-MSI-mapping-in-the-CVM-scenario.patch create mode 100644 accel-tcg-Fix-user-only-probe_access_internal-plugin.patch create mode 100644 acpi-tests-avocado-bits-wait-for-200-seconds-for-SHU.patch create mode 100644 audio-audio.c-remove-trailing-newline-in-error_setg.patch create mode 100644 cpu-ensure-we-don-t-call-start_exclusive-from-cpu_ex.patch create mode 100644 hw-misc-mos6522-Fix-bad-class-definition-of-the-MOS6.patch create mode 100644 linux-user-Honor-elf-alignment-when-placing-images.patch create mode 100644 linux-user-Tolerate-CONFIG_LSM_MMAP_MIN_ADDR.patch create mode 100644 target-i386-Fix-minor-typo-in-NO_NESTED_DATA_BP-feat.patch diff --git a/Avoid-unaligned-fetch-in-ladr_match.patch b/Avoid-unaligned-fetch-in-ladr_match.patch new file mode 100644 index 00000000..7f553e9d --- /dev/null +++ b/Avoid-unaligned-fetch-in-ladr_match.patch @@ -0,0 +1,37 @@ +From d2ee29691b6d6b48ba8da179e97572f5a6684a9d Mon Sep 17 00:00:00 2001 +From: gubin +Date: Mon, 18 Nov 2024 14:47:25 +0800 +Subject: [PATCH] Avoid unaligned fetch in ladr_match() + +cherry-pick from 6a5287ce80470bb8df95901d73ee779a64e70c3a + +There is no guarantee that the PCNetState is allocated such that +csr[8] is allocated on an 8-byte boundary. Since not all hosts are +capable of unaligned fetches the 16-bit elements need to be fetched +individually to avoid a potential fault. Closes issue #2143 + +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2143 +Signed-off-by: Nick Briggs +Reviewed-by: Peter Maydell +Signed-off-by: Jason Wang +Signed-off-by: gubin +--- + hw/net/pcnet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c +index a7e123e60d..7d574f487b 100644 +--- a/hw/net/pcnet.c ++++ b/hw/net/pcnet.c +@@ -632,7 +632,7 @@ static inline int ladr_match(PCNetState *s, const uint8_t *buf, int size) + { + struct qemu_ether_header *hdr = (void *)buf; + if ((*(hdr->ether_dhost)&0x01) && +- ((uint64_t *)&s->csr[8])[0] != 0LL) { ++ (s->csr[8] | s->csr[9] | s->csr[10] | s->csr[11]) != 0) { + uint8_t ladr[8] = { + s->csr[8] & 0xff, s->csr[8] >> 8, + s->csr[9] & 0xff, s->csr[9] >> 8, +-- +2.41.0.windows.1 + diff --git a/Reserve-address-for-MSI-mapping-in-the-CVM-scenario.patch b/Reserve-address-for-MSI-mapping-in-the-CVM-scenario.patch new file mode 100644 index 00000000..234f4590 --- /dev/null +++ b/Reserve-address-for-MSI-mapping-in-the-CVM-scenario.patch @@ -0,0 +1,41 @@ +From e698238a5fa6e78fdffc8269d59884df69da3434 Mon Sep 17 00:00:00 2001 +From: chenzheng +Date: Thu, 5 Dec 2024 11:06:57 +0000 +Subject: [PATCH] Reserve address for MSI mapping in the CVM scenario. + +Signed-off-by: yangxiangkai@huawei.com +--- + hw/arm/virt.c | 3 ++- + include/hw/arm/virt.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index a9efcec85e..8823f2ed1c 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -162,8 +162,9 @@ static const MemMapEntry base_memmap[] = { + [VIRT_PVTIME] = { 0x090a0000, 0x00010000 }, + [VIRT_SECURE_GPIO] = { 0x090b0000, 0x00001000 }, + [VIRT_CPUHP_ACPI] = { 0x090c0000, ACPI_CPU_HOTPLUG_REG_LEN}, +- /* In the virtCCA scenario, this space is used for MSI interrupt mapping */ + [VIRT_MMIO] = { 0x0a000000, 0x00000200 }, ++ /* In the virtCCA scenario, this space is used for MSI interrupt mapping */ ++ [VIRT_CVM_MSI] = { 0x0a001000, 0x00fff000 }, + [VIRT_CPUFREQ] = { 0x0b000000, 0x00010000 }, + /* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that size */ + [VIRT_PLATFORM_BUS] = { 0x0c000000, 0x02000000 }, +diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h +index 4b7dc61c24..345b2d5594 100644 +--- a/include/hw/arm/virt.h ++++ b/include/hw/arm/virt.h +@@ -121,6 +121,7 @@ enum { + VIRT_UART, + VIRT_CPUFREQ, + VIRT_MMIO, ++ VIRT_CVM_MSI, + VIRT_RTC, + VIRT_FW_CFG, + VIRT_PCIE, +-- +2.41.0.windows.1 + diff --git a/accel-tcg-Fix-user-only-probe_access_internal-plugin.patch b/accel-tcg-Fix-user-only-probe_access_internal-plugin.patch new file mode 100644 index 00000000..5042483c --- /dev/null +++ b/accel-tcg-Fix-user-only-probe_access_internal-plugin.patch @@ -0,0 +1,42 @@ +From b611bd7f3f4525c8373f2e504594414e1ed5b058 Mon Sep 17 00:00:00 2001 +From: guping +Date: Mon, 18 Nov 2024 02:50:17 +0000 +Subject: [PATCH] accel/tcg: Fix user-only probe_access_internal plugin check + cherry-pick from 2a339fee450638b512c5122281cb5ab49331cfb8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The acc_flag check for write should have been against PAGE_WRITE_ORG, +not PAGE_WRITE. But it is better to combine two acc_flag checks +to a single check against access_type. This matches the system code +in cputlb.c. + +Cc: qemu-stable@nongnu.org +Resolves: #2647 + +Signed-off-by: default avatarRichard Henderson +Message-Id: 20241111145002.144995-1-richard.henderson@linaro.org +Reviewed-by: default avatarAlex Bennée + +Signed-off-by: guping +--- + accel/tcg/user-exec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c +index 68b252cb8e..e87848a5e2 100644 +--- a/accel/tcg/user-exec.c ++++ b/accel/tcg/user-exec.c +@@ -794,7 +794,7 @@ static int probe_access_internal(CPUArchState *env, vaddr addr, + if (guest_addr_valid_untagged(addr)) { + int page_flags = page_get_flags(addr); + if (page_flags & acc_flag) { +- if ((acc_flag == PAGE_READ || acc_flag == PAGE_WRITE) ++ if (access_type != MMU_INST_FETCH + && cpu_plugin_mem_cbs_enabled(env_cpu(env))) { + return TLB_MMIO; + } +-- +2.41.0.windows.1 + diff --git a/acpi-tests-avocado-bits-wait-for-200-seconds-for-SHU.patch b/acpi-tests-avocado-bits-wait-for-200-seconds-for-SHU.patch new file mode 100644 index 00000000..a9186214 --- /dev/null +++ b/acpi-tests-avocado-bits-wait-for-200-seconds-for-SHU.patch @@ -0,0 +1,66 @@ +From 1f6dde2350209e937a5676c6775d1500136caea2 Mon Sep 17 00:00:00 2001 +From: gubin +Date: Mon, 18 Nov 2024 13:48:37 +0800 +Subject: [PATCH] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN + event from bits VM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +cheery-pick from 7ef4c41e91d59d72a3b8bc022a6cb3e81787a50a + +By default, the timeout to receive any specified event from the QEMU VM is 60 +seconds set by the python avocado test framework. Please see event_wait() and +events_wait() in python/qemu/machine/machine.py. If the matching event is not +triggered within that interval, an asyncio.TimeoutError is generated. Since the +timeout for the bits avocado test is 200 secs, we need to make event_wait() +timeout of the same value as well so that an early timeout is not triggered by +the avocado framework. + +CC: peter.maydell@linaro.org +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2077 +Signed-off-by: Ani Sinha +Reviewed-by: Daniel P. Berrangé +Message-id: 20240117042556.3360190-1-anisinha@redhat.com +Signed-off-by: Peter Maydell +Signed-off-by: gubin +--- + tests/avocado/acpi-bits.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py +index 68b9e98d4e..efe4f52ee0 100644 +--- a/tests/avocado/acpi-bits.py ++++ b/tests/avocado/acpi-bits.py +@@ -54,6 +54,8 @@ + deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box. + supported_platforms = ['x86_64'] # supported test platforms. + ++# default timeout of 120 secs is sometimes not enough for bits test. ++BITS_TIMEOUT = 200 + + def which(tool): + """ looks up the full path for @tool, returns None if not found +@@ -133,7 +135,7 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes + + """ + # in slower systems the test can take as long as 3 minutes to complete. +- timeout = 200 ++ timeout = BITS_TIMEOUT + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) +@@ -400,7 +402,8 @@ def test_acpi_smbios_bits(self): + + # biosbits has been configured to run all the specified test suites + # in batch mode and then automatically initiate a vm shutdown. +- # Rely on avocado's unit test timeout. +- self._vm.event_wait('SHUTDOWN') ++ # Set timeout to BITS_TIMEOUT for SHUTDOWN event from bits VM at par ++ # with the avocado test timeout. ++ self._vm.event_wait('SHUTDOWN', timeout=BITS_TIMEOUT) + self._vm.wait(timeout=None) + self.parse_log() +-- +2.41.0.windows.1 + diff --git a/audio-audio.c-remove-trailing-newline-in-error_setg.patch b/audio-audio.c-remove-trailing-newline-in-error_setg.patch new file mode 100644 index 00000000..0b74577c --- /dev/null +++ b/audio-audio.c-remove-trailing-newline-in-error_setg.patch @@ -0,0 +1,36 @@ +From b60350d9f495f568aa1380f02a13b51e9619a7de Mon Sep 17 00:00:00 2001 +From: gubin +Date: Mon, 18 Nov 2024 14:17:52 +0800 +Subject: [PATCH] audio/audio.c: remove trailing newline in error_setg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +cherry-pick from 09a36158c283f7448d1b00fdbb6634f05d27f922 + +error_setg() appends newline to the formatted message. +Fixes: cb94ff5f80c5 ("audio: propagate Error * out of audio_init") + +Signed-off-by: Michael Tokarev +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: gubin +--- + audio/audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/audio/audio.c b/audio/audio.c +index 8d1e4ad922..7ac74f9e16 100644 +--- a/audio/audio.c ++++ b/audio/audio.c +@@ -1744,7 +1744,7 @@ static AudioState *audio_init(Audiodev *dev, Error **errp) + if (driver) { + done = !audio_driver_init(s, driver, dev, errp); + } else { +- error_setg(errp, "Unknown audio driver `%s'\n", drvname); ++ error_setg(errp, "Unknown audio driver `%s'", drvname); + } + if (!done) { + goto out; +-- +2.41.0.windows.1 + diff --git a/cpu-ensure-we-don-t-call-start_exclusive-from-cpu_ex.patch b/cpu-ensure-we-don-t-call-start_exclusive-from-cpu_ex.patch new file mode 100644 index 00000000..b50c17cf --- /dev/null +++ b/cpu-ensure-we-don-t-call-start_exclusive-from-cpu_ex.patch @@ -0,0 +1,37 @@ +From c5b349f9ff0792cce72cdd1ade2521c568058a25 Mon Sep 17 00:00:00 2001 +From: qihao_yewu +Date: Mon, 18 Nov 2024 14:20:56 -0500 +Subject: [PATCH] cpu: ensure we don't call start_exclusive from cpu_exec +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +cheery-pick from 779f30a01af8566780cefc8639505b758950afb3 + +Reviewed-by: Richard Henderson +Signed-off-by: Pierrick Bouvier +Reviewed-by: Philippe Mathieu-Daudé +Message-ID: <20241025175857.2554252-3-pierrick.bouvier@linaro.org> +Signed-off-by: Richard Henderson +Signed-off-by: qihao_yewu +--- + cpu-common.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cpu-common.c b/cpu-common.c +index 54e63b3f77..a949ad7ca3 100644 +--- a/cpu-common.c ++++ b/cpu-common.c +@@ -234,6 +234,9 @@ void start_exclusive(void) + CPUState *other_cpu; + int running_cpus; + ++ /* Ensure we are not running, or start_exclusive will be blocked. */ ++ g_assert(!current_cpu->running); ++ + if (current_cpu->exclusive_context_count) { + current_cpu->exclusive_context_count++; + return; +-- +2.41.0.windows.1 + diff --git a/hw-misc-mos6522-Fix-bad-class-definition-of-the-MOS6.patch b/hw-misc-mos6522-Fix-bad-class-definition-of-the-MOS6.patch new file mode 100644 index 00000000..6177a5c4 --- /dev/null +++ b/hw-misc-mos6522-Fix-bad-class-definition-of-the-MOS6.patch @@ -0,0 +1,49 @@ +From f0be5a2c99d2f893a27839cd5eb5fa74f3ff5564 Mon Sep 17 00:00:00 2001 +From: qihao_yewu +Date: Mon, 18 Nov 2024 21:03:55 -0500 +Subject: [PATCH] hw/misc/mos6522: Fix bad class definition of the MOS6522 + device +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +cheery-pick from c3d7c18b0d616cf7fb3c1f325503e1462307209d + +When compiling QEMU with --enable-cfi, the "q800" m68k machine +currently crashes very early, when the q800_machine_init() function +tries to wire the interrupts of the "via1" device. +This happens because TYPE_MOS6522_Q800_VIA1 is supposed to be a +proper SysBus device, but its parent (TYPE_MOS6522) has a mistake +in its class definition where it is only derived from DeviceClass, +and not from SysBusDeviceClass, so we end up in funny memory access +issues here. Using the right class hierarchy for the MOS6522 device +fixes the problem. + +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2675 +Signed-off-by: Thomas Huth +Fixes: 51f233ec92 ("misc: introduce new mos6522 VIA device") +Reviewed-by: Philippe Mathieu-Daudé +Reviewed-by: Mark Cave-Ayland +Message-ID: <20241114104653.963812-1-thuth@redhat.com> +Signed-off-by: Philippe Mathieu-Daudé +Signed-off-by: qihao_yewu +--- + include/hw/misc/mos6522.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h +index fba45668ab..920871a598 100644 +--- a/include/hw/misc/mos6522.h ++++ b/include/hw/misc/mos6522.h +@@ -154,7 +154,7 @@ struct MOS6522State { + OBJECT_DECLARE_TYPE(MOS6522State, MOS6522DeviceClass, MOS6522) + + struct MOS6522DeviceClass { +- DeviceClass parent_class; ++ SysBusDeviceClass parent_class; + + ResettablePhases parent_phases; + void (*portB_write)(MOS6522State *dev); +-- +2.41.0.windows.1 + diff --git a/linux-user-Honor-elf-alignment-when-placing-images.patch b/linux-user-Honor-elf-alignment-when-placing-images.patch new file mode 100644 index 00000000..f7b8a49f --- /dev/null +++ b/linux-user-Honor-elf-alignment-when-placing-images.patch @@ -0,0 +1,105 @@ +From ad5b05def5521a9cbbdd750c915fccaba391f53b Mon Sep 17 00:00:00 2001 +From: Richard Henderson +Date: Tue, 12 Nov 2024 11:32:01 -0800 +Subject: [PATCH] linux-user: Honor elf alignment when placing images + +Most binaries don't actually depend on more than page alignment, +but any binary can request it. Not honoring this was a bug. + +This became obvious when gdb reported + + Failed to read a valid object file image from memory + +when examining some vdso which are marked as needing more +than page alignment. + +Signed-off-by: Richard Henderson +Signed-off-by: Zhongrui Tang +--- + linux-user/elfload.c | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +diff --git a/linux-user/elfload.c b/linux-user/elfload.c +index cf9e74468b..2a82468079 100644 +--- a/linux-user/elfload.c ++++ b/linux-user/elfload.c +@@ -3263,7 +3263,8 @@ static void load_elf_image(const char *image_name, const ImageSource *src, + char **pinterp_name) + { + g_autofree struct elf_phdr *phdr = NULL; +- abi_ulong load_addr, load_bias, loaddr, hiaddr, error; ++ abi_ulong load_addr, load_bias, loaddr, hiaddr, error, align; ++ size_t reserve_size, align_size; + int i, prot_exec; + Error *err = NULL; + +@@ -3347,6 +3348,9 @@ static void load_elf_image(const char *image_name, const ImageSource *src, + + load_addr = loaddr; + ++ align = pow2ceil(info->alignment); ++ info->alignment = align; ++ + if (pinterp_name != NULL) { + if (ehdr->e_type == ET_EXEC) { + /* +@@ -3355,8 +3359,6 @@ static void load_elf_image(const char *image_name, const ImageSource *src, + */ + probe_guest_base(image_name, loaddr, hiaddr); + } else { +- abi_ulong align; +- + /* + * The binary is dynamic, but we still need to + * select guest_base. In this case we pass a size. +@@ -3374,10 +3376,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src, + * Since we do not have complete control over the guest + * address space, we prefer the kernel to choose some address + * rather than force the use of LOAD_ADDR via MAP_FIXED. +- * But without MAP_FIXED we cannot guarantee alignment, +- * only suggest it. + */ +- align = pow2ceil(info->alignment); + if (align) { + load_addr &= -align; + } +@@ -3401,13 +3400,35 @@ static void load_elf_image(const char *image_name, const ImageSource *src, + * In both cases, we will overwrite pages in this range with mappings + * from the executable. + */ +- load_addr = target_mmap(load_addr, (size_t)hiaddr - loaddr + 1, PROT_NONE, ++ reserve_size = (size_t)hiaddr - loaddr + 1; ++ align_size = reserve_size; ++ ++ if (ehdr->e_type != ET_EXEC && align > qemu_real_host_page_size()) { ++ align_size += align - 1; ++ } ++ ++ load_addr = target_mmap(load_addr, align_size, PROT_NONE, + MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | + (ehdr->e_type == ET_EXEC ? MAP_FIXED_NOREPLACE : 0), + -1, 0); + if (load_addr == -1) { + goto exit_mmap; + } ++ ++ if (align_size != reserve_size) { ++ abi_ulong align_addr = ROUND_UP(load_addr, align); ++ abi_ulong align_end = align_addr + reserve_size; ++ abi_ulong load_end = load_addr + align_size; ++ ++ if (align_addr != load_addr) { ++ target_munmap(load_addr, align_addr - load_addr); ++ } ++ if (align_end != load_end) { ++ target_munmap(align_end, load_end - align_end); ++ } ++ load_addr = align_addr; ++ } ++ + load_bias = load_addr - loaddr; + + if (elf_is_fdpic(ehdr)) { +-- +2.41.0.windows.1 + diff --git a/linux-user-Tolerate-CONFIG_LSM_MMAP_MIN_ADDR.patch b/linux-user-Tolerate-CONFIG_LSM_MMAP_MIN_ADDR.patch new file mode 100644 index 00000000..74d8b689 --- /dev/null +++ b/linux-user-Tolerate-CONFIG_LSM_MMAP_MIN_ADDR.patch @@ -0,0 +1,52 @@ +From 6d4db685ae8b4cbffab80c61c01ef56c57b67eb4 Mon Sep 17 00:00:00 2001 +From: guping +Date: Mon, 18 Nov 2024 03:09:59 +0000 +Subject: [PATCH] linux-user: Tolerate CONFIG_LSM_MMAP_MIN_ADDR cherry-pick + from fb7f3572b111ffb6c2dd2c7f6c5b4dc57dd8a3f5 + +Running qemu-i386 on a system running with SELinux in enforcing mode +(more precisely: s390x trixie container on Fedora 40) fails with: + + qemu-i386: tests/tcg/i386-linux-user/sigreturn-sigmask: Unable to find a guest_base to satisfy all guest address mapping requirements + 00000000-ffffffff + +The reason is that main() determines mmap_min_addr from +/proc/sys/vm/mmap_min_addr, but SELinux additionally defines +CONFIG_LSM_MMAP_MIN_ADDR, which is normally larger: 32K or 64K, but, +in general, can be anything. There is no portable way to query its +value: /boot/config, /proc/config and /proc/config.gz are distro- and +environment-specific. + +Once the identity map fails, the magnitude of guest_base does not +matter, so fix by starting the search from 1M or 1G. + +Cc: qemu-stable@nongnu.org +Resolves: #2598 + + +Suggested-by: default avatarRichard Henderson +Signed-off-by: default avatarIlya Leoshkevich +Message-ID: <20241023002558.34589-1-iii@linux.ibm.com> +Signed-off-by: default avatarRichard Henderson + +Signed-off-by: guping +--- + linux-user/elfload.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linux-user/elfload.c b/linux-user/elfload.c +index cf9e74468b..0df64c6442 100644 +--- a/linux-user/elfload.c ++++ b/linux-user/elfload.c +@@ -2980,7 +2980,7 @@ static uintptr_t pgb_try_itree(const PGBAddrs *ga, uintptr_t base, + static uintptr_t pgb_find_itree(const PGBAddrs *ga, IntervalTreeRoot *root, + uintptr_t align, uintptr_t brk) + { +- uintptr_t last = mmap_min_addr; ++ uintptr_t last = sizeof(uintptr_t) == 4 ? MiB : GiB; + uintptr_t base, skip; + + while (true) { +-- +2.41.0.windows.1 + diff --git a/qemu.spec b/qemu.spec index f09c6da0..1a2682a9 100644 --- a/qemu.spec +++ b/qemu.spec @@ -3,7 +3,7 @@ Name: qemu Version: 8.2.0 -Release: 27 +Release: 28 Epoch: 11 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY-SA-4.0 @@ -563,6 +563,16 @@ Patch0546: hw-loongarch-clean-code.patch Patch0547: hw-loongarch-boot-Use-warn_report-when-no-kernel-fil.patch Patch0548: hw-loongarch-fix-cpu-hotplug-reset.patch Patch0549: fix-compile-error-on-loongarch.patch +Patch0550: Reserve-address-for-MSI-mapping-in-the-CVM-scenario.patch +Patch0551: linux-user-Honor-elf-alignment-when-placing-images.patch +Patch0552: accel-tcg-Fix-user-only-probe_access_internal-plugin.patch +Patch0553: linux-user-Tolerate-CONFIG_LSM_MMAP_MIN_ADDR.patch +Patch0554: acpi-tests-avocado-bits-wait-for-200-seconds-for-SHU.patch +Patch0555: audio-audio.c-remove-trailing-newline-in-error_setg.patch +Patch0556: Avoid-unaligned-fetch-in-ladr_match.patch +Patch0557: cpu-ensure-we-don-t-call-start_exclusive-from-cpu_ex.patch +Patch0558: target-i386-Fix-minor-typo-in-NO_NESTED_DATA_BP-feat.patch +Patch0559: hw-misc-mos6522-Fix-bad-class-definition-of-the-MOS6.patch BuildRequires: flex BuildRequires: gcc @@ -1161,6 +1171,18 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Feb 21 2025 Jiabo Feng - 11:8.2.0-28 +- hw/misc/mos6522: Fix bad class definition of the MOS6522 device +- target/i386: Fix minor typo in NO_NESTED_DATA_BP feature bit +- cpu: ensure we don't call start_exclusive from cpu_exec +- Avoid unaligned fetch in ladr_match() +- audio/audio.c: remove trailing newline in error_setg +- acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM +- linux-user: Tolerate CONFIG_LSM_MMAP_MIN_ADDR +- accel/tcg: Fix user-only probe_access_internal plugin +- linux-user: Honor elf alignment when placing images +- Reserve address for MSI mapping in the CVM scenario. + * Fri Dec 13 2024 Xianglai Li - 11:8.2.0-27 - fix compile error on loongarch - hw/loongarch: fix cpu hotplug reset diff --git a/target-i386-Fix-minor-typo-in-NO_NESTED_DATA_BP-feat.patch b/target-i386-Fix-minor-typo-in-NO_NESTED_DATA_BP-feat.patch new file mode 100644 index 00000000..448226ed --- /dev/null +++ b/target-i386-Fix-minor-typo-in-NO_NESTED_DATA_BP-feat.patch @@ -0,0 +1,50 @@ +From c006b5b78ffe7e6af76cde943a9fdd082473ba55 Mon Sep 17 00:00:00 2001 +From: qihao_yewu +Date: Mon, 18 Nov 2024 15:45:24 -0500 +Subject: [PATCH] target/i386: Fix minor typo in NO_NESTED_DATA_BP feature bit + +cheery-pick from 9c882ad4dc96f658ff9f92b88b3749d0398e6fa2 + +Rename CPUID_8000_0021_EAX_No_NESTED_DATA_BP to + CPUID_8000_0021_EAX_NO_NESTED_DATA_BP. + +No functional change intended. + +Signed-off-by: Babu Moger +Link: https://lore.kernel.org/r/a6749acd125670d3930f4ca31736a91b1d965f2f.1729807947.git.babu.moger@amd.com +Signed-off-by: Paolo Bonzini +Signed-off-by: qihao_yewu +--- + target/i386/cpu.c | 2 +- + target/i386/cpu.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index ca7e5337b0..c2dc929eaa 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -5063,7 +5063,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + CPUID_8000_0008_EBX_STIBP_ALWAYS_ON | + CPUID_8000_0008_EBX_AMD_SSBD | CPUID_8000_0008_EBX_AMD_PSFD, + .features[FEAT_8000_0021_EAX] = +- CPUID_8000_0021_EAX_No_NESTED_DATA_BP | ++ CPUID_8000_0021_EAX_NO_NESTED_DATA_BP | + CPUID_8000_0021_EAX_LFENCE_ALWAYS_SERIALIZING | + CPUID_8000_0021_EAX_NULL_SEL_CLR_BASE | + CPUID_8000_0021_EAX_AUTO_IBRS, +diff --git a/target/i386/cpu.h b/target/i386/cpu.h +index 34f9615b98..6ca185cd9d 100644 +--- a/target/i386/cpu.h ++++ b/target/i386/cpu.h +@@ -971,7 +971,7 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, + #define CPUID_8000_0008_EBX_AMD_PSFD (1U << 28) + + /* Processor ignores nested data breakpoints */ +-#define CPUID_8000_0021_EAX_No_NESTED_DATA_BP (1U << 0) ++#define CPUID_8000_0021_EAX_NO_NESTED_DATA_BP (1U << 0) + /* LFENCE is always serializing */ + #define CPUID_8000_0021_EAX_LFENCE_ALWAYS_SERIALIZING (1U << 2) + /* Null Selector Clears Base */ +-- +2.41.0.windows.1 + -- Gitee