Re: [PATCH v2 05/11] block/nvme: Have nvme_create_queue_pair() report errors consistently

2021-08-26 Thread Klaus Jensen
On Aug 26 21:50, Philippe Mathieu-Daudé wrote: > nvme_create_queue_pair() does not return a boolean value (indicating > eventual error) but a pointer, and is inconsistent in how it fills the > error handler. To fulfill callers expectations, always set an error > message on failure. > >

Re: [PATCH v2 02/11] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report()

2021-08-26 Thread Klaus Jensen
On Aug 26 21:50, Philippe Mathieu-Daudé wrote: > Instead of displaying the error on stderr, use error_report() > which also report to the monitor. > > Reviewed-by: Fam Zheng > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Klaus Jensen signature.asc

Re: [PATCH v2 06/11] util/vfio-helpers: Pass Error handle to qemu_vfio_dma_map()

2021-08-26 Thread Klaus Jensen
On Aug 26 21:50, Philippe Mathieu-Daudé wrote: > Currently qemu_vfio_dma_map() displays errors on stderr. > When using management interface, this information is simply > lost. Pass qemu_vfio_dma_map() an Error** handle so it can > propagate the error to callers. > > Reviewed-by: Fam Zheng >

[PULL 14/15] Remove superfluous ERRP_GUARD()

2021-08-26 Thread Markus Armbruster
Macro ERRP_GUARD() is only needed when we want to dereference @errp or pass it to error_prepend() or error_append_hint(). Delete superfluous ones. Signed-off-by: Markus Armbruster Message-Id: <20210720125408.387910-15-arm...@redhat.com> Acked-by: Michael S. Tsirkin --- hw/remote/mpqemu-link.c

[PULL 02/15] spapr: Plug memory leak when we can't add a migration blocker

2021-08-26 Thread Markus Armbruster
Fixes: 2500fb423adb17995485de0b4d507cf2f09e3a7f Cc: Aravinda Prasad Cc: Ganesh Goudar Cc: David Gibson Signed-off-by: Markus Armbruster Message-Id: <20210720125408.387910-3-arm...@redhat.com> Acked-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_events.c | 3 +--

[PULL 12/15] vhost: Clean up how VhostOpts method vhost_get_config() fails

2021-08-26 Thread Markus Armbruster
vhost_user_get_config() can fail without setting an error. Unclean. Its caller vhost_dev_get_config() compensates by substituting a generic error then. Goes back to commit 50de51387f "vhost: Distinguish errors in vhost_dev_get_config()". Clean up by moving the generic error from

[PULL 09/15] migration: Unify failure check for migrate_add_blocker()

2021-08-26 Thread Markus Armbruster
Most callers check the return value. Some check whether it set an error. Functionally equivalent, but the former tends to be easier on the eyes, so do that everywhere. Prior art: commit c6ecec43b2 "qemu-option: Check return value instead of @err where convenient". Signed-off-by: Markus

[PULL 04/15] multi-process: Fix pci_proxy_dev_realize() error handling

2021-08-26 Thread Markus Armbruster
The Error ** argument must be NULL, _abort, _fatal, or a pointer to a variable containing NULL. Passing an argument of the latter kind twice without clearing it in between is wrong: if the first call sets an error, it no longer points to NULL for the second call. pci_proxy_dev_realize() is wrong

[PULL 10/15] migration: Handle migration_incoming_setup() errors consistently

2021-08-26 Thread Markus Armbruster
Commit b673eab4e2 "multifd: Make multifd_load_setup() get an Error parameter" changed migration_incoming_setup() to take an Error ** argument, and adjusted the callers accordingly. It neglected to change adjust multifd_load_setup(): it still exit()s on error. Clean that up. The error now gets

[PULL 01/15] error: Use error_fatal to simplify obvious fatal errors (again)

2021-08-26 Thread Markus Armbruster
We did this with scripts/coccinelle/use-error_fatal.cocci before, in commit 50beeb68094 and 007b06578ab. This commit cleans up rarer variations that don't seem worth matching with Coccinelle. Cc: Thomas Huth Cc: Cornelia Huck Cc: Peter Xu Cc: Juan Quintela Cc: Stefan Hajnoczi Cc: Paolo

[PULL 13/15] vhost: Clean up how VhostOpts method vhost_backend_init() fails

2021-08-26 Thread Markus Armbruster
vhost_user_backend_init() can fail without setting an error. Unclean. Its caller vhost_dev_init() compensates by substituting a generic error then. Goes back to commit 28770ff935 "vhost: Distinguish errors in vhost_backend_init()". Clean up by moving the generic error from vhost_dev_init() to

[PULL 08/15] whpx nvmm: Drop useless migrate_del_blocker()

2021-08-26 Thread Markus Armbruster
There is nothing to delete after migrate_add_blocker() failed. Trying anyway is safe, but useless. Don't. Cc: Sunil Muthuswamy Cc: Kamil Rytarowski Cc: Reinoud Zandijk Signed-off-by: Markus Armbruster Message-Id: <20210720125408.387910-9-arm...@redhat.com> Reviewed-by: Reinoud Zandijk

[PULL 06/15] i386: Never free migration blocker objects instead of sometimes

2021-08-26 Thread Markus Armbruster
invtsc_mig_blocker has static storage duration. When a CPU with certain features is initialized, and invtsc_mig_blocker is still null, we add a migration blocker and store it in invtsc_mig_blocker. The object is freed when migrate_add_blocker() fails, leaving invtsc_mig_blocker dangling. It is

[PULL 07/15] vfio: Avoid error_propagate() after migrate_add_blocker()

2021-08-26 Thread Markus Armbruster
When migrate_add_blocker(blocker, ) is followed by error_propagate(errp, err), we can often just as well do migrate_add_blocker(..., errp). This is the case in vfio_migration_probe(). Prior art: commit 386f6c07d2 "error: Avoid error_propagate() after migrate_add_blocker()". Cc: Kirti Wankhede

[PULL 15/15] vl: Clean up -smp error handling

2021-08-26 Thread Markus Armbruster
The Error ** argument must be NULL, _abort, _fatal, or a pointer to a variable containing NULL. Passing an argument of the latter kind twice without clearing it in between is wrong: if the first call sets an error, it no longer points to NULL for the second call. machine_parse_property_opt() is

[PULL 05/15] vhost-scsi: Plug memory leak on migrate_add_blocker() failure

2021-08-26 Thread Markus Armbruster
Cc: Michael S. Tsirkin Signed-off-by: Markus Armbruster Message-Id: <20210720125408.387910-6-arm...@redhat.com> Acked-by: Michael S. Tsirkin --- hw/scsi/vhost-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index

[PULL 11/15] microvm: Drop dead error handling in microvm_machine_state_init()

2021-08-26 Thread Markus Armbruster
Stillborn in commit 0ebf007dda "hw/i386: Introduce the microvm machine type". Cc: Sergio Lopez Signed-off-by: Markus Armbruster Message-Id: <20210720125408.387910-12-arm...@redhat.com> Reviewed-by: Sergio Lopez Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pankaj Gupta Acked-by: Michael

[PULL 03/15] spapr: Explain purpose of ->fwnmi_migration_blocker more clearly

2021-08-26 Thread Markus Armbruster
spapr_mce_req_event() makes an effort to prevent migration from degrading the reporting of FWNMIs. It adds a migration blocker when it receives one, and deletes it when it's done handling it. This is a best effort. Commit 2500fb423a "migration: Include migration support for machine check

[PULL 00/15] Error reporting patches for 2021-08-26

2021-08-26 Thread Markus Armbruster
The following changes since commit c83fcfaf8a54d0d034bd0edf7bbb3b0d16669be9: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-08-26' into staging (2021-08-26 13:42:34 +0100) are available in the Git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-error-2021-08-26

Re: [PATCH v2 42/43] bsd-user: Add '-0 argv0' option to bsd-user/main.c

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:12 PM, i...@bsdimp.com wrote: > From: Colin Percival > > Previously it was impossible to emulate a program with a file name > different from its argv[0]. With this change, you can run > qemu -0 fakename realname args > which runs the program "realname" with an argv of

Re: [PATCH v2 41/43] bsd-user: Implement cpu_copy() helper routine

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > cpu_copy shouldbe called when processes are creating new threads. It Typo "should be" > copies the current state of the CPU to a new cpu state needed for the > new thread. > > Signed-off-by: Stacey Son > Signed-off-by:

Re: [PATCH v2 30/43] bsd-user: Remove dead #ifdefs from elfload.c

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > LOW_ELF_STACK doesn't exist on FreeBSD and likely never will. Remove it. > Likewise, remove an #if 0 block that's not useful > > Signed-off-by: Warner Losh > Reviewed-by: Richard Henderson > --- > bsd-user/elfload.c | 20

Re: [PATCH v2 19/43] bsd-user: start to move target CPU functions to target_arch*

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > Move the CPU functons into target_arch_cpu.c that are unique to each Typo "functions" > CPU. These are defined in target_arch.h. > > Signed-off-by: Stacey Son > Signed-off-by: Warner Losh > Reviewed-by: Richard Henderson >

Re: [PATCH v2 15/43] bsd-user: assume pthreads and support of __thread

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > All compilers for some time have supported this. Follow linux-user Please insert: "(see 24cb36a61c6: "configure: Make NPTL non-optional")" > and > eliminate the #define THREAD and unconditionally insert __thread where >

Re: [PATCH v2 12/43] bsd-user: remove a.out support

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > Remove still-born a.out support. The BSDs switched from a.out to ELF 20+ years > ago. It's out of scope for bsd-user, and what little support there was would > simply wind up at a not-implemented message. Simplify the whole mess

Re: [PATCH v2 08/43] bsd-user: pass the bsd_param into loader_exec

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > Pass the bsd_param into loader_exec, and adjust. Missing the "why" justification. Anyway, Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Warner Losh > Reviewed-by: Richard Henderson > --- > bsd-user/bsdload.c | 37

Re: [PATCH v2 07/43] bsd-user: move arch specific defines out of elfload.c

2021-08-26 Thread Philippe Mathieu-Daudé
On 8/26/21 11:11 PM, i...@bsdimp.com wrote: > From: Warner Losh > > Move the arcitecture specific defines to target_arch_elf.h and delete Typo "architecture" > them from elfload.c. unifdef as appropriate for i386 vs x86_64 "un-ifdef" or untangle? > versions. Add the copyright/license

Re: [PATCH v6 4/6] qmp: add QMP command x-debug-virtio-queue-status

2021-08-26 Thread Jason Wang
在 2021/8/26 下午2:25, Jonah Palmer 写道: Hi Jason, could I get your thoughts on this implementation question below? I'm not too sure on how I should proceed determining if vhost is active or not. Thank you! Jonah On 7/26/21 5:33 AM, Jonah Palmer wrote: On 7/22/21 5:22 AM, Jason Wang

Re: [PATCH v2 0/2] target/ppc: Fix vextu[bhw][lr]x on big endian hosts

2021-08-26 Thread David Gibson
On Thu, Aug 26, 2021 at 11:14:44AM -0300, matheus.fe...@eldorado.org.br wrote: > From: Matheus Ferst > > The definition of struct Int128 is currently independent of the host > endianness, causing different results when using the member s128 of > union ppc_vsr_t in big-endian builds with

Re: [PATCH v3 0/2] target/ppc: Fix vector registers access in gdbstub for little-endian

2021-08-26 Thread David Gibson
On Thu, Aug 26, 2021 at 11:56:54AM -0300, matheus.fe...@eldorado.org.br wrote: > From: Matheus Ferst > > PPC gdbstub code has two possible swaps of the 64-bit elements of AVR > registers: in gdb_get_avr_reg/gdb_set_avr_reg (based on msr_le) and in > gdb_get_reg128/ldq_p (based on

Re: [PATCH] RFC: build-sys: drop dtc submodule

2021-08-26 Thread David Gibson
On Thu, Aug 26, 2021 at 11:34:59AM +0400, Marc-André Lureau wrote: > Hi > > On Thu, Aug 26, 2021 at 7:11 AM David Gibson > wrote: > > > On Thu, Aug 26, 2021 at 12:11:17AM +0400, Marc-André Lureau wrote: > > > Hi > > > > > > On Thu, Aug 26, 2021 at 12:00 AM Peter Maydell > > > > > wrote: > > >

RE: [PATCH] hw/arm/smmuv3: Support non-PCI/PCIe devices connection

2021-08-26 Thread Li, Chunming
> -Original Message- > From: Peter Maydell [mailto:peter.mayd...@linaro.org] > Sent: Thursday, August 26, 2021 11:57 PM > To: Li, Chunming > Cc: eric.au...@redhat.com; Liu, Renwei; qemu-...@nongnu.org; Wen, > Jianxian; qemu-devel@nongnu.org > Subject: Re: [PATCH] hw/arm/smmuv3: Support

[RFC PATCH v2 00/12] Add AMD Secure Nested Paging (SEV-SNP) support

2021-08-26 Thread Michael Roth
These patches implement SEV-SNP along with CPUID enforcement support for QEMU, and are also available at: https://github.com/mdroth/qemu/commits/snp-rfc-v2-upstream They are based on the initial RFC submitted by Brijesh:

[RFC PATCH v2 09/12] target/i386: allow versioned CPUs to specify new cache_info

2021-08-26 Thread Michael Roth
New EPYC CPUs versions require small changes to their cache_info's. Because current QEMU x86 CPU definition does not support cache versions, we would have to declare a new CPU type for each such case. To avoid this duplication, the patch allows new cache_info pointers to be specificed for a new

[RFC PATCH v2 07/12] i386/sev: populate secrets and cpuid page and finalize the SNP launch

2021-08-26 Thread Michael Roth
From: Brijesh Singh During the SNP guest launch sequence, a special secrets and cpuid page needs to be populated by the SEV-SNP firmware. The secrets page contains the VM Platform Communication Key (VMPCKs) used by the guest to send and receive secure messages to the PSP. And CPUID page will

[RFC PATCH v2 10/12] target/i386: add new EPYC CPU versions with updated cache_info

2021-08-26 Thread Michael Roth
This patch introduces new EPYC cpu versions: EPYC-v4, EPYC-Rome-v3, and EPYC-Milan-v2. The only difference vs. older models is an updated cache_info with the 'complex_indexing' bit unset, since this bit is not currently defined for AMD and may cause problems should it be used for something else in

[RFC PATCH v2 05/12] i386/sev: add the SNP launch start context

2021-08-26 Thread Michael Roth
From: Brijesh Singh The SNP_LAUNCH_START is called first to create a cryptographic launch context within the firmware. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth --- target/i386/sev.c| 29 - target/i386/trace-events | 1 + 2 files changed,

[RFC PATCH v2 03/12] i386/sev: introduce 'sev-snp-guest' object

2021-08-26 Thread Michael Roth
From: Brijesh Singh SEV-SNP support relies on a different set of properties/state than the existing 'sev-guest' object. This patch introduces the 'sev-snp-guest' object, which can be used to configure an SEV-SNP guest. For example, a default-configured SEV-SNP guest with no additional

[RFC PATCH v2 08/12] target/i386: set SEV-SNP CPUID bit when SNP enabled

2021-08-26 Thread Michael Roth
SNP guests will rely on this bit to determine certain feature support. Signed-off-by: Michael Roth --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 97e250e876..f0b441f692 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c

[RFC PATCH v2 04/12] i386/sev: initialize SNP context

2021-08-26 Thread Michael Roth
From: Brijesh Singh When SEV-SNP is enabled, the KVM_SNP_INIT command is used to initialize the platform. The command checks whether SNP is enabled in the KVM, if enabled then it allocates a new ASID from the SNP pool and calls the firmware to initialize the all the resources. Signed-off-by:

[RFC PATCH v2 01/12] i386/sev: introduce "sev-common" type to encapsulate common SEV state

2021-08-26 Thread Michael Roth
Currently all SEV/SEV-ES functionality is managed through a single 'sev-guest' QOM type. With upcoming support for SEV-SNP, taking this same approach won't work well since some of the properties/state managed by 'sev-guest' is not applicable to SEV-SNP, which will instead rely on a new QOM type

[RFC PATCH v2 06/12] i386/sev: add support to encrypt BIOS when SEV-SNP is enabled

2021-08-26 Thread Michael Roth
From: Brijesh Singh The KVM_SEV_SNP_LAUNCH_UPDATE command is used for encrypting the bios image used for booting the SEV-SNP guest. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth --- hw/i386/pc_sysfw.c | 7 --- include/sysemu/sev.h | 2 +- target/i386/sev-stub.c |

[RFC PATCH v2 02/12] linux-header: add the SNP specific command

2021-08-26 Thread Michael Roth
From: Brijesh Singh Sync the kvm.h with the kernel to include the SNP specific commands. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth --- linux-headers/linux/kvm.h | 50 +++ 1 file changed, 50 insertions(+) diff --git

[RFC PATCH v2 12/12] i386/sev: update query-sev QAPI format to handle SEV-SNP

2021-08-26 Thread Michael Roth
Most of the current 'query-sev' command is relevant to both legacy SEV/SEV-ES guests and SEV-SNP guests, with 2 exceptions: - 'policy' is a 64-bit field for SEV-SNP, not 32-bit, and the meaning of the bit positions has changed - 'handle' is not relevant to SEV-SNP To address this, this

[RFC PATCH v2 11/12] i386/sev: sev-snp: add support for CPUID validation

2021-08-26 Thread Michael Roth
SEV-SNP firmware allows a special guest page to be populated with a table of guest CPUID values so that they can be validated through firmware before being loaded into encrypted guest memory where they can be used in place of hypervisor-provided values[1]. As part of SEV-SNP guest initialization,

[PATCH 0/2] virtiofsd: Add capability to block xattrs

2021-08-26 Thread Vivek Goyal
As of now we have a knob "-o xattr/no_xattr" which either enables all xattrs or disables all xattrs. We need something more fine grained where we can selectively disable only certain xattrs (and not all). For example, in some cases we want to disable "security.selinux" xattr. This is equivalent

[PATCH v2 39/43] bsd-user: move qemu_log to later in the file

2021-08-26 Thread imp
From: Warner Losh Signed-off-by: Warner Losh Acked-by: Richard Henderson --- bsd-user/main.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 57669ad7b7..d60a0a7ee2 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c

[PATCH v2 30/43] bsd-user: Remove dead #ifdefs from elfload.c

2021-08-26 Thread imp
From: Warner Losh LOW_ELF_STACK doesn't exist on FreeBSD and likely never will. Remove it. Likewise, remove an #if 0 block that's not useful Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/elfload.c | 20 1 file changed, 20 deletions(-) diff --git

[PATCH v2 34/43] bsd-user: Add target_arch_reg to describe a target's register set

2021-08-26 Thread imp
From: Warner Losh target_reg_t is the normal register. target_fpreg_t is the floating point registers. target_copy_regs copies the registers out of CPU context for things like core dumps. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson ---

[PATCH v2 33/43] bsd-user: update debugging in mmap.c

2021-08-26 Thread imp
From: Warner Losh Update the debugging code for new features and different targets. Signed-off-by: Mikaël Urankar Signed-off-by: Sean Bruno Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Acked-by: Richard Henderson --- bsd-user/mmap.c | 45

[PATCH v2 32/43] bsd-user: Make cpu_model and cpu_type visible to all of main.c

2021-08-26 Thread imp
From: Warner Losh cpu_model and cpu_type will be used future commits, so move them from main() scoped to file scoped. Signed-off-by: Warner Losh Acked-by: Richard Henderson --- bsd-user/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/main.c

[PATCH v2 42/43] bsd-user: Add '-0 argv0' option to bsd-user/main.c

2021-08-26 Thread imp
From: Colin Percival Previously it was impossible to emulate a program with a file name different from its argv[0]. With this change, you can run qemu -0 fakename realname args which runs the program "realname" with an argv of "fakename args". Signed-off-by: Colin Percival Signed-off-by:

[PATCH v2 29/43] bsd-user: elf cleanup

2021-08-26 Thread imp
From: Warner Losh Move OS-dependent defines into target_os_elf.h. Move the architectural dependent stuff into target_arch_elf.h. Adjust elfload.c to use target_create_elf_tables instead of create_elf_tables. Signed-off-by: Warner Losh Signed-off-by: Stacey Son Signed-off-by: Kyle Evans

[PATCH v2 38/43] bsd-user: Refactor load_elf_sections and is_target_elf_binary

2021-08-26 Thread imp
From: Warner Losh Factor out load_elf_sections and is_target_elf_binary out of load_elf_interp. Signed-off-by: Mikaël Urankar Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/elfload.c | 350 + 1 file changed, 164 insertions(+),

[PATCH v2 23/43] bsd-user: define max args in terms of pages

2021-08-26 Thread imp
From: Warner Losh For 32-bit platforms, pass in up to 256k of args. For 64-bit, bump that to 512k. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git

[PATCH v2 31/43] bsd-user: Rewrite target system call definintion glue

2021-08-26 Thread imp
From: Warner Losh Rewrite target definnitions to interface with the FreeBSD system calls. This covers basic types (time_t, iovec, umtx_time, timespec, timeval, rusage, rwusage) and basic defines (mmap, rusage). Also included are FreeBSD version-specific variations. Signed-off-by: Stacey Son

[PATCH v2 21/43] bsd-user: pull in target_arch_thread.h update target_arch_elf.h

2021-08-26 Thread imp
From: Warner Losh Update target_arch_elf.h to remove thread_init. Move its contents to target_arch_thread.h and rename to target_thread_init(). Update elfload.c to call it. Create thread_os_thread.h to hold the os specific parts of the thread and threat manipulation routines. Currently, it just

[PATCH 2/2] virtiofsd: Add option "block_xattr=" to block certain xattrs

2021-08-26 Thread Vivek Goyal
We need capability to block security.selinux xattr and return EOPNOTSUPP. That way guest SELinux thinks filesystem does not support selinux xattr and falls back to some default label (virtiofs_t) for the virtiofs filesystem instance. So add a generic option "-o block_xattr=", which can allow user

[PATCH v2 28/43] bsd-user: Add system independent stack, data and text limiting

2021-08-26 Thread imp
From: Warner Losh Eliminate the x86 specific stack stuff in favor of more generic control over the process size: target_maxtsiz max text size target_dfldsiz initial data size limit target_maxdsiz max data size target_dflssiz initial stack size limit target_maxssiz max

[PATCH v2 24/43] bsd-user: Create target specific vmparam.h

2021-08-26 Thread imp
From: Warner Losh Target specific values for vm parameters and details. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_vmparam.h | 38 ++ bsd-user/i386/target_arch_vmparam.h | 46

[PATCH v2 18/43] bsd-user: save the path to the qemu emulator

2021-08-26 Thread imp
From: Warner Losh Save the path to the qemu emulator. This will be used later when we have a more complete implementation of exec. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Acked-by: Richard Henderson --- bsd-user/main.c | 21 + bsd-user/qemu.h | 1 + 2 files

[PATCH 1/2] virtiofsd: Add an array to keep track of blocked xattrs

2021-08-26 Thread Vivek Goyal
Right now we have capability to block "system.posix_acl_access" and "system.posix_acl_default" xattrs. But we have sort of hardcoded these two values and its not generic. Now we want to support blocking of arbitrary xattr as passed in by user. So let us keep an array of blocked xattrs and consult

[PATCH v2 17/43] bsd-user: Include host-os.h from main

2021-08-26 Thread imp
From: Warner Losh Include host-os.h from main.c to pick up the default OS to emulate. Set that default in main(). Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/host-os.h | 2 ++ bsd-user/main.c| 4 +++-

[PATCH v2 43/43] bsd-user: Update mapping to handle reserved and starting conditions

2021-08-26 Thread imp
From: Warner Losh Update the reserved base based on what platform we're on, as well as the start of the mmap range. Update routines that find va ranges to interact with the reserved ranges as well as properly align the mapping (this is especially important for targets whose page size does not

[PATCH v2 20/43] bsd-user: Move per-cpu code into target_arch_cpu.h

2021-08-26 Thread imp
From: Warner Losh Move cpu_loop() into target_cpu_loop(), and put that in target_arch_cpu.h for each architecture. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_cpu.c | 1 + bsd-user/i386/target_arch_cpu.h | 208 ++ bsd-user/main.c

[PATCH v2 40/43] bsd-user: Implement interlock for atomic operations

2021-08-26 Thread imp
From: Warner Losh Implement the internlock in fork_start() and fork_end() to properly cope with atomic operations and to safely keep state for parent and child processes. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/main.c | 23

Re: [PATCH v3 3/3] hw/usb/xhci: Always expect 'dma' link property to be set

2021-08-26 Thread Mark Cave-Ayland
On 26/08/2021 21:07, Philippe Mathieu-Daudé wrote: Simplify by always passing a MemoryRegion property to the device. Doing so we can move the AddressSpace field to the device struct, removing need for heap allocation. Update the MicroVM machine to pass the default system memory instead of a

[PATCH v2 22/43] bsd-user: Include more things in qemu.h

2021-08-26 Thread imp
From: Warner Losh Include more header files to match bsd-user fork. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 5e4cbb40d4..55d71130bb 100644 --- a/bsd-user/qemu.h +++

[PATCH v2 14/43] bsd-user: elfload: simplify bswap a bit.

2021-08-26 Thread imp
From: Warner Losh Reduce the number of ifdefs by always calling the swapping routine, but making them empty when swapping isn't needed. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/elfload.c | 97 ++ 1 file changed, 47

[PATCH v2 13/43] bsd-user: TARGET_NGROUPS unused in this file, remove

2021-08-26 Thread imp
From: Warner Losh Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 6aefc7a28b..5b3c061a45 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -19,8 +19,6

[PATCH v2 36/43] bsd-user: add stubbed out core dump support

2021-08-26 Thread imp
From: Warner Losh Add a stubbed-out version of the bsd-user fork's core dump support. This allows elfload.c to be almost the same between what's upstream and what's in qemu-project upstream w/o the burden of reviewing the core dump support. Signed-off-by: Stacey Son Signed-off-by: Warner Losh

[PATCH v2 41/43] bsd-user: Implement cpu_copy() helper routine

2021-08-26 Thread imp
From: Warner Losh cpu_copy shouldbe called when processes are creating new threads. It copies the current state of the CPU to a new cpu state needed for the new thread. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Signed-off-by: Justin Hibbits Reviewed-by: Richard Henderson ---

[PATCH v2 15/43] bsd-user: assume pthreads and support of __thread

2021-08-26 Thread imp
From: Warner Losh All compilers for some time have supported this. Follow linux-user and eliminate the #define THREAD and unconditionally insert __thread where needed. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/main.c | 2 +- bsd-user/qemu.h | 10 +- 2

[PATCH v2 10/43] bsd-user: implement path searching

2021-08-26 Thread imp
From: Warner Losh Use the PATH to find the executable given a bare argument. We need to do this so we can implement mixing native and emulated binaries (e.g., execing a x86 native binary from an emulated arm binary to optimize parts of the build). By finding the binary, we will know how to exec

[PATCH v2 26/43] bsd-user: *BSD specific siginfo defintions

2021-08-26 Thread imp
From: Warner Losh Add FreeBSD, NetBSD and OpenBSD values for the various signal info types and defines to decode different signals to discover more information about the specific signal types. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Acked-by: Richard Henderson ---

[PATCH v2 12/43] bsd-user: remove a.out support

2021-08-26 Thread imp
From: Warner Losh Remove still-born a.out support. The BSDs switched from a.out to ELF 20+ years ago. It's out of scope for bsd-user, and what little support there was would simply wind up at a not-implemented message. Simplify the whole mess by removing it entirely. Should future support be

[PATCH v2 37/43] bsd-user: elfload.c style catch up patch

2021-08-26 Thread imp
From: Warner Losh Various style fixes to elfload.c that were too painful to make earlier in this series. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/elfload.c | 210 ++--- 1 file changed, 105 insertions(+), 105 deletions(-)

[PATCH v2 27/43] bsd-user: Move stack initializtion into a per-os file.

2021-08-26 Thread imp
From: Warner Losh Move all of the stack initialization into target_os_stack.h. Each BSD sets up processes a little differently. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_stack.h | 180 +

[PATCH v2 11/43] bsd-user: Eliminate elf personality

2021-08-26 Thread imp
From: Warner Losh The linux kernel supports a number of different ELF binaries. The Linux userland emulator inheritted some of that. And we inheritted it from there. However, for BSD there's only one kind of ELF file supported per platform, so there's no need to cope with historical quirks.

[PATCH v2 09/43] bsd-user: Fix calculation of size to allocate

2021-08-26 Thread imp
From: Warner Losh It was incorrect to subtract off the size of an unsigned int here. In bsd-user fork, this change was made when moving the arch specific items to specific files. The size in BSD that's available for the arguments does not need a return address subtracted from it.

[PATCH v2 35/43] bsd-user: Add target_os_user.h to capture the user/kernel structures

2021-08-26 Thread imp
From: Warner Losh This file evolved over the years to capture the user/kernel interfaces, including those that changed over time. Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Warner Losh Acked-by: Richard Henderson --- bsd-user/freebsd/target_os_user.h | 429

[PATCH v2 08/43] bsd-user: pass the bsd_param into loader_exec

2021-08-26 Thread imp
From: Warner Losh Pass the bsd_param into loader_exec, and adjust. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 37 +++-- bsd-user/main.c| 7 ++- bsd-user/qemu.h| 3 ++- 3 files changed, 27 insertions(+), 20

[PATCH v2 19/43] bsd-user: start to move target CPU functions to target_arch*

2021-08-26 Thread imp
From: Warner Losh Move the CPU functons into target_arch_cpu.c that are unique to each CPU. These are defined in target_arch.h. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch.h | 31 +

[PATCH v2 07/43] bsd-user: move arch specific defines out of elfload.c

2021-08-26 Thread imp
From: Warner Losh Move the arcitecture specific defines to target_arch_elf.h and delete them from elfload.c. unifdef as appropriate for i386 vs x86_64 versions. Add the copyright/license comments, and guard ifdefs. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson ---

[PATCH v2 25/43] bsd-user: Add architecture specific signal tramp code

2021-08-26 Thread imp
From: Warner Losh Add a stubbed out version of setup_sigtramp. This is not yet used for x86, but is used for other architectures. This will be connected in future commits. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson ---

[PATCH v2 00/43] bsd-user updates to run hello world

2021-08-26 Thread imp
From: Warner Losh This series of patches gets me to the point that I can run "Hello World" on i386 and x86_64. This is for static binaries only, that are relatively small, but it's better than the 100% instant mmap failre that is the current state of all things bsd-user in upstream qemu. Future

[PATCH v2 06/43] bsd-user: Remove all non-x86 code from elfload.c

2021-08-26 Thread imp
From: Warner Losh bsd-user only builds x86 at the moment. Remove all non x86 code from elfload.c. We'll move the x86 code to {i386,x86_64}/target_arch_elf.h and bring it that support code from the forked bsd-user when the time comes. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson

[PATCH v2 04/43] bsd-user: add license to bsdload.c

2021-08-26 Thread imp
From: Warner Losh Pull in the license statement at the top of the bsdload.c file from the bsd-user fork version of this file. No functional changes. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 17 - 1 file changed, 16 insertions(+), 1

[PATCH v2 16/43] bsd-user: add host-os.h

2021-08-26 Thread imp
From: Warner Losh Host OS specific bits for this implementation go in this file. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/host-os.h | 23 +++ bsd-user/netbsd/host-os.h | 23 +++

[PATCH v2 05/43] bsd-user: style nits: bsdload.c whitespace to qemu standard

2021-08-26 Thread imp
From: Warner Losh Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 0ade58b9e2..ec71c5e923 100644 --- a/bsd-user/bsdload.c +++

[PATCH v2 01/43] bsd-user: remove sparc and sparc64

2021-08-26 Thread imp
From: Warner Losh These are broken here and in the bsd-user fork. They won't be fixed as FreeBSD has dropped support for sparc. If people wish to support this in other BSDs, you're better off starting over than starting from these files. Signed-off-by: Warner Losh Reviewed-by: Richard

[PATCH v2 03/43] bsd-user: Add Stacey's copyright to main.c

2021-08-26 Thread imp
From: Warner Losh Add Stacey's updated copyright to main.c Signed-off-by: Warner Losh Signed-off-by: Stacey Son Reviewed-by: Richard Henderson --- bsd-user/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index

[PATCH v2 02/43] bsd-user: add copyright header to elfload.c

2021-08-26 Thread imp
From: Warner Losh Add Stacey's copyright to elfload.c Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/elfload.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c

Re: [PATCH v3 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-26 Thread Mark Cave-Ayland
On 26/08/2021 21:07, Philippe Mathieu-Daudé wrote: Do not ignore eventual error if we failed at setting the 'host' property of the TYPE_XHCI model. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v3 1/3] hw/pci: Introduce pci_dma_memory_region() helper

2021-08-26 Thread Mark Cave-Ayland
On 26/08/2021 21:07, Philippe Mathieu-Daudé wrote: pci_get_address_space() returns an AddressSpace. In some cases we want a MemoryRegion. Add the pci_dma_memory_region() equivalent helper. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 5 + 1 file changed, 5

[PATCH v3 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-26 Thread Philippe Mathieu-Daudé
Do not ignore eventual error if we failed at setting the 'host' property of the TYPE_XHCI model. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index

[PATCH v3 3/3] hw/usb/xhci: Always expect 'dma' link property to be set

2021-08-26 Thread Philippe Mathieu-Daudé
Simplify by always passing a MemoryRegion property to the device. Doing so we can move the AddressSpace field to the device struct, removing need for heap allocation. Update the MicroVM machine to pass the default system memory instead of a NULL value. We don't need to change the Versal machine,

[PATCH v3 0/3] hw/usb: Always expect 'dma' link property to be set to simplify

2021-08-26 Thread Philippe Mathieu-Daudé
Simplify the XHCI based devices by always passing a MemoryRegion property to the device. Doing so we can move the AddressSpace field to the device struct, removing need for heap allocation. Since v2: - Use _abort (Eduardo) Philippe Mathieu-Daudé (3): hw/pci: Introduce pci_dma_memory_region()

[PATCH v3 1/3] hw/pci: Introduce pci_dma_memory_region() helper

2021-08-26 Thread Philippe Mathieu-Daudé
pci_get_address_space() returns an AddressSpace. In some cases we want a MemoryRegion. Add the pci_dma_memory_region() equivalent helper. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/hw/pci/pci.h

[PATCH v2 09/11] util/vfio-helpers: Simplify qemu_vfio_dma_map() returning directly

2021-08-26 Thread Philippe Mathieu-Daudé
To simplify qemu_vfio_dma_map(): - reduce 'ret' (returned value) scope by returning errno directly, - remove the goto 'out' label. Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git

  1   2   3   4   >