Re: [PATCH v2] target/riscv: write back unmodified value for csrrc/csrrs with rs1 is not x0 but holding zero

2022-03-17 Thread Weiwei Li
在 2022/3/17 下午12:39, Alistair Francis 写道: On Thu, Mar 17, 2022 at 12:10 PM Weiwei Li wrote: 在 2022/3/17 上午6:35, Alistair Francis 写道: On Thu, Mar 17, 2022 at 1:13 AM Weiwei Li wrote: riscv_raise_exception(env, ret, GETPC()); @@ -90,7 +90,7 @@ void helper_csrw_i128(CPURISCVState

Re: [PATCH v6 08/12] target/riscv: Add sscofpmf extension support

2022-03-17 Thread Frank Chang
On Fri, Mar 4, 2022 at 8:06 AM Atish Patra wrote: > The Sscofpmf ('Ss' for Privileged arch and Supervisor-level extensions, > and 'cofpmf' for Count OverFlow and Privilege Mode Filtering) > extension allows the perf to handle overflow interrupts and filtering > support. This patch provides a fram

Re: [PATCH 2/3] hw/display: Allow vga_common_init() to return errors

2022-03-17 Thread Markus Armbruster
Thomas Huth writes: > On 16/03/2022 15.16, Markus Armbruster wrote: >> Thomas Huth writes: >> >>> On 16/03/2022 14.32, Philippe Mathieu-Daudé wrote: On 16/3/22 14:24, Thomas Huth wrote: > The vga_common_init() function currently cannot report errors to its > caller. But in the foll

Re: [PATCH v4] ppc64: Avoid pt_regs struct definition

2022-03-17 Thread Cédric Le Goater
Laurent, On 3/15/22 11:31, Peter Maydell wrote: On Tue, 15 Mar 2022 at 02:14, Richard Henderson wrote: On 3/14/22 18:57, Khem Raj wrote: Remove pt_regs indirection and instead reference gp_regs directly, this makes it portable across musl/glibc Use PT_* constants defined in asm/ptrace.h Mo

[PATCH 2/2] intel-iommu: update iq_dw during post load

2022-03-17 Thread Jason Wang
We need to update iq_dw according to the DMA_IRQ_REG during post load. Otherwise we may get wrong IOTLB invalidation descriptor after migration. Fixes: fb43cf739e ("intel_iommu: scalable mode emulation") Signed-off-by: Jason Wang --- hw/i386/intel_iommu.c | 21 +++-- 1 file chang

[PATCH 1/2] intel-iommu: update root_scalable before switching as during post_load

2022-03-17 Thread Jason Wang
We need check whether passthrough is enabled during vtd_switch_address_space() by checking the context entries. This requires the root_scalable to be set correctly otherwise we may try to check legacy rsvd bits instead of scalable ones. Fixing this by updating root_scalable before switching the ad

Re: [PATCH v7 00/46] CXl 2.0 emulation Support

2022-03-17 Thread Mark Cave-Ayland
On 16/03/2022 18:26, Jonathan Cameron via wrote: On Wed, 16 Mar 2022 17:58:46 + Jonathan Cameron wrote: On Wed, 16 Mar 2022 17:16:55 + Mark Cave-Ayland wrote: On 16/03/2022 16:50, Jonathan Cameron via wrote: On Thu, 10 Mar 2022 16:02:22 +0800 Peter Xu wrote: On Wed, Mar

Re: [PATCH v3 1/3] docs: Consistent typography for options of qemu-nbd

2022-03-17 Thread Daniel P . Berrangé
On Mon, Mar 14, 2022 at 03:38:16PM -0500, Eric Blake wrote: > Prefer the :option:`--name` form when cross-referencing other options > from the qemu-nbd documentation. > > Signed-off-by: Eric Blake > --- > docs/tools/qemu-nbd.rst | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-

Re: [PATCH v2] MAINTAINERS: change Vladimir's email address

2022-03-17 Thread Vladimir Sementsov-Ogievskiy
17.03.2022 00:36, Eric Blake wrote: On Wed, Mar 16, 2022 at 12:27:02PM +0300, Vladimir Sementsov-Ogievskiy wrote: Old vsement...@virtuozzo.com is not accessible anymore. Signed-off-by: Vladimir Sementsov-Ogievskiy --- v2: @ya.ru mailbox works bad with mailing lists and git send-email command,

[PATCH v2 0/3] Fix crash when adding a second ISA VGA device

2022-03-17 Thread Thomas Huth
QEMU currently abort()s if the user tries to add a second ISA VGA device, for example: $ ./qemu-system-x86_64 -device isa-vga -device isa-vga RAMBlock "vga.vram" already registered, abort! Aborted (core dumped) $ ./qemu-system-x86_64 -device isa-cirrus-vga -device isa-cirrus-vga RAMBlock "vga.vram

[PATCH v2 1/3] hw/display/cirrus_vga: Clean up indentation in pci_cirrus_vga_realize()

2022-03-17 Thread Thomas Huth
Most of the code in this function had been indented with 5 spaces instead of 4. Since 4 is our preferred style, remove one space in the bad lines here. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- hw/display/cirrus_vga.c | 57 + 1 fi

[PATCH v2 2/3] hw/display: Allow vga_common_init() to return errors

2022-03-17 Thread Thomas Huth
The vga_common_init() function currently cannot report errors to its caller. But in the following patch, we'd need this possibility, so let's change it to take an "Error **" as parameter for this. Signed-off-by: Thomas Huth --- hw/display/vga_int.h| 2 +- hw/display/ati.c|

[PATCH v2 3/3] hw/display/vga: Report a proper error when adding a 2nd ISA VGA

2022-03-17 Thread Thomas Huth
QEMU currently abort()s if the user tries to add a second ISA VGA device, for example: $ ./qemu-system-x86_64 -device isa-vga -device isa-vga RAMBlock "vga.vram" already registered, abort! Aborted (core dumped) $ ./qemu-system-x86_64 -device isa-cirrus-vga -device isa-cirrus-vga RAMBlock "vga.vram

Re: [PATCH v2 1/6] block: Support passing NULL ops to blk_set_dev_ops()

2022-03-17 Thread Kevin Wolf
Am 16.03.2022 um 13:18 hat Stefan Hajnoczi geschrieben: > On Tue, Mar 15, 2022 at 03:30:22PM -0400, John Snow wrote: > > On Tue, Mar 15, 2022 at 4:47 AM Stefan Hajnoczi wrote: > > > > > > On Mon, Mar 14, 2022 at 03:09:35PM -0400, John Snow wrote: > > > > On Mon, Mar 14, 2022 at 1:23 PM Stefan Hajn

Re: [PATCH 03/27] meson: use chardev_ss dependencies

2022-03-17 Thread Marc-André Lureau
Hi On Wed, Mar 16, 2022 at 1:52 PM wrote: > > From: Marc-André Lureau > > chardev subsystem/library doesn't use gnutls. Use the dedicated > chardev_ss.dependencies() instead. > > Signed-off-by: Marc-André Lureau > --- > meson.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > di

Re: [PATCH 1/4] target/i386: Fix sanity check on max APIC ID / X2APIC enablement

2022-03-17 Thread Igor Mammedov
re-sending reply as something went wrong with headers (I suspect Daniel's name formatting) and email got bounced back. On Wed, 16 Mar 2022 14:31:33 + David Woodhouse wrote: > On Wed, 2022-03-16 at 12:28 +0100, Igor Mammedov wrote: > > Generally Daniel is right, as long as it's something t

Re: [PATCH 04/27] meson: add util dependency for oslib-posix on freebsd

2022-03-17 Thread Marc-André Lureau
Hi On Wed, Mar 16, 2022 at 1:52 PM wrote: > > From: Marc-André Lureau > > kinfo_getproc() requires it. This is required for correctness and for the next patch, which moves qemu-openpty and its "util" dependency away from util_ss. Please review > > Signed-off-by: Marc-André Lureau > --- > ut

Re: [PATCH v3 2/5] python/utils: add VerboseProcessError

2022-03-17 Thread Hanna Reitz
On 08.03.22 02:57, John Snow wrote: This adds an Exception that extends the Python stdlib subprocess.CalledProcessError. The difference is that the str() method of this exception also adds the stdout/stderr logs. In effect, if this exception goes unhandled, Python will print the output in a visu

Re: [EXT] Re: QEMU+KVM on RISC-V + Hypervisor Extension

2022-03-17 Thread Peter Maydell
On Wed, 16 Mar 2022 at 22:23, Alistair Francis wrote: > Hmm... This seems like a bug. We shouldn't allow the user to specify a > `-bios` option if using KVM. Would you mind preparing a patch to catch > this? You don't want to allow the possibility of a bios blob that expects to run in S-mode, the

Re: [PATCH v6] target/riscv: Add isa extenstion strings to the device tree

2022-03-17 Thread Frank Chang
On Thu, Mar 17, 2022 at 1:58 AM Atish Patra wrote: > The Linux kernel parses the ISA extensions from "riscv,isa" DT > property. It used to parse only the single letter base extensions > until now. A generic ISA extension parsing framework was proposed[1] > recently that can parse multi-letter ISA

Re: [PATCH v20 2/7] net/vmnet: add vmnet backends to qapi/net

2022-03-17 Thread Markus Armbruster
Vladislav Yaroshchuk writes: > On Wed, Mar 16, 2022 at 4:58 PM Markus Armbruster wrote: > >> Vladislav Yaroshchuk writes: >> >> > Create separate netdevs for each vmnet operating mode: >> > - vmnet-host >> > - vmnet-shared >> > - vmnet-bridged >> > >> > Signed-off-by: Vladislav Yaroshchuk >> >

Re: [libvirt RFC] virFile: new VIR_FILE_WRAPPER_BIG_PIPE to improve performance

2022-03-17 Thread Claudio Fontana
On 3/16/22 1:17 PM, Claudio Fontana wrote: > On 3/14/22 6:48 PM, Daniel P. Berrangé wrote: >> On Mon, Mar 14, 2022 at 06:38:31PM +0100, Claudio Fontana wrote: >>> On 3/14/22 6:17 PM, Daniel P. Berrangé wrote: On Sat, Mar 12, 2022 at 05:30:01PM +0100, Claudio Fontana wrote: > the first user

Re: [libvirt RFC] virFile: new VIR_FILE_WRAPPER_BIG_PIPE to improve performance

2022-03-17 Thread Daniel P . Berrangé
On Thu, Mar 17, 2022 at 11:12:11AM +0100, Claudio Fontana wrote: > On 3/16/22 1:17 PM, Claudio Fontana wrote: > > On 3/14/22 6:48 PM, Daniel P. Berrangé wrote: > >> On Mon, Mar 14, 2022 at 06:38:31PM +0100, Claudio Fontana wrote: > >>> On 3/14/22 6:17 PM, Daniel P. Berrangé wrote: > On Sat, Ma

Re: [PATCH v3 4/5] iotests: make qemu_img raise on non-zero rc by default

2022-03-17 Thread Hanna Reitz
On 08.03.22 02:57, John Snow wrote: re-write qemu_img() as a function that will by default raise a VerboseProcessException (extended from CalledProcessException) on non-zero return codes. This will produce a stack trace that will show the command line arguments and return code from the failed pro

[PATCH v21 1/7] net/vmnet: add vmnet dependency and customizable option

2022-03-17 Thread Vladislav Yaroshchuk
vmnet.framework dependency is added with 'vmnet' option to enable or disable it. Default value is 'auto'. used vmnet features are available since macOS 11.0, but new backend can be built and work properly with subset of them on 10.15 too. Signed-off-by: Vladislav Yaroshchuk --- meson.build

[PATCH v21 7/7] net/vmnet: update hmp-commands.hx

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- hmp-commands.hx | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 8476277aa9..8f3d78f177 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1265,7 +1265,11 @@ ERST { .name

Re: [PATCH v3 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-17 Thread Hanna Reitz
On 08.03.22 02:57, John Snow wrote: qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow --- tests/qemu-iotests/163 |

Re: [PATCH v3 1/5] python/utils: add add_visual_margin() text decoration utility

2022-03-17 Thread Hanna Reitz
On 08.03.22 02:57, John Snow wrote: print(add_visual_margin(msg, width=72, name="Commit Message")) ┏━ Commit Message ━━ ┃ add_visual_margin() takes a chunk of text and wraps it in a visual ┃ container that force-wraps to a specified width. An o

Re: [PATCH v3 5/5] iotests: fortify compare_images() against crashes

2022-03-17 Thread Hanna Reitz
On 08.03.22 02:57, John Snow wrote: Fortify compare_images() to be more discerning about the status codes it receives. If qemu_img() returns an exit code that implies it didn't actually perform the comparison, treat that as an exceptional circumstance and force the caller to be aware of the peril

[PATCH v21 0/7] Add vmnet.framework based network backend

2022-03-17 Thread Vladislav Yaroshchuk
macOS provides networking API for VMs called 'vmnet.framework': https://developer.apple.com/documentation/vmnet We can provide its support as the new QEMU network backends which represent three different vmnet.framework interface usage modes: * `vmnet-shared`: allows the guest to communicat

[PATCH v21 6/7] net/vmnet: update qemu-options.hx

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- qemu-options.hx | 25 + 1 file changed, 25 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 5ce0ada75e..ea00d0eeb6 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2743,6 +2743,25 @@ DEF("netdev", HAS_ARG, QE

Re: [PATCH v3 15/17] linux-user/strace: Fix print_syscall_err

2022-03-17 Thread Pierre Muller
Hello Richard, being mainly a Pascal programmer, I always jump when I see such constructs: You change the type of the print_syscall_err parameter to abi_ulong, with is an unsigned type as the name suggests, and after you compare it to a signed constant -4096. This would never work in Pasc

[PATCH v21 2/7] net/vmnet: add vmnet backends to qapi/net

2022-03-17 Thread Vladislav Yaroshchuk
Create separate netdevs for each vmnet operating mode: - vmnet-host - vmnet-shared - vmnet-bridged Acked-by: Markus Armbruster Signed-off-by: Vladislav Yaroshchuk --- net/clients.h | 11 net/meson.build | 7 +++ net/net.c | 10 net/vmnet-bridged.m | 25 +++

[PATCH v21 3/7] net/vmnet: implement shared mode (vmnet-shared)

2022-03-17 Thread Vladislav Yaroshchuk
Interaction with vmnet.framework in different modes differs only on configuration stage, so we can create common `send`, `receive`, etc. procedures and reuse them. Signed-off-by: Phillip Tennen Signed-off-by: Vladislav Yaroshchuk --- net/vmnet-common.m | 358

Re: [PATCH v6] target/riscv: Add isa extenstion strings to the device tree

2022-03-17 Thread Frank Chang
On Thu, Mar 17, 2022 at 1:58 AM Atish Patra wrote: > The Linux kernel parses the ISA extensions from "riscv,isa" DT > property. It used to parse only the single letter base extensions > until now. A generic ISA extension parsing framework was proposed[1] > recently that can parse multi-letter ISA

[PATCH v21 4/7] net/vmnet: implement host mode (vmnet-host)

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- net/vmnet-host.c | 109 --- 1 file changed, 103 insertions(+), 6 deletions(-) diff --git a/net/vmnet-host.c b/net/vmnet-host.c index a461d507c5..e6d01fd65e 100644 --- a/net/vmnet-host.c +++ b/net/vmnet-host.c @@

Re: [PATCH 01/14] iotests: add qemu_img_json()

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:53, John Snow wrote: qemu_img_json() is a new helper built on top of qemu_img() that tries to pull a valid JSON document out of the stdout stream. In the event that the return code is negative (the program crashed), or the code is greater than zero and did not produce valid JSON o

[PATCH v21 5/7] net/vmnet: implement bridged mode (vmnet-bridged)

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- net/vmnet-bridged.m | 130 ++-- 1 file changed, 125 insertions(+), 5 deletions(-) diff --git a/net/vmnet-bridged.m b/net/vmnet-bridged.m index 91c1a2f2c7..6970c7d17b 100644 --- a/net/vmnet-bridged.m +++ b/net/vmnet-b

Re: [PATCH 02/14] iotests: use qemu_img_json() when applicable

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:53, John Snow wrote: qemu_img_json() gives better diagnostic information on failure. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Hanna Reitz

Re: [PATCH v3 4/5] iotests: make qemu_img raise on non-zero rc by default

2022-03-17 Thread Hanna Reitz
On 17.03.22 11:25, Hanna Reitz wrote: On 08.03.22 02:57, John Snow wrote: re-write qemu_img() as a function that will by default raise a VerboseProcessException (extended from CalledProcessException) on non-zero return codes. This will produce a stack trace that will show the command line argume

Re: [PATCH 03/14] iotests: add qemu_img_info()

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:53, John Snow wrote: Add qemu_img_info() by analogy with qemu_img_measure() and qemu_img_check(). Modify image_size() to use this function instead to take advantage of the better diagnostic information on failure provided (ultimately) by qemu_img(). Signed-off-by: John Snow ---

Re: [PATCH 1/4] target/i386: Fix sanity check on max APIC ID / X2APIC enablement

2022-03-17 Thread David Woodhouse
On Thu, 2022-03-17 at 10:05 +0100, Igor Mammedov wrote: > re-sending reply as something went wrong with headers (I suspect Daniel's > name formatting) > and email got bounced back. > > On Wed, 16 Mar 2022 14:31:33 + > David Woodhouse wrote: > > > On Wed, 2022-03-16 at 12:28 +0100, Igor Mamm

Re: [PATCH 04/14] iotests/remove-bitmap-from-backing: use qemu_img_info()

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:53, John Snow wrote: This removes two more usages of qemu_img_pipe() and replaces them with calls to qemu_img(), which provides better diagnostic information on failure. Signed-off-by: John Snow --- tests/qemu-iotests/tests/remove-bitmap-from-backing | 6 +++--- 1 file changed

Re: [PATCH 05/14] iotests: add qemu_img_map() function

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:53, John Snow wrote: Add a qemu_img_map() function by analogy with qemu_img_measure(), qemu_img_check(), and qemu_img_info() that all return JSON information. Replace calls to qemu_img_pipe('map', '--output=json', ...) with this new function, which provides better diagnostic infor

Re: [PATCH for-7.1] hw: Add compat machines for 7.1

2022-03-17 Thread Cédric Le Goater
On 3/16/22 15:55, Cornelia Huck wrote: Add 7.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck --- hw/arm/virt.c | 9 - hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 14 ++

Re: [PATCH 06/14] iotests: change supports_quorum to use qemu_img

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:53, John Snow wrote: Similar to other recent changes: use the qemu_img() invocation that supports throwing loud, nasty exceptions when it fails for surprising reasons. (Why would "--help" ever fail? I don't know, but eliminating *all* calls to qemu-img that do not go through qemu_

Re: [PATCH v2 2/3] hw/display: Allow vga_common_init() to return errors

2022-03-17 Thread Philippe Mathieu-Daudé
On 17/3/22 09:30, Thomas Huth wrote: The vga_common_init() function currently cannot report errors to its caller. But in the following patch, we'd need this possibility, so let's change it to take an "Error **" as parameter for this. Thanks for updating to return a boolean. Reviewed-by: Philip

Re: [PATCH 07/14] iotests: replace unchecked calls to qemu_img_pipe()

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:54, John Snow wrote: qemu_img_pipe() discards the return code from qemu-img in favor of returning just its output. Some tests using this function don't save, log, or check the output either, though, which is unsafe. Replace all of these calls with a checked version. Tests affecte

Re: [PATCH 10/27] Replace config-time define HOST_WORDS_BIGENDIAN

2022-03-17 Thread Cédric Le Goater
On 3/16/22 10:53, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Paolo Bonzini
On 3/16/22 22:06, Peter Maydell wrote: Speaking of 7.1, is cocoa currently completely broken, ie in need of an interim fix for 7.0 ? If so, which of the various patches/approaches should it be ? To answer the first half of my question, yes, the cocoa UI is currently completely broken as it asse

[RFC PATCH-for-7.0 v3 0/2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Since v2: - Extracted code movement in preliminary patch v2: https://lore.kernel.org/qemu-devel/20220316160300.85438-1-philippe.mathieu.da...@gmail.com/ v1: https://lore.kernel.org/qemu-devel/20220307151004.578069-1-pbonz...@redhat.com/ Paolo Bonzini (1): ui/coc

[RFC PATCH-for-7.0 v3 2/2] ui/cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
From: Paolo Bonzini Simplify the initialization dance by running qemu_init() in the main thread before the Cocoa event loop starts. The cocoa_display_init() code that is post-applicationDidFinishLaunching: moves to the application delegate itself, and the secondary thread only runs the rest of q

Re: [RFC PATCH-for-7.0 v3 1/2] ui/cocoa: Code movement

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 11:57, Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > Pure code movement in preparation for the next commit. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell thanks -- PMM

Re: [RFC PATCH-for-7.0 v3 2/2] ui/cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
On 17/3/22 12:56, Philippe Mathieu-Daudé wrote: From: Paolo Bonzini Simplify the initialization dance by running qemu_init() in the main thread before the Cocoa event loop starts. The cocoa_display_init() code that is post-applicationDidFinishLaunching: moves to the application delegate itself

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Paolo Bonzini
Just one change to aid future reading of the code, possibly. Move this line: On 3/16/22 17:03, Philippe Mathieu-Daudé wrote: +qemu_event_init(&cbevent, false); just before +cbowner = [[QemuCocoaPasteboardTypeOwner alloc] init]; i.e. the place where it was before the patch, in cocoa

[RFC PATCH-for-7.0 v3 1/2] ui/cocoa: Code movement

2022-03-17 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Pure code movement in preparation for the next commit. Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 86 +++--- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index cb

Re: [RFC PATCH-for-7.0 v3 2/2] ui/cocoa: run qemu_init in the main thread

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 11:57, Philippe Mathieu-Daudé wrote: > > From: Paolo Bonzini > > Simplify the initialization dance by running qemu_init() in the main > thread before the Cocoa event loop starts. The cocoa_display_init() > code that is post-applicationDidFinishLaunching: moves to the > app

Re: [PULL 15/22] x86: Grant AMX permission for guest

2022-03-17 Thread Maxim Levitsky
On Wed, 2022-03-16 at 17:50 +, Daniel P. Berrangé wrote: > On Wed, Mar 16, 2022 at 05:48:04PM +, David Edmondson wrote: > > On Wednesday, 2022-03-16 at 16:05:01 GMT, Daniel P. Berrangé wrote: > > > > > On Wed, Mar 16, 2022 at 04:57:39PM +0100, Peter Krempa wrote: > > > > On Tue, Mar 08, 20

Re: [PATCH 08/14] iotests/149: Remove qemu_img_pipe() call

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:54, John Snow wrote: qemu_img_pipe calls blank their output when the command being run is a 'create' call and the command succeeds. Thus, the normative output for this command in iotest 149 is to print a blank line. We can remove the logging from this invocation and use a checked i

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-17 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 3/15/22 16:55, Daniel P. Berrangé wrote: > > Expecting maintainers to enforce a subset during code review feels > > like it would be a tedious burden, that will inevitably let stuff > > through because humans are fallible, especially when presented

Re: [PATCH 2/3] hw/display: Allow vga_common_init() to return errors

2022-03-17 Thread Thomas Huth
On 17/03/2022 08.40, Markus Armbruster wrote: Thomas Huth writes: On 16/03/2022 15.16, Markus Armbruster wrote: Thomas Huth writes: On 16/03/2022 14.32, Philippe Mathieu-Daudé wrote: On 16/3/22 14:24, Thomas Huth wrote: The vga_common_init() function currently cannot report errors to its

Re: [PATCH 09/14] iotests: remove remaining calls to qemu_img_pipe()

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:54, John Snow wrote: As part of moving all python iotest invocations of qemu-img onto a single qemu_img() implementation, remove a few lingering uses of qemu_img_pipe() from outside of iotests.py itself. Several cases here rely on the knowledge that qemu_img_pipe() suppresses *all

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
On 17/3/22 12:57, Paolo Bonzini wrote: Just one change to aid future reading of the code, possibly.  Move this line: On 3/16/22 17:03, Philippe Mathieu-Daudé wrote: +    qemu_event_init(&cbevent, false); just before +    cbowner = [[QemuCocoaPasteboardTypeOwner alloc] init]; i.e. the place

Re: [RFC PATCH-for-7.0 v3 2/2] ui/cocoa: run qemu_init in the main thread

2022-03-17 Thread Akihiko Odaki
On Thu, Mar 17, 2022 at 8:57 PM Philippe Mathieu-Daudé wrote: > > From: Paolo Bonzini > > Simplify the initialization dance by running qemu_init() in the main > thread before the Cocoa event loop starts. The cocoa_display_init() > code that is post-applicationDidFinishLaunching: moves to the > a

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-17 Thread Daniel P . Berrangé
On Wed, Mar 16, 2022 at 12:08:33AM +0100, Paolo Bonzini wrote: > On 3/15/22 16:55, Daniel P. Berrangé wrote: > > Expecting maintainers to enforce a subset during code review feels > > like it would be a tedious burden, that will inevitably let stuff > > through because humans are fallible, especial

Re: [RFC PATCH-for-7.0 v3 2/2] ui/cocoa: run qemu_init in the main thread

2022-03-17 Thread Akihiko Odaki
On Thu, Mar 17, 2022 at 8:57 PM Philippe Mathieu-Daudé wrote: > > From: Paolo Bonzini > > Simplify the initialization dance by running qemu_init() in the main > thread before the Cocoa event loop starts. The cocoa_display_init() > code that is post-applicationDidFinishLaunching: moves to the > a

[RFC PATCH-for-7.0 v4 0/2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Posting v4 in case someone want to iterate. Pending issue raised by Akihiko Odaki: * this actually breaks the "runas" option with ui/cocoa. [+NSApplication sharedApplication] calls issetugid() to see if setgid() or setuid() is called before and calls exit() if

[RFC PATCH-for-7.0 v4 1/2] ui/cocoa: Code movement

2022-03-17 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Pure code movement in preparation for the next commit. Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 86 +++--- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/ui/c

[RFC PATCH-for-7.0 v4 2/2] ui/cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
From: Paolo Bonzini Simplify the initialization dance by running qemu_init() in the main thread before the Cocoa event loop starts. The cocoa_display_init() code that is post-applicationDidFinishLaunching: moves to the application delegate itself, and the secondary thread only runs the rest of q

[PATCH] gitattributes: Cover Objective-C source files

2022-03-17 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé See comments in commit 29cf16db23 ("buildsys: Help git-diff adding .gitattributes config file") for details. Signed-off-by: Philippe Mathieu-Daudé --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 07f430e94

Re: [PATCH 10/14] iotests: use qemu_img() in has_working_luks()

2022-03-17 Thread Hanna Reitz
On 09.03.22 04:54, John Snow wrote: Admittedly a mostly lateral move, but qemu_img() is essentially the replacement for qemu_img_pipe_and_status(). It will give slightly better diagnostics on crash. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 18 +- 1 file ch

Re: [PATCH 2/3] hw/display: Allow vga_common_init() to return errors

2022-03-17 Thread Markus Armbruster
Thomas Huth writes: > On 17/03/2022 08.40, Markus Armbruster wrote: >> Thomas Huth writes: >> >>> On 16/03/2022 15.16, Markus Armbruster wrote: Thomas Huth writes: > On 16/03/2022 14.32, Philippe Mathieu-Daudé wrote: >> On 16/3/22 14:24, Thomas Huth wrote: >>> The vga_com

Re: [PATCH for-7.1 v6 01/51] tcg: Fix indirect lowering vs TCG_OPF_COND_BRANCH

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 05:09, Richard Henderson wrote: > > With TCG_OPF_COND_BRANCH, we extended the lifetimes of > globals across extended basic blocks. This means that > the liveness computed in pass 1 does not kill globals > in the same way as normal temps. > > Introduce TYPE_EBB to match this

Re: [libvirt RFC] virFile: new VIR_FILE_WRAPPER_BIG_PIPE to improve performance

2022-03-17 Thread Claudio Fontana
On 3/17/22 11:25 AM, Daniel P. Berrangé wrote: > On Thu, Mar 17, 2022 at 11:12:11AM +0100, Claudio Fontana wrote: >> On 3/16/22 1:17 PM, Claudio Fontana wrote: >>> On 3/14/22 6:48 PM, Daniel P. Berrangé wrote: On Mon, Mar 14, 2022 at 06:38:31PM +0100, Claudio Fontana wrote: > On 3/14/22 6:

Re: [PATCH for-7.1] vfio/common: remove spurious tpm-crb-cmd misalignment warning

2022-03-17 Thread Eric Auger
Hi Alex, On 3/17/22 12:08 AM, Alex Williamson wrote: > On Wed, 16 Mar 2022 21:29:51 +0100 > Eric Auger wrote: > >> The CRB command buffer currently is a RAM MemoryRegion and given >> its base address alignment, it causes an error report on >> vfio_listener_region_add(). This region could have bee

Question about vmstate_register(), dc->vmsd and instance_id

2022-03-17 Thread Daniel Henrique Barboza
Hi, I've been looking into converting some vmstate_register() calls to use dc->vmsd, using as a base the docs in docs/devel/migration.rst. This doc mentions that we can either register the vmsd by using vmstate_register() or we can use dc->vmsd for qdev-based devices. When trying to convert this

[RFC PATCH v3 04/36] target/i386: Introduce kvm_confidential_guest_init()

2022-03-17 Thread Xiaoyao Li
Introduce a separate function kvm_confidential_guest_init() for SEV (and future TDX). Signed-off-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 11 ++- target/i386/sev.c | 1 - target/i386/sev.h | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/target/i386/kvm

[RFC PATCH v3 02/36] i386: Introduce tdx-guest object

2022-03-17 Thread Xiaoyao Li
Introduce tdx-guest object which implements the interface of CONFIDENTIAL_GUEST_SUPPORT, and will be used to create TDX VMs (TDs) by qemu -machine ...,confidential-guest-support=tdx0 \ -object tdx-guset,id=tdx0 It has only one property 'attributes' with fixed value 0 and not configur

[RFC PATCH v3 01/36] *** HACK *** linux-headers: Update headers to pull in TDX API changes

2022-03-17 Thread Xiaoyao Li
Pull in recent TDX updates, which are not backwards compatible. It's just to make this series runnable. It will be updated by script scripts/update-linux-headers.sh once TDX support is upstreamed in linux kernel. Signed-off-by: Xiaoyao Li Co-developed-by: Sean Christopherson Signed-of

[RFC PATCH v3 03/36] target/i386: Implement mc->kvm_type() to get VM type

2022-03-17 Thread Xiaoyao Li
TDX VM requires VM type KVM_X86_TDX_VM to be passed to kvm_ioctl(KVM_CREATE_VM). Hence implement mc->kvm_type() for i386 architecture. If tdx-guest object is specified to confidential-guest-support, like, qemu -machine ...,confidential-guest-support=tdx0 \ -object tdx-guest,id=tdx0,...

[RFC PATCH v3 08/36] i386/tdx: Adjust get_supported_cpuid() for TDX VM

2022-03-17 Thread Xiaoyao Li
For TDX, the allowable CPUID configuration differs from what KVM reports for KVM scope via KVM_GET_SUPPORTED_CPUID. - Some CPUID bits are not supported for TDX VM while KVM reports the support. Mask them off for TDX VM. e.g., CPUID_EXT_VMX, some PV featues. - The supported XCR0 and XSS bits n

[RFC PATCH v3 09/36] KVM: Introduce kvm_arch_pre_create_vcpu()

2022-03-17 Thread Xiaoyao Li
Introduce kvm_arch_pre_create_vcpu(), to perform arch-dependent work prior to create any vcpu. This is for i386 TDX because it needs call TDX_INIT_VM before creating any vcpu. Signed-off-by: Xiaoyao Li --- accel/kvm/kvm-all.c| 7 +++ include/sysemu/kvm.h | 1 + target/arm/kvm64.c |

[RFC PATCH v3 07/36] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object

2022-03-17 Thread Xiaoyao Li
It will need special handling for TDX VMs all around the QEMU. Introduce is_tdx_vm() helper to query if it's a TDX VM. Cache tdx_guest object thus no need to cast from ms->cgs every time. Signed-off-by: Xiaoyao Li --- target/i386/kvm/tdx.c | 10 ++ target/i386/kvm/tdx.h | 10 ++

[RFC PATCH v3 10/36] i386/kvm: Move architectural CPUID leaf generation to separate helper

2022-03-17 Thread Xiaoyao Li
From: Sean Christopherson Move the architectural (for lack of a better term) CPUID leaf generation to a separate helper so that the generation code can be reused by TDX, which needs to generate a canonical VM-scoped configuration. Signed-off-by: Sean Christopherson Signed-off-by: Xiaoyao Li --

[RFC PATCH v3 00/36] TDX QEMU support

2022-03-17 Thread Xiaoyao Li
This patch series aims to enable TDX support to allow creating and booting a TD (TDX VM) with QEMU. It needs to work with corresponding KVM patch for TDX [1]. You can find TDX related documents in [2]. You can also find this series in below repo in github: https://github.com/intel/qemu-tdx.git a

[RFC PATCH v3 12/36] i386/tdx: Add property sept-ve-disable for tdx-guest object

2022-03-17 Thread Xiaoyao Li
Add sept-ve-disable property for tdx-guest object. It's used to configure bit 28 of TD attributes. Signed-off-by: Xiaoyao Li --- qapi/qom.json | 5 - target/i386/kvm/tdx.c | 24 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/qapi/qom.json b/q

[RFC PATCH v3 11/36] i386/tdx: Initialize TDX before creating TD vcpus

2022-03-17 Thread Xiaoyao Li
Invoke KVM_TDX_INIT in kvm_arch_pre_create_vcpu() that KVM_TDX_INIT configures global TD state, e.g. the canonical CPUID config, and must be executed prior to creating vCPUs. Use kvm_x86_arch_cpuid() to setup the CPUID settings for TDX VM and tie x86cpu->enable_pmu with TD's attributes. Note, thi

[RFC PATCH v3 05/36] i386/tdx: Implement tdx_kvm_init() to initialize TDX VM context

2022-03-17 Thread Xiaoyao Li
Introduce tdx_kvm_init() and invoke it in kvm_confidential_guest_init() if it's a TDX VM. More initialization will be added later. Signed-off-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 15 ++- target/i386/kvm/meson.build | 2 +- target/i386/kvm/tdx-stub.c | 9 + targ

[RFC PATCH v3 14/36] i386/tdx: Validate TD attributes

2022-03-17 Thread Xiaoyao Li
Validate TD attributes with tdx_caps that fixed-0 bits must be zero and fixed-1 bits must be set. Besides, sanity check the attribute bits that have not been supported by QEMU yet. e.g., debug bit, that it will be allowed in the future when debug TD support lands in QEMU. Signed-off-by: Xiaoyao L

[RFC PATCH v3 18/36] i386/tdvf: Introduce function to parse TDVF metadata

2022-03-17 Thread Xiaoyao Li
From: Isaku Yamahata TDX VM needs to boot with its specialized firmware, Trusted Domain Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD guest memory prior to running the TDX VM. A TDVF Metadata in TDVF image describes the structure of firmware. QEMU refers to it to setup memor

[RFC PATCH v3 16/36] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM

2022-03-17 Thread Xiaoyao Li
TDX only supports readonly for shared memory but not for private memory. In the view of QEMU, it has no idea whether a memslot is used by shared memory of private. Thus just mark kvm_readonly_mem_enabled to false to TDX VM for simplicity. Note, pflash has dependency on readonly capability from KV

[RFC PATCH v3 06/36] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2022-03-17 Thread Xiaoyao Li
KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing TDX context. It will be used to validate user's setting later. Besides, introduce the interfaces to invoke TDX "ioctls" at different scope (VM and VCPU) in pre

[RFC PATCH v3 36/36] docs: Add TDX documentation

2022-03-17 Thread Xiaoyao Li
Add docs/system/i386/tdx.rst for TDX support, and add tdx in confidential-guest-support.rst Signed-off-by: Xiaoyao Li --- docs/system/confidential-guest-support.rst | 1 + docs/system/i386/tdx.rst | 103 + docs/system/target-i386.rst| 1 +

[RFC PATCH v3 22/36] i386/tdx: Track RAM entries for TDX VM

2022-03-17 Thread Xiaoyao Li
The RAM of TDX VM can be classified into two types: - TDX_RAM_UNACCEPTED: default type of TDX memory, which needs to be accepted by TDX guest before it can be used and will be all-zeros after being accepted. - TDX_RAM_ADDED: the RAM that is ADD'ed to TD guest before running, and can be

[RFC PATCH v3 21/36] i386/tdx: Track mem_ptr for each firmware entry of TDVF

2022-03-17 Thread Xiaoyao Li
For every TDVF sections, QEMU needs to copy its content to guest private memory via KVM API, to initialize them. So add a field @mem_ptr to track the pointer of each TDVF sections. BFV and CFV are firmware and loaded as plfash. TEMP_MEM and TD_HOB always locate at guest RAM before 4G, specifical

[RFC PATCH v3 13/36] i386/tdx: Wire CPU features up with attributes of TD guest

2022-03-17 Thread Xiaoyao Li
For QEMU VMs, PKS is configured via CPUID_7_0_ECX_PKS and PMU is configured by x86cpu->enable_pmu. Reuse the existing configuration interface for TDX VMs. Signed-off-by: Xiaoyao Li --- target/i386/kvm/tdx.c | 13 + 1 file changed, 13 insertions(+) diff --git a/target/i386/kvm/tdx.c

[RFC PATCH v3 34/36] i386/tdx: Skip kvm_put_apicbase() for TDs

2022-03-17 Thread Xiaoyao Li
KVM doesn't allow wirting to MSR_IA32_APICBASE for TDs. Signed-off-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 480c05d6c969..9c7eb3dea0a8 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386

[RFC PATCH v3 24/36] i386/tdx: Call KVM_TDX_INIT_VCPU to initialize TDX vcpu

2022-03-17 Thread Xiaoyao Li
TDX vcpu needs to be initialized by SEAMCALL(TDH.VP.INIT) and KVM provides vcpu level IOCTL KVM_TDX_INIT_VCPU for it. KVM_TDX_INIT_VCPU needs the address of the HOB as input. Invoke it for each vcpu after HOB list is created. Signed-off-by: Xiaoyao Li --- target/i386/kvm/tdx.c | 18

[RFC PATCH v3 23/36] i386/tdx: Create the TD HOB list upon machine init done

2022-03-17 Thread Xiaoyao Li
The TD HOB list is used to pass the information from VMM to TDVF. The TD HOB must include PHIT HOB and Resource Descriptor HOB. More details can be found in TDVF specification and PI specification. Build the TD HOB in machine_init_done callback. Co-developed-by: Isaku Yamahata Signed-off-by: Isa

[RFC PATCH v3 15/36] i386/tdx: Implement user specified tsc frequency

2022-03-17 Thread Xiaoyao Li
Reuse "-cpu,tsc-frequency=" to get user wanted tsc frequency and pass it to KVM_TDX_INIT_VM. Besides, sanity check the tsc frequency to be in the legal range and legal granularity (required by TDX module). Signed-off-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 8 target/i386/kvm/tdx.c

  1   2   3   >