Re: [PATCH v4 0/4] softmmu/memory_mapping: optimize dump/tpm for virtio-mem

2021-10-02 Thread Paolo Bonzini
On 27/07/21 10:25, David Hildenbrand wrote: Minor fixes and cleanups, followed by an optimization for virtio-mem regarding guest dumps and tpm. virtio-mem logically plugs/unplugs memory within a sparse memory region and notifies via the RamDiscardMgr interface when parts become plugged (populate

[PULL 02/13] qapi/gen: use dict.items() to iterate over _modules

2021-10-02 Thread Markus Armbruster
From: John Snow New pylint warning. I could silence it, but this is the only occurrence in the entire tree, including everything in iotests/ and python/. Easier to just change this one instance. (The warning is emitted in cases where you are fetching the values anyway, so you may as well just ta

[PULL 07/13] qapi/parser: Introduce NullSection

2021-10-02 Thread Markus Armbruster
From: John Snow Here's the weird bit. QAPIDoc generally expects -- virtually everywhere -- that it will always have a current section. The sole exception to this is in the case that end_comment() is called, which leaves us with *no* section. However, in this case, we also don't expect to actually

Re: [PATCH v2] monitor: Rate-limit MEMORY_DEVICE_SIZE_CHANGE qapi events per device

2021-10-02 Thread Paolo Bonzini
On 22/09/21 14:57, David Hildenbrand wrote: We want to rate-limit MEMORY_DEVICE_SIZE_CHANGE events per device, otherwise we can lose some events for devices. As we might not always have a device id, add the qom-path to the event and use that to rate-limit per device. This was noticed by starting

[PULL 13/13] qapi/parser: enable pylint checks

2021-10-02 Thread Markus Armbruster
From: John Snow Signed-off-by: John Snow Message-Id: <20210930205716.1148693-14-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qa

[PULL 04/13] qapi: Add spaces after symbol declaration for consistency

2021-10-02 Thread Markus Armbruster
From: John Snow Several QGA definitions omit a blank line after the symbol declaration. This works OK currently, but it's the only place where we do this. Adjust it for consistency. Future commits may wind up enforcing this formatting. Signed-off-by: John Snow Message-Id: <20210930205716.1148

[PULL 00/13] QAPI patches patches for 2021-10-02

2021-10-02 Thread Markus Armbruster
The following changes since commit 5f992102383ed8ed97076548e1c897c7034ed8a4: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2021-10-01 13:44:36 -0400) are available in the Git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-qapi-2021-10-02 for you

[PULL 11/13] qapi/parser: enable mypy checks

2021-10-02 Thread Markus Armbruster
From: John Snow Signed-off-by: John Snow Message-Id: <20210930205716.1148693-12-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/mypy.ini | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini in

[PULL 12/13] qapi/parser: Silence too-few-public-methods warning

2021-10-02 Thread Markus Armbruster
From: John Snow Eh. Not worth the fuss today. There are bigger fish to fry. Signed-off-by: John Snow Message-Id: <20210930205716.1148693-13-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 3 +++ 1 file changed, 3 insertions(+) d

[PULL 06/13] qapi/parser: clarify _end_section() logic

2021-10-02 Thread Markus Armbruster
From: John Snow The "if self._section" clause in end_section is mysterious: In which circumstances might we end a section when we don't have one? QAPIDoc always expects there to be a "current section", only except after a call to end_comment(). This actually *shouldn't* ever be 'None', so let's

[PULL 01/13] qapi/pylintrc: ignore 'consider-using-f-string' warning

2021-10-02 Thread Markus Armbruster
From: John Snow Pylint 2.11.x adds this warning. We're not yet ready to pursue that conversion, so silence it for now. Signed-off-by: John Snow Message-Id: <20210930205716.1148693-2-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/pylintrc |

[PULL 10/13] qapi/parser: Add FIXME for consolidating JSON-related types

2021-10-02 Thread Markus Armbruster
From: John Snow The fix for this comment is forthcoming in a future commit, but this will keep me honest. The linting configuration in ./python/setup.cfg prohibits 'FIXME' comments. A goal of this long-running series is to move ./scripts/qapi to ./python/qemu/qapi so that the QAPI generator is re

[PULL 05/13] qapi/parser: remove FIXME comment from _append_body_line

2021-10-02 Thread Markus Armbruster
From: John Snow True, we do not check the validity of this symbol -- but we don't check the validity of definition names during parse, either -- that happens later, during the expr check. I don't want to introduce a dependency on expr.py:check_name_str here and introduce a cycle. Instead, rest a

[PULL 08/13] qapi/parser: add import cycle workaround

2021-10-02 Thread Markus Armbruster
From: John Snow Adding static types causes a cycle in the QAPI generator: [schema -> expr -> parser -> schema]. It exists because the QAPIDoc class needs the names of types defined by the schema module, but the schema module needs to import both expr.py/parser.py to do its actual parsing. Ultima

[PULL 09/13] qapi/parser: add type hint annotations (QAPIDoc)

2021-10-02 Thread Markus Armbruster
From: John Snow Annotations do not change runtime behavior. This commit consists of only annotations. Signed-off-by: John Snow Message-Id: <20210930205716.1148693-10-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 67

[PULL 03/13] qapi/parser: fix unused check_args_section arguments

2021-10-02 Thread Markus Armbruster
From: John Snow Pylint informs us we're not using these arguments. Oops, it's right. Correct the error message and remove the remaining unused parameter. Fix test output now that the error message is improved. Fixes: e151941d1b Signed-off-by: John Snow Message-Id: <20210930205716.1148693-4-js.

Re: [PULL v2 00/33] x86 and misc changes for 2021-09-28

2021-10-02 Thread Peter Maydell
On Sat, 2 Oct 2021 at 01:41, Richard Henderson wrote: > > On 9/30/21 10:57 AM, Paolo Bonzini wrote: > > The following changes since commit ba0fa56bc06e563de68d2a2bf3ddb0cfea1be4f9: > > > >Merge remote-tracking branch > > 'remotes/vivier/tags/q800-for-6.2-pull-request' into staging (2021-09-29

Re: [PATCH v3 0/9] hw/nvram: hw/arm: Introduce Xilinx eFUSE and BBRAM

2021-10-02 Thread Peter Maydell
On Fri, 17 Sept 2021 at 06:24, Tong Ho wrote: > > This series implements the Xilinx eFUSE and BBRAM devices for > the Versal and ZynqMP product families. > > Furthermore, both new devices are connected to the xlnx-versal-virt > board and the xlnx-zcu102 board. > > See changes in docs/system/arm/xl

Re: [PULL 11/20] nubus-device: add romfile property for loading declaration ROMs

2021-10-02 Thread Peter Maydell
On Wed, 29 Sept 2021 at 10:53, Laurent Vivier wrote: > > From: Mark Cave-Ayland > > The declaration ROM is located at the top-most address of the standard slot > space. > > Signed-off-by: Mark Cave-Ayland > Reviewed-by: Laurent Vivier > Message-Id: <20210924073808.1041-12-mark.cave-ayl...@iland

Re: [PULL 03/20] nubus-device: expose separate super slot memory region

2021-10-02 Thread Peter Maydell
On Wed, 29 Sept 2021 at 10:49, Laurent Vivier wrote: > > From: Mark Cave-Ayland > > According to "Designing Cards and Drivers for the Macintosh Family" each > physical > nubus slot can access 2 separate address ranges: a super slot memory region > which > is 256MB and a standard slot memory reg

Re: [PULL 33/44] target/ppc: Fix 64-bit decrementer

2021-10-02 Thread Peter Maydell
On Thu, 30 Sept 2021 at 06:44, David Gibson wrote: > > From: Cédric Le Goater > > The current way the mask is built can overflow with a 64-bit decrementer. > Use sextract64() to extract the signed values and remove the logic to > handle negative values which has become useless. > > Cc: Luis Ferna

[PATCH 00/12] macfb: fixes for booting MacOS

2021-10-02 Thread Mark Cave-Ayland
This is the next set of patches to allow users to boot MacOS in QEMU's q800 machine. Patches 1 to 3 are fixes for existing bugs that I discovered whilst developing the remainder of the patchset whilst patch 4 simplifies the registration of the framebuffer RAM. Patch 5 adds trace events to the fra

[PATCH 02/12] macfb: fix invalid object reference in macfb_common_realize()

2021-10-02 Thread Mark Cave-Ayland
During realize memory_region_init_ram_nomigrate() is used to initialise the RAM memory region used for the framebuffer but the owner object reference is incorrect since MacFbState is a typedef and not a QOM type. Change the memory region owner to be the corresponding DeviceState to fix the issue a

[PATCH 01/12] macfb: handle errors that occur during realize

2021-10-02 Thread Mark Cave-Ayland
Make sure any errors that occur within the macfb realize chain are detected and handled correctly to prevent crashes and to ensure that error messages are reported back to the user. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 11 +++ 1 file changed, 11 insertions(+) diff --

[PATCH 05/12] macfb: add trace events for reading and writing the control registers

2021-10-02 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 8 +++- hw/display/trace-events | 4 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index e86f64..62c2727a5b 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c

[PATCH 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM

2021-10-02 Thread Mark Cave-Ayland
The monitor modes table is found by experimenting with the Monitors Control Panel in MacOS and analysing the reads/writes. From this it can be found that the mode is controlled by writes to the DAFB_MODE_CTRL1 and DAFB_MODE_CTRL2 registers. Implement the first block of DAFB registers as a register

[PATCH 04/12] macfb: use memory_region_init_ram() in macfb_common_realize() for the framebuffer

2021-10-02 Thread Mark Cave-Ayland
Currently macfb_common_realize() defines the framebuffer RAM memory region as being non-migrateable but then immediately registers it for migration. Replace memory_region_init_ram_nomigrate() with memory_region_init_ram() which is clearer and does exactly the same thing. Signed-off-by: Mark Cave-

[PATCH 09/12] macfb: fix up 1-bit pixel encoding

2021-10-02 Thread Mark Cave-Ayland
The MacOS driver expects the RGB values for the pixel to be in entries 0 and 1 of the colour palette. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 6a69334565..0c9e181b9b

[PATCH 03/12] macfb: fix overflow of color_palette array

2021-10-02 Thread Mark Cave-Ayland
The palette_current index counter has a maximum size of 256 * 3 to cover a full color palette of 256 RGB entries. Linux assumes that the palette_current index wraps back around to zero after writing 256 RGB entries so ensure that palette_current is reset at this point to prevent data corruption wit

[PATCH 07/12] macfb: add qdev property to specify display type

2021-10-02 Thread Mark Cave-Ayland
Since the available resolutions and colour depths are determined by the attached display type, add a qdev property to allow the display type to be specified. The main resolutions of interest are high resolution 1152x870 with 8-bit colour and SVGA resolution up to 800x600 with 32-bit colour so upda

[PATCH 11/12] macfb: add vertical blank interrupt

2021-10-02 Thread Mark Cave-Ayland
The MacOS driver expects a 60.15Hz vertical blank interrupt to be generated by the framebuffer which in turn schedules the mouse driver via the Vertical Retrace Manager. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 81 ++ include/hw/displa

[PATCH 12/12] q800: wire macfb IRQ to separate video interrupt on VIA2

2021-10-02 Thread Mark Cave-Ayland
Whilst the in-built Quadra 800 framebuffer exists within the Nubus address space for slot 9, it has its own dedicated interrupt on VIA2. Force the macfb device to occupy slot 9 in the q800 machine and wire its IRQ to the separate video interrupt since this is what is expected by the MacOS interrupt

[PATCH 06/12] macfb: implement mode sense to allow display type to be detected

2021-10-02 Thread Mark Cave-Ayland
The MacOS toolbox ROM uses the monitor sense to detect the display type and then offer a fixed set of resolutions and colour depths accordingly. Implement the monitor sense using information found in Apple Technical Note HW26: "Macintosh Quadra Built-In Video" along with some local experiments. Si

[PATCH 10/12] macfb: fix 24-bit RGB pixel encoding

2021-10-02 Thread Mark Cave-Ayland
According to Apple Technical Note HW26: "Macintosh Quadra Built-In Video" the in-built framebuffer encodes each 24-bit pixel into 4 bytes. Adjust the 24-bit RGB pixel encoding accordingly which agrees with the encoding expected by MacOS when changing into 24-bit colour mode. Signed-off-by: Mark Ca

Re: [PATCH v12 16/16] machine: Make smp_parse return a boolean

2021-10-02 Thread Markus Armbruster
Paolo Bonzini writes: > On 01/10/21 19:15, Daniel P. Berrangé wrote: >> On Fri, Oct 01, 2021 at 07:08:51PM +0200, Paolo Bonzini wrote: >>> On 29/09/21 04:58, Yanan Wang wrote: @@ -933,8 +935,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, ret

Re: [PATCH 01/12] macfb: handle errors that occur during realize

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Mark Cave-Ayland wrote: Make sure any errors that occur within the macfb realize chain are detected and handled correctly to prevent crashes and to ensure that error messages are reported back to the user. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 11 +

Re: [PATCH 02/12] macfb: fix invalid object reference in macfb_common_realize()

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Mark Cave-Ayland wrote: During realize memory_region_init_ram_nomigrate() is used to initialise the RAM memory region used for the framebuffer but the owner object reference is incorrect since MacFbState is a typedef and not a QOM type. Change the memory region owner to be th

Re: [PATCH 04/12] macfb: use memory_region_init_ram() in macfb_common_realize() for the framebuffer

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Mark Cave-Ayland wrote: Currently macfb_common_realize() defines the framebuffer RAM memory region as being non-migrateable but then immediately registers it for migration. Replace memory_region_init_ram_nomigrate() with memory_region_init_ram() which is clearer and does exac

[PATCH 0/2] nubus: a couple of Coverity fixes

2021-10-02 Thread Mark Cave-Ayland
These patches fix a couple of issues found by Coverity in the recent nubus patchset as reported by Peter. Signed-off-by: Mark Cave-Ayland Mark Cave-Ayland (2): nubus.h: add ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE nubus-device: ensure that name is freed after use in

[PATCH 2/2] nubus-device: ensure that name is freed after use in nubus_device_realize()

2021-10-02 Thread Mark Cave-Ayland
Coverity points out that there is memory leak because name is never freed after use in nubus_device_realize(). Fixes: Coverity CID 1464062 Signed-off-by: Mark Cave-Ayland --- hw/nubus/nubus-device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-devi

[PATCH 1/2] nubus.h: add ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE

2021-10-02 Thread Mark Cave-Ayland
Coverity thinks that the slot_offset multiplications in nubus_device_realize() might overflow because the resulting hwaddr is 64-bit whilst the multiplication is only done at 32-bits. Add an explicit ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE to ensure that the multiplication is

[PATCH v3 00/22] target/i386/sev: Housekeeping SEV + measured Linux SEV guest

2021-10-02 Thread Philippe Mathieu-Daudé
Hi, While testing James & Dov patch: https://www.mail-archive.com/qemu-devel@nongnu.org/msg810571.html I wasted some time trying to figure out how OVMF was supposed to behave until realizing the binary I was using was built without SEV support... Then wrote this series to help other developers to

[PATCH v3 05/22] target/i386/monitor: Return QMP error when SEV is disabled in build

2021-10-02 Thread Philippe Mathieu-Daudé
If the management layer tries to inject a secret, it gets an empty response in case the binary built without SEV: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 } } { "return": { } } Make it clearer

[PATCH v3 12/22] target/i386/sev: Declare system-specific functions in 'sev_i386.h'

2021-10-02 Thread Philippe Mathieu-Daudé
While prefixed with sysemu, 'sysemu/sev.h' contains the architecture specific declarations. The system specific parts are declared in 'sev_i386.h'. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/sev.h | 6 -- target/i386/sev_i386.h | 7 +++ hw/i386/pc_sysfw.c | 2 +- 3 fi

[PATCH v3 03/22] target/i386/kvm: Introduce i386_softmmu_kvm Meson source set

2021-10-02 Thread Philippe Mathieu-Daudé
Introduce the i386_softmmu_kvm Meson source set to be able to add features dependent on CONFIG_KVM. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/meson.build | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.b

[PATCH v3 08/22] target/i386/sev: Remove sev_get_me_mask()

2021-10-02 Thread Philippe Mathieu-Daudé
Unused dead code makes review harder, so remove it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 1 - target/i386/sev-stub.c | 5 - target/i386/sev.c | 9 - 3 files changed, 15 deletions(-) di

[PATCH v3 01/22] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines

2021-10-02 Thread Philippe Mathieu-Daudé
Wrap long lines before 70 characters for legibility. Suggested-by: Markus Armbruster Reviewed-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- qapi/misc-target.json | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qapi/misc-target.json b/qap

[PATCH v3 19/22] monitor: Restrict 'info sev' to x86 targets

2021-10-02 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/monitor/hmp-target.h | 1 + include/monitor/hmp.h | 1 - target/i386/sev-sysemu-stub.c | 2 +- target/i386/sev.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/mon

[PATCH v3 02/22] qapi/misc-target: Group SEV QAPI definitions

2021-10-02 Thread Philippe Mathieu-Daudé
There is already a section with various SEV commands / types, so move the SEV guest attestation together. Signed-off-by: Philippe Mathieu-Daudé --- qapi/misc-target.json | 80 +-- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/qapi/misc-ta

[PATCH v3 07/22] target/i386/sev_i386.h: Remove unused headers

2021-10-02 Thread Philippe Mathieu-Daudé
Declarations don't require these headers, remove them. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 4 target/i386/sev-stub.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h

[PATCH v3 10/22] target/i386/sev: sev_get_attestation_report use g_autofree

2021-10-02 Thread Philippe Mathieu-Daudé
From: "Dr. David Alan Gilbert" Removes a whole bunch of g_free's and a goto. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Brijesh Singh Message-Id: <20210603113017.34922-1-dgilb...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev.c | 11 +

Re: [PULL v2 00/33] x86 and misc changes for 2021-09-28

2021-10-02 Thread Richard Henderson
On 10/2/21 6:09 AM, Peter Maydell wrote: On Sat, 2 Oct 2021 at 01:41, Richard Henderson wrote: On 9/30/21 10:57 AM, Paolo Bonzini wrote: The following changes since commit ba0fa56bc06e563de68d2a2bf3ddb0cfea1be4f9: Merge remote-tracking branch 'remotes/vivier/tags/q800-for-6.2-pull-reque

[PATCH v3 04/22] target/i386/kvm: Restrict SEV stubs to x86 architecture

2021-10-02 Thread Philippe Mathieu-Daudé
SEV is x86-specific, no need to add its stub to other architectures. Move the stub file to target/i386/kvm/. Signed-off-by: Philippe Mathieu-Daudé --- {accel => target/i386}/kvm/sev-stub.c | 0 accel/kvm/meson.build | 1 - target/i386/kvm/meson.build | 2 ++ 3 files cha

[PATCH v3 14/22] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev_attestation_report() from monitor.c to sev.c and make sev_get_attestation_report() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 2 -- target/i386/monitor.c | 6 -- target/i386/sev-sys

[PATCH v3 09/22] target/i386/sev: Mark unreachable code with g_assert_not_reached()

2021-10-02 Thread Philippe Mathieu-Daudé
The unique sev_encrypt_flash() invocation (in pc_system_flash_map) is protected by the "if (sev_enabled())" check, so is not reacheable. Replace the abort() call in sev_es_save_reset_vector() by g_assert_not_reached() which meaning is clearer. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mat

[PATCH v3 06/22] target/i386/cpu: Add missing 'qapi/error.h' header

2021-10-02 Thread Philippe Mathieu-Daudé
Commit 00b81053244 ("target-i386: Remove assert_no_error usage") forgot to add the "qapi/error.h" for &error_abort, add it now. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v3 16/22] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev_capabilities() from monitor.c to sev.c and make sev_get_capabilities() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 1 - target/i386/monitor.c | 5 - target/i386/sev-sysemu-stub.c | 4 +

[PATCH v3 17/22] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev_launch_measure() from monitor.c to sev.c and make sev_get_launch_measurement() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 1 - target/i386/monitor.c | 17 - target/i386/s

[PATCH v3 11/22] target/i386/sev: Restrict SEV to system emulation

2021-10-02 Thread Philippe Mathieu-Daudé
SEV is irrelevant on user emulation, so restrict it to sysemu. Some stubs are still required because used in cpu.c by x86_register_cpudef_types(), so move the sysemu specific stubs to sev-sysemu-stub.c instead. This will allow us to simplify monitor.c (which is not available in user emulation) in t

[PATCH v3 21/22] x86/sev: generate SEV kernel loader hashes in x86_load_linux

2021-10-02 Thread Philippe Mathieu-Daudé
From: Dov Murik If SEV is enabled and a kernel is passed via -kernel, pass the hashes of kernel/initrd/cmdline in an encrypted guest page to OVMF for SEV measured boot. Co-developed-by: James Bottomley Signed-off-by: James Bottomley Signed-off-by: Dov Murik Reviewed-by: Daniel P. Berrangé Me

[PATCH v3 13/22] target/i386/sev: Remove stubs by using code elision

2021-10-02 Thread Philippe Mathieu-Daudé
Only declare sev_enabled() and sev_es_enabled() when CONFIG_SEV is set, to allow the compiler to elide unused code. Remove unnecessary stubs. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/sev.h| 14 +- target/i386/sev_i386.h | 3 --- target/i386/cpu.c | 16

[PATCH v3 22/22] MAINTAINERS: Cover AMD SEV files

2021-10-02 Thread Philippe Mathieu-Daudé
Add an entry to list SEV-related files. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 50435b8d2f5..733a5201e76 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3038,6 +3038,13 @@ F: hw/core/clock-vms

[PATCH v3 15/22] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_sev_inject_launch_secret() from monitor.c to sev.c and make sev_inject_launch_secret() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/monitor.c | 31 --- target/i386/sev-sysemu-stub.c | 6 +++-

[PATCH v3 18/22] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev() & hmp_info_sev()() from monitor.c to sev.c and make sev_get_info() static. We don't need the stub anymore, remove it. Add a stub for hmp_info_sev(). Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 3 --- target/i386/monitor.c | 38 +

[PATCH v3 20/22] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-10-02 Thread Philippe Mathieu-Daudé
From: Dov Murik Add the sev_add_kernel_loader_hashes function to calculate the hashes of the kernel/initrd/cmdline and fill a designated OVMF encrypted hash table area. For this to work, OVMF must support an encrypted area to place the data which is advertised via a special GUID in the OVMF rese

Re: hexagon container update

2021-10-02 Thread Richard Henderson
On 10/1/21 1:59 PM, Brian Cain wrote: If there's any trust concerns we can verify the download in the dockerfile using the hash file for the tarball and/or the gpg signature. That's true, I should have thought of that. r~

Re: [PATCH v3 6/6] tests/qapi-schema: Test cases for aliases

2021-10-02 Thread Markus Armbruster
Kevin Wolf writes: > Am 17.09.2021 um 10:26 hat Markus Armbruster geschrieben: [...] >> >> We actually require much less: for QMP chardev-add, we need >> >> 'data.addr.data.FOO' and nothing else, and for CLI -chardev, we need >> >> 'FOO' and nothing else (I think). The unneeded ones become acc

Re: [RFC PATCH: v3 1/2] add mi device in qemu

2021-10-02 Thread Padmakar Kalghatgi
On Wed, Sep 29, 2021 at 06:37:54AM +0200, Klaus Jensen wrote: On Aug 3 12:54, Padmakar Kalghatgi wrote: From: padmakar This patch contains the implementation of certain commands of nvme-mi specification.The MI commands are useful to manage/configure/monitor the device.Eventhough the MI comman

[PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Philippe Mathieu-Daudé
From: Leon Alrae Remove misleading gen_mfc0_load64() which actually loads 32 or 64 bits depending whether MIPS32 or MIPS64 and also replace the pair of tcg_gen_ld_tl() + tcg_gen_ext32s_tl() with single tcg_gen_ld32s_tl(). Patch partly generated using the following spatch script: @@ expr

Re: [PATCH 1/2] nubus.h: add ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 14:31, Mark Cave-Ayland wrote: > Coverity thinks that the slot_offset multiplications in nubus_device_realize() > might overflow because the resulting hwaddr is 64-bit whilst the > multiplication > is only done at 32-bits. > > Add an explicit ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUB

Re: [PATCH 2/2] nubus-device: ensure that name is freed after use in nubus_device_realize()

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 14:31, Mark Cave-Ayland wrote: > Coverity points out that there is memory leak because name is never freed > after > use in nubus_device_realize(). > > Fixes: Coverity CID 1464062 > Signed-off-by: Mark Cave-Ayland > --- > hw/nubus/nubus-device.c | 1 + > 1 file changed, 1 insertion(+

Re: [PATCH 01/12] macfb: handle errors that occur during realize

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 12:59, Mark Cave-Ayland wrote: > Make sure any errors that occur within the macfb realize chain are detected > and handled correctly to prevent crashes and to ensure that error messages are > reported back to the user. > > Signed-off-by: Mark Cave-Ayland > --- > hw/display/macfb.c | 1

Re: [PATCH 02/12] macfb: fix invalid object reference in macfb_common_realize()

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 12:59, Mark Cave-Ayland wrote: > During realize memory_region_init_ram_nomigrate() is used to initialise the > RAM > memory region used for the framebuffer but the owner object reference is > incorrect since MacFbState is a typedef and not a QOM type. > > Change the memory region owner

Re: [PATCH 04/12] macfb: use memory_region_init_ram() in macfb_common_realize() for the framebuffer

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 12:59, Mark Cave-Ayland wrote: > Currently macfb_common_realize() defines the framebuffer RAM memory region as > being non-migrateable but then immediately registers it for migration. Replace > memory_region_init_ram_nomigrate() with memory_region_init_ram() which is > clearer > and doe

Re: [PATCH 05/12] macfb: add trace events for reading and writing the control registers

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 13:00, Mark Cave-Ayland wrote: > Signed-off-by: Mark Cave-Ayland > --- > hw/display/macfb.c | 8 +++- > hw/display/trace-events | 4 > 2 files changed, 11 insertions(+), 1 deletion(-) > @@ -289,7 +290,10 @@ static uint64_t macfb_ctrl_read(void *opaque, >

Re: [PATCH 07/12] macfb: add qdev property to specify display type

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 13:00, Mark Cave-Ayland wrote: > Since the available resolutions and colour depths are determined by the > attached > display type, add a qdev property to allow the display type to be specified. > > The main resolutions of interest are high resolution 1152x870 with 8-bit > colour > an

Re: [PATCH 12/12] q800: wire macfb IRQ to separate video interrupt on VIA2

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 13:00, Mark Cave-Ayland wrote: > Whilst the in-built Quadra 800 framebuffer exists within the Nubus address > space for slot 9, it has its own dedicated interrupt on VIA2. Force the > macfb device to occupy slot 9 in the q800 machine and wire its IRQ to the > separate video interrupt sin

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Howard Spoelstra wrote: Hi all, I've booted Fedora12 and MacOS 9.2/OSX10.4 ppc with these patches applied. All boot OK. (Fedora12 requires -mac99,via=pmu. Here there seems to be some interference with the kbd, due to via=pmu presenting usb mouse and kdb to the guest. So I cou

Re: [PATCH v3 10/41] linux-user/host/sparc: Populate host_signal.h

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Split host_signal_pc and host_signal_write out of user-exec.c. > Drop the *BSD code, to be re-created under bsd-user/ later. > Drop the Solais code as completely unused. Typo 'Solaris'. > > Signed-off-by: Richard Henderson > --- > linux-user/host/sp

Re: [PATCH v3 11/41] linux-user/host/arm: Populate host_signal.h

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Split host_signal_pc and host_signal_write out of user-exec.c. > Drop the *BSD code, to be re-created under bsd-user/ later. > > Signed-off-by: Richard Henderson > --- > linux-user/host/arm/host-signal.h | 30 - > accel/tcg/user-ex

Re: [PATCH v3 21/41] target/alpha: Make alpha_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for alpha-linux-user. Renamed to TCGCPUOps.record_sigsegv in patch #19 of this series. Otherwise: Reviewed-by: Philippe Mathieu-Daudé > Remove the code from cpu_loop that handled EXCP_MMFAULT. > > Sig

Re: [PATCH v3 22/41] target/arm: Use cpu_loop_exit_segv for mte tag lookup

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Use the new os interface for raising the exception, > rather than calling arm_cpu_tlb_fill directly. > > Signed-off-by: Richard Henderson > --- > target/arm/mte_helper.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Phili

Re: [PATCH v3 28/41] target/m68k: Make m68k_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for m68k-linux-user. > Remove the code from cpu_loop that handled EXCP_ACCESS. > > Signed-off-by: Richard Henderson > --- > linux-user/m68k/cpu_loop.c | 10 -- > target/m68k/cpu.c | 2

Re: [PATCH v3 30/41] target/mips: Make mips_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for mips linux-user. > This means we can remove tcg/user/tlb_helper.c entirely. > Remove the code from cpu_loop that raised SIGSEGV. > > Signed-off-by: Richard Henderson > --- > target/mips/tcg/tcg-inte

Re: [PATCH v3 31/41] target/nios2: Implement nios2_cpu_record_sigsegv

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Because the linux-user kuser page handling is currently implemented > by detecting magic addresses in the unnamed 0xaa trap, we cannot > simply remove nios2_cpu_tlb_fill and rely on the fallback code. > > Signed-off-by: Richard Henderson > --- > targe

Re: [PATCH v3 33/41] target/openrisc: Make openrisc_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for openrisc. > This makes all of the code in mmu.c sysemu only, so remove > the ifdefs and move the file to openrisc_softmmu_ss. > Remove the code from cpu_loop that handled EXCP_DPF. > > Cc: Stafford Ho

Re: [PATCH v3 35/41] target/riscv: Make riscv_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for riscv. > Remove the code from cpu_loop that raised SIGSEGV. > > Cc: qemu-ri...@nongnu.org > Signed-off-by: Richard Henderson > --- > linux-user/riscv/cpu_loop.c | 7 --- > target/riscv/cpu.c

Re: [PATCH v3 40/41] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for xtensa. > Remove the code from cpu_loop that raised SIGSEGV. > > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > target/xtensa/cpu.h | 2 +- > linux-user/xtensa/cpu_loop.c |

Re: [PATCH v3 41/41] accel/tcg: Restrict TCGCPUOps::tlb_fill() to sysemu

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > We have replaced tlb_fill with record_sigsegv for user mod. Typo "user mode"? > Move the declaration to restrict it to system emulation. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > include/hw/core/tcg-cpu-ops.

Re: [PATCH v3 39/41] target/sparc: Make sparc_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for sparc. > > This makes all of the code in mmu_helper.c sysemu only, so remove > the ifdefs and move the file to sparc_softmmu_ss. Remove the code > from cpu_loop that handled TT_DFAULT and TT_TFAULT.

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Fri, 1 Oct 2021, BALATON Zoltan wrote: Posted as RFC because it's unfinfished and untested as there seems to be some regression with mac99 so it does not boot for me for some reason I haven't debugged yet. Hope Howard can test it and see if it changes any of the traces seen before. I've now

Re: [PATCH] docs/devel: memory: Document MemoryRegionOps requirement

2021-10-02 Thread Bin Meng
On Thu, Sep 9, 2021 at 4:17 AM Philippe Mathieu-Daudé wrote: > > On 9/8/21 8:50 PM, Peter Xu wrote: > > On Mon, Sep 06, 2021 at 03:01:54PM +0200, Philippe Mathieu-Daudé wrote: > >> On 9/6/21 2:20 PM, Bin Meng wrote: > >>> It's been a requirement that at least one function pointer for read > >>> an

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Howard Spoelstra wrote: Both have issues communicating with endpoint 4 (the hid controls volume up/down and mute). Endpoint 1 should receive the isochronous audio stream, but never does. After some experimentation with unplugging/plugging the headset and probing the usb stack

[PATCH v3 3/3] hw/mips/boston: Add FDT generator

2021-10-02 Thread Jiaxun Yang
Generate FDT on our own if no dtb argument supplied. Avoid introducing unused device in FDT with user supplied dtb. Signed-off-by: Jiaxun Yang -- v2: Address f4bug cmments (Thanks!) --- hw/mips/boston.c | 234 +-- 1 file changed, 226 insertions(+), 8 d

[PATCH v3 0/3] hw/mips/boston: ELF kernel support

2021-10-02 Thread Jiaxun Yang
Jiaxun Yang (3): hw/mips/boston: Massage memory map information hw/mips/boston: Allow loading elf kernel and dtb hw/mips/boston: Add FDT generator hw/mips/boston.c | 348 +++ 1 file changed, 320 insertions(+), 28 deletions(-) -- 2.30.2

[PATCH v3 1/3] hw/mips/boston: Massage memory map information

2021-10-02 Thread Jiaxun Yang
Use memmap array to uinfy address of memory map. That would allow us reuse address information for FDT generation. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé -- v2: Fix minor style issue, fix uart map size --- hw/mips/boston.c | 95 ---

[PATCH v3 2/3] hw/mips/boston: Allow loading elf kernel and dtb

2021-10-02 Thread Jiaxun Yang
ELF kernel allows us debugging much easier with DWARF symbols. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé -- v2: Use g_autofree v3: Remove unused kernel_low and uint64_t cast (BALATON) --- hw/mips/boston.c | 35 +++ 1 file changed, 31 insertio

Re: [PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Jiaxun Yang
在 2021/10/2 14:37, Philippe Mathieu-Daudé 写道: From: Leon Alrae Remove misleading gen_mfc0_load64() which actually loads 32 or 64 bits depending whether MIPS32 or MIPS64 and also replace the pair of tcg_gen_ld_tl() + tcg_gen_ext32s_tl() with single tcg_gen_ld32s_tl(). Patch partly generated

Re: [PULL 00/13] QAPI patches patches for 2021-10-02

2021-10-02 Thread Richard Henderson
On 10/2/21 5:56 AM, Markus Armbruster wrote: The following changes since commit 5f992102383ed8ed97076548e1c897c7034ed8a4: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2021-10-01 13:44:36 -0400) are available in the Git repository at: git://repo.or.cz/qe

Re: [PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Richard Henderson
On 10/2/21 9:37 AM, Philippe Mathieu-Daudé wrote: From: Leon Alrae Remove misleading gen_mfc0_load64() which actually loads 32 or 64 bits depending whether MIPS32 or MIPS64 and also replace the pair of tcg_gen_ld_tl() + tcg_gen_ext32s_tl() with single tcg_gen_ld32s_tl(). Patch partly generated

  1   2   >