Re: [PATCH 27/33] cpu: Remove page_size_init

2023-08-21 Thread Philippe Mathieu-Daudé
On 18/8/23 19:12, Richard Henderson wrote: Move qemu_host_page_{size,mask} and HOST_PAGE_ALIGN into bsd-user. It should be removed from bsd-user as well, but defer that cleanup. Signed-off-by: Richard Henderson --- bsd-user/qemu.h | 7 +++ include/exec/cpu-common.h | 7 --

Re: [PATCH 28/33] accel/tcg: Disconnect TargetPageDataNode from page size

2023-08-21 Thread Philippe Mathieu-Daudé
On 18/8/23 19:12, Richard Henderson wrote: Dynamically size the node for the runtime target page size. Signed-off-by: Richard Henderson --- accel/tcg/user-exec.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 30/33] target/arm: Enable TARGET_PAGE_BITS_VARY for AArch64 user-only

2023-08-21 Thread Philippe Mathieu-Daudé
On 18/8/23 19:12, Richard Henderson wrote: Since aarch64 binaries are generally built for multiple page sizes, it is trivial to allow the page size to vary. Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 6 - target/arm/cpu.c | 51 ---

Re: [PATCH 32/33] target/ppc: Enable TARGET_PAGE_BITS_VARY for user-only

2023-08-21 Thread Philippe Mathieu-Daudé
On 18/8/23 19:12, Richard Henderson wrote: Since ppc binaries are generally built for multiple page sizes, it is trivial to allow the page size to vary. Signed-off-by: Richard Henderson --- target/ppc/cpu-param.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Ph

Re: [PATCH 09/33] linux-user: Remove REAL_HOST_PAGE_ALIGN from mmap.c

2023-08-21 Thread Philippe Mathieu-Daudé
On 18/8/23 19:12, Richard Henderson wrote: We already have qemu_real_host_page_size() in a local variable. Signed-off-by: Richard Henderson --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 02/23] tcg: Use tcg_gen_negsetcond_*

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 6 ++ tcg/tcg-op.c | 6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 05/23] target/m68k: Use tcg_gen_negsetcond_*

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/m68k/translate.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 06/23] target/openrisc: Use tcg_gen_negsetcond_*

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 1/2] audio/jackaudio: Avoid dynamic stack allocation in qjack_client_init

2023-08-21 Thread Francisco Iglesias
On [2023 Aug 18] Fri 16:58:45, Peter Maydell wrote: > Avoid a dynamic stack allocation in qjack_client_init(), by using > a g_autofree heap allocation instead. > > (We stick with allocate + snprintf() because the JACK API requires > the name to be no more than its maximum size, so g_strdup_printf(

Re: [PATCH v2 09/23] target/tricore: Replace gen_cond_w with tcg_gen_negsetcond_tl

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- target/tricore/translate.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 17/23] tcg/i386: Merge tcg_out_brcond{32,64}

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 110 +- 1 file changed, 49 insertions(+), 61 deletions(-)

Re: [PATCH v2 18/23] tcg/i386: Merge tcg_out_setcond{32,64}

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) Reviewed-by: Phi

Re: [PATCH v2 19/23] tcg/i386: Merge tcg_out_movcond{32,64}

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 00:13, Richard Henderson wrote: Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) Reviewed-by:

Re: [PATCH 3/3] ui/vnc-enc-tight: Avoid dynamic stack allocation

2023-08-21 Thread Francisco Iglesias
On [2023 Aug 18] Fri 16:10:57, Peter Maydell wrote: > From: Philippe Mathieu-Daudé > > Use autofree heap allocation instead of variable-length > array on the stack. > > The codebase has very few VLAs, and if we can get rid of them all we > can make the compiler error on new additions. This is a

Re: [PATCH 01/21] block: Remove unused BlockReopenQueueEntry.perms_checked

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > This field has been unused since commit 72373e40fbc ('block: > bdrv_reopen_multiple: refresh permissions on updated graph'). > Remove it. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 02/21] preallocate: Factor out preallocate_truncate_to_real_size()

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > It's essentially the same code in preallocate_check_perm() and > preallocate_close(), except that the latter ignores errors. > > Signed-off-by: Kevin Wolf > --- Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_replace_child_tran(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that they can't cal

Re: [PATCH 12/21] block: Mark bdrv_attach_child() GRAPH_WRLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_attach_child_common(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that they can't ca

Re: [PATCH 16/21] block: Mark bdrv_parent_cb_change_media() GRAPH_RDLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 20/21] block: Mark bdrv_unref_child() GRAPH_WRLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_unref_child(). These callers will typically > already hold the graph lock once the locking work is completed, which > means that they can't call funct

Re: [PATCH 08/21] block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_replace_child_noperm(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that they can't c

Re: [PATCH 17/21] block: Take graph rdlock in bdrv_drop_intermediate()

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 21/21] block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The functions read the parents list in the generic block layer, so we > need to hold the graph lock already there. The BlockDriver > implementations actually modify the graph, so it has to be a writer > lock. > > Signed-off-by: Kevin Wolf Reviewed-

Re: [PATCH 04/21] block: Take AioContext lock for bdrv_append() more consistently

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The documentation for bdrv_append() says that the caller must hold the > AioContext lock for bs_top. Change all callers to actually adhere to the > contract. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 19/21] block: Mark bdrv_root_unref_child() GRAPH_WRLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_root_unref_child(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that they can't call

Re: [PATCH 06/21] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Add a new wrapper type for GRAPH_WRLOCK functions that should be called > from coroutine context. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 13/21] block: Mark bdrv_parent_perms_conflict() and callers GRAPH_RDLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 18/21] block: Take graph rdlock in bdrv_change_aio_context()

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 15/21] block: Mark bdrv_child_perm() GRAPH_RDLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_child_perm() need to hold a reader lock for the graph because > some implementations access the children list of a node. > > The callers of bdrv_child_perm() conveniently already ho

Re: [PATCH 14/21] block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > The function reads the parents list, so it needs to hold the graph lock. > > This happens to result in BlockDriver.bdrv_set_perm() to be called with > the graph lock held. For consistency, make it the same for all of the > BlockDriver callbacks for u

Re: [PATCH] bsd-user: Add missing break after do_bsd_preadv

2023-08-21 Thread Philippe Mathieu-Daudé
On 20/8/23 06:54, Warner Losh wrote: Without it, we'd call preadv, then write with weird parameters, which is clearly not ideal... Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 1 + 1 file changed, 1 insertion(+) Ouch. Fixes: 770d8abae7 ("bsd-user/bsd-file.h: Meat of the

Re: [PATCH 07/21] block-coroutine-wrapper: Allow arbitrary parameter names

2023-08-21 Thread Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Don't assume specific parameter names like 'bs' or 'blk' in the > generated code, but use the actual name. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH 0/2] audio/jackaudio: avoid dynamic stack allocations

2023-08-21 Thread Marc-André Lureau
On Fri, Aug 18, 2023 at 7:59 PM Peter Maydell wrote: > > This patchset removes two variable length arrays from the jack audio > backend. The codebase has very few VLAs, and if we can get rid of > them all we can make the compiler error on new additions. This is a > defensive measure against secu

Re: [PATCH v2 02/18] target/arm: Use clmul_8* routines

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routines for 8-bit carry-less multiply. Remove our local version of pmull_h. Signed-off-by: Richard Henderson --- target/arm/tcg/vec_internal.h | 5 target/arm/tcg/mve_helper.c | 8 ++ target/arm/tcg/vec_helper.c | 53 +++

Re: [PATCH v2 06/18] target/arm: Use clmul_16* routines

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routines for 16-bit carry-less multiply. Remove our local version of pmull_w. Signed-off-by: Richard Henderson --- target/arm/tcg/vec_internal.h | 6 -- target/arm/tcg/mve_helper.c | 8 ++-- target/arm/tcg/vec_helper.c | 1

Re: [PATCH v2 10/18] target/arm: Use clmul_32* routines

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routines for 32-bit carry-less multiply. Remove our local version of pmull_d. Signed-off-by: Richard Henderson --- target/arm/tcg/vec_helper.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) Reviewed-by: Philippe M

Re: [PATCH v3 4/5] target/s390x/kvm: Refactor AP functionalities

2023-08-21 Thread Thomas Huth
On 18/08/2023 13.15, Steffen Eiden wrote: kvm_s390_set_attr() is a misleading name as it only sets attributes for the KVM_S390_VM_CRYPTO group. Therefore, rename it to kvm_s390_set_crypto_attr(). Add new functions ap_available() and ap_enabled() to avoid code duplication later. Reviewed-by: Mic

Re: [PATCH 2/3] ui/vnc-enc-hextile: Use static rather than dynamic length stack array

2023-08-21 Thread Marc-André Lureau
Hi On Fri, Aug 18, 2023 at 7:11 PM Peter Maydell wrote: > > In the send_hextile_tile_* function we create a variable length array > data[]. In fact we know that the client_pf.bytes_per_pixel is at > most 4 (enforced by set_pixel_format()), so we can make the array a > compile-time fixed length o

Re: [PATCH 1/2] audio/jackaudio: Avoid dynamic stack allocation in qjack_client_init

2023-08-21 Thread Christian Schoenebeck
On Friday, August 18, 2023 5:58:45 PM CEST Peter Maydell wrote: > Avoid a dynamic stack allocation in qjack_client_init(), by using > a g_autofree heap allocation instead. > > (We stick with allocate + snprintf() because the JACK API requires > the name to be no more than its maximum size, so g_st

Re: [PATCH 2/2] audio/jackaudio: Avoid dynamic stack allocation in qjack_process()

2023-08-21 Thread Francisco Iglesias
On [2023 Aug 18] Fri 16:58:46, Peter Maydell wrote: > Avoid a dynamic stack allocation in qjack_process(). Since this > function is a JACK process callback, we are not permitted to malloc() > here, so we allocate a working buffer in qjack_client_init() instead. > > The codebase has very few VLAs,

Re: [PATCH v2 03/58] target/i386: Parse TDX vm type

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:49:46AM -0400, Xiaoyao Li wrote: > TDX VM requires VM type KVM_X86_TDX_VM to be passed to > kvm_ioctl(KVM_CREATE_VM). > > If tdx-guest object is specified to confidential-guest-support, like, > > qemu -machine ...,confidential-guest-support=tdx0 \ >-object tdx

Re: [PATCH v3 5/5] target/s390x: AP-passthrough for PV guests

2023-08-21 Thread Thomas Huth
On 18/08/2023 13.15, Steffen Eiden wrote: Enabling AP-passthrough(AP-pt) for PV-guest by using the new CPU features for PV-AP-pt of KVM. As usual QEMU first checks which CPU features are available and then sets them if available and selected by user. An additional check is done to verify that PV

Re: Funny results with long double denorms on m68k

2023-08-21 Thread Laurent Vivier
Le 20/08/2023 à 22:55, Keith Packard a écrit : #include #include #define X 0x1p+16383l #define Y 0x1p-16446l static long double build_mul = X * Y; static volatile long double x = X; static volatile long double y = Y; static void dump_ld(const char *label, long double ld) { u

Re: [PATCH v2 06/58] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:49:49AM -0400, Xiaoyao Li wrote: > KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of > IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing > TDX context. It will be used to validate user's setting later. > > Since there is no interfac

Re: [PATCH v2 07/58] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:49:50AM -0400, Xiaoyao Li wrote: > It will need special handling for TDX VMs all around the QEMU. > Introduce is_tdx_vm() helper to query if it's a TDX VM. > > Cache tdx_guest object thus no need to cast from ms->cgs every time. > > Signed-off-by: Xiaoyao Li > Acked-by

Re: [PATCH v2 14/58] i386/tdx: Initialize TDX before creating TD vcpus

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:49:57AM -0400, Xiaoyao Li wrote: > Invoke KVM_TDX_INIT in kvm_arch_pre_create_vcpu() that KVM_TDX_INIT > configures global TD configurations, e.g. the canonical CPUID config, > and must be executed prior to creating vCPUs. > > Use kvm_x86_arch_cpuid() to setup the CPUID

Re: [PATCH v2 13/58] kvm: Introduce kvm_arch_pre_create_vcpu()

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:49:56AM -0400, Xiaoyao Li wrote: > Introduce kvm_arch_pre_create_vcpu(), to perform arch-dependent > work prior to create any vcpu. This is for i386 TDX because it needs > call TDX_INIT_VM before creating any vcpu. > > Signed-off-by: Xiaoyao Li > Acked-by: Gerd Hoffmann

Re: [PATCH v2 15/58] i386/tdx: Add property sept-ve-disable for tdx-guest object

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:49:58AM -0400, Xiaoyao Li wrote: > Bit 28 of TD attribute, named SEPT_VE_DISABLE. When set to 1, it disables > EPT violation conversion to #VE on guest TD access of PENDING pages. > > Some guest OS (e.g., Linux TD guest) may require this bit as 1. > Otherwise refuse to b

Re: [PATCH v2 18/58] i386/tdx: Validate TD attributes

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:01AM -0400, Xiaoyao Li wrote: > Validate TD attributes with tdx_caps that fixed-0 bits must be zero and > fixed-1 bits must be set. > > Besides, sanity check the attribute bits that have not been supported by > QEMU yet. e.g., debug bit, it will be allowed in the futu

Re: [PATCH v2 19/58] qom: implement property helper for sha384

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:02AM -0400, Xiaoyao Li wrote: > From: Isaku Yamahata > > Implement property_add_sha384() which converts hex string <-> uint8_t[48] > It will be used for TDX which uses sha384 for measurement. I think it is likely a better idea to use base64 for the encoding the bina

Re: [PATCH v2 20/58] i386/tdx: Allows mrconfigid/mrowner/mrownerconfig for TDX_INIT_VM

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:03AM -0400, Xiaoyao Li wrote: > From: Isaku Yamahata > > When creating TDX vm, three sha384 hash values can be provided for > TDX attestation. > > So far they were hard coded as 0. Now allow user to specify those values > via property mrconfigid, mrowner and mrowner

Re: [PATCH v2 21/58] i386/tdx: Implement user specified tsc frequency

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:04AM -0400, Xiaoyao Li wrote: > Reuse "-cpu,tsc-frequency=" to get user wanted tsc frequency and call VM > scope VM_SET_TSC_KHZ to set the tsc frequency of TD before KVM_TDX_INIT_VM. > > Besides, sanity check the tsc frequency to be in the legal range and > legal gran

Re: [PATCH v2 25/58] kvm/tdx: Don't complain when converting vMMIO region to shared

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:08AM -0400, Xiaoyao Li wrote: > From: Isaku Yamahata > > Because vMMIO region needs to be shared region, guest TD may explicitly > convert such region from private to shared. Don't complain such > conversion. > > Signed-off-by: Isaku Yamahata > Signed-off-by: Xiao

Re: [PATCH v2 32/58] i386/tdx: Track RAM entries for TDX VM

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:15AM -0400, Xiaoyao Li wrote: > The RAM of TDX VM can be classified into two types: > > - TDX_RAM_UNACCEPTED: default type of TDX memory, which needs to be >accepted by TDX guest before it can be used and will be all-zeros >after being accepted. > > - TDX_R

Re: [PATCH v2 36/58] memory: Introduce memory_region_init_ram_gmem()

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:19AM -0400, Xiaoyao Li wrote: > Introduce memory_region_init_ram_gmem() to allocate private gmem on the > MemoryRegion initialization. It's for the usercase of TDVF, which must > be private on TDX case. > > Signed-off-by: Xiaoyao Li > --- > include/exec/memory.h |

Re: [PATCH 2/4] target/i386: Translate feature_word_info to xml

2023-08-21 Thread Tim Wiederhake
On Thu, 2023-08-17 at 12:07 +0100, Daniel P. Berrangé wrote: > On Fri, Aug 11, 2023 at 03:50:09PM +0200, Tim Wiederhake wrote: > > This is the data file that will be used to generate the C code. > > All information, including the comments, is preserved. > > > > Signed-off-by: Tim Wiederhake > > -

Re: [PATCH v2 47/58] i386/tdx: Wire REPORT_FATAL_ERROR with GuestPanic facility

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 05:50:30AM -0400, Xiaoyao Li wrote: > Originated-from: Isaku Yamahata > Signed-off-by: Xiaoyao Li > --- > qapi/run-state.json | 17 +-- > softmmu/runstate.c| 49 +++ > target/i386/kvm/tdx.c | 24 +++

Re: [PATCH 1/2] audio/jackaudio: Avoid dynamic stack allocation in qjack_client_init

2023-08-21 Thread Peter Maydell
On Mon, 21 Aug 2023 at 09:01, Christian Schoenebeck wrote: > > On Friday, August 18, 2023 5:58:45 PM CEST Peter Maydell wrote: > > Avoid a dynamic stack allocation in qjack_client_init(), by using > > a g_autofree heap allocation instead. > > > > (We stick with allocate + snprintf() because the JA

Re: [PATCH v4 1/3] qmp: remove virtio_list, search QOM tree instead

2023-08-21 Thread Daniel P . Berrangé
On Fri, Aug 18, 2023 at 01:19:24PM -0400, Jonah Palmer wrote: > The virtio_list duplicates information about virtio devices that already > exist in the QOM composition tree. Instead of creating this list of > realized virtio devices, search the QOM composition tree instead. > > This patch modifies

Re: Funny results with long double denorms on m68k

2023-08-21 Thread Laurent Vivier
Le 21/08/2023 à 10:34, Laurent Vivier a écrit : Le 20/08/2023 à 22:55, Keith Packard a écrit : #include #include #define X   0x1p+16383l #define Y   0x1p-16446l static long double build_mul = X * Y; static volatile long double x = X; static volatile long double y = Y; static void du

Re: [PATCH] softfloat: Handle m68k extended precision denormals properly

2023-08-21 Thread BALATON Zoltan
On Sun, 20 Aug 2023, Richard Henderson wrote: Motorola treats denormals with explicit integer bit set as having unbiased exponent 0, unlike Intel which treats it as having unbiased exponent 1 (like all other IEEE formats). Add a flag on FloatFmt to differentiate the behaviour. Reported-by: Keit

Re: [8.1 regression] Re: [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties

2023-08-21 Thread Marc-André Lureau
Hi Alex On Thu, Aug 17, 2023 at 1:25 AM Alex Williamson wrote: > > On Wed, 16 Aug 2023 15:08:10 -0600 > Alex Williamson wrote: > > > diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c > > > index 8f9fbf583e..3d19dbe382 100644 > > > --- a/ui/egl-helpers.c > > > +++ b/ui/egl-helpers.c > > > @@ -314,

Re: [PATCH v2 3/4] virtio: use defer_call() in virtio_irqfd_notify()

2023-08-21 Thread Ilya Maximets
On 8/17/23 17:58, Stefan Hajnoczi wrote: > virtio-blk and virtio-scsi invoke virtio_irqfd_notify() to send Used > Buffer Notifications from an IOThread. This involves an eventfd > write(2) syscall. Calling this repeatedly when completing multiple I/O > requests in a row is wasteful. > > Use the de

Re: [PATCH] target/arm: Fix SME ST1Q

2023-08-21 Thread Peter Maydell
On Fri, 18 Aug 2023 at 22:43, Richard Henderson wrote: > > A typo, noted in the bug report, resulting in an > incorrect write offset. > > Cc: qemu-sta...@nongnu.org > Fixes: 7390e0e9ab8 ("target/arm: Implement SME LD1, ST1") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1833 > Signed-o

Re: [PATCH] target/arm: Fix 64-bit SSRA

2023-08-21 Thread Peter Maydell
On Mon, 21 Aug 2023 at 03:20, Richard Henderson wrote: > > Typo applied byte-wise shift instead of double-word shift. > > Cc: qemu-sta...@nongnu.org > Fixes: 631e565450c ("target/arm: Create gen_gvec_[us]sra") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1779 > Signed-off-by: Richard

Re: [PATCH v3 00/32] Implement the stat system calls for FreeBSD.

2023-08-21 Thread Markus Armbruster
Subjects should start with a subsystem tag. Diffstat suggests "bsd-user:".

Re: [Qemu-devel] [PATCH] ahci: enable pci bus master MemoryRegion before loading ahci engines

2023-08-21 Thread manish.mishra
Hi Everyone, We are facing this issue. I see this conversation was never conversed and discussed issue is still active on QEMU master. Just for summary, the solution mentioned in this thread "temporarily enable bus master memory region" was not taken with the following justification. "Poking

Re: [PATCH 2/3] tcg: Fold deposit with zero to and

2023-08-21 Thread Philippe Mathieu-Daudé
On 16/8/23 16:55, Richard Henderson wrote: Inserting a zero into a value, or inserting a value into zero at offset 0 my be implemented with AND. Typo "may". Signed-off-by: Richard Henderson --- tcg/optimize.c | 35 +++ 1 file changed, 35 insertions(+) diff

Re: [PATCH 4/6] linux-user: Show heap address in /proc/pid/maps

2023-08-21 Thread Philippe Mathieu-Daudé
On 16/8/23 20:14, Richard Henderson wrote: Signed-off-by: Richard Henderson --- linux-user/syscall.c | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 6/6] linux-user: Show vdso address in /proc/pid/maps

2023-08-21 Thread Philippe Mathieu-Daudé
On 16/8/23 20:14, Richard Henderson wrote: Signed-off-by: Richard Henderson --- linux-user/qemu.h| 1 + linux-user/elfload.c | 1 + linux-user/syscall.c | 2 ++ 3 files changed, 4 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-21 Thread Markus Armbruster
Li Feng writes: >> 2023年8月14日 下午8:11,Raphael Norwitz 写道: >> >> Thanks for the cleanup! A few comments. >> >>> On Aug 4, 2023, at 1:29 AM, Li Feng wrote: >>> >>> Add a Error parameter to report the real error, like vhost-user-blk. >>> >>> Signed-off-by: Li Feng >>> --- >>> hw/scsi/vhost-scs

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-21 Thread Igor Mammedov
On Fri, 11 Aug 2023 17:26:24 +0200 David Hildenbrand wrote: [...] > Nowadays, "-mem-path" always defaults to MAP_PRIVATE. For the original > hugetlb use case, it's still good enough. For anything else, I'm not so > sure. We can deprecate -mem-path and direct users to use explicitly defined mem

Re: [PATCH v2 14/18] target/arm: Use clmul_64

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routine for 64-bit carry-less multiply. Signed-off-by: Richard Henderson --- target/arm/tcg/vec_helper.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 15/18] target/s390x: Use clmul_64

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use the generic routine for 64-bit carry-less multiply. Remove our local version of galois_multiply64. Signed-off-by: Richard Henderson --- target/s390x/tcg/vec_int_helper.c | 58 +++ 1 file changed, 12 insertions(+), 46

Re: [PATCH v2 2/8] hw/misc: Introduce a model of Xilinx Versal's CFU_APB

2023-08-21 Thread Peter Maydell
On Thu, 10 Aug 2023 at 20:16, Francisco Iglesias wrote: > > Introduce a model of the software programming interface (CFU_APB) of > Xilinx Versal's Configuration Frame Unit. > > Signed-off-by: Francisco Iglesias Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2 16/18] target/ppc: Use clmul_64

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routine for 64-bit carry-less multiply. Signed-off-by: Richard Henderson --- target/ppc/int_helper.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 3/8] hw/misc/xlnx-versal-cfu: Introduce a model of Xilinx Versal CFU_FDRO

2023-08-21 Thread Peter Maydell
On Thu, 10 Aug 2023 at 20:16, Francisco Iglesias wrote: > > Introduce a model of Xilinx Versal's Configuration Frame Unit's data out > port (CFU_FDRO). > > Signed-off-by: Francisco Iglesias Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v5 0/4] Virtio shared dma-buf

2023-08-21 Thread Albert Esteve
Hi all, A little bump for this patch, sorry for the extra noise. Regards, Albert On Wed, Aug 2, 2023 at 11:08 AM Albert Esteve wrote: > v1 link -> > https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg00598.html > v2 link -> > https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg0453

Re: [PATCH v2 4/8] hw/misc/xlnx-versal-cfu: Introduce a model of Xilinx Versal's CFU_SFR

2023-08-21 Thread Peter Maydell
On Thu, 10 Aug 2023 at 20:16, Francisco Iglesias wrote: > > Introduce a model of Xilinx Versal's Configuration Frame Unit's Single > Frame Read port (CFU_SFR). > > Signed-off-by: Francisco Iglesias > --- > hw/misc/xlnx-versal-cfu.c | 87 +++ > include/hw/misc/

Re: [PATCH v2 11/18] target/s390x: Use clmul_32* routines

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routines for 32-bit carry-less multiply. Remove our local version of galois_multiply32. Signed-off-by: Richard Henderson --- target/s390x/tcg/vec_int_helper.c | 75 +-- 1 file changed, 22 insertions(+), 53 del

Re: [PATCH v2 07/18] target/s390x: Use clmul_16* routines

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routines for 16-bit carry-less multiply. Remove our local version of galois_multiply16. Signed-off-by: Richard Henderson --- target/s390x/tcg/vec_int_helper.c | 27 --- 1 file changed, 24 insertions(+), 3 deletion

Re: [PATCH v2 03/18] target/s390x: Use clmul_8* routines

2023-08-21 Thread Philippe Mathieu-Daudé
On 19/8/23 03:02, Richard Henderson wrote: Use generic routines for 8-bit carry-less multiply. Remove our local version of galois_multiply8. Signed-off-by: Richard Henderson --- target/s390x/tcg/vec_int_helper.c | 32 --- 1 file changed, 29 insertions(+), 3 deleti

Re: [PATCH v2 8/8] hw/arm/versal: Connect the CFRAME_REG and CFRAME_BCAST_REG

2023-08-21 Thread Peter Maydell
On Thu, 10 Aug 2023 at 20:16, Francisco Iglesias wrote: > > Connect the Configuration Frame controller (CFRAME_REG) and the > Configuration Frame broadcast controller (CFRAME_BCAST_REG) to the > Versal machine. > > Signed-off-by: Francisco Iglesias Reviewed-by: Peter Maydell thanks -- PMM

[PATCH v3 0/8] target/loongarch: Cleanups in preparation of loongarch32 support

2023-08-21 Thread Philippe Mathieu-Daudé
Series fully reviewed. v3: - Do not rename loongarch_la464_initfn (rth) - Added R-b v2: - Do no rename loongarch_cpu_get/set_pc (rth) - Rebased Jiajie's patches for convenience - Added rth's R-b Jiajie, this series contains few notes I took while reviewing your series adding loongarch32 support

[PATCH v3 8/8] target/loongarch: Add GDB support for loongarch32 mode

2023-08-21 Thread Philippe Mathieu-Daudé
From: Jiajie Chen GPRs and PC are 32-bit wide in loongarch32 mode. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230817093121.1053890-4-gaos...@loongson.cn> [PMD: Rebased, set gdb_num_core_regs] Signed-off-by: Philippe Mathieu-Daudé --- con

Re: [PATCH v2 6/8] hw/misc: Introduce a model of Xilinx Versal's CFRAME_BCAST_REG

2023-08-21 Thread Peter Maydell
On Thu, 10 Aug 2023 at 20:16, Francisco Iglesias wrote: > > Introduce a model of Xilinx Versal's Configuration Frame broadcast > controller (CFRAME_BCAST_REG). > > Signed-off-by: Francisco Iglesias > --- Reviewed-by: Peter Maydell thanks -- PMM

[PATCH v3 2/8] target/loongarch: Remove duplicated disas_set_info assignment

2023-08-21 Thread Philippe Mathieu-Daudé
Commit 228021f05e ("target/loongarch: Add core definition") sets disas_set_info to loongarch_cpu_disas_set_info. Probably due to a failed git-rebase, commit ca61e75071 ("target/loongarch: Add gdb support") also sets it to the same value. Remove the duplication. Signed-off-by: Philippe Mathieu-Daud

[PATCH v3 1/8] target/loongarch: Log I/O write accesses to CSR registers

2023-08-21 Thread Philippe Mathieu-Daudé
Various CSR registers have Read/Write fields. We might want to see guest trying to change such registers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Song Gao --- target/loongarch/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c

[PATCH v3 3/8] target/loongarch: Fix loongarch_la464_initfn() misses setting LSPW

2023-08-21 Thread Philippe Mathieu-Daudé
From: Song Gao Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230817093121.1053890-11-gaos...@loongson.cn> Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/lo

[PATCH v3 4/8] target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU

2023-08-21 Thread Philippe Mathieu-Daudé
In preparation of introducing TYPE_LOONGARCH32_CPU, introduce an abstract TYPE_LOONGARCH64_CPU. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/loongarch/cpu.h | 1 + target/loongarch/cpu.c | 12 +--- 2 files changed, 10 insertions(+), 3 deletions(-) di

[PATCH v3 7/8] target/loongarch: Add new object class for loongarch32 cpus

2023-08-21 Thread Philippe Mathieu-Daudé
From: Jiajie Chen Add object class stub for future loongarch32 cpus. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230817093121.1053890-3-gaos...@loongson.cn> [Rebased on TYPE_LOONGARCH64_CPU introduction] Signed-off-by: Philippe Mathieu-Daud

[PATCH v3 6/8] target/loongarch: Add function to check current arch

2023-08-21 Thread Philippe Mathieu-Daudé
From: Jiajie Chen Add is_la64 function to check if the current cpucfg[1].arch equals to 2(LA64). Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230817093121.1053890-2-gaos...@loongson.cn> Signed-off-by: Phili

[PATCH v3 5/8] target/loongarch: Extract 64-bit specifics to loongarch64_cpu_class_init

2023-08-21 Thread Philippe Mathieu-Daudé
Extract loongarch64 specific code from loongarch_cpu_class_init() to a new loongarch64_cpu_class_init(). In preparation of supporting loongarch32 cores, rename these functions using the '64' suffix. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/cpu.c

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-21 Thread Markus Armbruster
Sam Li writes: > To configure the zoned format feature on the qcow2 driver, it > requires following arguments: the device size, zoned profile, > zoned model, zone size, zone capacity, number of conventional > zones, limits on zone resources (max append sectors, max open > zones, and max_active_zo

Re: [RFC 2/5] qcow2: add zone device metadata with zd_extension

2023-08-21 Thread Markus Armbruster
Sam Li writes: > Zone descriptor data is host definied data that is associated with > each zone. Add zone descriptor extensions to zonedmeta and > blk_get_zone_extension to access zd_extensions. > > Signed-off-by: Sam Li [...] > diff --git a/qapi/block-core.json b/qapi/block-core.json > index

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-21 Thread Stefan Hajnoczi
On Mon, Aug 14, 2023 at 04:58:00PM +0800, Sam Li wrote: > diff --git a/block/qcow2.h b/block/qcow2.h > index f789ce3ae0..3694c8d217 100644 > --- a/block/qcow2.h > +++ b/block/qcow2.h > @@ -236,6 +236,20 @@ typedef struct Qcow2CryptoHeaderExtension { > uint64_t length; > } QEMU_PACKED Qcow2Cry

Re: [PATCH v2 5/8] hw/misc: Introduce a model of Xilinx Versal's CFRAME_REG

2023-08-21 Thread Peter Maydell
On Thu, 10 Aug 2023 at 20:16, Francisco Iglesias wrote: > > Introduce a model of Xilinx Versal's Configuration Frame controller > (CFRAME_REG). > > Signed-off-by: Francisco Iglesias > --- > MAINTAINERS | 2 + > hw/misc/meson.build | 1 + > hw

Re: [PATCH v2 03/58] target/i386: Parse TDX vm type

2023-08-21 Thread Xiaoyao Li
On 8/21/2023 4:27 PM, Daniel P. Berrangé wrote: On Fri, Aug 18, 2023 at 05:49:46AM -0400, Xiaoyao Li wrote: TDX VM requires VM type KVM_X86_TDX_VM to be passed to kvm_ioctl(KVM_CREATE_VM). If tdx-guest object is specified to confidential-guest-support, like, qemu -machine ...,confidential-g

Re: about QEMU TLS

2023-08-21 Thread Yu Zhang
Hello Daniel, sorry for my slow reply! I tested the approach you suggested by the following way: On the target server, start a VM in -incoming mode: qemu-7.1 \ -uuid ${VM_UUID} \ ... -object tls-creds-x509,id=tls0,dir=${HOME}/qemutls,endpoint=server \ ... -incoming defer \ -qmp unix:${SOCK},se

Re: [PATCH v2 00/18] crypto: Provide clmul.h and host accel

2023-08-21 Thread Ard Biesheuvel
On Sat, 19 Aug 2023 at 03:02, Richard Henderson wrote: > > Inspired by Ard Biesheuvel's RFC patches [1] for accelerating > carry-less multiply under emulation. > > Changes for v2: > * Only accelerate clmul_64; keep generic helpers for other sizes. > * Drop most of the Int128 interfaces, except

  1   2   3   >