Re: [PATCH v2 for-8.2?] i386/sev: Avoid SEV-ES crash due to missing MSR_EFER_LMA bit

2023-12-08 Thread Maxim Levitsky
On Wed, 2023-12-06 at 11:42 -0600, Michael Roth wrote: > On Wed, Dec 06, 2023 at 07:20:14PM +0200, Maxim Levitsky wrote: > > On Tue, 2023-12-05 at 16:28 -0600, Michael Roth wrote: > > > Commit 7191f24c7fcf ("accel/kvm/kvm-all: Handle register access errors"

Re: [PATCH v2 for-8.2?] i386/sev: Avoid SEV-ES crash due to missing MSR_EFER_LMA bit

2023-12-06 Thread Maxim Levitsky
about something like that: if (sev_es_enabled() && env->efer & MSR_EFER_LME && env->cr[0] & CR0_PG_MASK) { /* * Workaround KVM bug, because of which KVM might not be aware of the * fact that EFER.LMA was toggled by the hardware */ e

Re: Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-10-03 Thread Maxim Levitsky
On Sun, 2022-10-02 at 07:56 -0600, Keith Busch wrote: > On Sun, Oct 02, 2022 at 11:59:42AM +0300, Maxim Levitsky wrote: > > On Thu, 2022-09-29 at 19:35 +0200, Paolo Bonzini wrote: > > > On 9/29/22 18:39, Christoph Hellwig wrote: > > > > On Thu, Sep 29, 2022 at 10:37

Re: Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-10-02 Thread Maxim Levitsky
this is qemu bug, but I do fear that it can cause quite some problems for users, especially for users that use outdated qemu version. It might be too much to ask, but maybe add a Kconfig option to keep legacy behavier for those that need it? Best regards, Maxim Levitsky

Re: Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-09-29 Thread Maxim Levitsky
f don't care, I would be happy to patch my qemu), but I afraid that this will break *lots* of users that only updated the kernel and not the qemu. What do you think? Best regards, Maxim Levitsky

Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-09-29 Thread Maxim Levitsky
6.0-rc7, using mainline master branch as yesterday. Best regards, Maxim Levitsky

Re: [PATCH RFC v1 1/2] i386: reset KVM nested state upon CPU reset

2022-08-10 Thread Maxim Levitsky
  env->nested_state->format = KVM_STATE_NESTED_FORMAT_SVM; > -    } > +    kvm_init_nested_state(env); >      } > } >   > @@ -2199,6 +2214,8 @@ void kvm_arch_reset_vcpu(X86CPU *cpu) > /* enabled by default */ > env->poll_control_msr = 1; >   > +    kvm_init_nested_state(env); > + > sev_es_set_reset_vector(CPU(cpu)); >  } >   Makes sense. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky

Re: [PATCH RFC v1 2/2] i386: reorder kvm_put_sregs2() and kvm_put_nested_state() when vCPU is reset

2022-08-10 Thread Maxim Levitsky
ve mentioned this, I actually already debugged the same issue while trying to reproduce the smm int window bug. 100% my fault. I also share the same feeling that this might be yet another 'whack a mole' and break somewhere else, but overall it does make sense. Reviewed-by: Maxim Levitsky

Re: Guest reboot issues since QEMU 6.0 and Linux 5.11

2022-07-21 Thread Maxim Levitsky
issues are related. Does the guest have HyperV enabled in it (that is nested virtualization?) Intel or AMD? Does the VM uses secure boot / SMM? Best regards, Maxim Levitsky > > There are also a few reports about non-Windows VMs, mostly Ubuntu 20.04 > with UEFI/OVMF, but again, it

Re: [PATCH] target/i386: do not consult nonexistent host leaves

2022-05-01 Thread Maxim Levitsky
28) | > @@ -5775,7 +5806,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, > uint32_t count, > case 0x801D: > *eax = 0; > if (cpu->cache_info_passthrough) { > -host_cpuid(index, count, eax, ebx, ecx, edx); > +x86_cpu_get_cache_cpuid(index, count, eax, ebx, ecx, edx); > break; > } > switch (count) { Makes sense. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky

Re: [PATCH v3 0/1] Patch to adjust coroutine pool size adaptively

2022-03-17 Thread Maxim Levitsky
Just FYI. As a workaround I reduced the virtio-blk queue-size to 16 and it seems to work again. I am only keeping this configuration to test that it boots thus performance is not an issue. Option to override the coroutine pool size would be ideal in this case IMHO though. Best regards, Maxim Levitsky

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

2022-03-17 Thread Maxim Levitsky
u.h | 4 +++ > > > > > target/i386/kvm/kvm-cpu.c | 12 > > > > > target/i386/kvm/kvm.c | 57 > > > > > ++ > > > > > target/i386/kvm/kvm_i386.h | 1 + > > > > > 5 files changed, 75 insertions(+), 6 deletions(-) > > > > > > > > With this commit qemu crashes for me when invoking the following > > > > QMP command: > > > > > > It is way worse than that even. If you remove '-S' you get an > > > immediate kaboom on startup on AMD hosts > > > > Which AMD CPU is in this host? > > AMD EPYC 7302P > > > With regards, > Daniel my 3970X - same issue. Best regards, Maxim Levitsky

[PATCH] KVM: SVM: always set MSR_AMD64_TSC_RATIO to default value

2022-02-23 Thread Maxim Levitsky
Even when the feature is not supported in guest CPUID, still set the msr to the default value which will be the only value KVM will accept in this case Signed-off-by: Maxim Levitsky --- target/i386/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/cpu.c b

[PATCH v2 1/3] KVM: use KVM_{GET|SET}_SREGS2 when supported.

2021-11-01 Thread Maxim Levitsky
This allows to make PDPTRs part of the migration stream and thus not reload them after migration which is against X86 spec. Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 5 ++ include/sysemu/kvm.h | 4 ++ target/i386/cpu.h | 3 ++ target/i386/kvm/kvm.c | 107

[PATCH v2 3/3] KVM: SVM: add migration support for nested TSC scaling

2021-11-01 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- target/i386/cpu.c | 5 + target/i386/cpu.h | 4 target/i386/kvm/kvm.c | 15 +++ target/i386/machine.c | 23 +++ 4 files changed, 47 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index

[PATCH v2 0/3] KVM: qemu patches for few KVM features I developed

2021-11-01 Thread Maxim Levitsky
These patches implement the qemu side logic to support the KVM features I developed recently. All 3 patches are for features that are accepted upstream in KVM. V2: rebased and fixed patch 2 to compile without kvm Best regards, Maxim Levitsky Maxim Levitsky (3): KVM: use KVM_{GET|SET

[PATCH v2 2/3] gdbstub: implement NOIRQ support for single step on KVM

2021-11-01 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 25 ++ gdbstub.c| 62 include/sysemu/kvm.h | 15 +++ 3 files changed, 91 insertions(+), 11 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm

Re: TCP/IP connections sometimes stop retransmitting packets (in nested virtualization case)

2021-10-18 Thread Maxim Levitsky
On Mon, 2021-10-18 at 16:49 -0400, Michael S. Tsirkin wrote: > On Mon, Oct 18, 2021 at 11:05:23AM -0700, Eric Dumazet wrote: > > > > On 10/17/21 3:50 AM, Maxim Levitsky wrote: > > > Hi! > > > > > > This is a follow up mail to my mail about NFS client

Re: [PATCH 2/3] gdbstub: implement NOIRQ support for single step on KVM

2021-10-13 Thread Maxim Levitsky
On Wed, 2021-10-13 at 16:50 +0100, Alex Bennée wrote: > Maxim Levitsky writes: > > > Signed-off-by: Maxim Levitsky > > --- > > accel/kvm/kvm-all.c | 25 ++ > > gdbstub.c| 60

Re: [PATCH 0/3] KVM: qemu patches for few KVM features I developed

2021-10-13 Thread Maxim Levitsky
On Tue, 2021-09-14 at 18:52 +0300, Maxim Levitsky wrote: > These patches implement the qemu side logic to support > the KVM features I developed recently. > > First two patches are for features that are already accepted > upstream, and I already posted them on the qemu ma

Re: [PATCH 0/3] KVM: qemu patches for few KVM features I developed

2021-09-30 Thread Maxim Levitsky
On Tue, 2021-09-14 at 18:52 +0300, Maxim Levitsky wrote: > These patches implement the qemu side logic to support > the KVM features I developed recently. > > First two patches are for features that are already accepted > upstream, and I already posted them on the qemu ma

Re: [PATCH] qemu-img: Add -F shorthand to convert

2021-09-15 Thread Maxim Levitsky
t_img -b "$TEST_IMG".base -F $IMGFMT > > $QEMU_IO -c "write -P 0 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | > _filter_testdir > -$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \ > +$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -F $IMGFMT \ > "$TEST_IMG" "$TEST_IMG".orig > $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | > _filter_testdir > $QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \ I have seen that warning few times already in my scripts, so good to have this option. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky

[PATCH 2/3] gdbstub: implement NOIRQ support for single step on KVM

2021-09-14 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 25 ++ gdbstub.c| 60 include/sysemu/kvm.h | 13 ++ 3 files changed, 88 insertions(+), 10 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c

[PATCH 1/3] KVM: use KVM_{GET|SET}_SREGS2 when supported.

2021-09-14 Thread Maxim Levitsky
This allows to make PDPTRs part of the migration stream and thus not reload them after migration which is against X86 spec. Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 5 ++ include/sysemu/kvm.h | 4 ++ target/i386/cpu.h | 3 ++ target/i386/kvm/kvm.c | 107

[PATCH 3/3] KVM: SVM: add migration support for nested TSC scaling

2021-09-14 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- target/i386/cpu.c | 5 + target/i386/cpu.h | 4 target/i386/kvm/kvm.c | 15 +++ target/i386/machine.c | 23 +++ 4 files changed, 47 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index

[PATCH 0/3] KVM: qemu patches for few KVM features I developed

2021-09-14 Thread Maxim Levitsky
accepted in KVM but can already be added to qemu since it is conditional on KVM supporting it, and ABI wise it only relies on SVM spec. Best regards, Maxim Levitsky Maxim Levitsky (3): KVM: use KVM_{GET|SET}_SREGS2 when supported. gdbstub: implement NOIRQ support for single step on KVM KVM: SVM

Re: About two-dimensional page translation (e.g., Intel EPT) and shadow page table in Linux QEMU/KVM

2021-07-12 Thread Maxim Levitsky
page table (SPT) > simultaneously (e.g., for an 80-core server, 40 cores use EPT/NPT and > the other 40 cores use SPT). What do you think? Thanks! > > Best regards, > Harry > > On Mon, Jul 12, 2021 at 4:49 AM Maxim Levitsky wrote: > > On Sun, 2021-07-11 at 15:13 -0500, harry harr

Re: About two-dimensional page translation (e.g., Intel EPT) and shadow page table in Linux QEMU/KVM

2021-07-12 Thread Maxim Levitsky
t; physical server? For example, if the physical server has 80 cores, is > it possible to let 40 cores use Intel EPT mechanisms for page > translation and the other 40 cores use shadow page table mechanisms? > Thanks! Nope sadly. EPT/NPT is enabled by a module param. Best regards,

Re: [PATCH v2] docs: Add '-device intel-iommu' entry

2021-07-07 Thread Maxim Levitsky
t: 39) > +This decides the address width of IOVA address space. The address > +space has 39 bits width for 3-level IOMMU page tables, and 48 bits > for > +4-level IOMMU page tables. > + > +Please also refer to the wiki page for general scenarios of VT-d >

Re: [PATCH] block/nvme: Fix VFIO_MAP_DMA failed: No space left on device

2021-06-17 Thread Maxim Levitsky
OMEM and -ENOSPC and recycle the mappings in both cases? I think that would work on both old and new kernels. What do you think? Best regards, Maxim Levitsky > > Should I check uname(2)'s utsname.release[]? Is it reliable? > > > The block driver started to mis-beha

Re: [PATCH v4 3/7] block: add max_hw_transfer to BlockLimits

2021-06-09 Thread Maxim Levitsky
ssed something as I haven't touched this area for a long time. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky > --- > block/block-backend.c | 12 > block/file-posix.c | 2 +- > block/io.c | 1 + > hw/scsi

Re: [PATCH v4 2/7] scsi-generic: pass max_segments via max_iov field in BlockLimits

2021-06-09 Thread Maxim Levitsky
max iovec number. https://www.mail-archive.com/qemu-devel@nongnu.org/msg768264.html Best regards, Maxim Levitsky > } > } > > diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c > index 98c30c5d5c..82e1e2ee79 100644 > --- a/hw/scsi/scsi-generi

Re: [PATCH v4 1/7] file-posix: fix max_iov for /dev/sg devices

2021-06-09 Thread Maxim Levitsky
ot;/sys/dev/block/%u:%u/queue/max_segments", > > major(st.st_rdev), minor(st.st_rdev)); > > sysfd = open(sysfspath, O_RDONLY); > > > > Other than that, this is the same as the patch from Tom Yan: https://www.mail-archive.com/qemu-devel@nongnu.org/msg768262.html In this version he does check if the SG_GET_SG_TABLESIZE is defined, so you might want to do this as well. Best regards, Maxim Levitsky

Re: [PATCH v4 4/7] file-posix: try BLKSECTGET on block devices too, do not round to power of 2

2021-06-09 Thread Maxim Levitsky
looks correct, but I might have missed something as well. This is roughly the same as patches from Tom Yan which I carried in my series https://www.mail-archive.com/qemu-devel@nongnu.org/msg768258.html https://www.mail-archive.com/qemu-devel@nongnu.org/msg768262.html I like a bit more how he created separate functions for /dev/sg and for all other block devices. Please take a look. Also not related to this patch, you are missing my fix I did to the VPD limit emulation, please consider taking it into the series: https://www.mail-archive.com/qemu-devel@nongnu.org/msg768260.html Best regards, Maxim Levitsky

Re: [PATCH v3 0/7] block: file-posix queue

2021-06-07 Thread Maxim Levitsky
h I think is similar to this patch series. Sorry that I kind of forgot about it for too much time. https://www.mail-archive.com/qemu-devel@nongnu.org/msg768261.html I'll need some time to swap-in this area so that I could compare our patches to see if we missed something. Best regards, Maxim Levitsky

Re: [PATCH 2/2] gdbstub: implement NOIRQ support for single step on KVM, when kvm's KVM_GUESTDBG_BLOCKIRQ debug flag is supported.

2021-05-05 Thread Maxim Levitsky
On Mon, 2021-04-19 at 17:29 +0100, Alex Bennée wrote: > Maxim Levitsky writes: > > > Signed-off-by: Maxim Levitsky > > --- > > accel/kvm/kvm-all.c | 25 +++ > > gdbstub.c| 59

Re: [PATCH 1/2] kvm: update kernel headers for KVM_GUESTDBG_BLOCKEVENTS

2021-05-05 Thread Maxim Levitsky
On Mon, 2021-04-19 at 17:22 +0100, Alex Bennée wrote: > Maxim Levitsky writes: > > > Signed-off-by: Maxim Levitsky > > Generally it's a good idea to reference where these are coming from, is > it a current kernel patch in flight or from an release we haven't synced >

[PATCH v2 2/2] KVM: use KVM_{GET|SET}_SREGS2 when supported.

2021-04-26 Thread Maxim Levitsky
This allows to make PDPTRs part of the migration stream and thus not reload them after migration which is against X86 spec. Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 5 ++ include/sysemu/kvm.h | 4 ++ target/i386/cpu.h | 3 ++ target/i386/kvm/kvm.c | 107

[PATCH v2 1/2] kvm: update kernel headers for KVM_{GET|SET}_SREGS2

2021-04-26 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- linux-headers/asm-x86/kvm.h | 13 + linux-headers/linux/kvm.h | 5 + 2 files changed, 18 insertions(+) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 8e76d3701d..d61dc76e24 100644 --- a/linux-headers/asm-x86

[PATCH v2 0/2] kvm: use KVM_{GET|SET}_SREGS2 when available

2021-04-26 Thread Maxim Levitsky
This implements support for using these new IOCTLS to migrate PDPTRS. Best regards, Maxim Levitsky Maxim Levitsky (2): kvm: update kernel headers for KVM_{GET|SET}_SREGS2 KVM: use KVM_{GET|SET}_SREGS2 when supported. accel/kvm/kvm-all.c | 5 ++ include/sysemu/kvm.h

Re: [PATCH 2/2] KVM: use KVM_{GET|SET}_SREGS2 when supported by kvm.

2021-04-01 Thread Maxim Levitsky
On Thu, 2021-04-01 at 18:09 +0200, Paolo Bonzini wrote: > On 01/04/21 16:45, Maxim Levitsky wrote: > > + > > +for (i = 0; i < 4; i++) { > > +sregs.pdptrs[i] = env->pdptrs[i]; > > +} > > + > > +sregs.flags = 0; > > +sregs.pa

[PATCH 0/2] kvm: use KVM_{GET|SET}_SREGS2 when available

2021-04-01 Thread Maxim Levitsky
clone of "starship_unstable" Maxim Levitsky (2): kvm: update kernel headers for KVM_{GET|SET}_SREGS2 KVM: use KVM_{GET|SET}_SREGS2 when supported by kvm. accel/kvm/kvm-all.c | 4 ++ include/sysemu/kvm.h| 4 ++ linux-headers/asm-x86/kvm.h | 13 + linux-hea

[PATCH 2/2] KVM: use KVM_{GET|SET}_SREGS2 when supported by kvm.

2021-04-01 Thread Maxim Levitsky
This allows qemu to make PDPTRs be part of the migration stream and thus not reload them after a migration which is against X86 spec. Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 4 ++ include/sysemu/kvm.h | 4 ++ target/i386/cpu.h | 1 + target/i386/kvm/kvm.c | 101

[PATCH 1/2] kvm: update kernel headers for KVM_{GET|SET}_SREGS2

2021-04-01 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- linux-headers/asm-x86/kvm.h | 13 + linux-headers/linux/kvm.h | 5 + 2 files changed, 18 insertions(+) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 8e76d3701d..8c604e6bb1 100644 --- a/linux-headers/asm-x86

[PATCH 0/2] gdbstub: implement support for blocking interrupts on single stepping

2021-04-01 Thread Maxim Levitsky
clone of "starship_unstable" Maxim Levitsky (2): kvm: update kernel headers for KVM_GUESTDBG_BLOCKEVENTS gdbstub: implement NOIRQ support for single step on KVM, when kvm's KVM_GUESTDBG_BLOCKIRQ debug flag is supported. accel/kvm/kvm-all.c | 25

[PATCH 1/2] kvm: update kernel headers for KVM_GUESTDBG_BLOCKEVENTS

2021-04-01 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- linux-headers/asm-x86/kvm.h | 2 ++ linux-headers/linux/kvm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 8e76d3701d..33878cdc34 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux

[PATCH 2/2] gdbstub: implement NOIRQ support for single step on KVM, when kvm's KVM_GUESTDBG_BLOCKIRQ debug flag is supported.

2021-04-01 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- accel/kvm/kvm-all.c | 25 +++ gdbstub.c| 59 include/sysemu/kvm.h | 13 ++ 3 files changed, 87 insertions(+), 10 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm

Re: [PATCH 2/2] qemu-img: align next status sector on destination alignment.

2021-03-18 Thread Maxim Levitsky
On Thu, 2020-11-12 at 17:04 +0200, Maxim Levitsky wrote: > On Thu, 2020-11-12 at 07:45 -0600, Eric Blake wrote: > > On 11/12/20 6:40 AM, Peter Lieven wrote: > > > > > > /* > > > > - * Avoid that s->sector_next_statu

Re: [PATCH] KVM: x86: do not fail if software breakpoint has already been removed

2021-03-12 Thread Maxim Levitsky
On Fri, 2021-03-12 at 12:59 +0100, Stefano Garzarella wrote: > On Thu, Mar 11, 2021 at 02:53:15PM +0200, Maxim Levitsky wrote: > > On Thu, 2021-03-04 at 11:15 +0100, Stefano Garzarella wrote: > > > On Wed, Mar 03, 2021 at 02:07:24PM +0200, Maxim Levitsky wrote: > > > &g

Re: [PATCH] KVM: x86: do not fail if software breakpoint has already been removed

2021-03-11 Thread Maxim Levitsky
On Thu, 2021-03-04 at 11:15 +0100, Stefano Garzarella wrote: > On Wed, Mar 03, 2021 at 02:07:24PM +0200, Maxim Levitsky wrote: > > On Tue, 2021-03-02 at 15:52 +0100, Stefano Garzarella wrote: > > > On Mon, Mar 01, 2021 at 02:56:40PM +0200, Maxim Levitsky wrote: > > > &g

Re: [PATCH] KVM: x86: do not fail if software breakpoint has already been removed

2021-03-03 Thread Maxim Levitsky
On Tue, 2021-03-02 at 15:52 +0100, Stefano Garzarella wrote: > On Mon, Mar 01, 2021 at 02:56:40PM +0200, Maxim Levitsky wrote: > > On Mon, 2021-03-01 at 12:17 +0100, Paolo Bonzini wrote: > > > If kvm_arch_remove_sw_breakpoint finds that a software breakpoint does not > > &g

Re: [PATCH] KVM: x86: deprecate -M kernel-irqchip=off except for -M isapc

2021-03-01 Thread Maxim Levitsky
d are tested with -M kernel-irqchip=split. > > Therefore, deprecate the local APIC and, with it, limit > -M kernel-irqchip=off to the ISA PC machine type, which does not > have a local APIC at all. > > Signed-off-by: Paolo Bonzini Reviewed-by: Maxim Levitsky Best r

Re: [PATCH] KVM: x86: do not fail if software breakpoint has already been removed

2021-03-01 Thread Maxim Levitsky
e breakpoint cannot be deleted and there is no way to add it > back. > > Suggested-by: Maxim Levitsky > Signed-off-by: Paolo Bonzini > --- > target/i386/kvm/kvm.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/target/i386/kv

Re: [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init()

2021-02-17 Thread Maxim Levitsky
> +++ b/util/event_notifier-posix.c > @@ -66,10 +66,10 @@ int event_notifier_init(EventNotifier *e, int active) > e->rfd = fds[0]; > e->wfd = fds[1]; > } > +e->initialized = true; > if (active) { > event_notifier_set(e); > } > -e->initialized = true; > return 0; > > fail: Sorry about that! Best regards, Maxim levitsky

Re: [PATCH v2 0/2] Quality of life patches for qemu coroutine debugging

2021-01-07 Thread Maxim Levitsky
On Thu, 2021-01-07 at 19:05 +0100, Paolo Bonzini wrote: > On 07/01/21 11:24, Maxim Levitsky wrote: > > On Thu, 2020-12-17 at 17:54 +0200, Maxim Levitsky wrote: > > > These are two patches that improve a bit the qemu gdb scripts in regard to > > > coroutines. > >

Re: [PATCH 1/2] file-posix: allow -EBUSY errors during write zeros on raw block devices

2021-01-07 Thread Maxim Levitsky
On Mon, 2020-11-16 at 15:48 +0100, Kevin Wolf wrote: > Am 11.11.2020 um 16:39 hat Maxim Levitsky geschrieben: > > On Linux, fallocate(fd, FALLOC_FL_PUNCH_HOLE) when it is used on a block > > device, > > without O_DIRECT can return -EBUSY if it races with another write

Re: [PATCH v6 0/3] qcow2: don't leave partially initialized file on image creation

2021-01-07 Thread Maxim Levitsky
On Thu, 2020-12-17 at 19:09 +0200, Maxim Levitsky wrote: > Use the bdrv_co_delete_file interface to delete the underlying > file if qcow2 initialization fails (e.g due to bad encryption secret) > > This makes the qcow2 driver behave the same way as the luks driver behaves. > &

Re: [PATCH 0/3] RFC: few random hacks to improve eventfd fallback path

2021-01-07 Thread Maxim Levitsky
On Thu, 2020-12-17 at 17:00 +0200, Maxim Levitsky wrote: > These few patches are the result of a random hacking I did to make the qemu > cope with eventfd allocation failure, when using an iothread, > as it happened in bz #1897550. > > I am not 100% sure which patches in this s

Re: [PATCH v2 0/2] Quality of life patches for qemu coroutine debugging

2021-01-07 Thread Maxim Levitsky
On Thu, 2020-12-17 at 17:54 +0200, Maxim Levitsky wrote: > These are two patches that improve a bit the qemu gdb scripts in regard to > coroutines. > > First patch fixes a bug in 'qemu coroutine' in regard to usage on non topmost > stack frame. > > Second patch implement

Re: [PATCH v3 0/5] SCSI: fix transfer limits for SCSI passthrough

2021-01-07 Thread Maxim Levitsky
On Thu, 2020-12-17 at 18:56 +0200, Maxim Levitsky wrote: > This patch series attempts to provide a solution to the problem of the > transfer > limits of the raw file driver (host_device/file-posix), some of which I > already tried to fix in the past. > > I included 2 patches

Re: [Bug 1873769] Re: SB16 audio playback freezes emulation in Windows 95 guest

2021-01-07 Thread Maxim Levitsky
win95 (I think) drivers. I didn't play with win95 though. I do notice the exact same issue with SB16. Best regards, Maxim Levitsky

[PATCH v6 0/3] qcow2: don't leave partially initialized file on image creation

2020-12-17 Thread Maxim Levitsky
, Maxim Levitsky Maxim Levitsky (3): crypto: luks: Fix tiny memory leak block: add bdrv_co_delete_file_noerr block: qcow2: remove the created file on initialization error block.c | 22 ++ block/crypto.c| 13 ++--- block/qcow2.c

[PATCH v6 1/3] crypto: luks: Fix tiny memory leak

2020-12-17 Thread Maxim Levitsky
When the underlying block device doesn't support the bdrv_co_delete_file interface, an 'Error' object was leaked. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block

[PATCH v6 3/3] block: qcow2: remove the created file on initialization error

2020-12-17 Thread Maxim Levitsky
If the qcow initialization fails, we should remove the file if it was already created, to avoid leaving stale files around. We already do this for luks raw images. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia --- block/qcow2.c | 8 +--- 1 file changed, 5 insertions(+), 3

[PATCH v6 2/3] block: add bdrv_co_delete_file_noerr

2020-12-17 Thread Maxim Levitsky
This function wraps bdrv_co_delete_file for the common case of removing a file, which was just created by format driver, on an error condition. It hides the -ENOTSUPP error, and reports all other errors otherwise. Use it in luks driver Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia

[PATCH v3 4/5] block: use blk_get_max_ioctl_transfer for SCSI passthrough

2020-12-17 Thread Maxim Levitsky
blk_get_max_ioctl_transfer interface. Fixes: 867eccfed8 ("file-posix: Use max transfer length/segment count only for SCSI passthrough") Signed-off-by: Maxim Levitsky --- block/file-posix.c | 7 --- block/iscsi.c | 1 + hw/scsi/scsi-generic.c | 4 ++-- 3 files

[PATCH v3 2/5] file-posix: add sg_get_max_segments that actually works with sg

2020-12-17 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/file-posix.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index cbf1271773..2bf4d095a7 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1179,6 +1179,26 @@ static

[PATCH v3 0/5] SCSI: fix transfer limits for SCSI passthrough

2020-12-17 Thread Maxim Levitsky
if this should be solved. V2: fixed an issue in a patch from Tom Yan (thanks), and removed refactoring from last patch according to Paulo's request. V3: few cosmitic changes due to the review feedback. Maxim Levitsky (3): block: add max_ioctl_transfer to BlockLimits block: use

[PATCH v3 5/5] block/scsi: correctly emulate the VPD block limits page

2020-12-17 Thread Maxim Levitsky
, thus the guest never sees the VPD block limits page as supported. Bump the transfer size by 1 in this case. Signed-off-by: Maxim Levitsky --- hw/scsi/scsi-generic.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index

[PATCH v3 3/5] block: add max_ioctl_transfer to BlockLimits

2020-12-17 Thread Maxim Levitsky
, and simultaneously, the block devices that implement scsi passthrough will switch to 'blk_get_max_ioctl_transfer' to query and to pass it to the guest. Signed-off-by: Maxim Levitsky --- block/block-backend.c | 12 block/io.c | 2 ++ include/block/block_int.h

[PATCH v3 1/5] file-posix: split hdev_refresh_limits from raw_refresh_limits

2020-12-17 Thread Maxim Levitsky
From: Tom Yan We can and should get max transfer length and max segments for all host devices / cdroms (on Linux). Also use MIN_NON_ZERO instead when we clamp max transfer length against max segments. Signed-off-by: Tom Yan Signed-off-by: Maxim Levitsky --- block/file-posix.c | 57

Re: [PATCH v2 1/5] file-posix: split hdev_refresh_limits from raw_refresh_limits

2020-12-17 Thread Maxim Levitsky
On Thu, 2020-12-10 at 18:36 +0800, Tom Yan wrote: > On Wed, 9 Dec 2020 at 21:54, Maxim Levitsky wrote: > > From: Tom Yan > > > > We can and should get max transfer length and max segments for all host > > devices / cdroms (on Linux). > > > > Also use

[PATCH v2 2/2] scripts/gdb: implement 'qemu bt'

2020-12-17 Thread Maxim Levitsky
This script first runs the regular gdb's 'bt' command, and then if we are in a coroutine it prints the coroutines backtraces in the order in which they were called. Signed-off-by: Maxim Levitsky --- scripts/qemu-gdb.py | 1 + scripts/qemugdb/coroutine.py | 28

[PATCH v2 1/2] scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame

2020-12-17 Thread Maxim Levitsky
-by: Maxim Levitsky --- scripts/qemugdb/coroutine.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/qemugdb/coroutine.py b/scripts/qemugdb/coroutine.py index db61389022..e1399211e6 100644 --- a/scripts/qemugdb/coroutine.py +++ b/scripts/qemugdb/coroutine.py @@ -70,6 +70,11 @@ def

[PATCH v2 0/2] Quality of life patches for qemu coroutine debugging

2020-12-17 Thread Maxim Levitsky
. Switch to try/catch around bt, so that when regular bt fails, we print the same message as original bt. 2. Print the correct co-routine address Best regards, Maxim Levitsky Maxim Levitsky (2): scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame

[PATCH 0/2] Quality of life patches for qemu coroutine debugging

2020-12-17 Thread Maxim Levitsky
These are two patches that improve a bit the qemu gdb scripts in regard to coroutines. First patch fixes a bug in 'qemu coroutine' in regard to usage on non topmost stack frame. Second patch implements 'qemu bt' as Stefan suggested. Best regards, Maxim Levitsky Maxim Levitsky (2

[PATCH 1/3] scsi: virtio-scsi: don't process IO on fenced dataplane

2020-12-17 Thread Maxim Levitsky
-by: Maxim Levitsky --- hw/scsi/virtio-scsi-dataplane.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index b995bab3a2..2824a25b65 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi

[PATCH 2/2] scripts/gdb: implement 'qemu bt'

2020-12-17 Thread Maxim Levitsky
This script first runs the regular gdb's 'bt' command, and then if we are in a coroutine it prints the coroutines backtraces in the order in which they were called. Signed-off-by: Maxim Levitsky --- scripts/qemu-gdb.py | 1 + scripts/qemugdb/coroutine.py | 32

[PATCH 0/3] RFC: few random hacks to improve eventfd fallback path

2020-12-17 Thread Maxim Levitsky
, Maxim Levitsky Maxim Levitsky (3): scsi: virtio-scsi: don't process IO on fenced dataplane virtio-scsi: don't uninitialize queues that we didn't initialize event_notifier: handle initialization failure better hw/scsi/virtio-scsi-dataplane.c | 26 +++--- include

[PATCH 1/2] scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame

2020-12-17 Thread Maxim Levitsky
-by: Maxim Levitsky --- scripts/qemugdb/coroutine.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/qemugdb/coroutine.py b/scripts/qemugdb/coroutine.py index db61389022..e1399211e6 100644 --- a/scripts/qemugdb/coroutine.py +++ b/scripts/qemugdb/coroutine.py @@ -70,6 +70,11 @@ def

[PATCH 2/3] virtio-scsi: don't uninitialize queues that we didn't initialize

2020-12-17 Thread Maxim Levitsky
Count number of queues that we initialized and only deinitialize these that we initialized successfully. Signed-off-by: Maxim Levitsky --- hw/scsi/virtio-scsi-dataplane.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio

[PATCH 3/3] event_notifier: handle initialization failure better

2020-12-17 Thread Maxim Levitsky
Add 'initialized' field and use it to avoid touching event notifiers which are either not initialized or if their initialization failed. This is somewhat a hack, but it seems the less intrusive way to make virtio code deal with event notifiers that failed initialization. Signed-off-by: Maxim

[PATCH 1/1] scsi: fix device removal race vs IO restart callback on resume

2020-12-10 Thread Maxim Levitsky
: https://bugzilla.redhat.com/show_bug.cgi?id=1854811 Fix it anyway with a patch that was proposed by Paulo in the above bugzilla. Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky --- hw/scsi/scsi-bus.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi

[PATCH 0/1] Fix for one more race on scsi device removal

2020-12-10 Thread Maxim Levitsky
Levitsky Maxim Levitsky (1): scsi: fix device removal race vs IO restart callback on resume hw/scsi/scsi-bus.c | 4 1 file changed, 4 insertions(+) -- 2.26.2

Re: [PATCH v5 2/4] block: add bdrv_co_delete_file_noerr

2020-12-10 Thread Maxim Levitsky
On Thu, 2020-12-10 at 13:54 +0300, Vladimir Sementsov-Ogievskiy wrote: > 09.12.2020 23:33, Maxim Levitsky wrote: > > This function wraps bdrv_co_delete_file for the common case of removing a > > file, > > which was just created by format driver, on an error conditi

Re: [PATCH v5 4/4] block: qcow2: remove the created file on initialization error

2020-12-10 Thread Maxim Levitsky
On Thu, 2020-12-10 at 14:00 +0300, Vladimir Sementsov-Ogievskiy wrote: > 09.12.2020 23:33, Maxim Levitsky wrote: > > If the qcow initialization fails, we should remove the file if it was > > already created, to avoid leaving stale files around. > > > > We already

Re: [PATCH v2 0/5] SCSI: fix transfer limits for SCSI passthrough

2020-12-10 Thread Maxim Levitsky
= OUTPUT END === > > > > Test command exited with code: 1 > > > > > > The full log is available at > > http://patchew.org/logs/20201209135355.561745-1-mlevi...@redhat.com/testing.checkpatch/?type=message. > > --- > > Email generated automatically by Patchew [https://patchew.org/]. > > Please send your feedback to patchew-de...@redhat.com > > > > Time for v3? I am waiting a bit to see if anything else pops up, to avoid doing too much noise. Best regards, Maxim Levitsky > > Paolo >

[PATCH v5 3/4] crypto: luks: use bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
This refactoring is now possible thanks to this function. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia --- block/crypto.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/block/crypto.c b/block/crypto.c index b3a5275132..1d30fde38e 100644

[PATCH v5 2/4] block: add bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
This function wraps bdrv_co_delete_file for the common case of removing a file, which was just created by format driver, on an error condition. It hides the -ENOTSUPP error, and reports all other errors otherwise. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia --- block.c

[PATCH v5 1/4] crypto: luks: Fix tiny memory leak

2020-12-09 Thread Maxim Levitsky
When the underlying block device doesn't support the bdrv_co_delete_file interface, an 'Error' object was leaked. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia --- block/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/crypto.c b/block/crypto.c index aef5a5721a

[PATCH v5 0/4] qcow2: don't leave partially initialized file on image creation

2020-12-09 Thread Maxim Levitsky
feedback and reworked commit messages V4: got rid of code duplication by adding bdrv_co_delete_file_noerr and made the qcow2 driver use this function to delete both the main and the data file. V5: addresssed review feedback on reworked version. Best regards, Maxim Levitsky Maxim Levitsky (4

[PATCH v5 4/4] block: qcow2: remove the created file on initialization error

2020-12-09 Thread Maxim Levitsky
If the qcow initialization fails, we should remove the file if it was already created, to avoid leaving stale files around. We already do this for luks raw images. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia --- block/qcow2.c | 6 -- 1 file changed, 4 insertions(+), 2

Re: [PATCH v4 4/4] block: qcow2: remove the created file on initialization error

2020-12-09 Thread Maxim Levitsky
On Wed, 2020-12-09 at 18:41 +0100, Alberto Garcia wrote: > On Wed 09 Dec 2020 05:44:41 PM CET, Maxim Levitsky wrote: > > @@ -3847,12 +3847,13 @@ static int coroutine_fn > > qcow2_co_create_opts(BlockDriver *drv, > > > > /* Create the qcow2 image (fo

Re: [PATCH v4 2/4] block: add bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
On Wed, 2020-12-09 at 18:34 +0100, Alberto Garcia wrote: > On Wed 09 Dec 2020 05:44:39 PM CET, Maxim Levitsky wrote: > > +void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs) > > +{ > > +Error *local_err = NULL; > > + > > +

[PATCH v4 3/4] crypto: luks: use bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
This refactoring is now possible thanks to this function. Signed-off-by: Maxim Levitsky --- block/crypto.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/block/crypto.c b/block/crypto.c index b3a5275132..1d30fde38e 100644 --- a/block/crypto.c +++ b/block

[PATCH v4 2/4] block: add bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
This function wraps bdrv_co_delete_file for the common case of removing a file, which was just created by format driver, on an error condition. It hides the -ENOTSUPP error, and reports all other errors otherwise. Signed-off-by: Maxim Levitsky --- block.c | 23

[PATCH v4 4/4] block: qcow2: remove the created file on initialization error

2020-12-09 Thread Maxim Levitsky
If the qcow initialization fails, we should remove the file if it was already created, to avoid leaving stale files around. We already do this for luks raw images. Signed-off-by: Maxim Levitsky --- block/qcow2.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block

[PATCH v4 1/4] crypto: luks: Fix tiny memory leak

2020-12-09 Thread Maxim Levitsky
When the underlying block device doesn't support the bdrv_co_delete_file interface, an 'Error' object was leaked. Signed-off-by: Maxim Levitsky Reviewed-by: Alberto Garcia --- block/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/crypto.c b/block/crypto.c index aef5a5721a

[PATCH v4 0/4] qcow2: don't leave partially initialized file on image creation

2020-12-09 Thread Maxim Levitsky
feedback and reworked commit messages V4: got rid of code duplication by adding bdrv_co_delete_file_noerr and made the qcow2 driver use this function to delete both the main and the data file. Best regards, Maxim Levitsky Maxim Levitsky (4): crypto: luks: Fix tiny memory leak block: add

Re: [PATCH v2 0/5] SCSI: fix transfer limits for SCSI passthrough

2020-12-09 Thread Maxim Levitsky
blk_get_max_ioctl_transfer for > SCSI passthrough) > 5/5 Checking commit 77c9000b7c30 (block/scsi: correctly emulate the VPD block > limits page) > ERROR: braces {} are necessary for all arms of this statement > #39: FILE: hw/scsi/scsi-generic.c:204: > +if (len &

  1   2   3   4   5   6   7   8   9   10   >