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

2023-08-08 Thread ThinerLogoer
At 2023-08-09 05:01:17, "Peter Xu" wrote: >On Mon, Aug 07, 2023 at 09:07:32PM +0200, David Hildenbrand wrote: >> From: Thiner Logoer >> >> Users may specify >> * "-mem-path" or >> * "-object memory-backend-file,share=off,readonly=off" >> and expect such COW (MAP_PRIVATE) mappings to work, even

Re: [PATCH v4 9/9] docs/system: add basic virtio-gpu documentation

2023-08-08 Thread Akihiko Odaki
On 2023/08/09 11:11, Gurchetan Singh wrote: This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh --- v2: - Incorporated suggestions by Akihiko Odaki - Listed the currently supported capset_names (Bernard) v3: - Incorporated suggestions

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

2023-08-08 Thread Akihiko Odaki
On 2023/08/09 11:11, Gurchetan Singh wrote: 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

Re: [PATCH 08/33] Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 10:41 PM Warner Losh wrote: > > > On Tue, Aug 8, 2023 at 9:12 PM Richard Henderson < > richard.hender...@linaro.org> wrote: > >> On 8/8/23 19:51, Warner Losh wrote: >> > > +/* __int32_t st_lspare; */ >> > >> > Why commented out? >> > >> > >> > I believe that

Re: [PATCH 08/33] Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 9:12 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/8/23 19:51, Warner Losh wrote: > > > +/* __int32_t st_lspare; */ > > > > Why commented out? > > > > > > I believe that the element was a padding one > > > > > +struct

Re: [PATCH] qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

2023-08-08 Thread Richard Henderson
On 8/8/23 20:50, Michael Tokarev wrote: 08.08.2023 19:44, Richard Henderson пишет: In order for our emulation of MAP_FIXED_NOREPLACE to succeed within linux-user target_mmap, we require a non-zero value.  This does not require host kernel support, merely the bit being defined. Hm. Should we

Re: [PATCH] qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

2023-08-08 Thread Michael Tokarev
08.08.2023 19:44, Richard Henderson пишет: In order for our emulation of MAP_FIXED_NOREPLACE to succeed within linux-user target_mmap, we require a non-zero value. This does not require host kernel support, merely the bit being defined. Hm. Should we add something like

Re: [PATCH] qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

2023-08-08 Thread Akihiko Odaki
On 2023/08/09 1:44, Richard Henderson wrote: In order for our emulation of MAP_FIXED_NOREPLACE to succeed within linux-user target_mmap, we require a non-zero value. This does not require host kernel support, merely the bit being defined. MAP_FIXED_NOREPLACE was added with glibc 2.28. From

Re: [PATCH v2 7/7] tcg/ppc: Use prefixed instructions for tcg_out_goto_tb

2023-08-08 Thread Richard Henderson
On 8/8/23 19:56, Jordan Niethe wrote: On Tue, Aug 8, 2023 at 1:02 PM Richard Henderson wrote: When a direct branch is out of range, we can load the destination for the indirect branch using PLA (for 16GB worth of buffer) and PLD from the TranslationBlock for everything larger. This means the

Re: [PATCH 18/33] Implement stat related syscalls

2023-08-08 Thread Richard Henderson
On 8/8/23 20:07, Warner Losh wrote: So, that's kinda why. I do agree with you that that would be a better structure, but can we use this structure for upstreaming and once we get the other issues worked out, we can do a restructure... We've moved things around a bit, and I'm also waiting for

Re: [PATCH 08/33] Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Richard Henderson
On 8/8/23 19:51, Warner Losh wrote: > +    /* __int32_t  st_lspare; */ Why commented out? I believe that the element was a padding one > +    struct target_freebsd_timespec st_birthtim; /* time of file creation */ Does that not place st_birthtim at the wrong place?

Re: [PATCH 02/33] Disable clang warnings arising from bsd-user/qemu.h

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 9:05 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/8/23 19:56, Warner Losh wrote: > > Looking at this now, This bug is in clang 7, from 2018. For FreeBSD, we > don't support > > anything older than clang 12 or 13 However, the bug still exists in > clang

Re: [PATCH 18/33] Implement stat related syscalls

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 3:53 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:08, Karim Taha wrote: > > From: Stacey Son > > > > Implement the following syscalls: > > stat(2) > > lstat(2) > > fstat(2) > > fstatat(2) > > nstat > > nfstat > > nlstat > > > > Signed-off-by:

Re: [PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Richard Henderson
On 8/8/23 19:41, Warner Losh wrote: I tried to implement both get and put in terms of this, but found that it broke the blitz branch. So why don't we land this as is for bsd-user and then one of us can try to put it into common-user so as to not create too many waves for our GSoC student

Re: [PATCH 02/33] Disable clang warnings arising from bsd-user/qemu.h

2023-08-08 Thread Richard Henderson
On 8/8/23 19:56, Warner Losh wrote: Looking at this now, This bug is in clang 7, from 2018. For FreeBSD, we don't support anything older than clang 12 or 13 However, the bug still exists in clang 16, the latest. I believe this was also copied verbatim from linux-user, so let's leave it and

Re: [PATCH 16/33] Implement host-target convertion functions

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 3:39 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:07, Karim Taha wrote: > > From: Stacey Son > > > > Implement the stat converstion functions: > > target_to_host_fcntl_cmd > > > > Signed-off-by: Stacey Son > > Signed-off-by: Karim Taha > >

Re: [PATCH 02/33] Disable clang warnings arising from bsd-user/qemu.h

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 2:50 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:07, Karim Taha wrote: > > +/* > > + * Tricky points: > > + * - Use __builtin_choose_expr to avoid type promotion from ?:, > > + * - Invalid sizes result in a compile time error stemming from > >

Re: [PATCH v2 7/7] tcg/ppc: Use prefixed instructions for tcg_out_goto_tb

2023-08-08 Thread Jordan Niethe
On Tue, Aug 8, 2023 at 1:02 PM Richard Henderson wrote: > > When a direct branch is out of range, we can load the destination for > the indirect branch using PLA (for 16GB worth of buffer) and PLD from > the TranslationBlock for everything larger. > > This means the patch affects exactly one

Re: [PATCH 10/33] Add struct target_freebsd_fhandle and fcntl flags to bsd-user/syscall_defs.h

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 3:26 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:07, Karim Taha wrote: > > +struct target_freebsd_fid { > > +u_short fid_len;/* len of data in bytes */ > > +u_short fid_data0; /* force longword align */ > >

Re: [PATCH 08/33] Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 3:24 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:07, Karim Taha wrote: > > +uint32_t st_flags;/* user defined flags for file */ > > +__uint32_t st_gen; /* file generation number */ > > Drop the __. > > > +/* __int32_t

Re: [PATCH 06/33] Add struct target_freebsd11_stat to bsd-user/syscall_defs

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 3:23 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:07, Karim Taha wrote: > > +uint32_t st_flags;/* user defined flags for file */ > > +__uint32_t st_gen; /* file generation number */ > > +__int32_t st_lspare; > > Oh, drop

Re: [PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 7:47 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/8/23 18:39, Warner Losh wrote: > > > +#define __put_user_e(x, hptr, e) > \ > > > +do { > \ > > > +PRAGMA_DISABLE_PACKED_WARNING; > \ > >

Re: [PATCH] virtio: don't zero out memory region cache for indirect descriptors

2023-08-08 Thread Jason Wang
On Tue, Aug 8, 2023 at 6:28 AM Ilya Maximets wrote: > > Lots of virtio functions that are on a hot path in data transmission > are initializing indirect descriptor cache at the point of stack > allocation. It's a 112 byte structure that is getting zeroed out on > each call adding unnecessary

Re: [PATCH v3 0/9] gfxstream + rutabaga_gfx

2023-08-08 Thread Huang Rui
On Wed, Aug 09, 2023 at 09:50:29AM +0800, Gurchetan Singh wrote: >On Mon, Aug 7, 2023 at 7:24 AM Erico Nunes <[1]ernu...@redhat.com> >wrote: > > Hello, > On 04/08/2023 01:54, Gurchetan Singh wrote: > > Prior versions: > > > > >

Re: [PATCH v5 1/5] ebpf: Added eBPF map update through mmap.

2023-08-08 Thread Jason Wang
On Wed, Aug 9, 2023 at 7:15 AM Andrew Melnichenko wrote: > > Hi all, > > On Tue, Aug 8, 2023 at 5:39 AM Jason Wang wrote: > > > > On Thu, Aug 3, 2023 at 5:01 AM Andrew Melnychenko wrote: > > > > > > Changed eBPF map updates through mmaped array. > > > Mmaped arrays provide direct access to map

[PATCH v4 2/9] virtio-gpu: CONTEXT_INIT feature

2023-08-08 Thread Gurchetan Singh
From: Antonio Caggiano The feature can be enabled when a backend wants it. Signed-off-by: Antonio Caggiano Reviewed-by: Marc-André Lureau Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- hw/display/virtio-gpu-base.c

[PATCH v4 5/9] gfxstream + rutabaga prep: added need defintions, fields, and options

2023-08-08 Thread Gurchetan Singh
This modifies the common virtio-gpu.h file have the fields and defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga. The command to run these would be: -device virtio-vga-rutabaga,capset_names=gfxstream-vulkan:cross-domain, \

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

2023-08-08 Thread 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 paravirtualization. It has been powering graphics in the

[PATCH v4 4/9] virtio-gpu: blob prep

2023-08-08 Thread Gurchetan Singh
From: Antonio Caggiano This adds preparatory functions needed to: - decode blob cmds - tracking iovecs Signed-off-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- hw/display/virtio-gpu.c | 10 +++---

[PATCH v4 1/9] virtio: Add shared memory capability

2023-08-08 Thread Gurchetan Singh
From: "Dr. David Alan Gilbert" Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow defining shared memory regions with sizes and offsets of 2^32 and more. Multiple instances of the capability are allowed and distinguished by a device-specific 'id'. Signed-off-by: Dr. David

[PATCH v4 9/9] docs/system: add basic virtio-gpu documentation

2023-08-08 Thread Gurchetan Singh
This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh --- v2: - Incorporated suggestions by Akihiko Odaki - Listed the currently supported capset_names (Bernard) v3: - Incorporated suggestions by Akihiko Odaki and Alyssa Ross v4: -

[PATCH v4 3/9] virtio-gpu: hostmem

2023-08-08 Thread Gurchetan Singh
From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Signed-off-by: Antonio Caggiano Tested-by: Alyssa Ross Acked-by: Michael S. Tsirkin --- hw/display/virtio-gpu-pci.c| 14 ++ hw/display/virtio-gpu.c| 1 + hw/display/virtio-vga.c| 33

[PATCH v4 8/9] gfxstream + rutabaga: enable rutabaga

2023-08-08 Thread Gurchetan Singh
This change enables rutabaga to receive virtio-gpu-3d hypercalls when it is active. Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- v3: Whitespace fix (Akihiko) hw/display/virtio-gpu-base.c | 3 ++- hw/display/virtio-gpu.c | 5 +++-- softmmu/qdev-monitor.c | 3 +++

[PATCH v4 7/9] gfxstream + rutabaga: meson support

2023-08-08 Thread Gurchetan Singh
- Add meson detection of rutabaga_gfx - Build virtio-gpu-rutabaga.c + associated vga/pci files when present Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- v3: Fix alignment issues (Akihiko) hw/display/meson.build| 22 ++ meson.build

[PATCH v4 0/9] gfxstream + rutabaga_gfx

2023-08-08 Thread Gurchetan Singh
From: Gurchetan Singh Prior versions: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg00565.html https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg05801.html https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02341.html

[PATCH] powerpc/spapr: Add DEXCR to device tree

2023-08-08 Thread Benjamin Gray
Each DEXCR aspect is allocated a bit in the device tree, using the 68--71 byte range (inclusive). The functionality of the [P]HASHST/[P]HASHCHK instructions is separately declared in byte 72, bit 0 (BE). QEMU supports these features (though the speculation aspects are just tracked, they don't do

Re: [PATCH v3 0/9] gfxstream + rutabaga_gfx

2023-08-08 Thread Gurchetan Singh
On Mon, Aug 7, 2023 at 7:24 AM Erico Nunes wrote: > Hello, > > On 04/08/2023 01:54, Gurchetan Singh wrote: > > Prior versions: > > > > https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg05801.html > > > > https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02341.html > > > > >

Re: [PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Richard Henderson
On 8/8/23 18:39, Warner Losh wrote: > +#define __put_user_e(x, hptr, e)                                            \ > +    do {                                                                    \ > +        PRAGMA_DISABLE_PACKED_WARNING;                                      \

Re: [PULL v2] hw/nvme fixes

2023-08-08 Thread Richard Henderson
On 8/8/23 06:35, Klaus Jensen wrote: From: Klaus Jensen Hi, There was a small typo in the last pull. This replaces it. The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452: Merge tag 'fixes-pull-request' ofhttps://gitlab.com/marcandre.lureau/qemu into staging

Re: [PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Warner Losh
On Tue, Aug 8, 2023 at 3:03 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/7/23 23:07, Karim Taha wrote: > > From: Warner Losh > > > > Use __builtin_choose_expr to avoid type promotion from ?: > > in __put_user_e and __get_user_e macros. > > Copied from linux-user/qemu.h,

Re: [PATCH 0/9] Replace remaining target_ulong in system-mode accel

2023-08-08 Thread Richard Henderson
On 8/7/23 08:56, Anton Johansson wrote: This patchset replaces the remaining uses of target_ulong in the accel/ directory. Specifically, the address type of a few kvm/hvf functions is widened to vaddr, and the address type of the cpu_[st|ld]*() functions is changed to abi_ptr (which is

Re: [PATCH v2 4/9] target: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint

2023-08-08 Thread Richard Henderson
On 8/7/23 08:57, Anton Johansson wrote: Changes the signature of the target-defined functions for inserting/removing hvf hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/hvf/hvf-all.c and makes the api target-agnostic.

Re: [PATCH v2 3/9] target: Use vaddr for kvm_arch_[insert|remove]_hw_breakpoint

2023-08-08 Thread Richard Henderson
On 8/7/23 08:57, Anton Johansson wrote: Changes the signature of the target-defined functions for inserting/removing kvm hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/kvm/kvm-all.c and makes the api target-agnostic.

[PATCH for-8.1] tests/tcg: Disable filename test for info proc mappings

2023-08-08 Thread Richard Henderson
This test fails when host page size != guest page size, because qemu may not be able to directly map the file. Fixes: a6341482695 ("tests/tcg: Add a test for info proc mappings") Signed-off-by: Richard Henderson --- tests/tcg/multiarch/gdbstub/test-proc-mappings.py | 3 ++- 1 file changed, 2

Re: [PULL 00/14] linux-user image mapping fixes

2023-08-08 Thread Richard Henderson
://gitlab.com/rth7680/qemu.git tags/pull-lu-20230808 for you to fetch changes up to dd55885516f42f718d0d121c59a5f7be5fdae3e6: linux-user: Rewrite non-fixed probe_guest_base (2023-08-08 13:41:55 -0700) linux-user: Adjust guest image

Re: [PULL 0/3] fix ppc64le build, fully kill alpha and s390 linux-user

2023-08-08 Thread Richard Henderson
On 8/8/23 11:45, Paolo Bonzini wrote: The following changes since commit 9400601a689a128c25fa9c21e932562e0eeb7a26: Merge tag 'pull-tcg-20230806-3' ofhttps://gitlab.com/rth7680/qemu into staging (2023-08-06 16:47:48 -0700) are available in the Git repository at:

[PATCH v6 1/5] ebpf: Added eBPF map update through mmap.

2023-08-08 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v6 5/5] ebpf: Updated eBPF program and skeleton.

2023-08-08 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Also, added map_flags with explicitly declared BPF_F_MMAPABLE. Which would require kernel 5.5+. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1460

[PATCH v6 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-08 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id. It would require for future qmp commands that may require specific eBPF blob. Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in

[PATCH v6 2/5] ebpf: Added eBPF initialization by fds.

2023-08-08 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v6 0/5] eBPF RSS through QMP support.

2023-08-08 Thread Andrew Melnychenko
This series of patches provides the ability to retrieve eBPF program through qmp, so management application may load bpf blob with proper capabilities. Now, virtio-net devices can accept eBPF programs and maps through properties as external file descriptors. Access to the eBPF map is direct

[PATCH v6 3/5] virtio-net: Added property to load eBPF RSS with fds.

2023-08-08 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

Re: [PATCH v5 1/5] ebpf: Added eBPF map update through mmap.

2023-08-08 Thread Andrew Melnichenko
Hi all, On Tue, Aug 8, 2023 at 5:39 AM Jason Wang wrote: > > On Thu, Aug 3, 2023 at 5:01 AM Andrew Melnychenko wrote: > > > > Changed eBPF map updates through mmaped array. > > Mmaped arrays provide direct access to map data. > > It should omit using bpf_map_update_elem() call, > > which may

Re: [PATCH] gdbstub: Fix client Ctrl-C handling

2023-08-08 Thread Richard Henderson
On 8/1/23 11:40, Matheus Tavares Bernardino wrote: Hi, Nick. Nicholas Piggin wrote: On Tue Jul 11, 2023 at 9:03 PM AEST, Matheus Tavares Bernardino wrote: Nicholas Piggin wrote: diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 6911b73c07..ce8b42eb15 100644 --- a/gdbstub/gdbstub.c

CXL volatile memory is not listed

2023-08-08 Thread Maverickk 78
Hello, I am running qemu-system-x86_64 qemu-system-x86_64 --version QEMU emulator version 8.0.92 (v8.1.0-rc2-80-g0450cf0897) qemu-system-x86_64 \ -m 2G,slots=4,maxmem=4G \ -smp 4 \ -machine type=q35,accel=kvm,cxl=on \ -enable-kvm \ -nographic \ -device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52 \

Re: [PATCH v4 38/38] tests/tcg: Add a test for info proc mappings

2023-08-08 Thread Richard Henderson
On 6/30/23 11:04, Alex Bennée wrote: From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-9-...@linux.ibm.com> Signed-off-by: Alex Bennée ... +def run_test(): +"""Run through the tests one by one""" +

Re: [PATCH] qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

2023-08-08 Thread Alex Bennée
Richard Henderson writes: > In order for our emulation of MAP_FIXED_NOREPLACE to succeed within > linux-user target_mmap, we require a non-zero value. This does not > require host kernel support, merely the bit being defined. > > MAP_FIXED_NOREPLACE was added with glibc 2.28. From

Re: [PATCH 2/2] riscv: zicond: make default

2023-08-08 Thread Vineet Gupta
On 8/8/23 14:06, Daniel Henrique Barboza wrote: (CCing Alistair and other reviewers) On 8/8/23 15:17, Vineet Gupta wrote: Again this helps with better testing and something qemu has been doing with newer features anyways. Signed-off-by: Vineet Gupta --- Even if we can reach a consensus

Re: [PATCH 18/33] Implement stat related syscalls

2023-08-08 Thread Richard Henderson
On 8/7/23 23:08, Karim Taha wrote: From: Stacey Son Implement the following syscalls: stat(2) lstat(2) fstat(2) fstatat(2) nstat nfstat nlstat Signed-off-by: Stacey Son Signed-off-by: Karim Taha Why are all of these in os-stat.h instead of os-stat.c? Is this attempting to avoid clang's

Re: [PATCH 17/33] Implement h2t_freebsd_stat and h2t_freebsd_statfs functions

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Michal Meloun They are the 64-bit variants of h2t_freebsd11_stat and h2t_freebsd11_statfs, respectively Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 82 ++ 1 file changed,

Re: [PATCH 16/33] Implement host-target convertion functions

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Implement the stat converstion functions: target_to_host_fcntl_cmd Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 71 ++ 1 file changed, 71 insertions(+) Which

Re: [PATCH 15/33] Implement host-target convertion functions

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Implement the stat converstion functions: h2t_freebds11_statfs Signed-off-by: Stacey Son Signed-off-by: Karim Taha Same typo and changes to subject. Otherwise, Reviewed-by: Richard Henderson r~

Re: [PATCH 14/33] Implement host-target convertion functions

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Implement the stat converstion functions: h2t_freebsd_fhandle t2h_freebsd_fhandle Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 37 + 1 file changed, 37

Re: [PATCH 13/33] Implement host-target convertion functions

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Implement the stat converstion functions: h2t_freebsd11_stat h2t_freebsd_nstat "conversion" And copy the functions into the subject, so that we don't wind up with 4 commits with identical subject. r~

Re: [PATCH 13/33] Implement host-target convertion functions

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Implement the stat converstion functions: h2t_freebsd11_stat h2t_freebsd_nstat Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 94 ++ 1 file changed, 94 insertions(+)

Re: [PATCH 12/33] Rename target_freebsd_time_t to target_time_t

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Warner Losh This is necessary for future code using target_time_t, in bsd-user/syscall_defs. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by:

Re: [PATCH 11/33] Define safe_fcntl macro in bsd-user/syscall_defs.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Kyle Evans Signed-off-by: Kyle Evans Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH 10/33] Add struct target_freebsd_fhandle and fcntl flags to bsd-user/syscall_defs.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +struct target_freebsd_fid { +u_short fid_len;/* len of data in bytes */ +u_short fid_data0; /* force longword align */ +charfid_data[TARGET_MAXFIDSZ]; /* data (variable len) */ uint16_t? Otherwise, Acked-by:

Re: [PATCH 09/33] Add struct target_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +struct target_statfs { +uint32_t f_version; /* structure version number */ Indentation. Otherwise, Acked-by: Richard Henderson r~

Re: [PATCH 08/33] Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +uint32_t st_flags;/* user defined flags for file */ +__uint32_t st_gen; /* file generation number */ Drop the __. +/* __int32_t st_lspare; */ Why commented out? +struct target_freebsd_timespec st_birthtim; /* time of file

Re: [PATCH QEMU v3 1/3] tests: Add migration dirty-limit capability test

2023-08-08 Thread Peter Xu
On Thu, Jun 08, 2023 at 12:46:45AM +0800, ~hyman wrote: > From: Hyman Huang(黄勇) > > Add migration dirty-limit capability test if kernel support > dirty ring. > > Migration dirty-limit capability introduce dirty limit > capability, two parameters: x-vcpu-dirty-limit-period and > vcpu-dirty-limit

Re: [PATCH 06/33] Add struct target_freebsd11_stat to bsd-user/syscall_defs

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +uint32_t st_flags;/* user defined flags for file */ +__uint32_t st_gen; /* file generation number */ +__int32_t st_lspare; Oh, drop the __ types. r~

Re: [PATCH 07/33] Add struct target_stat to bsd-user/syscall_defs.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +struct target_stat { +uint64_t st_dev; /* inode's device */ +uint64_t st_ino; /* inode's number */ +uint64_t st_nlink; /* number of hard links */ Indentation of 8 instead of 4. Otherwise,

Re: [PATCH 06/33] Add struct target_freebsd11_stat to bsd-user/syscall_defs

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 33 + 1 file changed, 33 insertions(+) Acked-by: Richard Henderson r~

Re: [PATCH 05/33] Forward declare functions defined in os-stat.c

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Michal Meloun Add to bsd-user/freebsd/qemu-os.h the forward declarations of conversion functions related to stat syscalls. Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/qemu-os.h | 15 +++ 1 file changed,

Re: [PATCH 04/33] Declarations of h2t and t2h conversion functions.

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Declarations of functions that convert between host and target structs. Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/qemu-os.h | 35 +++ bsd-user/qemu.h| 1 + 2

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Palmer Dabbelt
On Tue, 08 Aug 2023 14:10:54 PDT (-0700), dbarb...@ventanamicro.com wrote: On 8/8/23 17:52, Palmer Dabbelt wrote: On Tue, 08 Aug 2023 11:45:49 PDT (-0700), Vineet Gupta wrote: On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Daniel Henrique Barboza
On 8/8/23 17:52, Palmer Dabbelt wrote: On Tue, 08 Aug 2023 11:45:49 PDT (-0700), Vineet Gupta wrote: On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in both llvm and gcc. It is still not in

[PULL 04/14] linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap

2023-08-08 Thread Richard Henderson
Use this as extra protection for the guest mapping over any qemu host mappings. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PULL 08/14] linux-user: Do not adjust zero_bss for host page size

2023-08-08 Thread Richard Henderson
Rely on target_mmap to handle guest vs host page size mismatch. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 63 +++- 1 file changed, 27 insertions(+), 36

[PULL 14/14] linux-user: Rewrite non-fixed probe_guest_base

2023-08-08 Thread Richard Henderson
Use pgb_addr_set to probe for all of the guest addresses, not just the main executable. Handle the identity map specially and separately from the search. If /proc/self/maps is available, utilize the full power of the interval tree search, rather than a linear search through the address list. If

[PULL 09/14] linux-user: Use zero_bss for PT_LOAD with no file contents too

2023-08-08 Thread Richard Henderson
If p_filesz == 0, then vaddr_ef == vaddr. We can reuse the code in zero_bss rather than incompletely duplicating it in load_elf_image. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson ---

[PULL 05/14] linux-user: Use elf_et_dyn_base for ET_DYN with interpreter

2023-08-08 Thread Richard Henderson
Follow the lead of the linux kernel in fs/binfmt_elf.c, in which an ET_DYN executable which uses an interpreter (usually a PIE executable) is loaded away from where the interpreter itself will be loaded. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki

[PULL 06/14] linux-user: Adjust initial brk when interpreter is close to executable

2023-08-08 Thread Richard Henderson
From: Helge Deller While we attempt to load a ET_DYN executable far away from TASK_UNMAPPED_BASE, we are not completely in control of the address space layout. If the interpreter lands close to the executable, leaving insufficient heap space, move brk. Tested-by: Helge Deller Signed-off-by:

[PULL 10/14] util/selfmap: Rewrite using qemu/interval-tree.h

2023-08-08 Thread Richard Henderson
We will want to be able to search the set of mappings. For this patch, the two users iterate the tree in order. Signed-off-by: Richard Henderson --- include/qemu/selfmap.h | 22 linux-user/elfload.c | 14 +++-- linux-user/syscall.c | 15 +++--- util/selfmap.c | 114

[PULL 12/14] linux-user: Consolidate guest bounds check in probe_guest_base

2023-08-08 Thread Richard Henderson
The three sets of checks are identical, logically. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/elfload.c | 50 +++- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c

[PULL 11/14] linux-user: Remove duplicate CPU_LOG_PAGE from probe_guest_base

2023-08-08 Thread Richard Henderson
The proper logging for probe_guest_base is in the main function. There is no need to duplicate that in the subroutines. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/elfload.c | 19 --- 1 file changed, 19 deletions(-) diff --git

[PULL 02/14] linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h

2023-08-08 Thread Richard Henderson
Provide default values that are as close as possible to the values used by the guest's kernel. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 10 ++

[PULL 13/14] linux-user: Rewrite fixed probe_guest_base

2023-08-08 Thread Richard Henderson
Create a set of subroutines to collect a set of guest addresses, all of which must be mappable on the host. Use this within the renamed pgb_fixed subroutine to validate the user's choice of guest_base specified by the -B command-line option. Reviewed-by: Alex Bennée Signed-off-by: Richard

[PULL 00/14] linux-user image mapping fixes

2023-08-08 Thread Richard Henderson
The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452: Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-08-07 13:55:00 -0700) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-lu-20230808

[PULL 03/14] linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h

2023-08-08 Thread Richard Henderson
Copy each guest kernel's default value, then bound it against reserved_va or the host address space. Tested-by: Helge Deller Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 3 +++ linux-user/alpha/target_mman.h | 3 +++

[PULL 01/14] linux-user: Adjust task_unmapped_base for reserved_va

2023-08-08 Thread Richard Henderson
Ensure that the chosen values for mmap_next_start and task_unmapped_base are within the guest address space. Tested-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/user-mmap.h | 34 +- linux-user/main.c | 28

[PULL 07/14] linux-user: Do not adjust image mapping for host page size

2023-08-08 Thread Richard Henderson
Remove TARGET_ELF_EXEC_PAGESIZE, and 3 other TARGET_ELF_PAGE* macros based off of that. Rely on target_mmap to handle guest vs host page size mismatch. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson ---

Re: [PATCH 2/2] riscv: zicond: make default

2023-08-08 Thread Daniel Henrique Barboza
(CCing Alistair and other reviewers) On 8/8/23 15:17, Vineet Gupta wrote: Again this helps with better testing and something qemu has been doing with newer features anyways. Signed-off-by: Vineet Gupta --- Even if we can reach a consensus about removing the experimental (x- prefix) status

Re: [PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Warner Losh Use __builtin_choose_expr to avoid type promotion from ?: in __put_user_e and __get_user_e macros. Copied from linux-user/qemu.h, originally by Blue Swirl. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/qemu.h | 81

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

2023-08-08 Thread Peter Xu
On Mon, Aug 07, 2023 at 09:07:32PM +0200, David Hildenbrand wrote: > From: Thiner Logoer > > Users may specify > * "-mem-path" or > * "-object memory-backend-file,share=off,readonly=off" > and expect such COW (MAP_PRIVATE) mappings to work, even if the user > does not have write permissions to

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Palmer Dabbelt
On Tue, 08 Aug 2023 11:45:49 PDT (-0700), Vineet Gupta wrote: On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in both llvm and gcc. It is still not in https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions Right,

Re: [PATCH 02/33] Disable clang warnings arising from bsd-user/qemu.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +/* + * Tricky points: + * - Use __builtin_choose_expr to avoid type promotion from ?:, + * - Invalid sizes result in a compile time error stemming from + * the fact that abort has no parameters. + * - It's easier to use the endian-specific unaligned

Re: [PATCH 01/33] Move _WANT_FREEBSD macros to include/qemu/osdep.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Warner Losh move _WANT_FREEBSD macros from bsd-user/freebsd/os-syscall.c to include/qemu/osdep.h in order to pull some struct defintions needed later in the build. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c

Re: [PATCH for-8.2 v2 1/2] qapi/migration: Deduplicate migration parameter field comments

2023-08-08 Thread Peter Xu
On Sun, Aug 06, 2023 at 11:49:46AM -0400, Peter Xu wrote: > > I think we have a tradeoff here. If perpetuating the unclean and ugly > > use of "" is what it takes to de-triplicate migration parameters, we may > > decide to accept that. > > I don't think it's a must. As Dan raised, we can

  1   2   3   >