[PATCH] target/riscv: Fix mcycle/minstret increment behavior

2023-12-25 Thread Xu Lu
The mcycle/minstret counter's stop flag is mistakenly updated on a copy on stack. Thus the counter increments even when the CY/IR bit in the mcountinhibit register is set. This commit corrects its behavior. Fixes: 3780e33732f88 (target/riscv: Support mcycle/minstret write operation) Signed-off-by:

[PATCH] edu: fix DMA range upper bound check

2023-12-25 Thread Max Erenberg
The edu_check_range function checks that start <= end1 < end2, where end1 is the upper bound (exclusive) of the guest-supplied DMA range and end2 is the upper bound (exclusive) of the device's allowed DMA range. When the guest tries to transfer exactly DMA_SIZE (4096) bytes, end1 will be equal to e

Re: [PATCH 1/5] target/i386: mask high bits of CR3 in 32-bit mode

2023-12-25 Thread Richard Henderson
On 12/23/23 04:59, Paolo Bonzini wrote: CR3 bits 63:32 are ignored in 32-bit mode (either legacy 2-level paging or PAE paging). Do this in mmu_translate() to remove the last where get_physical_address() meaningfully drops the high bits of the address. Cc: qemu-sta...@nongnu.org Suggested-by: Ri

[PATCH v11 7/7] test: bios-tables-test: add IVRS changed binary

2023-12-25 Thread Bui Quang Minh
Following the instructions in bios-tables-test, this adds the changed IVRS.ivrs binary. New IVRS differs in length, checksum, it enables EFRSup in Virtualization Info and adds IVHD type 0x11 with the same device entries as in IVHD type 0x10. ASL diff: /* * Intel ACPI Component Architecture

[PATCH v11 1/7] i386/tcg: implement x2APIC registers MSR access

2023-12-25 Thread Bui Quang Minh
This commit creates apic_register_read/write which are used by both apic_mem_read/write for MMIO access and apic_msr_read/write for MSR access. The apic_msr_read/write returns -1 on error, accelerator can use this to raise the appropriate exception. Signed-off-by: Bui Quang Minh --- hw/intc/api

[PATCH v11 3/7] apic, i386/tcg: add x2apic transitions

2023-12-25 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. The set_base in APICCommonClass now returns an integer to indicate error in execution. apic_set_base return -1 on invalid APIC state transition, acceler

[PATCH v11 5/7] test: bios-tables-test: prepare IVRS change in ACPI table

2023-12-25 Thread Bui Quang Minh
Following the instructions in bios-tables-test, this lists that IVRS.ivrs in ACPI table will be changed to add new IVHD type 0x11. Signed-off-by: Bui Quang Minh --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowe

[PATCH v11 6/7] amd_iommu: report x2APIC support to the operating system

2023-12-25 Thread Bui Quang Minh
This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used to support 32-bit destination id. Additionally, this commit exports IVHD type 0x11 besides the old IVHD type 0x10

[PATCH v11 4/7] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-12-25 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-)

[PATCH v11 0/7] Support x2APIC mode with TCG accelerator

2023-12-25 Thread Bui Quang Minh
Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot Linux kernel into x2APIC mode with TCG accel

[PATCH v11 2/7] apic: add support for x2APIC mode

2023-12-25 Thread Bui Quang Minh
This commit extends the APIC ID to 32-bit long and remove the 255 max APIC ID limit in userspace APIC. The array that manages local APICs is now dynamically allocated based on the max APIC ID of created x86 machine. Also, new x2APIC IPI destination determination scheme, self IPI and x2APIC mode reg

Re: [PATCH for 9.0 00/12] Map memory at destination .load_setup in vDPA-net migration

2023-12-25 Thread Michael S. Tsirkin
On Fri, Dec 15, 2023 at 06:28:18PM +0100, Eugenio Pérez wrote: > Current memory operations like pinning may take a lot of time at the > destination. Currently they are done after the source of the migration is > stopped, and before the workload is resumed at the destination. This is a > period wh

Re: [PATCH v3 0/4] virtio: Refactor vhost input stub

2023-12-25 Thread Michael S. Tsirkin
On Mon, Nov 20, 2023 at 12:37:17PM +0800, Leo Yan wrote: > This series is to refactor vhost stub vhost-user-input. > > Since vhost input stub requires set_config() callback for communication > event configurations between the backend and the guest, patch 01 is a > preparison for support set_config

Re: [PATCH v10 0/7] Support x2APIC mode with TCG accelerator

2023-12-25 Thread Michael S. Tsirkin
On Thu, Nov 09, 2023 at 10:19:17PM +0700, Bui Quang Minh wrote: > Hi everyone, > > This series implements x2APIC mode in userspace local APIC and the > RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu > and AMD iommu are adjusted to support x2APIC interrupt remapping. With

Re: [PATCH v3 0/6] migration: check required entries and sections are loaded

2023-12-25 Thread Michael S. Tsirkin
On Mon, Nov 06, 2023 at 03:35:54PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Hi, > > Surprisingly, the migration code doesn't check that required migration entries > and subsections are loaded. Either optional or required sections are both > ignored when missing. Ac

Re: [PATCH] docs/about: Mark the old pc-i440fx-2.0 - 2.3 machine types as deprecated

2023-12-25 Thread Michael S. Tsirkin
On Wed, Oct 18, 2023 at 03:28:16PM +0200, Thomas Huth wrote: > On 18/10/2023 15.17, Michael S. Tsirkin wrote: > > On Fri, Oct 06, 2023 at 09:52:47AM +0200, Thomas Huth wrote: > > > As we've seen in the past, it's useful for deprecating old machine > > > types to finally be able to get of legacy cod

Re: [PATCH v3 52/70] i386/tdx: handle TDG.VP.VMCALL

2023-12-25 Thread Xiaoyao Li
On 12/22/2023 9:14 PM, Daniel P. Berrangé wrote: On Fri, Dec 22, 2023 at 11:14:12AM +0800, Xiaoyao Li wrote: On 12/21/2023 7:05 PM, Daniel P. Berrangé wrote: On Wed, Nov 15, 2023 at 02:15:01AM -0500, Xiaoyao Li wrote: From: Isaku Yamahata For GetQuote, delegate a request to Quote Generation

Re: [PATCH] blockcommit: Reopen base image as RO after abort

2023-12-25 Thread Alexander Ivanov
Ping. Could someone please review the code? On 11/30/23 11:11, Alexander Ivanov wrote: If a blockcommit is aborted the base image remains in RW mode, that leads to a fail of subsequent live migration. How to reproduce: $ virsh snapshot-create-as vm snp1 --disk-only *** write something to

[PULL 1/1] migration/dirtyrate: Remove an extra parameter

2023-12-25 Thread Hyman Huang
From: Wafer vcpu_dirty_stat_collect() has an unused parameter so remove it. Signed-off-by: Wafer Reviewed-by: Hyman Huang Message-Id: <20231204012230.4123-1-wa...@jaguarmicro.com> --- migration/dirtyrate.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/di

[PULL 0/1] Dirty page rate and dirty page limit 20231225 patch

2023-12-25 Thread Hyman Huang
dirtylimit-dirtyrate-pull-request-20231225 for you to fetch changes up to 4918712fb1c34ae43361b402642e426be85a789e: migration/dirtyrate: Remove an extra parameter (2023-12-25 18:05:47 +0800) dirtylimit dirtyrate pull request 20231225 Nit

Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash

2023-12-25 Thread Samuel Tardieu
Michael Tokarev writes: -#!/bin/bash +#!/usr/bin/env bash What's the reason for this indirection? bash has been /bin/bash for decades, it is used this way in many other places in qemu code and in other projects. Yes I know about current move /bin => /usr/bin etc, but the thing is that t

Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash

2023-12-25 Thread Stefan Weil via
Am 25.12.23 um 09:05 schrieb Michael Tokarev: 23.11.2023 23:57, Samuel Tardieu : This file is the only one involved in the compilation process which still uses the /bin/bash path. Signed-off-by: Samuel Tardieu ---   target/hexagon/idef-parser/prepare | 2 +-   1 file changed, 1 insertion(+), 1

[PULL 3/7] qemu-options: Tell more for -display cocoa

2023-12-25 Thread Michael Tokarev
From: Akihiko Odaki Some options for -display cocoa were not described or not listed at all. Reported-by: BALATON Zoltan Signed-off-by: Akihiko Odaki Signed-off-by: Michael Tokarev --- qemu-options.hx | 17 + 1 file changed, 17 insertions(+) diff --git a/qemu-options.hx b/qe

[PULL 6/7] include/ui/rect.h: fix qemu_rect_init() mis-assignment

2023-12-25 Thread Michael Tokarev
From: Elen Avan Signed-off-by: Elen Avan Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2051 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2050 Fixes: a200d53b1fde "virtio-gpu: replace PIXMAN for region/rect test" Cc: qemu-sta...@nongnu.org Reviewed-by: Michael Tokarev Review

[PULL 5/7] accel/kvm: Turn DPRINTF macro use into tracepoints

2023-12-25 Thread Michael Tokarev
From: Jai Arora Patch removes DPRINTF macro and adds multiple tracepoints to capture different kvm events. We also drop the DPRINTFs that don't add any additional information than trace_kvm_run_exit already does. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1827 Signed-off-by: Jai A

[PULL 0/7] Trivial patches for 2023-12-25

2023-12-25 Thread Michael Tokarev
The following changes since commit 80f1709aa0eb4de09b4240563463f991a5b9d855: Merge tag 'pull-loongarch-20231221' of https://gitlab.com/gaosong/qemu into staging (2023-12-21 19:44:19 -0500) are available in the Git repository at: https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches f

[PULL 2/7] qemu-options: Unify the help entries for cocoa

2023-12-25 Thread Michael Tokarev
From: Akihiko Odaki Apparently the help entries were not merged when the patches got in. Fixes: f844cdb99714 ("ui/cocoa: capture all keys and combos when mouse is grabbed") Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- qemu-options.hx |

[PULL 4/7] docs/tools/qemu-img.rst: fix typo (sumarizes)

2023-12-25 Thread Michael Tokarev
From: Samuel Tardieu Signed-off-by: Samuel Tardieu Reviewed-by: Zhao Liu Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index 4459c065f1..3653adb963 100644 --- a/d

[PULL 7/7] virtio-blk: Fix potential nullpointer read access in virtio_blk_data_plane_destroy

2023-12-25 Thread Michael Tokarev
From: Stefan Weil via Fixes: CID 1532828 Fixes: b6948ab01d ("virtio-blk: add iothread-vq-mapping parameter") Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- hw/block/dataplane/virtio-blk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/block/dataplane/vi

[PULL 1/7] target/riscv/kvm: do not use non-portable strerrorname_np()

2023-12-25 Thread Michael Tokarev
From: Natanael Copa strerrorname_np is non-portable and breaks building with musl libc. Use strerror(errno) instead, like we do other places. Cc: qemu-sta...@nongnu.org Fixes: commit 082e9e4a58ba (target/riscv/kvm: improve 'init_multiext_cfg' error msg) Resolves: https://gitlab.com/qemu-projec

Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash

2023-12-25 Thread Michael Tokarev
23.11.2023 23:57, Samuel Tardieu : This file is the only one involved in the compilation process which still uses the /bin/bash path. Signed-off-by: Samuel Tardieu --- target/hexagon/idef-parser/prepare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/idef-p

Re: [PATCH] virtio-blk: Fix potential nullpointer read access in virtio_blk_data_plane_destroy

2023-12-25 Thread Michael Tokarev
24.12.2023 14:43, Stefan Weil: Fixes: CID 1532828 Fixes: b6948ab01d ("virtio-blk: add iothread-vq-mapping parameter") Signed-off-by: Stefan Weil Applied to the trivial-patches tree, thank you! /mjt