summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | MAINTAINERS: add myself maintainer for the clock frameworkLuc Michel2021-02-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add Damien as a reviewer. Signed-off-by: Luc Michel <luc@lmichel.fr> Acked-by: Damien Hedde <damien.hedde@greensocs.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210211085318.2507-1-luc@lmichel.fr Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/i2c: Implement NPCM7XX SMBus Module FIFO ModeHao Wu2021-02-164-16/+501
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the FIFO mode of the SMBus module. In FIFO, the user transmits or receives at most 16 bytes at a time. The FIFO mode allows the module to transmit large amount of data faster than single byte mode. Since we only added the device in a patch that is only a few commits away in the same patch set. We do not increase the VMstate version number in this special case. Reviewed-by: Doug Evans<dje@google.com> Reviewed-by: Tyrong Ting<kfting@nuvoton.com> Signed-off-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Corey Minyard <cminyard@mvista.com> Message-id: 20210210220426.3577804-6-wuhaotsh@google.com Acked-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/i2c: Add a QTest for NPCM7XX SMBus DeviceHao Wu2021-02-162-0/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a QTest for NPCM7XX SMBus's single byte mode. It sends a byte to a device in the evaluation board, and verify the retrieved value is equivalent to the sent value. Reviewed-by: Doug Evans<dje@google.com> Reviewed-by: Tyrong Ting<kfting@nuvoton.com> Signed-off-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20210210220426.3577804-5-wuhaotsh@google.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/arm: Add I2C sensors and EEPROM for GSJ machineHao Wu2021-02-162-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add AT24 EEPROM and temperature sensors for GSJ machine. Reviewed-by: Doug Evans<dje@google.com> Reviewed-by: Tyrong Ting<kfting@nuvoton.com> Signed-off-by: Hao Wu <wuhaotsh@google.com> Message-id: 20210210220426.3577804-4-wuhaotsh@google.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/arm: Add I2C sensors for NPCM750 eval boardHao Wu2021-02-161-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add I2C temperature sensors for NPCM750 eval board. Reviewed-by: Doug Evans<dje@google.com> Reviewed-by: Tyrong Ting<kfting@nuvoton.com> Signed-off-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20210210220426.3577804-3-wuhaotsh@google.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/i2c: Implement NPCM7XX SMBus Module Single ModeHao Wu2021-02-167-17/+938
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements the single-byte mode of the SMBus. Each Nuvoton SoC has 16 System Management Bus (SMBus). These buses compliant with SMBus and I2C protocol. This patch implements the single-byte mode of the SMBus. In this mode, the user sends or receives a byte each time. The SMBus device transmits it to the underlying i2c device and sends an interrupt back to the QEMU guest. Reviewed-by: Doug Evans<dje@google.com> Reviewed-by: Tyrong Ting<kfting@nuvoton.com> Signed-off-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Corey Minyard <cminyard@mvista.com> Message-id: 20210210220426.3577804-2-wuhaotsh@google.com Acked-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | tests/tcg/aarch64: Add mte smoke testsRichard Henderson2021-02-167-0/+239
| | | | | | | | | | | | | | | | | | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-32-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target/arm: Enable MTE for user-onlyRichard Henderson2021-02-161-0/+15
| | | | | | | | | | | | | | | | | | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-31-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target/arm: Add allocation tag storage for user modeRichard Henderson2021-02-161-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the now-saved PAGE_ANON and PAGE_MTE bits, and the per-page saved data. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-30-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user/aarch64: Signal SEGV_MTEAERR for async tag check errorRichard Henderson2021-02-163-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The real kernel collects _TIF_MTE_ASYNC_FAULT into the current thread's state on any kernel entry (interrupt, exception etc), and then delivers the signal in advance of resuming the thread. This means that while the signal won't be delivered immediately, it will not be delayed forever -- at minimum it will be delivered after the next clock interrupt. We don't have a clock interrupt in linux-user, so we issue a cpu_kick to signal a return to the main loop at the end of the current TB. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-29-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user/aarch64: Signal SEGV_MTESERR for sync tag check faultRichard Henderson2021-02-162-0/+5
| | | | | | | | | | | | | | | | | | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-28-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user/aarch64: Pass syndrome to EXC_*_ABORTRichard Henderson2021-02-162-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A proper syndrome is required to fill in the proper si_code. Use page_get_flags to determine permission vs translation for user-only. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-27-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target/arm: Split out syndrome.h from internals.hRichard Henderson2021-02-162-244/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move everything related to syndromes to a new file, which can be shared with linux-user. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-26-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user/aarch64: Implement PROT_MTERichard Henderson2021-02-164-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remember the PROT_MTE bit as PAGE_MTE/PAGE_TARGET_2. Otherwise this does not yet have effect. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-25-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAGRichard Henderson2021-02-162-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | These prctl fields are required for the function of MTE. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-24-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target/arm: Use the proper TBI settings for linux-userRichard Henderson2021-02-163-10/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were fudging TBI1 enabled to speed up the generated code. Now that we've improved the code generation, remove this. Also, tidy the comment to reflect the current code. The pauth test was testing a kernel address (-1) and making incorrect assumptions about TBI1; stick to userland addresses. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-23-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target/arm: Improve gen_top_byte_ignoreRichard Henderson2021-02-161-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use simple arithmetic instead of a conditional move when tbi0 != tbi1. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-22-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLERichard Henderson2021-02-164-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the prctl bit that controls whether syscalls accept tagged addresses. See Documentation/arm64/tagged-address-abi.rst in the linux kernel. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-21-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Handle tags in lock_user/unlock_userRichard Henderson2021-02-161-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve the untagged address once, using thread_cpu. Tidy the DEBUG_REMAP code using glib routines. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-20-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Fix types in uaccess.cRichard Henderson2021-02-162-29/+28Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For copy_*_user, only 0 and -TARGET_EFAULT are returned; no need to involve abi_long. Use size_t for lengths. Use bool for the lock_user copy argument. Use ssize_t for target_strlen, because we can't overflow the host memory space. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-19-richard.henderson@linaro.org [PMM: moved fix for ifdef error to previous commit] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Move lock_user et al out of lineRichard Henderson2021-02-162-40/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions are not small, except for unlock_user without debugging enabled. Move them out of line, and add missing braces on the way. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-18-richard.henderson@linaro.org [PMM: fixed the sense of an ifdef test in qemu.h] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Use cpu_untagged_addr in access_ok; split out *_untaggedRichard Henderson2021-02-166-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide both tagged and untagged versions of access_ok. In a few places use thread_cpu, as the user is several callees removed from do_syscall1. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-17-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: Rename guest_{addr,range}_valid to *_untaggedRichard Henderson2021-02-165-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The places that use these are better off using untagged addresses, so do not provide a tagged versions. Rename to make it clear about the address type. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-16-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Use guest_range_valid in access_okRichard Henderson2021-02-161-6/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're currently open-coding the range check in access_ok; use guest_range_valid when size != 0. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-15-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Explicitly untag memory management syscallsRichard Henderson2021-02-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We define target_mmap et al as untagged, so that they can be used from the binary loaders. Explicitly call cpu_untagged_addr for munmap, mprotect, mremap syscall entry points. Add a few comments for the syscalls that are exempted by the kernel's tagged-address-abi.rst. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-14-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: Use cpu_untagged_addr in g2h; split out g2h_untaggedRichard Henderson2021-02-1620-137/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use g2h_untagged in contexts that have no cpu, e.g. the binary loaders that operate before the primary cpu is created. As a colollary, target_mmap and friends must use untagged addresses, since they are used by the loaders. Use g2h_untagged on values returned from target_mmap, as the kernel never applies a tag itself. Use g2h_untagged on all pc values. The only current user of tags, aarch64, removes tags from code addresses upon branch, so "pc" is always untagged. Use g2h with the cpu context on hand wherever possible. Use g2h_untagged in lock_user, which will be updated soon. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-13-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: Introduce cpu_untagged_addrRichard Henderson2021-02-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide an identity fallback for target that do not use tagged addresses. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-12-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Fix guest_addr_valid vs reserved_vaRichard Henderson2021-02-161-5/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We must always use GUEST_ADDR_MAX, because even 32-bit hosts can use -R <reserved_va> to restrict the memory address of the guest. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-11-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Do not use guest_addr_valid for h2g_validRichard Henderson2021-02-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the only use of guest_addr_valid that does not begin with a guest address, but a host address being transformed to a guest address. We will shortly adjust guest_addr_valid to handle guest memory tags, and the host address should not be subjected to that. Move h2g_valid adjacent to the other h2g macros. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | bsd-user: Tidy VERIFY_READ/VERIFY_WRITERichard Henderson2021-02-161-5/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These constants are only ever used with access_ok, and friends. Rather than translating them to PAGE_* bits, let them equal the PAGE_* bits to begin. Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Tidy VERIFY_READ/VERIFY_WRITERichard Henderson2021-02-161-5/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These constants are only ever used with access_ok, and friends. Rather than translating them to PAGE_* bits, let them equal the PAGE_* bits to begin. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-8-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Check for overflow in access_okRichard Henderson2021-02-161-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that addr + size - 1 does not wrap around. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-7-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: Improve types for guest_addr_validRichard Henderson2021-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return bool not int; pass abi_ulong not 'unsigned long'. All callers use abi_ulong already, so the change in type has no effect. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: Use uintptr_t in cpu_ldst.hRichard Henderson2021-02-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more descriptive than 'unsigned long'. No functional change, since these match on all linux+bsd hosts. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: Use uintptr_t for guest_baseRichard Henderson2021-02-164-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more descriptive than 'unsigned long'. No functional change, since these match on all linux+bsd hosts. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | linux-user: Introduce PAGE_ANONRichard Henderson2021-02-162-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Record whether the backing page is anonymous, or if it has file backing. This will allow us to get close to the Linux AArch64 ABI for MTE, which allows tag memory only on ram-backed VMAs. The real ABI allows tag memory on files, when those files are on ram-backed filesystems, such as tmpfs. We will not be able to implement that in QEMU linux-user. Thankfully, anonymous memory for malloc arenas is the primary consumer of this feature, so this restricted version should still be of use. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | tcg: Introduce target-specific page data for user-onlyRichard Henderson2021-02-164-9/+69
| |/ | | | | | | | | | | | | | | | | | | | | | | This data can be allocated by page_alloc_target_data() and released by page_set_flags(start, end, prot | PAGE_RESET). This data will be used to hold tag memory for AArch64 MTE. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | Merge remote-tracking branch ↵Peter Maydell2021-02-167-127/+163
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/cleber-gitlab/tags/python-next-pull-request' into staging Acceptance Tests and Python libs improvements Along with the Acceptance Tests and Python libs improvements, a improvement to the diff generation for Python code. # gpg: Signature made Tue 16 Feb 2021 04:55:45 GMT # gpg: using RSA key 7ABB96EB8B46B94D5E0FE9BB657E8D33A5F209F3 # gpg: Good signature from "Cleber Rosa <crosa@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 * remotes/cleber-gitlab/tags/python-next-pull-request: Acceptance Tests: set up existing ssh keys by default Acceptance Tests: fix population of public key in cloudinit image Acceptance Tests: introduce method for requiring an accelerator Acceptance Tests: introduce LinuxTest base class maint: Tell git that *.py files should use python diff hunks tests/acceptance/virtio-gpu.py: preserve virtio-user-gpu log Python: close the log file kept by QEMUMachine before reading it virtiofs_submounts.py test: Note on vmlinuz param Acceptance Tests: bump Avocado version requirement to 85.0 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * Acceptance Tests: set up existing ssh keys by defaultCleber Rosa2021-02-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's questionable whether it's necessary to create one brand new pair for each test. It's not questionable that it takes less time and resources to just use the keys available at "tests/keys" that exist for that exact reason. If a location for the public key is not given explicitly, the LinuxTest will now set up the existing pair of keys as the default. This removes the need for a lot of boilerplate code. To avoid the ssh client from erroring on permission issues, a directory with restrictive permissions is created for the private key. This should still be a lot cheaper than creating a new key. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210203172357.1422425-19-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> [marcandre: fix typos in commit message] Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * Acceptance Tests: fix population of public key in cloudinit imageCleber Rosa2021-02-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Currently the path of the ssh public key is being set, but its content is obviously what's needed. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210203172357.1422425-18-crosa@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * Acceptance Tests: introduce method for requiring an acceleratorCleber Rosa2021-02-163-29/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Some tests explicitly require a QEMU accelerator to be available. Given that this depends on some runtime aspects not known before the test is started, such as the currently set QEMU binary, it's left to be checked also at runtime. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210203172357.1422425-17-crosa@redhat.com> Reviewed-by: Beraldo Leal <bleal@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * Acceptance Tests: introduce LinuxTest base classCleber Rosa2021-02-163-93/+94
| | | | | | | | | | | | | | | | | | | | | | This is basically the infrastructure around "boot_linux.py" tests, but now made into a base class for general use. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210203172357.1422425-15-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * maint: Tell git that *.py files should use python diff hunksEric Blake2021-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git's default hunk pattern recognizer favors the C language, but it also includes several built-in diff styles that give saner results in other languages. In particular, telling git to treat all .py files as python changes the beginning of diff hunks as follows: | --- a/python/qemu/machine.py | +++ b/python/qemu/machine.py | -@@ -337,12 +337,12 @@ class QEMUMachine: | +@@ -337,12 +337,12 @@ def _post_shutdown(self) -> None: | self._qmp.close() which makes it much easier to tell what function a patch is touching, rather than a non-descript listing of what class contains the changes. Sadly, our python files that don't use .py suffix (such as numerous iotests) do not benefit from this glob. Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20210215222524.1820223-1-eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * tests/acceptance/virtio-gpu.py: preserve virtio-user-gpu logCleber Rosa2021-02-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preserve log at location already prepared for keeping the test's log files. While at it, log info about its location (in the main test log file), instead of printing it out. Reference: https://avocado-framework.readthedocs.io/en/85.0/api/test/avocado.html#avocado.Test.logdir Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> [philmd: use full sentence] Message-Id: <20210211220146.2525771-7-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * Python: close the log file kept by QEMUMachine before reading itCleber Rosa2021-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Closing a file that is open for writing, and then reading from it sounds like a better idea than the opposite, given that the content will be flushed. Reference: https://docs.python.org/3/library/io.html#io.IOBase.close Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210211220146.2525771-2-crosa@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * virtiofs_submounts.py test: Note on vmlinuz paramMax Reitz2021-02-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From the cancel message, it is not entirely clear why this parameter is mandatory now, or that it will be optional in the future. Add such a more detailed explanation as a comment in the test source file. Suggested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210212151649.252440-1-mreitz@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Cleber Rosa <crosa@redhat.com>
| * Acceptance Tests: bump Avocado version requirement to 85.0Cleber Rosa2021-02-161-1/+1
|/ | | | | | | | | | | | | | | | | | This version (and 84.0) contain improvements that address specific QEMU use cases, including: * Being able to download and use Fedora 31 images and thus re-activate the "boot_linux.py" tests * Being able to register local assets via "avocado assets register" and use them in tests Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210211232835.2608059-2-crosa@redhat.com> Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell2021-02-1512-34/+69
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Block layer patches: - qemu-storage-daemon: Enable object-add - blockjob: Fix crash with IOthread when block commit after snapshot - monitor: Shutdown fixes - xen-block: fix reporting of discard feature - qcow2: Remove half-initialised image file after failed image creation - ahci: Fix DMA direction - iotests fixes # gpg: Signature made Mon 15 Feb 2021 14:58:47 GMT # gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6 # gpg: issuer "kwolf@redhat.com" # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: monitor/qmp: Stop processing requests when shutdown is requested monitor: Fix assertion failure on shutdown block: qcow2: remove the created file on initialization error block: add bdrv_co_delete_file_noerr crypto: luks: Fix tiny memory leak tests/qemu-iotests: Remove test 259 from the "auto" group xen-block: fix reporting of discard feature hw/ide/ahci: map cmd_fis as DMA_DIRECTION_TO_DEVICE blockjob: Fix crash with IOthread when block commit after snapshot iotests: Consistent $IMGOPTS boundary matching qemu-storage-daemon: Enable object-add Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * monitor/qmp: Stop processing requests when shutdown is requestedKevin Wolf2021-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, monitor_qmp_dispatcher_co() used to check whether shutdown is requested only when it would have to wait for new requests. If there were still some queued requests, it would try to execute all of them before shutting down. This can be surprising when the queued QMP commands take long or hang because Ctrl-C may not actually exit QEMU as soon as possible. Change monitor_qmp_dispatcher_co() so that it additionally checks whether shutdown is request before it gets a new request from the queue. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210212172028.288825-3-kwolf@redhat.com> Tested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * monitor: Fix assertion failure on shutdownKevin Wolf2021-02-151-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 357bda95 already tried to fix the order in monitor_cleanup() by moving shutdown of the dispatcher coroutine further to the start. However, it didn't go far enough: iothread_stop() makes sure that all pending work (bottom halves) in the AioContext of the monitor iothread is completed. iothread_destroy() depends on this and fails an assertion if there is still a pending BH. While the dispatcher coroutine is running, it will try to resume the monitor after taking a request out of the queue, which involves a BH. The dispatcher is run until it terminates in the AIO_WAIT_WHILE() loop. However, adding new BHs between iothread_stop() and iothread_destroy() is forbidden. Fix this by stopping the dispatcher first before shutting down the other parts of the monitor. This means we can now receive requests that aren't handled any more when QEMU is shutting down, but this is unlikely to be a problem for QMP clients. Fixes: 357bda9590784ff75803d52de43150d4107ed98e Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210212172028.288825-2-kwolf@redhat.com> Tested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>