Re: [PATCH v8 16/16] sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2

2025-06-19 Thread Liam Merwick
extract the sev_features then secondly to actually configure the guest. Signed-off-by: Roy Hopkins Acked-by: Michael S. Tsirkin Acked-by: Stefano Garzarella Acked-by: Gerd Hoffman Tested-by: Stefano Garzarella Reviewed-by: Liam Merwick --- backends/igvm.c | 17

Re: [PATCH v8 14/16] backends/igvm: Handle policy for SEV guests

2025-06-18 Thread Liam Merwick
On 13/06/2025 16:22, Roy Hopkins wrote: Adds a handler for the guest policy initialization IGVM section and builds an SEV policy based on this information and the ID block directive if present. The policy is applied using by calling 'set_guest_policy()' on the ConfidentialGuestSupport object.

[PATCH] hw/xen: Fix trace_xs_node_read() params

2025-05-23 Thread Liam Merwick
'value' is not null before passing it to trace_xs_node_read(). Fixes: e6cdeee95990 ("hw/xen: Add xs_node_read() helper function") Signed-off-by: Liam Merwick --- hw/xen/xen-bus-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen-bus-help

Re: [PATCH v1 3/3] i386/sev: Add KVM_EXIT_SNP_REQ_CERTS support for certificate-fetching

2025-02-05 Thread Liam Merwick
Hi Michael, On 18/12/2024 15:49, Michael Roth wrote: The GHCB specification[1] defines a VMGEXIT-based Guest Request hypercall to allow an SNP guest to issue encrypted requests directly to SNP firmware to do things like query the attestation report for the guest. These are generally handled pure

Re: [PATCH v4 18/31] hw/i386/sev: Add function to get SEV metadata from OVMF header

2024-05-31 Thread Liam Merwick via
On 31/05/2024 16:41, Paolo Bonzini wrote: > On Fri, May 31, 2024 at 5:20 PM Liam Merwick wrote: >>> +metadata = (OvmfSevMetadata *)(flash_ptr + flash_size - data->offset); >>> +if (memcmp(metadata->signature, "ASEV&

Re: [PATCH v4 18/31] hw/i386/sev: Add function to get SEV metadata from OVMF header

2024-05-31 Thread Liam Merwick via
On 30/05/2024 12:16, Pankaj Gupta wrote: > From: Brijesh Singh > > A recent version of OVMF expanded the reset vector GUID list to add > SEV-specific metadata GUID. The SEV metadata describes the reserved > memory regions such as the secrets and CPUID page used during the SEV-SNP > guest launch.

Re: [PATCH v4 02/31] linux-headers: Update to current kvm/next

2024-05-31 Thread Liam Merwick via
On 30/05/2024 12:16, Pankaj Gupta wrote: > Co-developed-by: Michael Roth > Signed-off-by: Michael Roth > Signed-off-by: Pankaj Gupta > --- > linux-headers/asm-loongarch/bitsperlong.h | 23 ++ > linux-headers/asm-loongarch/kvm.h | 4 ++ > linux-headers/asm-loongarch/mman.h

Re: [PATCH v10 0/9] KVM: mm: fd-based approach for supporting KVM

2023-01-25 Thread Liam Merwick
On 25/01/2023 12:53, Kirill A. Shutemov wrote: On Wed, Jan 25, 2023 at 12:20:26AM +, Sean Christopherson wrote: On Tue, Jan 24, 2023, Liam Merwick wrote: On 14/01/2023 00:37, Sean Christopherson wrote: On Fri, Dec 02, 2022, Chao Peng wrote: ... When running LTP (https://github.com

Re: [PATCH v10 0/9] KVM: mm: fd-based approach for supporting KVM

2023-01-24 Thread Liam Merwick
On 14/01/2023 00:37, Sean Christopherson wrote: On Fri, Dec 02, 2022, Chao Peng wrote: This patch series implements KVM guest private memory for confidential computing scenarios like Intel TDX[1]. If a TDX host accesses TDX-protected guest memory, machine check can happen which can further crash

Re: [Virtio-fs] [PATCH v2] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-26 Thread Liam Merwick
explicitly Cc: qemu-sta...@nongnu.org Or would only a long-term fix target that? Reviewed-by: Liam Merwick Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Vivek Goyal Signed-off-by: Stefan Hajnoczi --- v2: * Add doc comment clarifying that symlinks are traversed client-side [Daniel] This

Re: [PATCH v2 0/3] nvdimm: read-only file support

2020-12-10 Thread Liam Merwick
to memory_region_init_ram_from_file() hostmem-file: add readonly=on|off option nvdimm: honor -object memory-backend-file,readonly=on option Reviewed-by: Liam Merwick Tested-by: Liam Merwick (I just quickly modified kata-runtime to unconditionally pass readonly=on and verified that the root filesys

Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22

2020-06-17 Thread Liam Merwick
On 16/06/2020 15:14, Michael Roth wrote: Hi everyone, The following new patches are queued for QEMU stable v4.2.1: https://github.com/mdroth/qemu/commits/stable-4.2-staging The release is planned for 2020-06-25: https://wiki.qemu.org/Planning/4.2 Due to delays on my part this release i

Re: [PATCH] block: Remove trailing newline in format used by error_report API

2020-02-28 Thread Liam Merwick
ed-by: Liam Merwick --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 1bdb9c679d..e466d15914 100644 --- a/block.c +++ b/block.c @@ -5994,7 +5994,7 @@ void bdrv_img_create(const char *filename, const char *fmt, /* Couldn'

Re: [PATCH] qapi/machine: Place the 'Notes' tag after the 'Since' tag

2020-02-27 Thread Liam Merwick
SysEmuTarget', 'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32', Does the same issue occur for @CpuInstanceProperties: at line 829? The 'Since:' follows a 'Note:' section (but maybe the singular usage is intended). otherwise Reviewed-by: Liam Merwick

Re: [PATCH v2 2/6] tests/boot_linux_console: add BIOS acceptance test

2020-02-26 Thread Liam Merwick
On 19/02/2020 19:20, Wainer dos Santos Moschetta wrote: On 2/6/20 12:12 PM, Philippe Mathieu-Daudé wrote: On 2/5/20 3:56 PM, Liam Merwick wrote: Add a test to use qboot with the 'pc' machine class and SeaBIOS with the 'microvm' machine class (since microvm uses qboot by de

Re: [PATCH v2 09/29] tests/acceptance: Use 'machine' tag to check if available in QEMU binary

2020-02-26 Thread Liam Merwick
On 06/02/2020 18:17, Liam Merwick wrote: On 29/01/2020 21:23, Philippe Mathieu-Daudé wrote: We already use the 'machine' tag in Avocado tests. If the requested machine is not available in the QEMU binary, the tests will be cancelled (skipped):    $ python -m avocado --show=app

Re: [PATCH v2 13/29] python/qemu: Add binutils::binary_get_devices()

2020-02-07 Thread Liam Merwick
On 29/01/2020 21:23, Philippe Mathieu-Daudé wrote: Since QEMU binaries can be built with various configurations, the list of devices linked in can vary. Add a helper to query the list of devices built into a QEMU binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick

Re: [PATCH v2 12/29] python/qemu/accel: Use binutils::binary_get_accels()

2020-02-07 Thread Liam Merwick
On 29/01/2020 21:23, Philippe Mathieu-Daudé wrote: Instead of parsing the process help output, use the binary_get_accels() helper which queries the list of accelerators over a QMP socket. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick --- python/qemu/accel.py | 26

Re: [PATCH v2 11/29] python/qemu: Add binutils::binary_get_accels()

2020-02-07 Thread Liam Merwick
On 29/01/2020 21:23, Philippe Mathieu-Daudé wrote: Add a helper to query the list of accelerators built into a QEMU binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick --- python/qemu/binutils.py | 10 ++ tests/acceptance/core_scripts.py | 10

Re: [PATCH v2 10/29] python/qemu: Add binutils::binary_get_qom_implementations()

2020-02-07 Thread Liam Merwick
ract) +LOG.info(res) +vm.shutdown() Based on Wainer's comment on patch3 - is this vm.shutdown() needed? otherwise Reviewed-by: Liam Merwick +return [m['name'] for m in res] diff --git a/tests/acceptance/core_scripts.py b/tests/acceptance

Re: [PATCH v2 09/29] tests/acceptance: Use 'machine' tag to check if available in QEMU binary

2020-02-06 Thread Liam Merwick
On 29/01/2020 21:23, Philippe Mathieu-Daudé wrote: We already use the 'machine' tag in Avocado tests. If the requested machine is not available in the QEMU binary, the tests will be cancelled (skipped): $ python -m avocado --show=app run tests/acceptance/x86_cpu_model_versions.py ...

Re: [PATCH v2 1/6] tests/boot_linux_console: add microvm acceptance test

2020-02-06 Thread Liam Merwick
On 06/02/2020 14:09, Philippe Mathieu-Daudé wrote: Hi Liam, On 2/6/20 2:57 PM, Philippe Mathieu-Daudé wrote: On 2/5/20 3:56 PM, Liam Merwick wrote: Refactor test_x86_64_pc() to test_x86_64_machine() so that separate functions which specify the Avocado tag of ':avocado: tags=machine:'

[PATCH v2 4/6] tests/boot_linux_console: add extract_from_rpm method

2020-02-05 Thread Liam Merwick
Add a method to extract a specified file from an RPM to the test's working directory and return the path to the extracted file. Signed-off-by: Liam Merwick Reviewed-by: Stefano Garzarella Reviewed-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 16 ++

[PATCH v2 2/6] tests/boot_linux_console: add BIOS acceptance test

2020-02-05 Thread Liam Merwick
Add a test to use qboot with the 'pc' machine class and SeaBIOS with the 'microvm' machine class (since microvm uses qboot by default) by adding the '-bios' option via self.vm.add_args() before calling do_test_x86_64_machine(). Signed-off-by: Liam Merwick R

[PATCH v2 1/6] tests/boot_linux_console: add microvm acceptance test

2020-02-05 Thread Liam Merwick
Refactor test_x86_64_pc() to test_x86_64_machine() so that separate functions which specify the Avocado tag of ':avocado: tags=machine:' as being either 'pc' or 'microvm' can be used to test booting a compressed kernel using either machine class. Signed-off-by: Liam

[PATCH v2 0/6] tests/boot_linux_console: add extra boot acceptance tests

2020-02-05 Thread Liam Merwick
rg/QEMU/20191206140012.15517-1-waine...@redhat.com/ [2] 176d2cda0dee ("i386/cpu: Consolidate die-id validity in smp context") [3] https://travis-ci.org/merwick/qemu/builds/645487393 [4] https://github.com/wainersm/qemu/commit/8f705e98df90b436b0f4946331d441309c437f7b Liam Merwick (6): t

[PATCH v2 6/6] tests/boot_linux_console: use os.path for filesystem paths

2020-02-05 Thread Liam Merwick
Change extract_from_deb() to use os.path routines to manipulate the filesystem path returned when extracting a file. Suggested-by: Wainer dos Santos Moschetta Signed-off-by: Liam Merwick --- tests/acceptance/boot_linux_console.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

[PATCH v2 5/6] tests/boot_linux_console: add PVH acceptance tests

2020-02-05 Thread Liam Merwick
Add tests to boot an uncompressed kernel using the x86/HVM direct boot ABI. The vmlinux binary is obtained from a small RPM for Kata containers and extracted using the new extract_from_rpm() method. Signed-off-by: Liam Merwick --- tests/acceptance/boot_linux_console.py | 60

[PATCH v2 3/6] travis.yml: install rpm2cpio for acceptance tests

2020-02-05 Thread Liam Merwick
The extract_from_rpm() method added for the PVH acceptance tests needs rpm2cpio to extract a vmlinux binary from an RPM. Signed-off-by: Liam Merwick Reviewed-by: Stefano Garzarella --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3b35b7cf04d3

Re: [PATCH 5/6] tests/boot_linux_console: add extract_from_rpm method

2020-02-04 Thread Liam Merwick
On 31/01/2020 15:02, Liam Merwick wrote: [... deleted ...] +    :returns: path of the extracted file +    """ +    cwd = os.getcwd() +    os.chdir(self.workdir) +    process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=Tru

Re: [PATCH 6/6] tests/boot_linux_console: add PVH acceptance tests

2020-01-31 Thread Liam Merwick
On 30/01/2020 23:57, Philippe Mathieu-Daudé wrote: On 1/27/20 5:36 PM, Liam Merwick wrote: Add tests to boot an uncompressed kernel using the x86/HVM direct boot ABI. The vmlinux binary is obtained from a small RPM for Kata containers and extracted using the new extract_from_rpm() method

Re: [PATCH 5/6] tests/boot_linux_console: add extract_from_rpm method

2020-01-31 Thread Liam Merwick
On 30/01/2020 19:19, Wainer dos Santos Moschetta wrote: On 1/30/20 1:34 PM, Liam Merwick wrote: On 30/01/2020 12:05, Stefano Garzarella wrote: On Mon, Jan 27, 2020 at 04:36:33PM +, Liam Merwick wrote: Add a method to extract a specified file from an RPM to the test's working dire

Re: [PATCH 2/6] tests/boot_linux_console: add BIOS acceptance test

2020-01-30 Thread Liam Merwick
On 30/01/2020 15:34, Liam Merwick wrote: On 30/01/2020 11:27, Stefano Garzarella wrote: Hi Liam, On Mon, Jan 27, 2020 at 04:36:30PM +, Liam Merwick wrote: Add tests to use qboot with the 'pc' and 'microvm' machine classes by adding the '-bios' option via sel

Re: [PATCH 2/6] tests/boot_linux_console: add BIOS acceptance test

2020-01-30 Thread Liam Merwick
On 30/01/2020 11:27, Stefano Garzarella wrote: Hi Liam, On Mon, Jan 27, 2020 at 04:36:30PM +, Liam Merwick wrote: Add tests to use qboot with the 'pc' and 'microvm' machine classes by adding the '-bios' option via self.vm.add_args() before calling do_test_x8

Re: [PATCH 5/6] tests/boot_linux_console: add extract_from_rpm method

2020-01-30 Thread Liam Merwick
On 30/01/2020 12:05, Stefano Garzarella wrote: On Mon, Jan 27, 2020 at 04:36:33PM +, Liam Merwick wrote: Add a method to extract a specified file from an RPM to the test's working directory and return the path to the extracted file. Signed-off-by: Liam Merwick --- tests/accep

Re: [PATCH v4 2/7] Acceptance tests: Extract _console_interaction()

2020-01-28 Thread Liam Merwick
Reviewed-by: Liam Merwick Tested-by: Liam Merwick --- tests/acceptance/avocado_qemu/__init__.py | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-)

Re: [PATCH v4 3/7] Acceptance tests: Add interrupt_interactive_console_until_pattern()

2020-01-28 Thread Liam Merwick
On 20/01/2020 23:51, Philippe Mathieu-Daudé wrote: We need a function to interrupt interactive consoles. Example: Interrupt U-Boot to set different environment values. Tested-by: Niek Linnenbank Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick Tested-by: Liam Merwick

Re: [PATCH v4 4/7] python/qemu/machine: Allow to use other serial consoles than default

2020-01-28 Thread Liam Merwick
console_index): +    args.extend(['-serial', 'null']) This patch is not sufficient, we have to initialize _console_index in __init__(): with that fix applied Reviewed-by: Liam Merwick Tested-by: Liam Merwick -- >8 -- diff --git a/python/qemu/machine.py b/python/q

Re: [PATCH] docs: add virtiofsd(1) man page

2020-01-27 Thread Liam Merwick
m,share=on \ + -numa node,memdev=mem \ + ... + guest# mount -t virtio_fs myfs /mnt This should be 'mount -t virtiofs myfs /mnt' like on https://virtio-fs.gitlab.io/howto-qemu.html otherwise Reviewed-by: Liam Merwick

[PATCH 6/6] tests/boot_linux_console: add PVH acceptance tests

2020-01-27 Thread Liam Merwick
Add tests to boot an uncompressed kernel using the x86/HVM direct boot ABI. The vmlinux binary is obtained from a small RPM for Kata containers and extracted using the new extract_from_rpm() method. Signed-off-by: Liam Merwick --- tests/acceptance/boot_linux_console.py | 49

[PATCH 5/6] tests/boot_linux_console: add extract_from_rpm method

2020-01-27 Thread Liam Merwick
Add a method to extract a specified file from an RPM to the test's working directory and return the path to the extracted file. Signed-off-by: Liam Merwick --- tests/acceptance/boot_linux_console.py | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tests/accep

[PATCH 1/6] tests/boot_linux_console: add microvm acceptance test

2020-01-27 Thread Liam Merwick
Refactor test_x86_64_pc() to test_x86_64_machine() so that separate functions which specify the Avocado tag of ':avocado: tags=machine:' as being either 'pc' or 'microvm' can be used to test booting a compressed kernel using either machine class. Signed-off-by: Liam

[PATCH 3/6] tests/boot_linux_console: fix extract_from_deb() comment

2020-01-27 Thread Liam Merwick
The second param in extract_from_deb() is 'path' not 'file' Signed-off-by: Liam Merwick --- tests/acceptance/boot_linux_console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_li

[PATCH 0/6] tests/boot_linux_console: add extra boot acceptance tests

2020-01-27 Thread Liam Merwick
es, etc. [1] https://patchew.org/QEMU/20191206140012.15517-1-waine...@redhat.com/ [2] 176d2cda0dee ("i386/cpu: Consolidate die-id validity in smp context") [3] https://travis-ci.org/merwick/qemu/jobs/641505543 [4] https://github.com/wainersm/qemu/commit/8f705e98df90b436b0f4946331d441309

[PATCH 4/6] travis.yml: install rpm2cpio for acceptance tests

2020-01-27 Thread Liam Merwick
The extract_from_rpm() method added for the PVH acceptance tests needs rpm2cpio to extract a vmlinux binary from an RPM. Signed-off-by: Liam Merwick --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1ae645e9fcec..3d8c2a38e679 100644 --- a

[PATCH 2/6] tests/boot_linux_console: add BIOS acceptance test

2020-01-27 Thread Liam Merwick
Add tests to use qboot with the 'pc' and 'microvm' machine classes by adding the '-bios' option via self.vm.add_args() before calling do_test_x86_64_machine(). Signed-off-by: Liam Merwick --- tests/acceptance/boot_linux_console.py | 15 ++- 1 fil

Re: [PATCH] tests/acceptance: Add boot tests for some of the QEMU advent calendar images

2020-01-24 Thread Liam Merwick
we're there, drop the superfluous --python parameter (python3 is now the only supported version anyway). Signed-off-by: Thomas Huth Reviewed-by: Liam Merwick --- .travis.yml| 2 +- tests/acceptance/boot_linux_console.py | 96 ++

Re: [PATCH 025/104] virtiofsd: Add Makefile wiring for virtiofsd contrib

2019-12-13 Thread Liam Merwick
On 12/12/2019 16:37, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" Wire up the building of the virtiofsd in contrib. s/contrib/tools/ otherwise Reviewed-by: Liam Merwick virtiofsd relies on Linux-specific system calls and seccomp. Anyone wishing to

Re: [PATCH 092/104] virtiofsd: add man page

2019-12-13 Thread Liam Merwick
,allow_other,user_id=0,group_id=0,rootmode=04,dax \ +myfs /mnt Should this be 'mount -t virtiofs myfs /mnt' like on https://virtio-fs.gitlab.io/howto-qemu.html ? otherwise Reviewed-by: Liam Merwick

[PATCH v2] hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass

2019-11-18 Thread Liam Merwick
chineClass to X86MachineClass. Fixes: f0bb276bf8d5 ("hw/i386: split PCMachineState deriving X86MachineState from it") Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny --- v1 -> v2 - fix SHA1 of patch being referenced. hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 4

[PATCH] hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass

2019-11-18 Thread Liam Merwick
chineClass to X86MachineClass. Fixes: 46bf71657c56 ("hw/i386: split PCMachineState deriving X86MachineState from it") Signed-off-by: Liam Merwick --- hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 4 ++-- hw/i386/pc_q35.c | 4 ++-- hw/i386/x86.c | 1 + inclu

Re: [Qemu-devel] [PATCH] usbredir: fix buffer-overflow on vmload

2019-08-07 Thread Liam Merwick
#9 0x7f0c0604e37f (/lib64/libc.so.6+0x4d37f) Signed-off-by: Marc-André Lureau Reviewed-by: Liam Merwick --- hw/usb/redirect.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 998fc6e4b0..9764a57987 100644 --- a/hw/usb/redirect.c +++

Re: [Qemu-devel] [PATCH] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined

2019-07-30 Thread Liam Merwick
On 30/07/2019 01:27, piaojun wrote: Use F_GETLK for fcntl when F_OFD_GETLK not defined. Use F_GETLK/F_SETLK for fcntl when F_OFD_GETLK/F_OFD_SETLK not defined. Signed-off-by: Jun Piao --- contrib/virtiofsd/passthrough_ll.c | 9 + 1 file changed, 9 insertions(+) diff --git a/con

Re: [Qemu-devel] [PATCH v3 1/4] hw/virtio: Factorize virtio-mmio headers

2019-07-25 Thread Liam Merwick
way Reviewed-by: Liam Merwick --- hw/virtio/virtio-mmio.c | 35 +--- hw/virtio/virtio-mmio.h | 60 + 2 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 hw/virtio/virtio-mmio.h diff --git a/hw/virtio/virtio-mmi

Re: [Qemu-devel] [PATCH v3 3/4] hw/i386: Factorize PVH related functions

2019-07-23 Thread Liam Merwick
On 02/07/2019 13:11, Sergio Lopez wrote: Extract PVH related functions from pc.c, and put them in pvh.c, so they can be shared with other components. Signed-off-by: Sergio Lopez Refactoring LGTM Reviewed-by: Liam Merwick --- hw/i386/Makefile.objs | 1 + hw/i386/pc.c | 120

[Qemu-devel] [PATCH] docs/devel/testing: Fix typo in dockerfile path

2019-06-28 Thread Liam Merwick
Signed-off-by: Liam Merwick --- docs/devel/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index da2d0fc9646f..3ef50a61db4d 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -327,7 +327,7 @@ Images

Re: [Qemu-devel] [PATCH] sd: Fix out-of-bounds assertions

2019-04-09 Thread Liam Merwick
On 09/04/2019 06:51, Markus Armbruster wrote: Lidong Chen writes: Due to an off-by-one error, the assert statements allow an out-of-bounds array access. Signed-off-by: Lidong Chen Reviewed-by: Liam Merwick --- hw/sd/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[Qemu-devel] [PATCH] acpi: verify file entries in bios_linker_loader_add_pointer()

2019-03-21 Thread Liam Merwick
The callers to bios_linker_find_file() assert that the file entry returned is not NULL, except for those in bios_linker_loader_add_pointer(). Add two asserts in that case for completeness and to facilitate static code analysis. Signed-off-by: Liam Merwick --- hw/acpi/bios-linker-loader.c | 2

Re: [Qemu-devel] [PATCH 1/2] trace: handle tracefs path truncation

2019-03-21 Thread Liam Merwick
systems since tracefs is mounted on /sys/kernel/debug/tracing/, but the compiler is smart enough to foresee the possibility and warn about the unchecked snprintf(3) return value. This patch fixes the compiler warning. Reported-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi Reviewed-by: Liam

Re: [Qemu-devel] [PATCH 2/2] trace: avoid SystemTap dtrace(1) warnings on empty files

2019-03-21 Thread Liam Merwick
by emitting an empty file instead of "provider qemu {}" when there are no enabled trace events. Fixes: 23c3d569f44284066714ff7c46bc4f19e630583f ("target/hppa: add TLB trace events") Reported-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi Reviewed-by: Liam Merwick

[Qemu-devel] [PATCH] json: Fix off-by-one assert check in next_state()

2019-03-21 Thread Liam Merwick
The assert checking if the value of lexer->state in next_state(), which is used as an index to the 'json_lexer' array, incorrectly checks for an index value less than or equal to ARRAY_SIZE(json_lexer). Fix assert so that it just checks for an index less than the array size. Signed

Re: [Qemu-devel] Booting kernels with PVHVM documentation?

2019-03-08 Thread Liam Merwick
On 06/03/2019 17:51, Alex Bennée wrote: Hi, I've been looking at using PVH as an alternative to a long bios boot sequence to boot some x86_64 test kernels for tests/tcg. I'm finding it hard to piece together all the bits but I naively thought it would just be a case of adding a few ELF NOTES to

Re: [Qemu-devel] [PATCH v3 3/3] vfio/display: delay link up event

2019-02-22 Thread Liam Merwick
- another candidate in vfio_display_edid_link_up(). Either way: Reviewed-by: Liam Merwick --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/display.c | 26 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/

Re: [Qemu-devel] [PATCH v3 2/3] vfio/display: add xres + yres properties

2019-02-22 Thread Liam Merwick
the vfio edid region for this to work. Signed-off-by: Gerd Hoffmann Reviewed-by: Liam Merwick --- hw/vfio/pci.h | 2 ++ hw/vfio/display.c | 12 ++-- hw/vfio/pci.c | 12 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.h b

Re: [Qemu-devel] [PATCH v3 1/3] vfio/display: add edid support.

2019-02-22 Thread Liam Merwick
ret) "va=0x%"PRIx64" size vfio_spapr_create_window(int ps, uint64_t ws, uint64_t off) "pageshift=0x%x winsize=0x%"PRIx64" offset=0x%"PRIx64 vfio_spapr_remove_window(uint64_t off) "offset=0x%"PRIx64 vfio_spapr_group_attach(int groupfd, int tablefd) "Attached groupfd %d to liobn fd %d" + +# hw/vfio/display.c +vfio_display_edid_available(void) "" +vfio_display_edid_link_up(void) "" +vfio_display_edid_link_down(void) "" +vfio_display_edid_update(uint32_t prefx, uint32_t prefy) "%dx%d" These should be %u since the variables are uint32_t +vfio_display_edid_write_error(void) "" Otherwise Reviewed-by: Liam Merwick

Re: [Qemu-devel] [PULL 8/9] usb: add device checks before redirector calls to usb_ep_get()

2019-02-21 Thread Liam Merwick
On 20/02/2019 11:24, Yuval Shaia wrote: On Wed, Feb 20, 2019 at 12:13:45PM +0100, Gerd Hoffmann wrote: From: Liam Merwick Add an assert and an explicit check before the two callers to usb_ep_get() in the USB redirector code to ensure the device passed in is not NULL. Signed-off-by: Liam

Re: [Qemu-devel] [PATCH] build: remove unnecessary assignments from Makefile.target

2019-02-15 Thread Liam Merwick
On 15/02/2019 10:49, Paolo Bonzini wrote: It is only necessary to clear block-obj-y because Makefile.objs uses "+=" instead of "="; fix that and remove the assignment. The other variables need not be cleared at all. Signed-off-by: Paolo Bonzini Revie

[Qemu-devel] [PATCH v5 3/3] tpm_tis: convert tpm_tis_show_buffer() to use trace event

2019-02-15 Thread Liam Merwick
and the two debug callers use the trace event infrastructure so that it's available in production cases also and not just when DEBUG_TIS is enabled. Signed-off-by: Liam Merwick --- v3 -> v4 - Allow for null terminator in buffer length calc. - dropped "tpm_tis: " from direction s

[Qemu-devel] [PATCH v5 1/3] tpm_tis: fix loop that cancels any seizure by a lower locality

2019-02-15 Thread Liam Merwick
in the for loop to check the localities up to the requesting locality. Signed-off-by: Liam Merwick Reviewed-by: Stefan Berger --- v4 -> v5 First char in patch got deleted, corrupting email subject. hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/

[Qemu-devel] [PATCH v5 2/3] tpm_tis: assert valid addr passed to tpm_tis_locality_from_addr()

2019-02-15 Thread Liam Merwick
analysis tools that report that no explicit checking is being done. Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 61a130beef35..772431f20874 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm

[Qemu-devel] [PATCH v4 2/3] tpm_tis: assert valid addr passed to tpm_tis_locality_from_addr()

2019-02-15 Thread Liam Merwick
analysis tools that report that no explicit checking is being done. Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 61a130beef35..772431f20874 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm

[Qemu-devel] [PATCH v4 3/3] tpm_tis: convert tpm_tis_show_buffer() to use trace event

2019-02-15 Thread Liam Merwick
and the two debug callers use the trace event infrastructure so that it's available in production cases also and not just when DEBUG_TIS is enabled. Signed-off-by: Liam Merwick --- v3 -> v4 - Allow for null terminator in buffer length calc. - dropped "tpm_tis: " from direction s

[Qemu-devel] rom c17b1cc4b07370e504cc0ca4ce4af560a83d5977 Mon Sep 17 00:00:00 2001

2019-02-15 Thread Liam Merwick
in the for loop to check the localities up to the requesting locality. Signed-off-by: Liam Merwick Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index fd6bb9b59a96..61a130beef35 100644 --- a

Re: [Qemu-devel] [PATCH v3 3/3] tpm_tis: convert tpm_tis_show_buffer() to use trace event

2019-02-13 Thread Liam Merwick
On 12/02/2019 21:01, Stefan Berger wrote: On 2/12/19 3:48 PM, Liam Merwick wrote: cppcheck reports: [hw/tpm/tpm_tis.c:113]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int' Rather than just converting the format specif

[Qemu-devel] [PATCH v3 1/3] tpm_tis: fix loop that cancels any seizure by a lower locality

2019-02-12 Thread Liam Merwick
in the for loop to check the localities up to the requesting locality. Signed-off-by: Liam Merwick Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index fd6bb9b59a96..61a130beef35 100644 --- a

[Qemu-devel] [PATCH v3 2/3] tpm_tis: assert valid addr passed to tpm_tis_locality_from_addr()

2019-02-12 Thread Liam Merwick
analysis tools that report that no explicit checking is being done. Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 61a130beef35..772431f20874 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw

[Qemu-devel] [PATCH v3 3/3] tpm_tis: convert tpm_tis_show_buffer() to use trace event

2019-02-12 Thread Liam Merwick
and the two debug callers use the trace event infrastructure so that it's available in production cases also and not just when DEBUG_TIS is enabled. Signed-off-by: Liam Merwick --- Sample trace output % echo tpm_tis_show_buffer > /tmp/events % export QTEST_QEMU_BINARY="/home/De

Re: [Qemu-devel] [PATCH v2 3/3] tpm_tis: fix format string specifier in tpm_tis_show_buffer()

2019-02-12 Thread Liam Merwick
On 12/02/2019 13:27, Stefan Berger wrote: On 2/12/19 7:31 AM, Philippe Mathieu-Daudé wrote: On 2/11/19 10:13 PM, Stefan Berger wrote: On 2/11/19 3:09 PM, Liam Merwick wrote: On 11/02/2019 19:56, Stefan Berger wrote: On 2/11/19 11:02 AM, Philippe Mathieu-Daudé wrote: On 2/11/19 4:03 PM, Liam

Re: [Qemu-devel] [PATCH v2] Kconfig: add documentation

2019-02-12 Thread Liam Merwick
On 12/02/2019 09:57, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini Reviewed-by: Liam Merwick --- docs/devel/kconfig.rst | 305 + 1 file changed, 305 insertions(+) create mode 100644 docs/devel/kconfig.rst diff --git a/docs/devel/kconfig.rst

Re: [Qemu-devel] [PATCH v2 3/3] tpm_tis: fix format string specifier in tpm_tis_show_buffer()

2019-02-11 Thread Liam Merwick
On 11/02/2019 19:56, Stefan Berger wrote: On 2/11/19 11:02 AM, Philippe Mathieu-Daudé wrote: Hi Liam, On 2/11/19 4:03 PM, Liam Merwick wrote: cppcheck reports: [hw/tpm/tpm_tis.c:113]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int

[Qemu-devel] [PATCH v2 2/3] tpm_tis: assert valid addr passed to tpm_tis_locality_from_addr()

2019-02-11 Thread Liam Merwick
Defensive check to prevent future caller passing incorrect address or catch if the MMIO address parameters were not all changed together. Signed-off-by: Liam Merwick --- I've been running static analysis tools on QEMU and one reports this check. While it's just theoretically correct (

[Qemu-devel] [PATCH v2 1/3] tpm_tis: fix loop that cancels any seizure by a lower locality

2019-02-11 Thread Liam Merwick
in the for loop to check the localities up to the requesting locality. Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index fd6bb9b59a96..61a130beef35 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw

[Qemu-devel] [PATCH v2 3/3] tpm_tis: fix format string specifier in tpm_tis_show_buffer()

2019-02-11 Thread Liam Merwick
cppcheck reports: [hw/tpm/tpm_tis.c:113]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int' Fix this by using %u instead of %d Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [Qemu-devel] [PATCH] tpm_tis: validate locality values don't overrun array

2019-02-08 Thread Liam Merwick
Hi Stefan, Thanks for the detailed explanations. On 04/02/2019 18:05, Stefan Berger wrote: On 1/30/19 9:45 AM, Liam Merwick wrote: Assert that various locality values don't exceed TPM_TIS_NUM_LOCALITIES by adding specific calls to assert(TPM_TIS_NUM_LOCALITIES(l)) in order to help static

Re: [Qemu-devel] [PATCH] virtio-blk: cleanup using VirtIOBlock *s and VirtIODevice *vdev

2019-02-08 Thread Liam Merwick
On 08/02/2019 14:23, Stefano Garzarella wrote: In several part we still using req->dev or VIRTIO_DEVICE(req->dev) when we have already defined s and vdev pointers: VirtIOBlock *s = req->dev; VirtIODevice *vdev = VIRTIO_DEVICE(s); Signed-off-by: Stefano Garzarella Reviewed

[Qemu-devel] [PATCH v2 6/9] uhci: check device is not NULL before calling usb_ep_get()

2019-02-06 Thread Liam Merwick
In uhci_handle_td(), the call to ehci_find_device() can return NULL if it doesn't find a device matching 'addr' so explicitly check the return value before passing it to usb_ep_get(). Signed-off-by: Liam Merwick --- hw/usb/hcd-uhci.c | 8 +--- 1 file changed, 5 insertions(

[Qemu-devel] [PATCH v2 7/9] usb: check device is not NULL before calling usb_ep_get()

2019-02-06 Thread Liam Merwick
In musb_packet(), the call to usb_find_device() can return NULL if it doesn't find a device matching 'addr' so explicitly check the return value before passing it to usb_ep_get(). This then allows the subsequent calculation of 'id' to be streamlined. Signed-off-by: Liam

[Qemu-devel] [PATCH v2 9/9] usb: remove unnecessary NULL device check from usb_ep_get()

2019-02-06 Thread Liam Merwick
No caller of usb_ep_get() calls it with a NULL device (previous commits have addressed the few remaining cases which didn't explicitly check). Replace check for 'dev == NULL' with an assert instead. Signed-off-by: Liam Merwick --- hw/usb/core.c | 4 +--- 1 file changed, 1

[Qemu-devel] [PATCH v2 8/9] usb: add device checks before redirector calls to usb_ep_get()

2019-02-06 Thread Liam Merwick
Add an assert and an explicit check before the two callers to usb_ep_get() in the USB redirector code to ensure the device passed in is not NULL. Signed-off-by: Liam Merwick --- hw/usb/redirect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/usb/redirect.c b/hw/usb

[Qemu-devel] [PATCH v2 2/9] xhci: add asserts to help with static code analysis

2019-02-06 Thread Liam Merwick
XHCIPort. Signed-off-by: Liam Merwick --- hw/usb/hcd-xhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 19c64f7ff421..99b83aaa9ed5 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2607,6 +2607,7 @@ static void xhci_port_update(XHCIPort

[Qemu-devel] [PATCH v2 4/9] ehci: check device is not NULL before calling usb_ep_get()

2019-02-06 Thread Liam Merwick
In ehci_process_itd(), the call to ehci_find_device() can return NULL if it doesn't find a device matching 'devaddr' so explicitly check the return value before passing it to usb_ep_get(). Signed-off-by: Liam Merwick --- hw/usb/hcd-ehci.c | 7 +-- 1 file changed, 5 i

[Qemu-devel] [PATCH v2 5/9] ohci: check device is not NULL before calling usb_ep_get()

2019-02-06 Thread Liam Merwick
A call to ohci_find_device() can return NULL if it doesn't find a device matching 'addr' so for the two callers, explicitly check the return value before passing it to usb_ep_get(). Signed-off-by: Liam Merwick --- hw/usb/hcd-ohci.c | 8 1 file changed, 8 insertions(+)

[Qemu-devel] [PATCH v2 1/9] usb: rearrange usb_ep_get()

2019-02-06 Thread Liam Merwick
There is no need to calculate the 'eps' variable in usb_ep_get() if 'ep' is the control endpoint. Instead the calculation should be done after validating the input before returning an entry indexed by the endpoint 'ep'. Signed-off-by: Liam Merwick Reviewed-by: D

[Qemu-devel] [PATCH v2 3/9] xhci: check device is not NULL before calling usb_ep_get()

2019-02-06 Thread Liam Merwick
Signed-off-by: Liam Merwick --- hw/usb/hcd-xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 99b83aaa9ed5..ec28bee31963 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3276,10 +3276,10 @@ static USBEndpoint

[Qemu-devel] [PATCH v2 0/9] Dealing with Null devices in usb_ep_get()

2019-02-06 Thread Liam Merwick
>token >> 15) & 0xf); if (ep == NULL) { [ ... ] ... and uhci_find_device can return NULL. So, I'd suggest to check all usb_ep_get() callers, fix them if needed, then remove the 'if (dev== NULL)' check in usb_ep_get() and add the assert() instead. === Pas

Re: [Qemu-devel] [PATCH 2/2] usb: deal with potential Null pointer returned by usb_ep_get()

2019-02-04 Thread Liam Merwick
On 31/01/2019 08:03, Gerd Hoffmann wrote: On Wed, Jan 30, 2019 at 02:37:02PM +, Liam Merwick wrote: From: Liam Merwick usb_ep_get() can return a Null pointer in the (albeit unlikely) case that a NULL USBDevice is passed in via the 'dev' parameter. That should never e

[Qemu-devel] [PATCH] kvm: Potential NULL pointer dereference in kvm_arch_init_vcpu()

2019-01-30 Thread Liam Merwick
From: Liam Merwick In kvm_arch_init_vcpu() a call to cpuid_find_entry() can return NULL so the pointer returned should be checked before dereferencing it. Reported by the Parfait static code analysis tool Signed-off-by: Liam Merwick --- target/i386/kvm.c | 4 +++- 1 file changed, 3

[Qemu-devel] [PATCH] tpm_tis: validate locality values don't overrun array

2019-01-30 Thread Liam Merwick
Assert that various locality values don't exceed TPM_TIS_NUM_LOCALITIES by adding specific calls to assert(TPM_TIS_NUM_LOCALITIES(l)) in order to help static code analysis. Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/tpm/tpm_

[Qemu-devel] [PATCH 1/2] usb: rearrange usb_ep_get()

2019-01-30 Thread Liam Merwick
There is no need to calculate the 'eps' variable in usb_ep_get() if 'ep' is the control endpoint. Instead the calculation should be done after validating the input and the resulting pointer also validated before returning an entry indexed on the endpoint 'ep'

[Qemu-devel] [PATCH 2/2] usb: deal with potential Null pointer returned by usb_ep_get()

2019-01-30 Thread Liam Merwick
From: Liam Merwick usb_ep_get() can return a Null pointer in the (albeit unlikely) case that a NULL USBDevice is passed in via the 'dev' parameter. Before dereferencing the return value from usb_ep_get(), check its validity and use a default (invalid) value where needed. Repor

  1   2   >