Re: [PATCH 3/5] qemu-options: Remove the deprecated -async-teardown option

2024-01-12 Thread Claudio Imbrenda
On Fri, 12 Jan 2024 11:00:57 +0100 Thomas Huth wrote: > It's been marked as deprecated since QEMU 8.1 (and was only available > since QEMU 8.0 anyway), so it should be fine to remove this now. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > docs/ab

Re: [PATCH v2] target/s390x/kvm/pv: Provide some more useful information if decryption fails

2024-01-11 Thread Claudio Imbrenda
certain *execution with that fixed: Reviewed-by: Claudio Imbrenda > host key. However, if you still (accidentally) do it, you only get a > very user-unfriendly error message that looks like this: > > qemu-system-s390x: KVM PV command 2 (KVM_PV_SET_SEC_PARMS) failed: > header rc 108 rrc

Re: [PATCH] target/s390x/kvm/pv: Provide some more useful information if decryption fails

2024-01-09 Thread Claudio Imbrenda
rovide at least a somewhat nicer hint to the users so that they > are able to figure out what might have gone wrong. > > Buglink: https://issues.redhat.com/browse/RHEL-18212 > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > target/s390x/kvm/pv.c | 20 +

Re: [PATCH v2 3/3] target/s390x/arch_dump: Add arch cleanup function for PV dumps

2023-11-09 Thread Claudio Imbrenda
he dump file. > > Let's add a cleanup function that tries to do a dump end. The dump > completion data is discarded but there's no point in writing it to a > file anyway if there's a possibility that other PV dump data is > missing. > > Signed-off-by: Janosch Frank Reviewed-by: C

Re: [PATCH 2/4] target/s390x/dump: Remove unneeded dump info function pointer init

2023-11-07 Thread Claudio Imbrenda
On Tue, 7 Nov 2023 14:20:46 + Janosch Frank wrote: > dump_state_prepare() now sets the fucntion pointers to NULL so we only > need to touch them if we're going to use them. > > Signed-off-by: Janosch Frank I would merge this and the previous patch > --- > target/s390x/arch_dump.c | 4

Re: [PATCH] MAINTAINERS: Fix a couple s390 paths

2023-10-20 Thread Claudio Imbrenda
On Fri, 20 Oct 2023 16:15:09 +0200 Eric Farman wrote: > These are simple typos, since the directories don't exist but the > files themselves do in hw/s390x/ > > Fixes: 56e3483402 ("MAINTAINERS: split out s390x sections") > Signed-off-by: Eric Farman Revi

Re: util/async-teardown.c: is it really needed for --disable-system build?

2023-08-14 Thread Claudio Imbrenda
On Mon, 14 Aug 2023 10:12:35 +0300 Michael Tokarev wrote: > 14.08.2023 10:01, Claudio Imbrenda wrote: > > > I think we could guard the offending item with CONFIG_SOFTMMU for now, > > to immediately fix the issues you raised, and do the refactoring you > > propose

Re: util/async-teardown.c: is it really needed for --disable-system build?

2023-08-14 Thread Claudio Imbrenda
On Sat, 12 Aug 2023 12:48:14 +0300 Michael Tokarev wrote: > 12.08.2023 12:38, Michael Tokarev wrote: > ... > > It smells like, at the very least, os-posix.c should be split. We shouldn't > > include > > a ton of qemu-system functionality (like very specific option parsing) into > > qemu-nbd >

Re: [PATCH] os-posix: Allow 'chroot' via '-run-with' and deprecate the old '-chroot' option

2023-06-30 Thread Claudio Imbrenda
) and that the options become introspectable via QMP this way. > So let's start moving more switches into this option group, starting > with "-chroot" now. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > docs/about/deprecate

Re: [PATCH v3 7/7] pc-bios/s390-ccw: Don't use __bss_start with the "larl" instruction

2023-06-29 Thread Claudio Imbrenda
On Thu, 29 Jun 2023 13:12:26 +0200 Thomas Huth wrote: > On 29/06/2023 12.58, Claudio Imbrenda wrote: > > On Thu, 29 Jun 2023 12:48:21 +0200 > > Thomas Huth wrote: > > > >> start.S currently cannot be compiled with Clang 16 and binutils 2.40: > >> &g

Re: [PATCH v3 1/7] s390-ccw: Getting rid of ulong

2023-06-29 Thread Claudio Imbrenda
30510143925.4094-4-quint...@redhat.com> > Reviewed-by: Thomas Huth Reviewed-by: Claudio Imbrenda > Signed-off-by: Thomas Huth > --- > pc-bios/s390-ccw/helper.h| 2 +- > pc-bios/s390-ccw/s390-ccw.h | 7 +++ > pc-bios/s390-ccw/virtio-scsi.h | 2 +- > pc-bi

Re: [PATCH v3 7/7] pc-bios/s390-ccw: Don't use __bss_start with the "larl" instruction

2023-06-29 Thread Claudio Imbrenda
On Thu, 29 Jun 2023 12:48:21 +0200 Thomas Huth wrote: > start.S currently cannot be compiled with Clang 16 and binutils 2.40: > > ld: start.o(.text+0x8): misaligned symbol `__bss_start' (0xc1e5) for > relocation R_390_PC32DBL > > According to the built-in linker script of ld, the symbol

Re: [PATCH] pc-bios/s390-ccw: Get rid of the the __u* types

2023-06-27 Thread Claudio Imbrenda
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/drivers/s390/cio/cio.h?id=cd6b4f27b9bb2a > > So we should get rid of the __u* in the s390-ccw bios now finally, too. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > Ba

Re: [PATCH v2 3/4] pc-bios/s390-ccw: Move the stack array into start.S

2023-06-27 Thread Claudio Imbrenda
ing it to page > boundaries. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > pc-bios/s390-ccw/s390-ccw.h | 1 - > pc-bios/s390-ccw/main.c | 1 - > pc-bios/s390-ccw/netmain.c | 1 - > pc-bios/s390-ccw/start.S| 6 ++ > 4 files changed, 6 i

Re: [PATCH v2 1/4] pc-bios/s390-ccw: Fix indentation in start.S

2023-06-27 Thread Claudio Imbrenda
390x/ folder already, so let's adjust start.S accordingly. > > Reviewed-by: Cédric Le Goater > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > pc-bios/s390-ccw/start.S | 136 +++ > 1 file changed, 68 insertions(+), 68 deletion

Re: [PATCH v2 4/4] pc-bios/s390-ccw: Don't use __bss_start with the "larl" instruction

2023-06-27 Thread Claudio Imbrenda
ZE - 160 /* Set up stack */ > > /* clear bss */ > -larl%r2,__bss_start > +larl%r2,.bss > larl %r3,_end since we are here, do you have guarantees that _end is always correctly aligned? if so: Reviewed-by: Claudio Imbrenda > slgr%r3,%r2/* get sizeof bss */ > ltgr%r3,%r3/* bss empty? */

Re: [PATCH v2 2/4] pc-bios/s390-ccw: Provide space for initial stack frame in start.S

2023-06-27 Thread Claudio Imbrenda
t, add a proper STACK_SIZE macro for the stack size > instead of using magic numbers (this is also required for the following > patch). > > Reviewed-by: Christian Borntraeger > Reviewed-by: Cédric Le Goater > Signed-off-by: Thomas Huth with Marc's suggestion applie

Re: [PATCH v3 4/6] util/osdep: Introduce qemu_close_range()

2023-06-19 Thread Claudio Imbrenda
On Sat, 17 Jun 2023 13:36:19 +0800 Bin Meng wrote: > This introduces a new QEMU API qemu_close_range() that closes all > open file descriptors from first to last (included). > > This API will try a more efficient call to close_range(), or walk > through of /proc/self/fd whenever these are

Re: [PATCH v3 3/6] util/async-teardown: Fall back to close fds one by one

2023-06-19 Thread Claudio Imbrenda
On Sat, 17 Jun 2023 13:36:18 +0800 Bin Meng wrote: > When opening /proc/self/fd fails, current codes just return directly, > but we can fall back to close fds one by one. > > Signed-off-by: Bin Meng > > --- > > (no changes since v2) > > Changes in v2: > - new patch: "util/async-teardown:

Re: [PATCH v3 6/6] net: tap: Use qemu_close_range() to close fds

2023-06-19 Thread Claudio Imbrenda
On Sat, 17 Jun 2023 13:36:21 +0800 Bin Meng wrote: > From: Zhangjin Wu > > Current codes using a brute-force traversal of all file descriptors > do not scale on a system where the maximum number of file descriptors > is set to a very large value (e.g.: in a Docker container of Manjaro >

Re: [PATCH v3 5/6] util/async-teardown: Use qemu_close_range() to close fds

2023-06-19 Thread Claudio Imbrenda
On Sat, 17 Jun 2023 13:36:20 +0800 Bin Meng wrote: > From: Zhangjin Wu > > Based on the old close_all_open_fd() of util/async-teardown.c, a new > generic qemu_close_range() has been added in osdep.c. > > Now, let's switch over to use the generic qemu_close_range(). > > Signed-off-by:

[PATCH v2 0/1] s390x/pv: Fix spurious warning with asynchronous teardown

2023-05-10 Thread Claudio Imbrenda
machine state to s390_pv_vm_try_disable_async instead of using qdev_get_machine() [thomas] * Update and improve patch description and comments Claudio Imbrenda (1): s390x/pv: Fix spurious warning with asynchronous teardown hw/s390x/pv.c | 10 -- hw/s390x/s390-virtio-ccw.c | 2 +- inc

[PATCH v2 1/1] s390x/pv: Fix spurious warning with asynchronous teardown

2023-05-10 Thread Claudio Imbrenda
ronous teardown for reboot") Link: https://lore.kernel.org/all/20230421085036.52511-2-imbre...@linux.ibm.com/ Signed-off-by: Claudio Imbrenda --- hw/s390x/pv.c | 10 -- hw/s390x/s390-virtio-ccw.c | 2 +- include/hw/s390x/pv.h | 2 +- 3 files changed, 10 insertions(+),

Re: [PATCH v1 1/1] s390x/pv: Fix spurious warning with asynchronous teardown

2023-05-10 Thread Claudio Imbrenda
On Wed, 10 May 2023 08:47:08 +0200 Thomas Huth wrote: > On 09/05/2023 18.27, Claudio Imbrenda wrote: > > When rebooting a small VM using asynchronous teardown, a spurious > > warning is emitted when the KVM_PV_ASYNC_CLEANUP_PREPARE ioctl fails. > > Why does the _PREPARE f

[PATCH v1 1/1] s390x/pv: Fix spurious warning with asynchronous teardown

2023-05-09 Thread Claudio Imbrenda
pointless overhead; normal teardown is fast enough for small VMs. Reported-by: Marc Hartmayer Fixes: c3a073c610 ("s390x/pv: Add support for asynchronous teardown for reboot") Signed-off-by: Claudio Imbrenda --- hw/s390x/pv.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff

[PATCH v7 1/1] util/async-teardown: wire up query-command-line-options

2023-05-05 Thread Claudio Imbrenda
ot;os-posix: asynchronous teardown for shutdown on Linux") Signed-off-by: Claudio Imbrenda --- docs/about/deprecated.rst | 5 + os-posix.c| 13 + qemu-options.hx | 34 +++--- util/async-teardown.c | 21 ++

[PATCH v7 0/1] util/async-teardown: appear in query-command-line-options

2023-05-05 Thread Claudio Imbrenda
rdown option so that it points to the new teardown option v1->v2 * remove the unneeded .implied_opt_name initializer [Thomas] Claudio Imbrenda (1): util/async-teardown: wire up query-command-line-options docs/about/deprecated.rst | 5 + os-posix.c| 13 + qemu-options

Re: [PATCH v6 1/1] util/async-teardown: wire up query-command-line-options

2023-04-28 Thread Claudio Imbrenda
On Fri, 28 Apr 2023 14:16:42 +0200 Thomas Huth wrote: > On 28/04/2023 13.12, Claudio Imbrenda wrote: > > Add new -run-with option with an async-teardown=on|off parameter. It is > > visible in the output of query-command-line-options QMP command, so it > > can be discovere

[PATCH v6 1/1] util/async-teardown: wire up query-command-line-options

2023-04-28 Thread Claudio Imbrenda
ot;os-posix: asynchronous teardown for shutdown on Linux") Signed-off-by: Claudio Imbrenda --- docs/about/deprecated.rst | 5 + os-posix.c| 15 +++ qemu-options.hx | 34 +++--- util/async-teardown.c | 21 ++

[PATCH v6 0/1] util/async-teardown: appear in query-command-line-options

2023-04-28 Thread Claudio Imbrenda
mediately instead of returning an error [thomas] v2->v3 * add a new teardown option with an async parameter [Markus] * reworded documentation of existing -async-teardown option so that it points to the new teardown option v1->v2 * remove the unneeded .implied_opt_name initializer [Thomas] Clau

[PATCH v5 0/1] util/async-teardown: appear in query-command-line-options

2023-03-27 Thread Claudio Imbrenda
v2->v3 * add a new teardown option with an async parameter [Markus] * reworded documentation of existing -async-teardown option so that it points to the new teardown option v1->v2 * remove the unneeded .implied_opt_name initializer [Thomas] Claudio Imbrenda (1): util/async-teardown: w

[PATCH v5 1/1] util/async-teardown: wire up query-command-line-options

2023-03-27 Thread Claudio Imbrenda
, but it was introduced only in the previous version and it had no users, since it was not visible in the query-command-line-options QMP command. Drop it. Reported-by: Boris Fiuczynski Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux") Signed-off-by: Claudio Imbrenda ---

[PATCH v4 0/1] util/async-teardown: wire up query-command-line-options

2023-03-27 Thread Claudio Imbrenda
points to the new teardown option v1->v2 * remove the unneeded .implied_opt_name initializer [Thomas] Claudio Imbrenda (1): util/async-teardown: wire up query-command-line-options os-posix.c| 15 +-- qemu-options.hx | 33 +++-- u

[PATCH v4 1/1] util/async-teardown: wire up query-command-line-options

2023-03-27 Thread Claudio Imbrenda
Signed-off-by: Claudio Imbrenda --- os-posix.c| 15 +-- qemu-options.hx | 33 +++-- util/async-teardown.c | 21 + 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/os-posix.c b/os-posix.c index

Re: [PATCH v3 1/1] util/async-teardown: wire up query-command-line-options

2023-03-24 Thread Claudio Imbrenda
On Fri, 24 Mar 2023 18:56:06 +0100 Thomas Huth wrote: > On 24/03/2023 18.45, Claudio Imbrenda wrote: > > The recently introduced -async-teardown commandline option was not > > wired up properly and did not show up in the output of the QMP command > > query-command-lin

[PATCH v3 1/1] util/async-teardown: wire up query-command-line-options

2023-03-24 Thread Claudio Imbrenda
wiring up the commandline option so that it appears in the output of query-command-line-options. Reported-by: Boris Fiuczynski Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux") Signed-off-by: Claudio Imbrenda --- os-posix.c| 14 ++ qemu-

[PATCH v3 0/1] util/async-teardown: wire up query-command-line-options

2023-03-24 Thread Claudio Imbrenda
nts to the new teardown option v1->v2 * remove the unneeded .implied_opt_name initializer [Thomas] Claudio Imbrenda (1): util/async-teardown: wire up query-command-line-options os-posix.c| 14 ++ qemu-options.hx | 35 --- util/async-tear

Re: [PATCH v2 1/1] util/async-teardown: wire up query-command-line-options

2023-03-20 Thread Claudio Imbrenda
On Mon, 20 Mar 2023 17:05:07 +0100 Markus Armbruster wrote: > Thomas Huth writes: > > > On 20/03/2023 16.31, Markus Armbruster wrote: > >> Claudio Imbrenda writes: > >> > >>> The recently introduced -async-teardown commandline option was not &

[PATCH v2 0/1] util/async-teardown: wire up query-command-line-options

2023-03-20 Thread Claudio Imbrenda
wiring up the commandline option so that it appears in the output of query-command-line-options. v1->v2 * remove the unneeded .implied_opt_name initializer [Thomas] Claudio Imbrenda (1): util/async-teardown: wire up query-command-line-options util/async-teardown.c | 17 + 1 f

[PATCH v2 1/1] util/async-teardown: wire up query-command-line-options

2023-03-20 Thread Claudio Imbrenda
wiring up the commandline option so that it appears in the output of query-command-line-options. Reported-by: Boris Fiuczynski Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux") Signed-off-by: Claudio Imbrenda --- util/async-teardown.c | 17 + 1 fi

Re: [PATCH v1 1/1] util/async-teardown: wire up query-command-line-options

2023-03-20 Thread Claudio Imbrenda
On Mon, 20 Mar 2023 09:56:05 +0100 Thomas Huth wrote: > On 20/03/2023 08.48, Claudio Imbrenda wrote: > > The recently introduced -async-teardown commandline option was not > > wired up properly and did not show up in the output of the QMP command > > query-command-lin

[PATCH v1 1/1] util/async-teardown: wire up query-command-line-options

2023-03-20 Thread Claudio Imbrenda
wiring up the commandline option so that it appears in the output of query-command-line-options. Reported-by: Boris Fiuczynski Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux") Signed-off-by: Claudio Imbrenda --- util/async-teardown.c | 18 ++ 1 fi

[PATCH v3 0/2] s390x/pv: Add support for asynchronous teardown for reboot

2023-02-14 Thread Claudio Imbrenda
e name of the thread directly * make the name of the thread more understandable Claudio Imbrenda (2): Linux header update s390x/pv: Add support for asynchronous teardown for reboot hw/s390x/pv.c | 28 hw/s390x/s390-virtio-ccw.c | 5 - include/hw/s390

[PATCH v3 1/2] Linux header update

2023-02-14 Thread Claudio Imbrenda
Update kvm.h Linux header with these commits: 8c516b25d6e9 ("KVM: s390: pv: add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE") fb491d5500a7 ("KVM: s390: pv: asynchronous destroy for reboot") Signed-off-by: Claudio Imbrenda --- linux-headers/linux/kvm.h | 3 +++ 1 file changed, 3

[PATCH v3 2/2] s390x/pv: Add support for asynchronous teardown for reboot

2023-02-14 Thread Claudio Imbrenda
. This considerably speeds up the reboot of a protected VM; for large VMs especially, it could take a long time to perform a reboot with the traditional synchronous teardown, while with this patch it is almost immediate. Signed-off-by: Claudio Imbrenda --- hw/s390x/pv.c | 28

Re: [PATCH v2 2/2] s390x/pv: Add support for asynchronous teardown for reboot

2023-01-17 Thread Claudio Imbrenda
On Tue, 17 Jan 2023 09:53:46 +0100 Thomas Huth wrote: [...] > > +static void *s390_pv_do_unprot_async_fn(void *p) > > +{ > > + s390_pv_cmd_exit(KVM_PV_ASYNC_CLEANUP_PERFORM, NULL); > > + return NULL; > > +} > > + > > +bool s390_pv_vm_try_disable_async(void) > > +{ > > +QemuThread

[PATCH v2 0/2] s390x/pv: Add support for asynchronous teardown for reboot

2023-01-05 Thread Claudio Imbrenda
teardown, the rebooted guest will be able to continue immediately, while a background thread actually performs the necessary cleanup. v1->v2: * remove useless snprintf and pass the name of the thread directly * make the name of the thread more understandable Claudio Imbrenda (2): Linux header upd

[PATCH v2 2/2] s390x/pv: Add support for asynchronous teardown for reboot

2023-01-05 Thread Claudio Imbrenda
. This considerably speeds up the reboot of a protected VM; for large VMs especially, it could take a long time to perform a reboot with the traditional synchronous teardown, while with this patch it is almost immediate. Signed-off-by: Claudio Imbrenda --- hw/s390x/pv.c | 25

[PATCH v2 1/2] Linux header update

2023-01-05 Thread Claudio Imbrenda
Signed-off-by: Claudio Imbrenda --- linux-headers/linux/kvm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index ebdafa576d..122b273433 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1175,6 +1175,7

Re: [PATCH 2/5] s390x/pv: Implement CGS check handler

2023-01-05 Thread Claudio Imbrenda
On Thu, 5 Jan 2023 12:42:54 +0100 Thomas Huth wrote: > On 04/01/2023 12.51, Cédric Le Goater wrote: > > From: Cédric Le Goater > > > > When a protected VM is started with the maximum number of CPUs (248), > > the service call providing information on the CPUs requires more > > buffer space

Re: [PATCH 4/5] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-05 Thread Claudio Imbrenda
On Wed, 4 Jan 2023 12:51:10 +0100 Cédric Le Goater wrote: > From: Cédric Le Goater > > If a secure kernel is started in a non-protected VM, the OS will hang > during boot without giving a proper error message to the user. > > Perform the checks on Confidential Guest support at runtime with

Re: [PATCH v1 2/2] s390x/pv: Add support for asynchronous teardown for reboot

2023-01-03 Thread Claudio Imbrenda
On Tue, 3 Jan 2023 12:27:32 +0100 Thomas Huth wrote: > On 22/12/2022 16.04, Claudio Imbrenda wrote: > > This patch adds support for the asynchronous teardown for reboot for > > protected VMs. > [...] > > +bool s390_pv_vm_try_disable_async(void) > > +{ > > +

[PATCH v1 1/2] Linux header update

2022-12-22 Thread Claudio Imbrenda
Signed-off-by: Claudio Imbrenda --- linux-headers/linux/kvm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index ebdafa576d..122b273433 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1175,6 +1175,7

[PATCH v1 0/2] s390x/pv: Add support for asynchronous teardown for reboot

2022-12-22 Thread Claudio Imbrenda
teardown, the rebooted guest will be able to continue immediately, while a background thread actually performs the necessary cleanup. Claudio Imbrenda (2): Linux header update s390x/pv: Add support for asynchronous teardown for reboot hw/s390x/pv.c | 28

[PATCH v1 2/2] s390x/pv: Add support for asynchronous teardown for reboot

2022-12-22 Thread Claudio Imbrenda
. This considerably speeds up the reboot of a protected VM; for large VMs especially, it could take a long time to perform a reboot with the traditional synchronous teardown, while with this patch it is almost immediate. Signed-off-by: Claudio Imbrenda --- hw/s390x/pv.c | 28

Re: [PATCH] docs/system/s390x: Document the "loadparm" machine property

2022-11-14 Thread Claudio Imbrenda
> > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2128235 > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > docs/system/s390x/bootdevices.rst | 26 ++ > 1 file changed, 26 insertions(+) > > diff --git a/docs/system/s390x/bootdevices.rst &g

[PATCH] s390x/pv: remove semicolon from macro definition

2022-10-10 Thread Claudio Imbrenda
Remove spurious semicolon at the end of the macro s390_pv_cmd Signed-off-by: Claudio Imbrenda --- hw/s390x/pv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c index 401b63d6cb..9bcd5d829f 100644 --- a/hw/s390x/pv.c +++ b/hw/s390x/pv.c @@ -45,7

[PATCH v4 1/1] os-posix: asynchronous teardown for shutdown on Linux

2022-08-12 Thread Claudio Imbrenda
th libvirt by adding the following to the XML domain definition to pass the parameter to qemu directly: http://libvirt.org/schemas/domain/qemu/1.0;> Signed-off-by: Claudio Imbrenda Reviewed-by: Murilo Opsfelder Araujo Tested-by: Murilo Opsfelder Araujo --- include/qemu/async-tea

Re: [PATCH v3 1/1] os-posix: asynchronous teardown for shutdown on Linux

2022-08-12 Thread Claudio Imbrenda
On Fri, 12 Aug 2022 08:38:59 -0300 Murilo Opsfelder Araújo wrote: > On 8/12/22 04:26, Claudio Imbrenda wrote: > > On Thu, 11 Aug 2022 23:05:52 -0300 > > Murilo Opsfelder Araújo wrote: > > > >> On 8/11/22 11:02, Daniel P. Berrangé wrote: > >> [...] &

Re: [PATCH v3 1/1] os-posix: asynchronous teardown for shutdown on Linux

2022-08-12 Thread Claudio Imbrenda
On Thu, 11 Aug 2022 23:05:52 -0300 Murilo Opsfelder Araújo wrote: > On 8/11/22 11:02, Daniel P. Berrangé wrote: > [...] > >>> Hmm, I was hoping you could just use SIGKILL to guarantee that this > >>> gets killed off. Is SIGKILL delivered too soon to allow for the > >>> main QEMU process to have

Re: [PATCH v3 1/1] os-posix: asynchronous teardown for shutdown on Linux

2022-08-11 Thread Claudio Imbrenda
On Thu, 11 Aug 2022 13:27:44 +0100 Daniel P. Berrangé wrote: > On Tue, Aug 09, 2022 at 08:40:24AM +0200, Claudio Imbrenda wrote: > > This patch adds support for asynchronously tearing down a VM on Linux. > > > > When qemu terminates, either naturally or because of a fat

Re: [PATCH v3 1/1] os-posix: asynchronous teardown for shutdown on Linux

2022-08-11 Thread Claudio Imbrenda
; diff --git a/include/qemu/async-teardown.h b/include/qemu/async-teardown.h > > new file mode 100644 > > index 00..092e7a37e7 > > --- /dev/null > > +++ b/include/qemu/async-teardown.h > > @@ -0,0 +1,22 @@ > > +/* > > + * Asynchronous teardo

Re: [PATCH v2 2/3] softmmu/physmem: Remove the ifdef __linux__ around the pagesize functions

2022-08-10 Thread Claudio Imbrenda
on all host architectures. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > softmmu/physmem.c | 17 - > 1 file changed, 17 deletions(-) > > diff --git a/softmmu/physmem.c b/softmmu/physmem.c > index dc3c3e5f2e..50231bab30 1006

Re: [PATCH v2 1/3] backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize()

2022-08-10 Thread Claudio Imbrenda
ps://bugzilla.redhat.com/show_bug.cgi?id=2116496 > Suggested-by: David Hildenbrand > Signed-off-by: Thomas Huth more removed lines than added, I like it Reviewed-by: Claudio Imbrenda > --- > backends/hostmem.c | 14 ++ > 1 file changed, 2 insertions(+), 12 delet

Re: [PATCH v2 0/3] Fix hugepages with memfd on s390x and clean up related code

2022-08-10 Thread Claudio Imbrenda
On Wed, 10 Aug 2022 14:57:17 +0200 Thomas Huth wrote: > The first patch fixes the problem that hugepages cannot be used via > the "memory-backend-memfd" object on s390x. The second and third patch > are some clean-ups that can be done after generalizing the code in the > first patch. thanks for

Re: [PATCH v2 3/3] util/mmap-alloc: Remove qemu_mempath_getpagesize()

2022-08-10 Thread Claudio Imbrenda
On Wed, 10 Aug 2022 14:57:20 +0200 Thomas Huth wrote: > The last user of this function has just been removed, so we can > drop this function now, too. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > include/qemu/mmap-alloc.h | 2 -- > util/mmap

[PATCH v3 1/1] os-posix: asynchronous teardown for shutdown on Linux

2022-08-09 Thread Claudio Imbrenda
u directly: http://libvirt.org/schemas/domain/qemu/1.0;> More advanced interfaces like pidfd or close_range have intentionally been avoided in order to be more compatible with older kernels. Signed-off-by: Claudio Imbrenda --- include/qemu/async-teardown.h | 22 +

Re: [PATCH v2 1/1] osdep: asynchronous teardown for shutdown on Linux

2022-08-05 Thread Claudio Imbrenda
On Thu, 4 Aug 2022 17:58:34 +0100 Daniel P. Berrangé wrote: > On Thu, Aug 04, 2022 at 09:20:59AM +0100, Daniel P. Berrangé wrote: > > On Thu, Aug 04, 2022 at 07:56:49AM +0200, Claudio Imbrenda wrote: > > > On Wed, 3 Aug 2022 18:34:45 +0100 > > >

Re: [PATCH v2 1/1] osdep: asynchronous teardown for shutdown on Linux

2022-08-05 Thread Claudio Imbrenda
On Thu, 4 Aug 2022 17:56:34 +0100 Daniel P. Berrangé wrote: > On Wed, Aug 03, 2022 at 07:31:41PM +0200, Claudio Imbrenda wrote: > > This patch adds support for asynchronously tearing down a VM on Linux. > > > > When qemu terminates, either naturally or because of a fat

Re: [PATCH v2 1/1] osdep: asynchronous teardown for shutdown on Linux

2022-08-05 Thread Claudio Imbrenda
On Thu, 4 Aug 2022 17:41:01 +0100 Daniel P. Berrangé wrote: > On Thu, Aug 04, 2022 at 04:49:29PM +0200, Claudio Imbrenda wrote: > > On Thu, 4 Aug 2022 09:29:39 +0100 > > Daniel P. Berrangé wrote: > > > > > On Wed, Aug 03, 2022 at 06:34:45PM +0100, Daniel P. Be

Re: [PATCH v2 1/1] osdep: asynchronous teardown for shutdown on Linux

2022-08-04 Thread Claudio Imbrenda
On Thu, 4 Aug 2022 09:29:39 +0100 Daniel P. Berrangé wrote: > On Wed, Aug 03, 2022 at 06:34:45PM +0100, Daniel P. Berrangé wrote: > > On Wed, Aug 03, 2022 at 07:31:41PM +0200, Claudio Imbrenda wrote: > > > This patch adds support for asynchronously tearing down a VM on Linux.

Re: [PATCH v2 1/1] osdep: asynchronous teardown for shutdown on Linux

2022-08-03 Thread Claudio Imbrenda
On Wed, 3 Aug 2022 18:34:45 +0100 Daniel P. Berrangé wrote: > On Wed, Aug 03, 2022 at 07:31:41PM +0200, Claudio Imbrenda wrote: > > This patch adds support for asynchronously tearing down a VM on Linux. > > > > When qemu terminates, either naturally or because of a fat

[PATCH v2 1/1] osdep: asynchronous teardown for shutdown on Linux

2022-08-03 Thread Claudio Imbrenda
ned-off-by: Claudio Imbrenda --- include/qemu/osdep.h | 2 ++ os-posix.c | 5 qemu-options.hx | 17 ++ util/osdep.c | 55 4 files changed, 79 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osde

Re: [PATCH v1 1/1] osdep: asynchronous teardown for shutdown on Linux

2021-12-06 Thread Claudio Imbrenda
On Mon, 6 Dec 2021 11:47:55 + Daniel P. Berrangé wrote: > On Mon, Dec 06, 2021 at 12:43:12PM +0100, Claudio Imbrenda wrote: > > On Mon, 6 Dec 2021 11:21:10 + > > Daniel P. Berrangé wrote: > > > > > On Mon, Dec 06, 2021 at 12:06:11PM +0100, Claudio Imbren

Re: [PATCH v1 1/1] osdep: asynchronous teardown for shutdown on Linux

2021-12-06 Thread Claudio Imbrenda
On Mon, 6 Dec 2021 11:21:10 + Daniel P. Berrangé wrote: > On Mon, Dec 06, 2021 at 12:06:11PM +0100, Claudio Imbrenda wrote: > > This patch adds support for asynchronously tearing down a VM on Linux. > > > > When qemu terminates, either naturally or because of a fat

[PATCH v1 1/1] osdep: asynchronous teardown for shutdown on Linux

2021-12-06 Thread Claudio Imbrenda
. The teardown process will share the same cgroups as qemu, so both memory usage and cpu time will be accounted properly. Signed-off-by: Claudio Imbrenda --- include/qemu/osdep.h | 2 ++ os-posix.c | 3 +++ qemu-options.hx | 17 util/osdep.c | 47

Re: [PATCH v1] s390x/tcg: fix and optimize SPX (SET PREFIX)

2021-08-05 Thread Claudio Imbrenda
let's not do anything in case the prefix doesn't change. also looks like a good idea Reviewed-by: Claudio Imbrenda > Cc: Richard Henderson > Cc: David Hildenbrand > Cc: Cornelia Huck > Cc: Thomas Huth > Cc: Claudio Imbrenda > Cc: qemu-s3...@nongnu.org > Signed-off-by: Da

Re: [PATCH v6 0/8] s390: Extended-Length SCCB & DIAGNOSE 0x318

2020-09-25 Thread Claudio Imbrenda
e. The alternative would be to allocate a static 4K for > > > the work_sccb. > > > > I had someone take a look at the patch for PV and was told > > everything looks sane. Since the patches have already been applied, > > it seems like it's too late to add a reviewed-

Re: [PATCH for-5.2 3/6] pc-bios/s390-ccw: Move the inner logic of find_subch() to a separate function

2020-08-04 Thread Claudio Imbrenda
On Tue, 4 Aug 2020 15:24:09 +0200 Thomas Huth wrote: > On 03/08/2020 10.46, Claudio Imbrenda wrote: > > On Tue, 28 Jul 2020 20:37:31 +0200 > > Thomas Huth wrote: > > > >> Move the code to a separate function to be able to re-use it from a > >> dif

Re: [PATCH for-5.2 3/6] pc-bios/s390-ccw: Move the inner logic of find_subch() to a separate function

2020-08-04 Thread Claudio Imbrenda
On Tue, 28 Jul 2020 20:37:31 +0200 Thomas Huth wrote: > Move the code to a separate function to be able to re-use it from a > different spot later. > > Signed-off-by: Thomas Huth > --- > pc-bios/s390-ccw/main.c | 99 > - 1 file changed, 57 >

Re: [PATCH for-5.2 5/6] pc-bios/s390-ccw: Scan through all boot devices if none has been specified

2020-08-04 Thread Claudio Imbrenda
On Tue, 28 Jul 2020 20:37:33 +0200 Thomas Huth wrote: > If no boot device has been specified (via "bootindex=..."), the > s390-ccw bios scans through all devices to find a bootable device. maybe a better title for the patch is "scan through all devices if no boot device specified" then, since

Re: [PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-07-29 Thread Claudio Imbrenda
> + > +int main(void) > +{ > +sclp_setup(); > +css_setup(); > +boot_setup(); > +find_boot_device(); > +enable_subchannel(blk_schid); > +ipl_boot_device(); > > panic("Failed to load OS from hard disk\n"); > return 0; /* make compiler happy */ Reviewed-by: Claudio Imbrenda

Re: [PATCH for-5.2 1/6] pc-bios/s390-ccw/Makefile: Compile with -std=gnu99, -fwrapv and -fno-common

2020-07-29 Thread Claudio Imbrenda
ct-aliasing > -fno-asynchronous-unwind-tables QEMU_CFLAGS += $(call cc-option, > $(QEMU_CFLAGS), -fno-stack-protector) +QEMU_CFLAGS += -msoft-float > -march=z900 +QEMU_CFLAGS += -std=gnu99 > LDFLAGS += -Wl,-pie -nostdlib > > build-all: s390-ccw.img s390-netboot.img Reviewed-by: Claudio Imbrenda

Re: [PATCH RFCv2 3/6] s390x/diag: implement diag260

2020-07-14 Thread Claudio Imbrenda
On Fri, 10 Jul 2020 17:12:36 +0200 David Hildenbrand wrote: > Let's implement diag260 - "Access Certain Virtual Machine > Information", used under z/VM to expose the storage configuration > (especially, layout of storage extends and thereby holes). For now, > the returned information is

Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV

2020-06-09 Thread Claudio Imbrenda
On Tue, 9 Jun 2020 11:41:30 +0200 Halil Pasic wrote: [...] > I don't know. Janosch could answer that, but he is on vacation. Adding > Claudio maybe he can answer. My understanding is, that while it might > be possible, it is ugly at best. The ability to do a transition is > indicated by a CPU

Re: [PATCH v10 01/16] s390x: Move diagnose 308 subcodes and rcs into ipl.h

2020-03-19 Thread Claudio Imbrenda
On Wed, 18 Mar 2020 10:30:32 -0400 Janosch Frank wrote: > They are part of the IPL process, so let's put them into the ipl > header. > > Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda > --- > hw/s390x/ipl.h | 11 +++ > target/s390x/diag.c

Re: [PATCH v9 09/15] s390x: protvirt: Set guest IPL PSW

2020-03-13 Thread Claudio Imbrenda
On Fri, 13 Mar 2020 15:21:07 +0100 Janosch Frank wrote: > On 3/13/20 1:57 PM, Claudio Imbrenda wrote: > > On Wed, 11 Mar 2020 09:21:45 -0400 > > Janosch Frank wrote: > > > >> Handling of CPU reset and setting of the IPL psw from guest > >> storage a

Re: [PATCH v9 09/15] s390x: protvirt: Set guest IPL PSW

2020-03-13 Thread Claudio Imbrenda
On Fri, 13 Mar 2020 15:21:07 +0100 Janosch Frank wrote: > On 3/13/20 1:57 PM, Claudio Imbrenda wrote: > > On Wed, 11 Mar 2020 09:21:45 -0400 > > Janosch Frank wrote: > > > >> Handling of CPU reset and setting of the IPL psw from guest > >> storage a

Re: [PATCH v9 15/15] s390x: Add unpack facility feature to GA1

2020-03-13 Thread Claudio Imbrenda
n't need HW > support */ set_bit(S390_FEAT_ZPCI, model->features); > set_bit(S390_FEAT_ADAPTER_EVENT_NOTIFICATION, model->features); Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 04/15] s390x: protvirt: Inhibit balloon when switching to protected mode

2020-03-13 Thread Claudio Imbrenda
error_free_or_abort(_mig_blocker); > return rc; > @@ -345,6 +349,7 @@ static int > s390_machine_protect(S390CcwMachineState *ms) /* Create SE VM */ > rc = s390_pv_vm_enable(); > if (rc) { > +qemu_balloon_inhibit(false); > error_report_err(local_err); > migrate_del_blocker(pv_mig_blocker); > error_free_or_abort(_mig_blocker); looks straightforward Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 09/15] s390x: protvirt: Set guest IPL PSW

2020-03-13 Thread Claudio Imbrenda
On Wed, 11 Mar 2020 09:21:45 -0400 Janosch Frank wrote: > Handling of CPU reset and setting of the IPL psw from guest storage at > offset 0 is done by a Ultravisor call. Let's only fetch it if > necessary. > > Signed-off-by: Janosch Frank > Reviewed-by: Thomas Huth > Reviewed-by: David

Re: [PATCH v9 03/15] s390x: protvirt: Add migration blocker

2020-03-13 Thread Claudio Imbrenda
+return rc; > +} > + > /* Create SE VM */ > rc = s390_pv_vm_enable(); > if (rc) { > +error_report_err(local_err); > +migrate_del_blocker(pv_mig_blocker); > +error_free_or_abort(_mig_blocker); > return rc; > } > looks rather straightforward Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 05/15] s390x: protvirt: KVM intercept changes

2020-03-13 Thread Claudio Imbrenda
(long)cs->kvm_run->psw_addr); > switch (icpt_code) { > case ICPT_INSTRUCTION: > +case ICPT_PV_INSTR: > +case ICPT_PV_INSTR_NOTIFICATION: > r = handle_instruction(cpu, run); > break; > case ICPT_PROGRAM: very straightforward Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 12/15] s390x: protvirt: Move IO control structures over SIDA

2020-03-13 Thread Claudio Imbrenda
On Wed, 11 Mar 2020 09:21:48 -0400 Janosch Frank wrote: > For protected guests, we need to put the IO emulation results into the > SIDA, so SIE will write them into the guest at the next entry. > > Signed-off-by: Janosch Frank > --- > target/s390x/ioinst.c | 87 >

Re: [PATCH v9 13/15] s390x: protvirt: Handle SIGP store status correctly

2020-03-13 Thread Claudio Imbrenda
r, > bool store_arch) hwaddr len = sizeof(*sa); > int i; > > +/* Storing will occur on next SIE entry for protected VMs */ > +if (s390_is_pv()) { > + return 0; > +} > + > sa = cpu_physical_memory_map(addr, , true); > if (!sa) { > return -EFAULT; Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 06/15] s390x: Add SIDA memory ops

2020-03-13 Thread Claudio Imbrenda
; +int ret; > + > + if (kvm_enabled()) { > +ret = kvm_s390_mem_op_pv(cpu, offset, hostbuf, len, > is_write); > +} else { > +/* Protected Virtualization is a KVM/Hardware only feature */ > +g_assert_not_reached(); > +} > +return ret; > +} > + > /** > * s390_cpu_virt_mem_rw: > * @laddr: the logical start address Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 14/15] docs: Add protvirt docs

2020-03-13 Thread Claudio Imbrenda
ludes the encrypted > +components (kernel, initrd, cmdline), the stage3a loader and > +metadata. In case this boot method is used, the command line > +options -initrd and -cmdline are ineffective. The preparation of a > PVM +image is done by genprotimg of the s390-tools package. Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 02/15] s390x: protvirt: Support unpack facility

2020-03-13 Thread Claudio Imbrenda
VALID 0x0402 > +#define DIAG_308_RC_NO_PV_CONF 0x0902 > > #define DIAG308_RESET_MOD_CLR 0 > #define DIAG308_RESET_LOAD_NORM 1 > @@ -59,10 +61,17 @@ int handle_diag_288(CPUS390XState *env, uint64_t > r1, uint64_t r3) #define DIAG308_LOAD_NORMAL_DUMP4 > #define DIAG308_SET 5 > #define DIAG308_STORE 6 > +#define DIAG308_PV_SET 8 > +#define DIAG308_PV_STORE9 > +#define DIAG308_PV_START10 > > static int diag308_parm_check(CPUS390XState *env, uint64_t r1, > uint64_t addr, uintptr_t ra, bool write) > { > +/* Handled by the Ultravisor */ > +if (s390_is_pv()) { > +return 0; > +} > if ((r1 & 1) || (addr & ~TARGET_PAGE_MASK)) { > s390_program_interrupt(env, PGM_SPECIFICATION, ra); > return -1; > @@ -93,6 +102,11 @@ void handle_diag_308(CPUS390XState *env, uint64_t > r1, uint64_t r3, uintptr_t ra) return; > } > > +if (subcode >= DIAG308_PV_SET && > !s390_has_feat(S390_FEAT_UNPACK)) { > +s390_program_interrupt(env, PGM_SPECIFICATION, ra); > +return; > +} > + > switch (subcode) { > case DIAG308_RESET_MOD_CLR: > s390_ipl_reset_request(cs, S390_RESET_MODIFIED_CLEAR); > @@ -105,6 +119,7 @@ void handle_diag_308(CPUS390XState *env, uint64_t > r1, uint64_t r3, uintptr_t ra) s390_ipl_reset_request(cs, > S390_RESET_REIPL); break; > case DIAG308_SET: > +case DIAG308_PV_SET: > if (diag308_parm_check(env, r1, addr, ra, false)) { > return; > } > @@ -128,10 +143,15 @@ out: > g_free(iplb); > return; > case DIAG308_STORE: > +case DIAG308_PV_STORE: > if (diag308_parm_check(env, r1, addr, ra, true)) { > return; > } > -iplb = s390_ipl_get_iplb(); > +if (subcode == DIAG308_PV_STORE) { > +iplb = s390_ipl_get_iplb_pv(); > +} else { > +iplb = s390_ipl_get_iplb(); > +} > if (iplb) { > cpu_physical_memory_write(addr, iplb, > be32_to_cpu(iplb->len)); env->regs[r1 + 1] = DIAG_308_RC_OK; > @@ -139,6 +159,15 @@ out: > env->regs[r1 + 1] = DIAG_308_RC_NO_CONF; > } > return; > +case DIAG308_PV_START: > +iplb = s390_ipl_get_iplb_pv(); > +if (!iplb) { > +env->regs[r1 + 1] = DIAG_308_RC_NO_PV_CONF; > +return; > +} > + > +s390_ipl_reset_request(cs, S390_RESET_PV); > +break; > default: > s390_program_interrupt(env, PGM_SPECIFICATION, ra); > break; with the two typos fixed and the fixup: Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 10/15] s390x: protvirt: Move diag 308 data over SIDA

2020-03-13 Thread Claudio Imbrenda
if (!iplb) { > env->regs[r1 + 1] = DIAG_308_RC_NO_CONF; > +return; > } > + > +if (!s390_is_pv()) { > +cpu_physical_memory_write(addr, iplb, > be32_to_cpu(iplb->len)); > +} else { > + s390_cpu_pv_mem_write(cpu, 0, iplb, > be32_to_cpu(iplb->len)); > +} > +env->regs[r1 + 1] = DIAG_308_RC_OK; > return; > case DIAG308_PV_START: > iplb = s390_ipl_get_iplb_pv(); Reviewed-by: Claudio Imbrenda

Re: [PATCH v9 08/15] s390x: protvirt: SCLP interpretation

2020-03-13 Thread Claudio Imbrenda
sclp_service_call_protected(env, sccb, code); > +break; > +case ICPT_INSTRUCTION: > +g_assert(!s390_is_pv()); > +r = sclp_service_call(env, sccb, code); > +if (r < 0) { > +kvm_s390_program_interrupt(cpu, -r); > +return; > +} > +setcc(cpu, r); > } > -setcc(cpu, r); > } > > static int handle_b2(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) Reviewed-by: Claudio Imbrenda

  1   2   >