Re: Boot failure after QEMU's upgrade to OpenSBI v1.3 (was Re: [PATCH for-8.2 6/7] target/riscv: add 'max' CPU type)

2023-07-15 Thread Atish Patra
On Fri, Jul 14, 2023 at 5:29 AM Conor Dooley wrote: > > On Fri, Jul 14, 2023 at 11:19:34AM +0100, Conor Dooley wrote: > > On Fri, Jul 14, 2023 at 10:00:19AM +0530, Anup Patel wrote: > > > > > > > OpenSBI v1.3 > > > > >_ _ > > > > > / __ \

[PATCH] For curses display, recognize a few more control keys

2023-07-15 Thread Sean Estabrooks
The curses display handles most control-X keys, and translates them into their corresponding keycode. Here we recognize a few that are missing, Ctrl-@ (null), Ctrl-\ (backslash), Ctrl-] (right bracket), Ctrl-^ (caret), Ctrl-_ (underscore). Signed-off-by: Sean Estabrooks --- ui/curses_keys.h | 6

[PULL 06/47] linux-user: Use abi_llong not int64_t in syscall_defs.h

2023-07-15 Thread Richard Henderson
Be careful not to change linux_dirent64, which is a host structure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/linux-user/syscall_defs.h b

[PULL 15/47] include/exec/user: Set ABI_LLONG_ALIGNMENT to 4 for nios2

2023-07-15 Thread Richard Henderson
Based on gcc's nios2.h setting BIGGEST_ALIGNMENT to 32 bits. Signed-off-by: Richard Henderson --- include/exec/user/abitypes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h index beba0a48c7..6191ce9f74 100644 ---

[PULL 05/47] linux-user: Use abi_ullong not uint64_t in syscall_defs.h

2023-07-15 Thread Richard Henderson
Be careful not to change linux_dirent64, which is a host structure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 72 +++ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/linux-user/syscall

[PULL 11/47] linux-user: Use abi_ushort not unsigned short in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 90 +++ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 442a8aefe3..21ca03b0f4 1006

[PULL 00/47] tcg + linux-user patch queue

2023-07-15 Thread Richard Henderson
The following changes since commit 4633c1e2c576fbabfe5c8c93f4b842504b69c096: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-07-14 16:39:46 +0100) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230715

[PULL 39/47] linux-user: Simplify target_munmap

2023-07-15 Thread Richard Henderson
All of the guest to host page adjustment is handled by mmap_reserve_or_unmap; there is no need to duplicate that. There are no failure modes for munmap after alignment and guest address range have been validated. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-23-richard.hender.

[PULL 04/47] linux-user: Use abi_int not int32_t in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 60 +++ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 414d88a9ec..caaa895bec 1006

[PULL 18/47] accel/tcg: Split out cpu_exec_longjmp_cleanup

2023-07-15 Thread Richard Henderson
Share the setjmp cleanup between cpu_exec_step_atomic and cpu_exec_setjmp. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard W.M. Jones Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 43 +++ 1 file changed, 1

[PULL 02/47] linux-user: Remove #if 0 block in syscall_defs.h

2023-07-15 Thread Richard Henderson
These definitions are in sparc/signal.c. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 24 1 file changed, 24 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e80d54780b..a4e4df

[PULL 30/47] linux-user: Widen target_mmap offset argument to off_t

2023-07-15 Thread Richard Henderson
We build with _FILE_OFFSET_BITS=64, so off_t = off64_t = uint64_t. With an extra cast, this fixes emulation of mmap2, which could overflow the computation of the full value of offset. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-14-richard.hender...@

[PULL 10/47] linux-user: Use abi_int not int in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 216 +++--- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e4fcbd16d2..442a8aefe3 10

[PULL 16/47] linux-user/syscall: Implement execve without execveat

2023-07-15 Thread Richard Henderson
From: Pierrick Bouvier Support for execveat syscall was implemented in 55bbe4 and is available since QEMU 8.0.0. It relies on host execveat, which is widely available on most of Linux kernels today. However, this change breaks qemu-user self emulation, if "host" qemu version is less than 8.0.0.

[PULL 23/47] linux-user: Split TARGET_MAP_* out of syscall_defs.h

2023-07-15 Thread Richard Henderson
Move the values into the per-target target_mman.h headers Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-7-richard.hender...@linaro.org> --- linux-user/alpha/target_mman.h | 13 + linux-user/generic/target_mman.h | 54 linux

[PULL 01/47] linux-user: Reformat syscall_defs.h

2023-07-15 Thread Richard Henderson
Untabify and re-indent. We had a mix of 2, 3, 4, and 8 space indentation. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 1948 ++--- 1 file changed, 974 insertions(+), 974 deletions(-) diff --git a/linux-user

[PULL 34/47] bsd-user: Use page_find_range_empty for mmap_find_vma_reserved

2023-07-15 Thread Richard Henderson
Use the interval tree to find empty space, rather than probing each page in turn. Cc: Warner Losh Cc: Kyle Evans Signed-off-by: Richard Henderson Reviewed-bt: Warner Losh Message-Id: <20230707204054.8792-18-richard.hender...@linaro.org> --- bsd-user/mmap.c | 48 +++

[PULL 35/47] linux-user: Use page_find_range_empty for mmap_find_vma_reserved

2023-07-15 Thread Richard Henderson
Use the interval tree to find empty space, rather than probing each page in turn. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-19-richard.hender...@linaro.org> --- linux-user/mmap.c | 52 ++- 1 file changed, 6 insertions(+), 46 del

[PULL 33/47] accel/tcg: Introduce page_find_range_empty

2023-07-15 Thread Richard Henderson
Use the interval tree to locate an unused range in the VM. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-17-richard.hender...@linaro.org> --- include/exec/cpu-all.h | 15 +++ accel/tcg/user-exec.c | 41 + 2 files changed, 5

[PULL 08/47] linux-user: Use abi_ullong not unsigned long long in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 20986bd1d3..45ebacd4b4 100644 ---

[PULL 19/47] tcg: Fix info_in_idx increment in layout_arg_by_ref

2023-07-15 Thread Richard Henderson
Off by one error, failing to take into account that layout_arg_1 already incremented info_in_idx for the first piece. We only need care for the n-1 TCG_CALL_ARG_BY_REF_N pieces here. Cc: qemu-sta...@nongnu.org Fixes: 313bdea84d2 ("tcg: Add TCG_CALL_{RET,ARG}_BY_REF") Resolves: https://gitlab.com/

[PULL 32/47] linux-user: Rewrite mmap_frag

2023-07-15 Thread Richard Henderson
Use 'last' variables instead of 'end' variables. Always zero MAP_ANONYMOUS fragments, which we previously failed to do if they were not writable; early exit in case we allocate a new page from the kernel, known zeros. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-16-richard.he

[PULL 14/47] include/exec/user: Set ABI_LLONG_ALIGNMENT to 4 for microblaze

2023-07-15 Thread Richard Henderson
Based on gcc's microblaze.h setting BIGGEST_ALIGNMENT to 32 bits. Signed-off-by: Richard Henderson --- include/exec/user/abitypes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h index 743b8bb9ea..beba0a48c7 1006

[PULL 17/47] linux-user: Fix do_shmat type errors

2023-07-15 Thread Richard Henderson
The guest address, raddr, should be unsigned, aka abi_ulong. The host addresses should be cast via *intptr_t not long. Drop the inline and fix two other whitespace issues. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <202306261402

[PULL 25/47] linux-user: Populate more bits in mmap_flags_tbl

2023-07-15 Thread Richard Henderson
Fix translation of TARGET_MAP_SHARED and TARGET_MAP_PRIVATE, which are types not single bits. Add TARGET_MAP_SHARED_VALIDATE, TARGET_MAP_SYNC, TARGET_MAP_NONBLOCK, TARGET_MAP_POPULATE, TARGET_MAP_FIXED_NOREPLACE, and TARGET_MAP_UNINITIALIZED. Update strace to match. Reviewed-by: Alex Bennée Sig

[PULL 28/47] linux-user: Implement MAP_FIXED_NOREPLACE

2023-07-15 Thread Richard Henderson
Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-12-richard.hender...@linaro.org> --- linux-user/mmap.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 639921dba0..9dc34fc29d 100644 --- a/linux-user/m

[PULL 20/47] linux-user: Make sure initial brk(0) is page-aligned

2023-07-15 Thread Richard Henderson
From: Andreas Schwab Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Signed-off-by: Andreas Schwab Message-Id: Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/

[PULL 27/47] bsd-user: Use page_check_range_empty for MAP_EXCL

2023-07-15 Thread Richard Henderson
The previous check returned -1 when any page within [start, start+len) is unmapped, not when all are unmapped. Cc: Warner Losh Cc: Kyle Evans Signed-off-by: Richard Henderson Reviewed-by: Warner Losh Message-Id: <20230707204054.8792-11-richard.hender...@linaro.org> --- bsd-user/mmap.c | 2 +-

[PULL 26/47] accel/tcg: Introduce page_check_range_empty

2023-07-15 Thread Richard Henderson
Examine the interval tree to validate that a region has no existing mappings. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-10-richard.hender...@linaro.org> --- include/exec/cpu-all.h | 12 accel/tcg/user-exec.c | 7 +++ 2 files ch

[PULL 47/47] tcg: Use HAVE_CMPXCHG128 instead of CONFIG_CMPXCHG128

2023-07-15 Thread Richard Henderson
We adjust CONFIG_ATOMIC128 and CONFIG_CMPXCHG128 with CONFIG_ATOMIC128_OPT in atomic128.h. It is difficult to tell when those changes have been applied with the ifdef we must use with CONFIG_CMPXCHG128. So instead use HAVE_CMPXCHG128, which triggers -Werror-undef when the proper header has not be

[PULL 37/47] linux-user: Rewrite mmap_reserve

2023-07-15 Thread Richard Henderson
Use 'last' variables instead of 'end' variables; be careful about avoiding overflow. Assert that the mmap succeeded. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-21-richard.hender...@linaro.org> --- linux-user/mmap.c | 68 +-- 1 f

[PULL 41/47] accel/tcg: Return bool from page_check_range

2023-07-15 Thread Richard Henderson
Replace the 0/-1 result with true/false. Invert the sense of the test of all callers. Document the function. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-25-richard.hender...@linaro.org> --- bsd-user/qemu.h| 2 +- include/exec/cpu-all.h | 13

[PULL 38/47] linux-user: Rename mmap_reserve to mmap_reserve_or_unmap

2023-07-15 Thread Richard Henderson
If !reserved_va, munmap instead and assert success. Update all callers. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-22-richard.hender...@linaro.org> --- linux-user/mmap.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lin

[PULL 09/47] linux-user: Use abi_llong not long long in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 45ebacd4b4..e4fcbd16d2 100644 --- a/linux-user/syscall_d

[PULL 46/47] accel/tcg: Always lock pages before translation

2023-07-15 Thread Richard Henderson
We had done this for user-mode by invoking page_protect within the translator loop. Extend this to handle system mode as well. Move page locking out of tb_link_page. Reported-by: Liren Wei Reported-by: Richard W.M. Jones Signed-off-by: Richard Henderson Tested-by: Richard W.M. Jones --- acc

[PULL 24/47] linux-user: Split TARGET_PROT_* out of syscall_defs.h

2023-07-15 Thread Richard Henderson
Move the values into the per-target target_mman.h headers Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-8-richard.hender...@linaro.org> --- linux-user/aarch64/target_mman.h | 8 linux-user/generic/target

[PULL 45/47] linux-user/arm: Do not allocate a commpage at all for M-profile CPUs

2023-07-15 Thread Richard Henderson
From: Philippe Mathieu-Daudé Since commit fbd3c4cff6 ("linux-user/arm: Mark the commpage executable") executing bare-metal (linked with rdimon.specs) cortex-M code fails as: $ qemu-arm -cpu cortex-m3 ~/hello.exe.m3 qemu-arm: ../../accel/tcg/user-exec.c:492: page_set_flags: Assertion `last <=

[PULL 13/47] linux-user: Use abi_uint not unsigned in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 9dc41828cf..c8ffb4f785 100644 --- a/linux-user/syscall_defs.h +++

[PULL 21/47] linux-user: Fix formatting of mmap.c

2023-07-15 Thread Richard Henderson
Fix all checkpatch.pl errors within mmap.c. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-5-richard.hender...@linaro.org> --- linux-user/mmap.c | 199 -- 1 file changed,

[PULL 40/47] accel/tcg: Accept more page flags in page_check_range

2023-07-15 Thread Richard Henderson
Only PAGE_WRITE needs special attention, all others can be handled as we do for PAGE_READ. Adjust the mask. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230707204054.8792-24-richard.hender...@linaro.org> --- accel/tcg/user-exec.c | 4 ++-- 1 file changed,

[PULL 12/47] linux-user: Use abi_short not short in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 21ca03b0f4..9dc41828cf 100644 --- a/linux-user/syscall_defs.h +

[PULL 44/47] linux-user: Drop uint and ulong

2023-07-15 Thread Richard Henderson
From: Juan Quintela These are types not used anymore anywhere else. Signed-off-by: Juan Quintela Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-id: <20230511085056.13809-1-quint...@redhat.com> Signed-off-by: Richard Henderson --- linu

[PULL 31/47] linux-user: Rewrite target_mprotect

2023-07-15 Thread Richard Henderson
Use 'last' variables instead of 'end' variables. When host page size > guest page size, detect when adjacent host pages have the same protection and merge that expanded host range into fewer syscalls. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-15-richard.hender...@linaro.or

[PULL 43/47] linux-user: Simplify target_madvise

2023-07-15 Thread Richard Henderson
The trivial length 0 check can be moved up, simplifying some of the other cases. The end < start test is handled by guest_range_valid_untagged. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-27-richard.hender...@linaro.org> --- linux-user/mmap.c | 19 --- 1 fi

[PULL 42/47] linux-user: Remove can_passthrough_madvise

2023-07-15 Thread Richard Henderson
Use page_check_range instead, which uses the interval tree instead of checking each page individually. Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-26-richard.hender...@linaro.org> --- linux-user/mmap.c | 24 +++- 1 file changed, 3 insertions(+), 21 delet

[PULL 22/47] linux-user/strace: Expand struct flags to hold a mask

2023-07-15 Thread Richard Henderson
A zero bit value does not make sense -- it must relate to some field in some way. Define FLAG_BASIC with a build-time sanity check. Adjust FLAG_GENERIC and FLAG_TARGET to use it. Add FLAG_GENERIC_MASK and FLAG_TARGET_MASK. Fix up the existing flag definitions for build errors. Reviewed-by: Alex

[PULL 03/47] linux-user: Use abi_uint not uint32_t in syscall_defs.h

2023-07-15 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 108 +++--- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a4e4df8d3e..414d88a9ec 1006

[PULL 29/47] linux-user: Split out target_to_host_prot

2023-07-15 Thread Richard Henderson
Split out from validate_prot_to_pageflags, as there is not one single host_prot for the entire range. We need to adjust prot for every host page that overlaps multiple guest pages. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20230707204054.8792-13-richard.hender...@li

[PULL 07/47] linux-user: Use abi_uint not unsigned int in syscall_defs.h

2023-07-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall_defs.h | 290 +++--- 1 file changed, 145 insertions(+), 145 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 2846a8cfa5..20986bd1d3 100644 --- a/linux-user/syscall_defs.h

[PULL 36/47] linux-user: Use 'last' instead of 'end' in target_mmap

2023-07-15 Thread Richard Henderson
Complete the transition within the mmap functions to a formulation that does not overflow at the end of the address space. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230707204054.8792-20-richard.hender...@linaro.org> --- linux-user/mmap.c | 45 ++

[PATCH v5 1/5] i386/tcg: implement x2APIC registers MSR access

2023-07-15 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4 +- includ

[PATCH v5 3/5] apic, i386/tcg: add x2apic transitions

2023-07-15 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc/api

[PATCH v5 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-15 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386/int

[PATCH v5 0/5] Support x2APIC mode with TCG accelerator

2023-07-15 Thread Bui Quang Minh
Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot Linux kernel into x2APIC mode with TCG accel

[PATCH v5 5/5] amd_iommu: report x2APIC support to the operating system

2023-07-15 Thread Bui Quang Minh
This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used to support 32-bit destination id. Additionally, this commit exports IVHD type 0x11 besides the old IVHD type 0x10

[PATCH v5 2/5] apic: add support for x2APIC mode

2023-07-15 Thread Bui Quang Minh
This commit extends the APIC ID to 32-bit long and remove the 255 max APIC ID limit in userspace APIC. The array that manages local APICs is now dynamically allocated based on the max APIC ID of created x86 machine. Also, new x2APIC IPI destination determination scheme, self IPI and x2APIC mode reg

Re: [PATCH v5 0/5] Support x2APIC mode with TCG accelerator

2023-07-15 Thread Bui Quang Minh
On 7/15/23 21:28, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot Li

[PATCH v6 0/5] Support x2APIC mode with TCG accelerator

2023-07-15 Thread Bui Quang Minh
Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot Linux kernel into x2APIC mode with TCG accel

[PATCH v6 3/5] apic, i386/tcg: add x2apic transitions

2023-07-15 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc/api

[PATCH v6 5/5] amd_iommu: report x2APIC support to the operating system

2023-07-15 Thread Bui Quang Minh
This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used to support 32-bit destination id. Additionally, this commit exports IVHD type 0x11 besides the old IVHD type 0x10

[PATCH v6 2/5] apic: add support for x2APIC mode

2023-07-15 Thread Bui Quang Minh
This commit extends the APIC ID to 32-bit long and remove the 255 max APIC ID limit in userspace APIC. The array that manages local APICs is now dynamically allocated based on the max APIC ID of created x86 machine. Also, new x2APIC IPI destination determination scheme, self IPI and x2APIC mode reg

[PATCH v6 1/5] i386/tcg: implement x2APIC registers MSR access

2023-07-15 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4 +- includ

[PATCH v6 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-15 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386/int

Re: [PATCH v1 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-07-15 Thread Bernhard Beschow
Am 11. Juli 2023 02:56:46 UTC schrieb Gurchetan Singh : >This adds initial support for gfxstream and cross-domain. Both >features rely on virtio-gpu blob resources and context types, which >are also implemented in this patch. > >gfxstream has a long and illustrious history in Android graphics