All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Marc Zyngier <maz@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
	Paul Mackerras <paulus@ozlabs.org>,
	Anup Patel <anup.patel@wdc.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Atish Patra <atish.patra@wdc.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, David Matlack <dmatlack@google.com>,
	Oliver Upton <oupton@google.com>,
	Jing Zhang <jingzhangos@google.com>,
	Wei Huang <wei.huang2@amd.com>
Subject: Re: [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful
Date: Thu, 02 Dec 2021 02:20:45 +0200	[thread overview]
Message-ID: <32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com> (raw)
In-Reply-To: <458c0819a578ba854f00089bc312c8faa177a81a.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]

On Tue, 2021-11-30 at 00:53 +0200, Maxim Levitsky wrote:
> On Mon, 2021-11-29 at 20:18 +0100, Paolo Bonzini wrote:
> > On 11/29/21 19:55, Sean Christopherson wrote:
> > > > Still it does seem to be a race that happens when IS_RUNNING=true but
> > > > vcpu->mode == OUTSIDE_GUEST_MODE.  This patch makes the race easier to
> > > > trigger because it moves IS_RUNNING=false later.
> > > 
> > > Oh!  Any chance the bug only repros with preemption enabled?  That would explain
> > > why I don't see problems, I'm pretty sure I've only run AVIC with a PREEMPT=n.
> > 
> > Me too.
> > 
> > > svm_vcpu_{un}blocking() are called with preemption enabled, and avic_set_running()
> > > passes in vcpu->cpu.  If the vCPU is preempted and scheduled in on a different CPU,
> > > avic_vcpu_load() will overwrite the vCPU's entry with the wrong CPU info.
> > 
> > That would make a lot of sense.  avic_vcpu_load() can handle 
> > svm->avic_is_running = false, but avic_set_running still needs its body 
> > wrapped by preempt_disable/preempt_enable.
> > 
> > Fedora's kernel is CONFIG_PREEMPT_VOLUNTARY, but I know Maxim uses his 
> > own build so it would not surprise me if he used CONFIG_PREEMPT=y.
> > 
> > Paolo
> > 
> 
> I will write ll the details tomorrow but I strongly suspect the CPU errata 
> https://developer.amd.com/wp-content/resources/56323-PUB_0.78.pdf
> #1235
>  
> Basically what I see that
>  
> 1. vCPU2 disables is_running in avic physical id cache
> 2. vCPU2 checks that IRR is empty and it is
> 3. vCPU2 does schedule();
>  
> and it keeps on sleeping forever. If I kick it via signal 
> (like just doing 'info registers' qemu hmp command
> or just stop/cont on the same hmp interface, the
> vCPU wakes up and notices that IRR suddenly is not empty,
> and the VM comes back to life (and then hangs after a while again
> with the same problem....).
>  
> As far as I see in the traces, the bit in IRR came from
> another VCPU who didn't respect the ir_running bit and didn't get 
> AVIC_INCOMPLETE_IPI VMexit.
> I can't 100% prove it yet, but everything in the trace shows this.
>  
> About the rest of the environment, currently I reproduce this in
> a VM which has no pci passed through devices at all, just AVIC.
> (I wasn't able to reproduce it before just because I forgot to
> enable AVIC in this configuration).
>  
> So I also agree that Sean's patch is not to blame here,
> it just made the window between setting is_running and getting to sleep
> shorter and made it less likely that other vCPUs will pick up the is_running change.
> (I suspect that they pick it up on next vmrun, and otherwise the value is somehow
> cached wrongfully in them).
>  
> A very performance killing workaround of kicking all vCPUs when one of them enters vcpu_block
> does seem to work for me but it skews all the timing off so I can't prove it.
>  
> That is all, I will write more detailed info, including some traces I have.
>  
> I do use windows 10 with so called LatencyMon in it, which shows overall how
> much latency hardware interrupts have, which used to be useful for me to
> ensure that my VMs are suitable for RT like latency (even before I joined RedHat,
> I tuned my VMs as much as I could to make my Rift CV1 VR headset work well which 
> needs RT like latencies.
>  
> These days VR works fine in my VMs anyway, but I still kept this tool to keep an eye on it).
>  
> I really need to write a kvm unit test to stress test IPIs, especially this case,
> I will do this very soon.
>  
>  
> Wei Huang, any info on this would be very helpful. 
>  
> Maybe putting the avic physical table in UC memory would help? 
> Maybe ringing doorbells of all other vcpus will help them notice the change?
> 
> Best regards,
> 	Maxim Levitsky


Hi!

I am now almost sure that this is errata #1235.

I had attached a kvm-unit-test I wrote (patch against master of https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git/)
which is able to reproduce the issue on stock 5.15.0 kernel (*no patches applied at all*) after just few seconds.
If kvm is loaded without halt-polling (that is  halt_poll_ns=0 is used).

Halt polling and/or Sean's patch are not to blame, it just changes timeing.
With Sean's patch I don't need to disable half polling.

I did find few avic inhibition bugs that this test also finds and to make it work before I fix them,
I added a workaround to not hit them in this test.
I'll send patches to fix those very soon.
Note that in windows VM there were no avic inhibitions so those bugs are not relevant.

Wei Huang, do you know if this issue is fixed on Zen3, and if it is fixed on some Zen2 machines?
Any workarounds other than 'don't use avic'?

Best regards,
	Maxim Levitsky


[-- Attachment #2: 0001-add-unit-test-for-avic-ipi.patch --]
[-- Type: text/x-patch, Size: 5236 bytes --]

From dba295579d10ff88b596697c861a7c83f5e9d013 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <mlevitsk@redhat.com>
Date: Tue, 30 Nov 2021 13:56:57 +0200
Subject: [PATCH] add unit test for avic ipi

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/Makefile.common |   3 +-
 x86/ipi_stress.c    | 169 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |   5 ++
 3 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 x86/ipi_stress.c

diff --git a/x86/Makefile.common b/x86/Makefile.common
index 461de51..372d6ec 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -60,7 +60,8 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/init.flat $(TEST_DIR)/smap.flat \
                $(TEST_DIR)/hyperv_synic.flat $(TEST_DIR)/hyperv_stimer.flat \
                $(TEST_DIR)/hyperv_connections.flat \
-               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat
+               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat \
+               $(TEST_DIR)/ipi_stress.flat
 
 test_cases: $(tests-common) $(tests)
 
diff --git a/x86/ipi_stress.c b/x86/ipi_stress.c
new file mode 100644
index 0000000..50cbf39
--- /dev/null
+++ b/x86/ipi_stress.c
@@ -0,0 +1,169 @@
+#include "libcflat.h"
+#include "smp.h"
+#include "alloc.h"
+#include "apic.h"
+#include "processor.h"
+#include "isr.h"
+#include "asm/barrier.h"
+#include "delay.h"
+#include "atomic.h"
+
+static atomic_t running_cpus;
+
+volatile u64 *isr_counts;
+
+volatile bool finish_init;
+
+u64 num_outer_iterations = 5;
+#define NUM_INNER_ITERATIONS 10000
+#define TOTAL_NUMBER_ITERATIONS (num_outer_iterations * NUM_INNER_ITERATIONS)
+
+static void ipi_interrupt_handler(isr_regs_t *r)
+{
+	isr_counts[smp_id()]++;
+	eoi();
+}
+
+static  void wait_for_ipi(volatile u64 *count)
+{
+	u64 old_count = *count;
+	while (1) {
+		if ((rdtsc() >> 4) % 10000 != 0 ) {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "nop\n"
+			    "cli\n"
+			);
+			if (old_count != *count)
+				break;
+		}
+
+		else {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "hlt\n"
+			    "cli\n"
+			);
+
+			if (old_count != *count)
+				break;
+		}
+	};
+}
+
+static void vcpu_init(void *data)
+{
+	int cpu = (long)data;
+
+	/* To make it easier to see iteration number in the trace */
+	handle_irq(0x40, ipi_interrupt_handler);
+	handle_irq(0x50, ipi_interrupt_handler);
+
+	atomic_inc(&running_cpus);
+
+	if (cpu != 0)
+		while (!finish_init);
+}
+
+static void vcpu_code(void *data)
+{
+	int ncpus = cpu_count();
+	int cpu = (long)data;
+	u64 i;
+
+	assert(cpu != 0);
+	if (cpu != 1)
+		wait_for_ipi(&isr_counts[cpu]);
+
+	for (i = 0; i < TOTAL_NUMBER_ITERATIONS; i++) {
+
+		u8 physical_dst = cpu == ncpus -1 ? 1 : cpu + 1;
+
+		// send IPI to a next vCPU in a circular fashion
+		apic_icr_write(APIC_INT_ASSERT |
+				APIC_DEST_PHYSICAL |
+				APIC_DM_FIXED |
+				(i % 2 ? 0x40 : 0x50),
+				physical_dst);
+
+		// wait for the IPI interrupt chain to come back to us
+		if (i < (TOTAL_NUMBER_ITERATIONS - 1) || cpu == 1)
+			wait_for_ipi(&isr_counts[cpu]);
+
+		if (cpu == 1 && (i % NUM_INNER_ITERATIONS == 0))
+			printf(".");
+	}
+}
+
+
+
+int main(int argc, void** argv)
+{
+	int cpu, ncpus = cpu_count();
+
+	assert(ncpus > 2);
+
+	if (argc > 1)
+		num_outer_iterations = atol(argv[1]);
+
+	isr_counts = (volatile u64 *)calloc(ncpus, sizeof(u64));
+
+	printf("found %d cpus\n", ncpus);
+	printf("running for %lld iterations\n",
+		(long long unsigned int)TOTAL_NUMBER_ITERATIONS);
+
+	/*
+	 * Ensure that we don't have interrupt window pending
+	 * from PIT timer which inhibits the AVIC.
+	 */
+
+	for (cpu = 0; cpu < ncpus; ++cpu)
+		on_cpu_async(cpu, vcpu_init, (void *)(long)cpu);
+
+	/* Workaround for apic->irr_pending bug vs avic inhibittion:
+	 * Ensure that all vCPUs are running before uninhibiting the AVIC
+	 * */
+
+	while (atomic_read(&running_cpus) < ncpus)
+		pause();
+
+	asm volatile("sti;nop;cli\n");
+
+	/* now let all the vCPUs end the IPI function*/
+	finish_init = true;
+
+	while (cpus_active() > 1)
+	      pause();
+
+	printf("starting test on all cpus but 0...\n");
+
+	for (cpu = ncpus-1; cpu > 0; cpu--)
+		on_cpu_async(cpu, vcpu_code, (void *)(long)cpu);
+
+	printf("test started, waiting to end...\n");
+
+	while (cpus_active() > 1) {
+
+		u64 isr_count1 = isr_counts[1];
+
+		delay(5ULL*1000*1000*1000);
+
+		if (isr_count1 == isr_counts[1]) {
+			printf("\n");
+			printf("hang detected!!\n");
+			break;
+		}
+	}
+
+	printf("\n");
+
+	for (cpu = 1; cpu < ncpus; ++cpu)
+		report(isr_counts[cpu] == TOTAL_NUMBER_ITERATIONS,
+				"Number of IPIs match (%lld)",
+				(long long unsigned int)isr_counts[cpu]);
+
+	free((void*)isr_counts);
+	return report_summary();
+}
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 6244595..ff866b4 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -61,6 +61,11 @@ smp = 2
 file = smptest.flat
 smp = 3
 
+[ipi_stress]
+file = ipi_stress.flat
+extra_params = -cpu host,-x2apic,-svm,-hypervisor -global kvm-pit.lost_tick_policy=discard -machine kernel-irqchip=on
+smp = 4
+
 [vmexit_cpuid]
 file = vmexit.flat
 extra_params = -append 'cpuid'
-- 
2.26.3


WARNING: multiple messages have this Message-ID (diff)
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Marc Zyngier <maz@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
	Paul Mackerras <paulus@ozlabs.org>,
	Anup Patel <anup.patel@wdc.com>,
	 Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Christian Borntraeger <borntraeger@de.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Atish Patra <atish.patra@wdc.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	linux-arm-kernel@lists.infradead.org,
	 kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org,
	kvm@vger.kernel.org,  kvm-ppc@vger.kernel.org,
	kvm-riscv@lists.infradead.org,  linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, David Matlack <dmatlack@google.com>,
	Oliver Upton <oupton@google.com>,
	Jing Zhang <jingzhangos@google.com>,
	Wei Huang <wei.huang2@amd.com>
Subject: Re: [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful
Date: Thu, 02 Dec 2021 02:20:45 +0200	[thread overview]
Message-ID: <32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com> (raw)
In-Reply-To: <458c0819a578ba854f00089bc312c8faa177a81a.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]

On Tue, 2021-11-30 at 00:53 +0200, Maxim Levitsky wrote:
> On Mon, 2021-11-29 at 20:18 +0100, Paolo Bonzini wrote:
> > On 11/29/21 19:55, Sean Christopherson wrote:
> > > > Still it does seem to be a race that happens when IS_RUNNING=true but
> > > > vcpu->mode == OUTSIDE_GUEST_MODE.  This patch makes the race easier to
> > > > trigger because it moves IS_RUNNING=false later.
> > > 
> > > Oh!  Any chance the bug only repros with preemption enabled?  That would explain
> > > why I don't see problems, I'm pretty sure I've only run AVIC with a PREEMPT=n.
> > 
> > Me too.
> > 
> > > svm_vcpu_{un}blocking() are called with preemption enabled, and avic_set_running()
> > > passes in vcpu->cpu.  If the vCPU is preempted and scheduled in on a different CPU,
> > > avic_vcpu_load() will overwrite the vCPU's entry with the wrong CPU info.
> > 
> > That would make a lot of sense.  avic_vcpu_load() can handle 
> > svm->avic_is_running = false, but avic_set_running still needs its body 
> > wrapped by preempt_disable/preempt_enable.
> > 
> > Fedora's kernel is CONFIG_PREEMPT_VOLUNTARY, but I know Maxim uses his 
> > own build so it would not surprise me if he used CONFIG_PREEMPT=y.
> > 
> > Paolo
> > 
> 
> I will write ll the details tomorrow but I strongly suspect the CPU errata 
> https://developer.amd.com/wp-content/resources/56323-PUB_0.78.pdf
> #1235
>  
> Basically what I see that
>  
> 1. vCPU2 disables is_running in avic physical id cache
> 2. vCPU2 checks that IRR is empty and it is
> 3. vCPU2 does schedule();
>  
> and it keeps on sleeping forever. If I kick it via signal 
> (like just doing 'info registers' qemu hmp command
> or just stop/cont on the same hmp interface, the
> vCPU wakes up and notices that IRR suddenly is not empty,
> and the VM comes back to life (and then hangs after a while again
> with the same problem....).
>  
> As far as I see in the traces, the bit in IRR came from
> another VCPU who didn't respect the ir_running bit and didn't get 
> AVIC_INCOMPLETE_IPI VMexit.
> I can't 100% prove it yet, but everything in the trace shows this.
>  
> About the rest of the environment, currently I reproduce this in
> a VM which has no pci passed through devices at all, just AVIC.
> (I wasn't able to reproduce it before just because I forgot to
> enable AVIC in this configuration).
>  
> So I also agree that Sean's patch is not to blame here,
> it just made the window between setting is_running and getting to sleep
> shorter and made it less likely that other vCPUs will pick up the is_running change.
> (I suspect that they pick it up on next vmrun, and otherwise the value is somehow
> cached wrongfully in them).
>  
> A very performance killing workaround of kicking all vCPUs when one of them enters vcpu_block
> does seem to work for me but it skews all the timing off so I can't prove it.
>  
> That is all, I will write more detailed info, including some traces I have.
>  
> I do use windows 10 with so called LatencyMon in it, which shows overall how
> much latency hardware interrupts have, which used to be useful for me to
> ensure that my VMs are suitable for RT like latency (even before I joined RedHat,
> I tuned my VMs as much as I could to make my Rift CV1 VR headset work well which 
> needs RT like latencies.
>  
> These days VR works fine in my VMs anyway, but I still kept this tool to keep an eye on it).
>  
> I really need to write a kvm unit test to stress test IPIs, especially this case,
> I will do this very soon.
>  
>  
> Wei Huang, any info on this would be very helpful. 
>  
> Maybe putting the avic physical table in UC memory would help? 
> Maybe ringing doorbells of all other vcpus will help them notice the change?
> 
> Best regards,
> 	Maxim Levitsky


Hi!

I am now almost sure that this is errata #1235.

I had attached a kvm-unit-test I wrote (patch against master of https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git/)
which is able to reproduce the issue on stock 5.15.0 kernel (*no patches applied at all*) after just few seconds.
If kvm is loaded without halt-polling (that is  halt_poll_ns=0 is used).

Halt polling and/or Sean's patch are not to blame, it just changes timeing.
With Sean's patch I don't need to disable half polling.

I did find few avic inhibition bugs that this test also finds and to make it work before I fix them,
I added a workaround to not hit them in this test.
I'll send patches to fix those very soon.
Note that in windows VM there were no avic inhibitions so those bugs are not relevant.

Wei Huang, do you know if this issue is fixed on Zen3, and if it is fixed on some Zen2 machines?
Any workarounds other than 'don't use avic'?

Best regards,
	Maxim Levitsky


[-- Attachment #2: 0001-add-unit-test-for-avic-ipi.patch --]
[-- Type: text/x-patch, Size: 5236 bytes --]

From dba295579d10ff88b596697c861a7c83f5e9d013 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <mlevitsk@redhat.com>
Date: Tue, 30 Nov 2021 13:56:57 +0200
Subject: [PATCH] add unit test for avic ipi

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/Makefile.common |   3 +-
 x86/ipi_stress.c    | 169 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |   5 ++
 3 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 x86/ipi_stress.c

diff --git a/x86/Makefile.common b/x86/Makefile.common
index 461de51..372d6ec 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -60,7 +60,8 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/init.flat $(TEST_DIR)/smap.flat \
                $(TEST_DIR)/hyperv_synic.flat $(TEST_DIR)/hyperv_stimer.flat \
                $(TEST_DIR)/hyperv_connections.flat \
-               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat
+               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat \
+               $(TEST_DIR)/ipi_stress.flat
 
 test_cases: $(tests-common) $(tests)
 
diff --git a/x86/ipi_stress.c b/x86/ipi_stress.c
new file mode 100644
index 0000000..50cbf39
--- /dev/null
+++ b/x86/ipi_stress.c
@@ -0,0 +1,169 @@
+#include "libcflat.h"
+#include "smp.h"
+#include "alloc.h"
+#include "apic.h"
+#include "processor.h"
+#include "isr.h"
+#include "asm/barrier.h"
+#include "delay.h"
+#include "atomic.h"
+
+static atomic_t running_cpus;
+
+volatile u64 *isr_counts;
+
+volatile bool finish_init;
+
+u64 num_outer_iterations = 5;
+#define NUM_INNER_ITERATIONS 10000
+#define TOTAL_NUMBER_ITERATIONS (num_outer_iterations * NUM_INNER_ITERATIONS)
+
+static void ipi_interrupt_handler(isr_regs_t *r)
+{
+	isr_counts[smp_id()]++;
+	eoi();
+}
+
+static  void wait_for_ipi(volatile u64 *count)
+{
+	u64 old_count = *count;
+	while (1) {
+		if ((rdtsc() >> 4) % 10000 != 0 ) {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "nop\n"
+			    "cli\n"
+			);
+			if (old_count != *count)
+				break;
+		}
+
+		else {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "hlt\n"
+			    "cli\n"
+			);
+
+			if (old_count != *count)
+				break;
+		}
+	};
+}
+
+static void vcpu_init(void *data)
+{
+	int cpu = (long)data;
+
+	/* To make it easier to see iteration number in the trace */
+	handle_irq(0x40, ipi_interrupt_handler);
+	handle_irq(0x50, ipi_interrupt_handler);
+
+	atomic_inc(&running_cpus);
+
+	if (cpu != 0)
+		while (!finish_init);
+}
+
+static void vcpu_code(void *data)
+{
+	int ncpus = cpu_count();
+	int cpu = (long)data;
+	u64 i;
+
+	assert(cpu != 0);
+	if (cpu != 1)
+		wait_for_ipi(&isr_counts[cpu]);
+
+	for (i = 0; i < TOTAL_NUMBER_ITERATIONS; i++) {
+
+		u8 physical_dst = cpu == ncpus -1 ? 1 : cpu + 1;
+
+		// send IPI to a next vCPU in a circular fashion
+		apic_icr_write(APIC_INT_ASSERT |
+				APIC_DEST_PHYSICAL |
+				APIC_DM_FIXED |
+				(i % 2 ? 0x40 : 0x50),
+				physical_dst);
+
+		// wait for the IPI interrupt chain to come back to us
+		if (i < (TOTAL_NUMBER_ITERATIONS - 1) || cpu == 1)
+			wait_for_ipi(&isr_counts[cpu]);
+
+		if (cpu == 1 && (i % NUM_INNER_ITERATIONS == 0))
+			printf(".");
+	}
+}
+
+
+
+int main(int argc, void** argv)
+{
+	int cpu, ncpus = cpu_count();
+
+	assert(ncpus > 2);
+
+	if (argc > 1)
+		num_outer_iterations = atol(argv[1]);
+
+	isr_counts = (volatile u64 *)calloc(ncpus, sizeof(u64));
+
+	printf("found %d cpus\n", ncpus);
+	printf("running for %lld iterations\n",
+		(long long unsigned int)TOTAL_NUMBER_ITERATIONS);
+
+	/*
+	 * Ensure that we don't have interrupt window pending
+	 * from PIT timer which inhibits the AVIC.
+	 */
+
+	for (cpu = 0; cpu < ncpus; ++cpu)
+		on_cpu_async(cpu, vcpu_init, (void *)(long)cpu);
+
+	/* Workaround for apic->irr_pending bug vs avic inhibittion:
+	 * Ensure that all vCPUs are running before uninhibiting the AVIC
+	 * */
+
+	while (atomic_read(&running_cpus) < ncpus)
+		pause();
+
+	asm volatile("sti;nop;cli\n");
+
+	/* now let all the vCPUs end the IPI function*/
+	finish_init = true;
+
+	while (cpus_active() > 1)
+	      pause();
+
+	printf("starting test on all cpus but 0...\n");
+
+	for (cpu = ncpus-1; cpu > 0; cpu--)
+		on_cpu_async(cpu, vcpu_code, (void *)(long)cpu);
+
+	printf("test started, waiting to end...\n");
+
+	while (cpus_active() > 1) {
+
+		u64 isr_count1 = isr_counts[1];
+
+		delay(5ULL*1000*1000*1000);
+
+		if (isr_count1 == isr_counts[1]) {
+			printf("\n");
+			printf("hang detected!!\n");
+			break;
+		}
+	}
+
+	printf("\n");
+
+	for (cpu = 1; cpu < ncpus; ++cpu)
+		report(isr_counts[cpu] == TOTAL_NUMBER_ITERATIONS,
+				"Number of IPIs match (%lld)",
+				(long long unsigned int)isr_counts[cpu]);
+
+	free((void*)isr_counts);
+	return report_summary();
+}
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 6244595..ff866b4 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -61,6 +61,11 @@ smp = 2
 file = smptest.flat
 smp = 3
 
+[ipi_stress]
+file = ipi_stress.flat
+extra_params = -cpu host,-x2apic,-svm,-hypervisor -global kvm-pit.lost_tick_policy=discard -machine kernel-irqchip=on
+smp = 4
+
 [vmexit_cpuid]
 file = vmexit.flat
 extra_params = -append 'cpuid'
-- 
2.26.3


[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Marc Zyngier <maz@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
	Paul Mackerras <paulus@ozlabs.org>,
	Anup Patel <anup.patel@wdc.com>,
	 Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Christian Borntraeger <borntraeger@de.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Atish Patra <atish.patra@wdc.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	linux-arm-kernel@lists.infradead.org,
	 kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org,
	kvm@vger.kernel.org,  kvm-ppc@vger.kernel.org,
	kvm-riscv@lists.infradead.org,  linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, David Matlack <dmatlack@google.com>,
	Oliver Upton <oupton@google.com>,
	Jing Zhang <jingzhangos@google.com>,
	Wei Huang <wei.huang2@amd.com>
Subject: Re: [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful
Date: Thu, 02 Dec 2021 02:20:45 +0200	[thread overview]
Message-ID: <32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com> (raw)
In-Reply-To: <458c0819a578ba854f00089bc312c8faa177a81a.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]

On Tue, 2021-11-30 at 00:53 +0200, Maxim Levitsky wrote:
> On Mon, 2021-11-29 at 20:18 +0100, Paolo Bonzini wrote:
> > On 11/29/21 19:55, Sean Christopherson wrote:
> > > > Still it does seem to be a race that happens when IS_RUNNING=true but
> > > > vcpu->mode == OUTSIDE_GUEST_MODE.  This patch makes the race easier to
> > > > trigger because it moves IS_RUNNING=false later.
> > > 
> > > Oh!  Any chance the bug only repros with preemption enabled?  That would explain
> > > why I don't see problems, I'm pretty sure I've only run AVIC with a PREEMPT=n.
> > 
> > Me too.
> > 
> > > svm_vcpu_{un}blocking() are called with preemption enabled, and avic_set_running()
> > > passes in vcpu->cpu.  If the vCPU is preempted and scheduled in on a different CPU,
> > > avic_vcpu_load() will overwrite the vCPU's entry with the wrong CPU info.
> > 
> > That would make a lot of sense.  avic_vcpu_load() can handle 
> > svm->avic_is_running = false, but avic_set_running still needs its body 
> > wrapped by preempt_disable/preempt_enable.
> > 
> > Fedora's kernel is CONFIG_PREEMPT_VOLUNTARY, but I know Maxim uses his 
> > own build so it would not surprise me if he used CONFIG_PREEMPT=y.
> > 
> > Paolo
> > 
> 
> I will write ll the details tomorrow but I strongly suspect the CPU errata 
> https://developer.amd.com/wp-content/resources/56323-PUB_0.78.pdf
> #1235
>  
> Basically what I see that
>  
> 1. vCPU2 disables is_running in avic physical id cache
> 2. vCPU2 checks that IRR is empty and it is
> 3. vCPU2 does schedule();
>  
> and it keeps on sleeping forever. If I kick it via signal 
> (like just doing 'info registers' qemu hmp command
> or just stop/cont on the same hmp interface, the
> vCPU wakes up and notices that IRR suddenly is not empty,
> and the VM comes back to life (and then hangs after a while again
> with the same problem....).
>  
> As far as I see in the traces, the bit in IRR came from
> another VCPU who didn't respect the ir_running bit and didn't get 
> AVIC_INCOMPLETE_IPI VMexit.
> I can't 100% prove it yet, but everything in the trace shows this.
>  
> About the rest of the environment, currently I reproduce this in
> a VM which has no pci passed through devices at all, just AVIC.
> (I wasn't able to reproduce it before just because I forgot to
> enable AVIC in this configuration).
>  
> So I also agree that Sean's patch is not to blame here,
> it just made the window between setting is_running and getting to sleep
> shorter and made it less likely that other vCPUs will pick up the is_running change.
> (I suspect that they pick it up on next vmrun, and otherwise the value is somehow
> cached wrongfully in them).
>  
> A very performance killing workaround of kicking all vCPUs when one of them enters vcpu_block
> does seem to work for me but it skews all the timing off so I can't prove it.
>  
> That is all, I will write more detailed info, including some traces I have.
>  
> I do use windows 10 with so called LatencyMon in it, which shows overall how
> much latency hardware interrupts have, which used to be useful for me to
> ensure that my VMs are suitable for RT like latency (even before I joined RedHat,
> I tuned my VMs as much as I could to make my Rift CV1 VR headset work well which 
> needs RT like latencies.
>  
> These days VR works fine in my VMs anyway, but I still kept this tool to keep an eye on it).
>  
> I really need to write a kvm unit test to stress test IPIs, especially this case,
> I will do this very soon.
>  
>  
> Wei Huang, any info on this would be very helpful. 
>  
> Maybe putting the avic physical table in UC memory would help? 
> Maybe ringing doorbells of all other vcpus will help them notice the change?
> 
> Best regards,
> 	Maxim Levitsky


Hi!

I am now almost sure that this is errata #1235.

I had attached a kvm-unit-test I wrote (patch against master of https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git/)
which is able to reproduce the issue on stock 5.15.0 kernel (*no patches applied at all*) after just few seconds.
If kvm is loaded without halt-polling (that is  halt_poll_ns=0 is used).

Halt polling and/or Sean's patch are not to blame, it just changes timeing.
With Sean's patch I don't need to disable half polling.

I did find few avic inhibition bugs that this test also finds and to make it work before I fix them,
I added a workaround to not hit them in this test.
I'll send patches to fix those very soon.
Note that in windows VM there were no avic inhibitions so those bugs are not relevant.

Wei Huang, do you know if this issue is fixed on Zen3, and if it is fixed on some Zen2 machines?
Any workarounds other than 'don't use avic'?

Best regards,
	Maxim Levitsky


[-- Attachment #2: 0001-add-unit-test-for-avic-ipi.patch --]
[-- Type: text/x-patch, Size: 5236 bytes --]

From dba295579d10ff88b596697c861a7c83f5e9d013 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <mlevitsk@redhat.com>
Date: Tue, 30 Nov 2021 13:56:57 +0200
Subject: [PATCH] add unit test for avic ipi

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/Makefile.common |   3 +-
 x86/ipi_stress.c    | 169 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |   5 ++
 3 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 x86/ipi_stress.c

diff --git a/x86/Makefile.common b/x86/Makefile.common
index 461de51..372d6ec 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -60,7 +60,8 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/init.flat $(TEST_DIR)/smap.flat \
                $(TEST_DIR)/hyperv_synic.flat $(TEST_DIR)/hyperv_stimer.flat \
                $(TEST_DIR)/hyperv_connections.flat \
-               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat
+               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat \
+               $(TEST_DIR)/ipi_stress.flat
 
 test_cases: $(tests-common) $(tests)
 
diff --git a/x86/ipi_stress.c b/x86/ipi_stress.c
new file mode 100644
index 0000000..50cbf39
--- /dev/null
+++ b/x86/ipi_stress.c
@@ -0,0 +1,169 @@
+#include "libcflat.h"
+#include "smp.h"
+#include "alloc.h"
+#include "apic.h"
+#include "processor.h"
+#include "isr.h"
+#include "asm/barrier.h"
+#include "delay.h"
+#include "atomic.h"
+
+static atomic_t running_cpus;
+
+volatile u64 *isr_counts;
+
+volatile bool finish_init;
+
+u64 num_outer_iterations = 5;
+#define NUM_INNER_ITERATIONS 10000
+#define TOTAL_NUMBER_ITERATIONS (num_outer_iterations * NUM_INNER_ITERATIONS)
+
+static void ipi_interrupt_handler(isr_regs_t *r)
+{
+	isr_counts[smp_id()]++;
+	eoi();
+}
+
+static  void wait_for_ipi(volatile u64 *count)
+{
+	u64 old_count = *count;
+	while (1) {
+		if ((rdtsc() >> 4) % 10000 != 0 ) {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "nop\n"
+			    "cli\n"
+			);
+			if (old_count != *count)
+				break;
+		}
+
+		else {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "hlt\n"
+			    "cli\n"
+			);
+
+			if (old_count != *count)
+				break;
+		}
+	};
+}
+
+static void vcpu_init(void *data)
+{
+	int cpu = (long)data;
+
+	/* To make it easier to see iteration number in the trace */
+	handle_irq(0x40, ipi_interrupt_handler);
+	handle_irq(0x50, ipi_interrupt_handler);
+
+	atomic_inc(&running_cpus);
+
+	if (cpu != 0)
+		while (!finish_init);
+}
+
+static void vcpu_code(void *data)
+{
+	int ncpus = cpu_count();
+	int cpu = (long)data;
+	u64 i;
+
+	assert(cpu != 0);
+	if (cpu != 1)
+		wait_for_ipi(&isr_counts[cpu]);
+
+	for (i = 0; i < TOTAL_NUMBER_ITERATIONS; i++) {
+
+		u8 physical_dst = cpu == ncpus -1 ? 1 : cpu + 1;
+
+		// send IPI to a next vCPU in a circular fashion
+		apic_icr_write(APIC_INT_ASSERT |
+				APIC_DEST_PHYSICAL |
+				APIC_DM_FIXED |
+				(i % 2 ? 0x40 : 0x50),
+				physical_dst);
+
+		// wait for the IPI interrupt chain to come back to us
+		if (i < (TOTAL_NUMBER_ITERATIONS - 1) || cpu == 1)
+			wait_for_ipi(&isr_counts[cpu]);
+
+		if (cpu == 1 && (i % NUM_INNER_ITERATIONS == 0))
+			printf(".");
+	}
+}
+
+
+
+int main(int argc, void** argv)
+{
+	int cpu, ncpus = cpu_count();
+
+	assert(ncpus > 2);
+
+	if (argc > 1)
+		num_outer_iterations = atol(argv[1]);
+
+	isr_counts = (volatile u64 *)calloc(ncpus, sizeof(u64));
+
+	printf("found %d cpus\n", ncpus);
+	printf("running for %lld iterations\n",
+		(long long unsigned int)TOTAL_NUMBER_ITERATIONS);
+
+	/*
+	 * Ensure that we don't have interrupt window pending
+	 * from PIT timer which inhibits the AVIC.
+	 */
+
+	for (cpu = 0; cpu < ncpus; ++cpu)
+		on_cpu_async(cpu, vcpu_init, (void *)(long)cpu);
+
+	/* Workaround for apic->irr_pending bug vs avic inhibittion:
+	 * Ensure that all vCPUs are running before uninhibiting the AVIC
+	 * */
+
+	while (atomic_read(&running_cpus) < ncpus)
+		pause();
+
+	asm volatile("sti;nop;cli\n");
+
+	/* now let all the vCPUs end the IPI function*/
+	finish_init = true;
+
+	while (cpus_active() > 1)
+	      pause();
+
+	printf("starting test on all cpus but 0...\n");
+
+	for (cpu = ncpus-1; cpu > 0; cpu--)
+		on_cpu_async(cpu, vcpu_code, (void *)(long)cpu);
+
+	printf("test started, waiting to end...\n");
+
+	while (cpus_active() > 1) {
+
+		u64 isr_count1 = isr_counts[1];
+
+		delay(5ULL*1000*1000*1000);
+
+		if (isr_count1 == isr_counts[1]) {
+			printf("\n");
+			printf("hang detected!!\n");
+			break;
+		}
+	}
+
+	printf("\n");
+
+	for (cpu = 1; cpu < ncpus; ++cpu)
+		report(isr_counts[cpu] == TOTAL_NUMBER_ITERATIONS,
+				"Number of IPIs match (%lld)",
+				(long long unsigned int)isr_counts[cpu]);
+
+	free((void*)isr_counts);
+	return report_summary();
+}
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 6244595..ff866b4 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -61,6 +61,11 @@ smp = 2
 file = smptest.flat
 smp = 3
 
+[ipi_stress]
+file = ipi_stress.flat
+extra_params = -cpu host,-x2apic,-svm,-hypervisor -global kvm-pit.lost_tick_policy=discard -machine kernel-irqchip=on
+smp = 4
+
 [vmexit_cpuid]
 file = vmexit.flat
 extra_params = -append 'cpuid'
-- 
2.26.3


[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Cornelia Huck <cohuck@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	kvm@vger.kernel.org, David Hildenbrand <david@redhat.com>,
	linux-kernel@vger.kernel.org, Paul Mackerras <paulus@ozlabs.org>,
	Atish Patra <atish.patra@wdc.com>,
	linux-riscv@lists.infradead.org,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	kvmarm@lists.cs.columbia.edu,
	Janosch Frank <frankja@linux.ibm.com>,
	Marc Zyngier <maz@kernel.org>, Joerg Roedel <joro@8bytes.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Wei Huang <wei.huang2@amd.com>,
	kvm-ppc@vger.kernel.org, Paul Walmsley <paul.walmsley@sifive.com>,
	David Matlack <dmatlack@google.com>,
	linux-arm-kernel@lists.infradead.org,
	Jim Mattson <jmattson@google.com>,
	Anup Patel <anup.patel@wdc.com>,
	linux-mips@vger.kernel.org, Palmer Dabbelt <palmer@dabbelt.com>,
	kvm-riscv@lists.infradead.org,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful
Date: Thu, 02 Dec 2021 02:20:45 +0200	[thread overview]
Message-ID: <32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com> (raw)
In-Reply-To: <458c0819a578ba854f00089bc312c8faa177a81a.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]

On Tue, 2021-11-30 at 00:53 +0200, Maxim Levitsky wrote:
> On Mon, 2021-11-29 at 20:18 +0100, Paolo Bonzini wrote:
> > On 11/29/21 19:55, Sean Christopherson wrote:
> > > > Still it does seem to be a race that happens when IS_RUNNING=true but
> > > > vcpu->mode == OUTSIDE_GUEST_MODE.  This patch makes the race easier to
> > > > trigger because it moves IS_RUNNING=false later.
> > > 
> > > Oh!  Any chance the bug only repros with preemption enabled?  That would explain
> > > why I don't see problems, I'm pretty sure I've only run AVIC with a PREEMPT=n.
> > 
> > Me too.
> > 
> > > svm_vcpu_{un}blocking() are called with preemption enabled, and avic_set_running()
> > > passes in vcpu->cpu.  If the vCPU is preempted and scheduled in on a different CPU,
> > > avic_vcpu_load() will overwrite the vCPU's entry with the wrong CPU info.
> > 
> > That would make a lot of sense.  avic_vcpu_load() can handle 
> > svm->avic_is_running = false, but avic_set_running still needs its body 
> > wrapped by preempt_disable/preempt_enable.
> > 
> > Fedora's kernel is CONFIG_PREEMPT_VOLUNTARY, but I know Maxim uses his 
> > own build so it would not surprise me if he used CONFIG_PREEMPT=y.
> > 
> > Paolo
> > 
> 
> I will write ll the details tomorrow but I strongly suspect the CPU errata 
> https://developer.amd.com/wp-content/resources/56323-PUB_0.78.pdf
> #1235
>  
> Basically what I see that
>  
> 1. vCPU2 disables is_running in avic physical id cache
> 2. vCPU2 checks that IRR is empty and it is
> 3. vCPU2 does schedule();
>  
> and it keeps on sleeping forever. If I kick it via signal 
> (like just doing 'info registers' qemu hmp command
> or just stop/cont on the same hmp interface, the
> vCPU wakes up and notices that IRR suddenly is not empty,
> and the VM comes back to life (and then hangs after a while again
> with the same problem....).
>  
> As far as I see in the traces, the bit in IRR came from
> another VCPU who didn't respect the ir_running bit and didn't get 
> AVIC_INCOMPLETE_IPI VMexit.
> I can't 100% prove it yet, but everything in the trace shows this.
>  
> About the rest of the environment, currently I reproduce this in
> a VM which has no pci passed through devices at all, just AVIC.
> (I wasn't able to reproduce it before just because I forgot to
> enable AVIC in this configuration).
>  
> So I also agree that Sean's patch is not to blame here,
> it just made the window between setting is_running and getting to sleep
> shorter and made it less likely that other vCPUs will pick up the is_running change.
> (I suspect that they pick it up on next vmrun, and otherwise the value is somehow
> cached wrongfully in them).
>  
> A very performance killing workaround of kicking all vCPUs when one of them enters vcpu_block
> does seem to work for me but it skews all the timing off so I can't prove it.
>  
> That is all, I will write more detailed info, including some traces I have.
>  
> I do use windows 10 with so called LatencyMon in it, which shows overall how
> much latency hardware interrupts have, which used to be useful for me to
> ensure that my VMs are suitable for RT like latency (even before I joined RedHat,
> I tuned my VMs as much as I could to make my Rift CV1 VR headset work well which 
> needs RT like latencies.
>  
> These days VR works fine in my VMs anyway, but I still kept this tool to keep an eye on it).
>  
> I really need to write a kvm unit test to stress test IPIs, especially this case,
> I will do this very soon.
>  
>  
> Wei Huang, any info on this would be very helpful. 
>  
> Maybe putting the avic physical table in UC memory would help? 
> Maybe ringing doorbells of all other vcpus will help them notice the change?
> 
> Best regards,
> 	Maxim Levitsky


Hi!

I am now almost sure that this is errata #1235.

I had attached a kvm-unit-test I wrote (patch against master of https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git/)
which is able to reproduce the issue on stock 5.15.0 kernel (*no patches applied at all*) after just few seconds.
If kvm is loaded without halt-polling (that is  halt_poll_ns=0 is used).

Halt polling and/or Sean's patch are not to blame, it just changes timeing.
With Sean's patch I don't need to disable half polling.

I did find few avic inhibition bugs that this test also finds and to make it work before I fix them,
I added a workaround to not hit them in this test.
I'll send patches to fix those very soon.
Note that in windows VM there were no avic inhibitions so those bugs are not relevant.

Wei Huang, do you know if this issue is fixed on Zen3, and if it is fixed on some Zen2 machines?
Any workarounds other than 'don't use avic'?

Best regards,
	Maxim Levitsky


[-- Attachment #2: 0001-add-unit-test-for-avic-ipi.patch --]
[-- Type: text/x-patch, Size: 5236 bytes --]

From dba295579d10ff88b596697c861a7c83f5e9d013 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <mlevitsk@redhat.com>
Date: Tue, 30 Nov 2021 13:56:57 +0200
Subject: [PATCH] add unit test for avic ipi

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/Makefile.common |   3 +-
 x86/ipi_stress.c    | 169 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |   5 ++
 3 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 x86/ipi_stress.c

diff --git a/x86/Makefile.common b/x86/Makefile.common
index 461de51..372d6ec 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -60,7 +60,8 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/init.flat $(TEST_DIR)/smap.flat \
                $(TEST_DIR)/hyperv_synic.flat $(TEST_DIR)/hyperv_stimer.flat \
                $(TEST_DIR)/hyperv_connections.flat \
-               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat
+               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat \
+               $(TEST_DIR)/ipi_stress.flat
 
 test_cases: $(tests-common) $(tests)
 
diff --git a/x86/ipi_stress.c b/x86/ipi_stress.c
new file mode 100644
index 0000000..50cbf39
--- /dev/null
+++ b/x86/ipi_stress.c
@@ -0,0 +1,169 @@
+#include "libcflat.h"
+#include "smp.h"
+#include "alloc.h"
+#include "apic.h"
+#include "processor.h"
+#include "isr.h"
+#include "asm/barrier.h"
+#include "delay.h"
+#include "atomic.h"
+
+static atomic_t running_cpus;
+
+volatile u64 *isr_counts;
+
+volatile bool finish_init;
+
+u64 num_outer_iterations = 5;
+#define NUM_INNER_ITERATIONS 10000
+#define TOTAL_NUMBER_ITERATIONS (num_outer_iterations * NUM_INNER_ITERATIONS)
+
+static void ipi_interrupt_handler(isr_regs_t *r)
+{
+	isr_counts[smp_id()]++;
+	eoi();
+}
+
+static  void wait_for_ipi(volatile u64 *count)
+{
+	u64 old_count = *count;
+	while (1) {
+		if ((rdtsc() >> 4) % 10000 != 0 ) {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "nop\n"
+			    "cli\n"
+			);
+			if (old_count != *count)
+				break;
+		}
+
+		else {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "hlt\n"
+			    "cli\n"
+			);
+
+			if (old_count != *count)
+				break;
+		}
+	};
+}
+
+static void vcpu_init(void *data)
+{
+	int cpu = (long)data;
+
+	/* To make it easier to see iteration number in the trace */
+	handle_irq(0x40, ipi_interrupt_handler);
+	handle_irq(0x50, ipi_interrupt_handler);
+
+	atomic_inc(&running_cpus);
+
+	if (cpu != 0)
+		while (!finish_init);
+}
+
+static void vcpu_code(void *data)
+{
+	int ncpus = cpu_count();
+	int cpu = (long)data;
+	u64 i;
+
+	assert(cpu != 0);
+	if (cpu != 1)
+		wait_for_ipi(&isr_counts[cpu]);
+
+	for (i = 0; i < TOTAL_NUMBER_ITERATIONS; i++) {
+
+		u8 physical_dst = cpu == ncpus -1 ? 1 : cpu + 1;
+
+		// send IPI to a next vCPU in a circular fashion
+		apic_icr_write(APIC_INT_ASSERT |
+				APIC_DEST_PHYSICAL |
+				APIC_DM_FIXED |
+				(i % 2 ? 0x40 : 0x50),
+				physical_dst);
+
+		// wait for the IPI interrupt chain to come back to us
+		if (i < (TOTAL_NUMBER_ITERATIONS - 1) || cpu == 1)
+			wait_for_ipi(&isr_counts[cpu]);
+
+		if (cpu == 1 && (i % NUM_INNER_ITERATIONS == 0))
+			printf(".");
+	}
+}
+
+
+
+int main(int argc, void** argv)
+{
+	int cpu, ncpus = cpu_count();
+
+	assert(ncpus > 2);
+
+	if (argc > 1)
+		num_outer_iterations = atol(argv[1]);
+
+	isr_counts = (volatile u64 *)calloc(ncpus, sizeof(u64));
+
+	printf("found %d cpus\n", ncpus);
+	printf("running for %lld iterations\n",
+		(long long unsigned int)TOTAL_NUMBER_ITERATIONS);
+
+	/*
+	 * Ensure that we don't have interrupt window pending
+	 * from PIT timer which inhibits the AVIC.
+	 */
+
+	for (cpu = 0; cpu < ncpus; ++cpu)
+		on_cpu_async(cpu, vcpu_init, (void *)(long)cpu);
+
+	/* Workaround for apic->irr_pending bug vs avic inhibittion:
+	 * Ensure that all vCPUs are running before uninhibiting the AVIC
+	 * */
+
+	while (atomic_read(&running_cpus) < ncpus)
+		pause();
+
+	asm volatile("sti;nop;cli\n");
+
+	/* now let all the vCPUs end the IPI function*/
+	finish_init = true;
+
+	while (cpus_active() > 1)
+	      pause();
+
+	printf("starting test on all cpus but 0...\n");
+
+	for (cpu = ncpus-1; cpu > 0; cpu--)
+		on_cpu_async(cpu, vcpu_code, (void *)(long)cpu);
+
+	printf("test started, waiting to end...\n");
+
+	while (cpus_active() > 1) {
+
+		u64 isr_count1 = isr_counts[1];
+
+		delay(5ULL*1000*1000*1000);
+
+		if (isr_count1 == isr_counts[1]) {
+			printf("\n");
+			printf("hang detected!!\n");
+			break;
+		}
+	}
+
+	printf("\n");
+
+	for (cpu = 1; cpu < ncpus; ++cpu)
+		report(isr_counts[cpu] == TOTAL_NUMBER_ITERATIONS,
+				"Number of IPIs match (%lld)",
+				(long long unsigned int)isr_counts[cpu]);
+
+	free((void*)isr_counts);
+	return report_summary();
+}
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 6244595..ff866b4 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -61,6 +61,11 @@ smp = 2
 file = smptest.flat
 smp = 3
 
+[ipi_stress]
+file = ipi_stress.flat
+extra_params = -cpu host,-x2apic,-svm,-hypervisor -global kvm-pit.lost_tick_policy=discard -machine kernel-irqchip=on
+smp = 4
+
 [vmexit_cpuid]
 file = vmexit.flat
 extra_params = -append 'cpuid'
-- 
2.26.3


[-- Attachment #3: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Marc Zyngier <maz@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
	Paul Mackerras <paulus@ozlabs.org>,
	Anup Patel <anup.patel@wdc.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Atish Patra <atish.patra@wdc.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, David Matlack <dmatlack@google.com>,
	Oliver Upton <oupton@google.com>,
	Jing Zhang <jingzhangos@google.com>,
	Wei Huang <wei.huang2@amd.com>
Subject: Re: [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful
Date: Thu, 02 Dec 2021 00:20:45 +0000	[thread overview]
Message-ID: <32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com> (raw)
In-Reply-To: <458c0819a578ba854f00089bc312c8faa177a81a.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]

On Tue, 2021-11-30 at 00:53 +0200, Maxim Levitsky wrote:
> On Mon, 2021-11-29 at 20:18 +0100, Paolo Bonzini wrote:
> > On 11/29/21 19:55, Sean Christopherson wrote:
> > > > Still it does seem to be a race that happens when IS_RUNNING=true but
> > > > vcpu->mode == OUTSIDE_GUEST_MODE.  This patch makes the race easier to
> > > > trigger because it moves IS_RUNNING=false later.
> > > 
> > > Oh!  Any chance the bug only repros with preemption enabled?  That would explain
> > > why I don't see problems, I'm pretty sure I've only run AVIC with a PREEMPT=n.
> > 
> > Me too.
> > 
> > > svm_vcpu_{un}blocking() are called with preemption enabled, and avic_set_running()
> > > passes in vcpu->cpu.  If the vCPU is preempted and scheduled in on a different CPU,
> > > avic_vcpu_load() will overwrite the vCPU's entry with the wrong CPU info.
> > 
> > That would make a lot of sense.  avic_vcpu_load() can handle 
> > svm->avic_is_running = false, but avic_set_running still needs its body 
> > wrapped by preempt_disable/preempt_enable.
> > 
> > Fedora's kernel is CONFIG_PREEMPT_VOLUNTARY, but I know Maxim uses his 
> > own build so it would not surprise me if he used CONFIG_PREEMPT=y.
> > 
> > Paolo
> > 
> 
> I will write ll the details tomorrow but I strongly suspect the CPU errata 
> https://developer.amd.com/wp-content/resources/56323-PUB_0.78.pdf
> #1235
>  
> Basically what I see that
>  
> 1. vCPU2 disables is_running in avic physical id cache
> 2. vCPU2 checks that IRR is empty and it is
> 3. vCPU2 does schedule();
>  
> and it keeps on sleeping forever. If I kick it via signal 
> (like just doing 'info registers' qemu hmp command
> or just stop/cont on the same hmp interface, the
> vCPU wakes up and notices that IRR suddenly is not empty,
> and the VM comes back to life (and then hangs after a while again
> with the same problem....).
>  
> As far as I see in the traces, the bit in IRR came from
> another VCPU who didn't respect the ir_running bit and didn't get 
> AVIC_INCOMPLETE_IPI VMexit.
> I can't 100% prove it yet, but everything in the trace shows this.
>  
> About the rest of the environment, currently I reproduce this in
> a VM which has no pci passed through devices at all, just AVIC.
> (I wasn't able to reproduce it before just because I forgot to
> enable AVIC in this configuration).
>  
> So I also agree that Sean's patch is not to blame here,
> it just made the window between setting is_running and getting to sleep
> shorter and made it less likely that other vCPUs will pick up the is_running change.
> (I suspect that they pick it up on next vmrun, and otherwise the value is somehow
> cached wrongfully in them).
>  
> A very performance killing workaround of kicking all vCPUs when one of them enters vcpu_block
> does seem to work for me but it skews all the timing off so I can't prove it.
>  
> That is all, I will write more detailed info, including some traces I have.
>  
> I do use windows 10 with so called LatencyMon in it, which shows overall how
> much latency hardware interrupts have, which used to be useful for me to
> ensure that my VMs are suitable for RT like latency (even before I joined RedHat,
> I tuned my VMs as much as I could to make my Rift CV1 VR headset work well which 
> needs RT like latencies.
>  
> These days VR works fine in my VMs anyway, but I still kept this tool to keep an eye on it).
>  
> I really need to write a kvm unit test to stress test IPIs, especially this case,
> I will do this very soon.
>  
>  
> Wei Huang, any info on this would be very helpful. 
>  
> Maybe putting the avic physical table in UC memory would help? 
> Maybe ringing doorbells of all other vcpus will help them notice the change?
> 
> Best regards,
> 	Maxim Levitsky


Hi!

I am now almost sure that this is errata #1235.

I had attached a kvm-unit-test I wrote (patch against master of https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git/)
which is able to reproduce the issue on stock 5.15.0 kernel (*no patches applied at all*) after just few seconds.
If kvm is loaded without halt-polling (that is  halt_poll_ns=0 is used).

Halt polling and/or Sean's patch are not to blame, it just changes timeing.
With Sean's patch I don't need to disable half polling.

I did find few avic inhibition bugs that this test also finds and to make it work before I fix them,
I added a workaround to not hit them in this test.
I'll send patches to fix those very soon.
Note that in windows VM there were no avic inhibitions so those bugs are not relevant.

Wei Huang, do you know if this issue is fixed on Zen3, and if it is fixed on some Zen2 machines?
Any workarounds other than 'don't use avic'?

Best regards,
	Maxim Levitsky


[-- Attachment #2: 0001-add-unit-test-for-avic-ipi.patch --]
[-- Type: text/x-patch, Size: 5236 bytes --]

From dba295579d10ff88b596697c861a7c83f5e9d013 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <mlevitsk@redhat.com>
Date: Tue, 30 Nov 2021 13:56:57 +0200
Subject: [PATCH] add unit test for avic ipi

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/Makefile.common |   3 +-
 x86/ipi_stress.c    | 169 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |   5 ++
 3 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 x86/ipi_stress.c

diff --git a/x86/Makefile.common b/x86/Makefile.common
index 461de51..372d6ec 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -60,7 +60,8 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/init.flat $(TEST_DIR)/smap.flat \
                $(TEST_DIR)/hyperv_synic.flat $(TEST_DIR)/hyperv_stimer.flat \
                $(TEST_DIR)/hyperv_connections.flat \
-               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat
+               $(TEST_DIR)/umip.flat $(TEST_DIR)/tsx-ctrl.flat \
+               $(TEST_DIR)/ipi_stress.flat
 
 test_cases: $(tests-common) $(tests)
 
diff --git a/x86/ipi_stress.c b/x86/ipi_stress.c
new file mode 100644
index 0000000..50cbf39
--- /dev/null
+++ b/x86/ipi_stress.c
@@ -0,0 +1,169 @@
+#include "libcflat.h"
+#include "smp.h"
+#include "alloc.h"
+#include "apic.h"
+#include "processor.h"
+#include "isr.h"
+#include "asm/barrier.h"
+#include "delay.h"
+#include "atomic.h"
+
+static atomic_t running_cpus;
+
+volatile u64 *isr_counts;
+
+volatile bool finish_init;
+
+u64 num_outer_iterations = 5;
+#define NUM_INNER_ITERATIONS 10000
+#define TOTAL_NUMBER_ITERATIONS (num_outer_iterations * NUM_INNER_ITERATIONS)
+
+static void ipi_interrupt_handler(isr_regs_t *r)
+{
+	isr_counts[smp_id()]++;
+	eoi();
+}
+
+static  void wait_for_ipi(volatile u64 *count)
+{
+	u64 old_count = *count;
+	while (1) {
+		if ((rdtsc() >> 4) % 10000 != 0 ) {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "nop\n"
+			    "cli\n"
+			);
+			if (old_count != *count)
+				break;
+		}
+
+		else {
+			asm volatile(
+			    /* short window for interrupts */
+			    "sti\n"
+			    "hlt\n"
+			    "cli\n"
+			);
+
+			if (old_count != *count)
+				break;
+		}
+	};
+}
+
+static void vcpu_init(void *data)
+{
+	int cpu = (long)data;
+
+	/* To make it easier to see iteration number in the trace */
+	handle_irq(0x40, ipi_interrupt_handler);
+	handle_irq(0x50, ipi_interrupt_handler);
+
+	atomic_inc(&running_cpus);
+
+	if (cpu != 0)
+		while (!finish_init);
+}
+
+static void vcpu_code(void *data)
+{
+	int ncpus = cpu_count();
+	int cpu = (long)data;
+	u64 i;
+
+	assert(cpu != 0);
+	if (cpu != 1)
+		wait_for_ipi(&isr_counts[cpu]);
+
+	for (i = 0; i < TOTAL_NUMBER_ITERATIONS; i++) {
+
+		u8 physical_dst = cpu == ncpus -1 ? 1 : cpu + 1;
+
+		// send IPI to a next vCPU in a circular fashion
+		apic_icr_write(APIC_INT_ASSERT |
+				APIC_DEST_PHYSICAL |
+				APIC_DM_FIXED |
+				(i % 2 ? 0x40 : 0x50),
+				physical_dst);
+
+		// wait for the IPI interrupt chain to come back to us
+		if (i < (TOTAL_NUMBER_ITERATIONS - 1) || cpu == 1)
+			wait_for_ipi(&isr_counts[cpu]);
+
+		if (cpu == 1 && (i % NUM_INNER_ITERATIONS == 0))
+			printf(".");
+	}
+}
+
+
+
+int main(int argc, void** argv)
+{
+	int cpu, ncpus = cpu_count();
+
+	assert(ncpus > 2);
+
+	if (argc > 1)
+		num_outer_iterations = atol(argv[1]);
+
+	isr_counts = (volatile u64 *)calloc(ncpus, sizeof(u64));
+
+	printf("found %d cpus\n", ncpus);
+	printf("running for %lld iterations\n",
+		(long long unsigned int)TOTAL_NUMBER_ITERATIONS);
+
+	/*
+	 * Ensure that we don't have interrupt window pending
+	 * from PIT timer which inhibits the AVIC.
+	 */
+
+	for (cpu = 0; cpu < ncpus; ++cpu)
+		on_cpu_async(cpu, vcpu_init, (void *)(long)cpu);
+
+	/* Workaround for apic->irr_pending bug vs avic inhibittion:
+	 * Ensure that all vCPUs are running before uninhibiting the AVIC
+	 * */
+
+	while (atomic_read(&running_cpus) < ncpus)
+		pause();
+
+	asm volatile("sti;nop;cli\n");
+
+	/* now let all the vCPUs end the IPI function*/
+	finish_init = true;
+
+	while (cpus_active() > 1)
+	      pause();
+
+	printf("starting test on all cpus but 0...\n");
+
+	for (cpu = ncpus-1; cpu > 0; cpu--)
+		on_cpu_async(cpu, vcpu_code, (void *)(long)cpu);
+
+	printf("test started, waiting to end...\n");
+
+	while (cpus_active() > 1) {
+
+		u64 isr_count1 = isr_counts[1];
+
+		delay(5ULL*1000*1000*1000);
+
+		if (isr_count1 == isr_counts[1]) {
+			printf("\n");
+			printf("hang detected!!\n");
+			break;
+		}
+	}
+
+	printf("\n");
+
+	for (cpu = 1; cpu < ncpus; ++cpu)
+		report(isr_counts[cpu] == TOTAL_NUMBER_ITERATIONS,
+				"Number of IPIs match (%lld)",
+				(long long unsigned int)isr_counts[cpu]);
+
+	free((void*)isr_counts);
+	return report_summary();
+}
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 6244595..ff866b4 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -61,6 +61,11 @@ smp = 2
 file = smptest.flat
 smp = 3
 
+[ipi_stress]
+file = ipi_stress.flat
+extra_params = -cpu host,-x2apic,-svm,-hypervisor -global kvm-pit.lost_tick_policy=discard -machine kernel-irqchip=on
+smp = 4
+
 [vmexit_cpuid]
 file = vmexit.flat
 extra_params = -append 'cpuid'
-- 
2.26.3


  reply	other threads:[~2021-12-02  0:21 UTC|newest]

Thread overview: 693+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09  2:11 [PATCH v2 00/43] KVM: Halt-polling and x86 APICv overhaul Sean Christopherson
2021-10-09  2:11 ` Sean Christopherson
2021-10-09  2:11 ` Sean Christopherson
2021-10-09  2:11 ` Sean Christopherson
2021-10-09  2:11 ` Sean Christopherson
2021-10-09  2:11 ` [PATCH v2 01/43] KVM: VMX: Don't unblock vCPU w/ Posted IRQ if IRQs are disabled in guest Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11 ` [PATCH v2 02/43] KVM: SVM: Ensure target pCPU is read once when signalling AVIC doorbell Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-25 13:21   ` Paolo Bonzini
2021-10-25 13:21     ` Paolo Bonzini
2021-10-25 13:21     ` Paolo Bonzini
2021-10-25 13:21     ` Paolo Bonzini
2021-10-25 13:21     ` Paolo Bonzini
2021-10-27  9:50   ` Maxim Levitsky
2021-10-27  9:50     ` Maxim Levitsky
2021-10-27  9:50     ` Maxim Levitsky
2021-10-27  9:50     ` Maxim Levitsky
2021-10-27  9:50     ` Maxim Levitsky
2021-10-09  2:11 ` [PATCH v2 03/43] KVM: s390: Ensure kvm_arch_no_poll() is read once when blocking vCPU Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11 ` [PATCH v2 04/43] KVM: Force PPC to define its own rcuwait object Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11 ` [PATCH v2 05/43] KVM: Update halt-polling stats if and only if halt-polling was attempted Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-27 10:18   ` Maxim Levitsky
2021-10-27 10:18     ` Maxim Levitsky
2021-10-27 10:18     ` Maxim Levitsky
2021-10-27 10:18     ` Maxim Levitsky
2021-10-27 10:18     ` Maxim Levitsky
2021-10-09  2:11 ` [PATCH v2 06/43] KVM: Refactor and document halt-polling stats update helper Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-09  2:11   ` Sean Christopherson
2021-10-27 10:56   ` Maxim Levitsky
2021-10-27 10:56     ` Maxim Levitsky
2021-10-27 10:56     ` Maxim Levitsky
2021-10-27 10:56     ` Maxim Levitsky
2021-10-27 10:56     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 07/43] KVM: Reconcile discrepancies in halt-polling stats Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-27 11:29   ` Maxim Levitsky
2021-10-27 11:29     ` Maxim Levitsky
2021-10-27 11:29     ` Maxim Levitsky
2021-10-27 11:29     ` Maxim Levitsky
2021-10-27 11:29     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 08/43] KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12 ` [PATCH v2 09/43] KVM: Drop obsolete kvm_arch_vcpu_block_finish() Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-22 15:02   ` Anup Patel
2021-10-22 15:14     ` Anup Patel
2021-10-22 15:02     ` Anup Patel
2021-10-22 15:02     ` Anup Patel
2021-10-22 15:02     ` Anup Patel
2021-10-09  2:12 ` [PATCH v2 10/43] KVM: arm64: Move vGIC v4 handling for WFI out arch callback hook Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 13:31   ` Paolo Bonzini
2021-10-25 13:31     ` Paolo Bonzini
2021-10-25 13:31     ` Paolo Bonzini
2021-10-25 13:31     ` Paolo Bonzini
2021-10-25 13:31     ` Paolo Bonzini
2021-10-26 15:41     ` Marc Zyngier
2021-10-26 15:41       ` Marc Zyngier
2021-10-26 15:41       ` Marc Zyngier
2021-10-26 15:41       ` Marc Zyngier
2021-10-26 15:41       ` Marc Zyngier
2021-10-26 16:12       ` Paolo Bonzini
2021-10-26 16:12         ` Paolo Bonzini
2021-10-26 16:12         ` Paolo Bonzini
2021-10-26 16:12         ` Paolo Bonzini
2021-10-26 16:12         ` Paolo Bonzini
2021-11-30 11:39         ` Paolo Bonzini
2021-11-30 11:39           ` Paolo Bonzini
2021-11-30 11:39           ` Paolo Bonzini
2021-11-30 11:39           ` Paolo Bonzini
2021-11-30 11:39           ` Paolo Bonzini
2021-11-30 12:04           ` Marc Zyngier
2021-11-30 12:04             ` Marc Zyngier
2021-11-30 12:04             ` Marc Zyngier
2021-11-30 12:04             ` Marc Zyngier
2021-11-30 16:07             ` Paolo Bonzini
2021-11-30 16:07               ` Paolo Bonzini
2021-11-30 16:07               ` Paolo Bonzini
2021-11-30 16:07               ` Paolo Bonzini
2021-11-30 16:07               ` Paolo Bonzini
2021-10-09  2:12 ` [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-27 13:40   ` Maxim Levitsky
2021-10-27 13:40     ` Maxim Levitsky
2021-10-27 13:40     ` Maxim Levitsky
2021-10-27 13:40     ` Maxim Levitsky
2021-10-27 13:40     ` Maxim Levitsky
2021-11-28 22:16     ` Maxim Levitsky
2021-11-28 22:16       ` Maxim Levitsky
2021-11-28 22:16       ` Maxim Levitsky
2021-11-28 22:16       ` Maxim Levitsky
2021-11-28 22:16       ` Maxim Levitsky
2021-11-29 17:25       ` Sean Christopherson
2021-11-29 17:25         ` Sean Christopherson
2021-11-29 17:25         ` Sean Christopherson
2021-11-29 17:25         ` Sean Christopherson
2021-11-29 17:25         ` Sean Christopherson
2021-11-29 17:53         ` Paolo Bonzini
2021-11-29 17:53           ` Paolo Bonzini
2021-11-29 17:53           ` Paolo Bonzini
2021-11-29 17:53           ` Paolo Bonzini
2021-11-29 17:53           ` Paolo Bonzini
2021-11-29 18:55           ` Sean Christopherson
2021-11-29 18:55             ` Sean Christopherson
2021-11-29 18:55             ` Sean Christopherson
2021-11-29 18:55             ` Sean Christopherson
2021-11-29 18:55             ` Sean Christopherson
2021-11-29 19:18             ` Paolo Bonzini
2021-11-29 19:18               ` Paolo Bonzini
2021-11-29 19:18               ` Paolo Bonzini
2021-11-29 19:18               ` Paolo Bonzini
2021-11-29 19:18               ` Paolo Bonzini
2021-11-29 22:53               ` Maxim Levitsky
2021-11-29 22:53                 ` Maxim Levitsky
2021-11-29 22:53                 ` Maxim Levitsky
2021-11-29 22:53                 ` Maxim Levitsky
2021-11-29 22:53                 ` Maxim Levitsky
2021-12-02  0:20                 ` Maxim Levitsky [this message]
2021-12-02  0:20                   ` Maxim Levitsky
2021-12-02  0:20                   ` Maxim Levitsky
2021-12-02  0:20                   ` Maxim Levitsky
2021-12-02  0:20                   ` Maxim Levitsky
2021-12-02  1:59                   ` Sean Christopherson
2021-12-02  2:00                     ` Sean Christopherson
2021-12-02  2:00                     ` Sean Christopherson
2021-12-02  2:00                     ` Sean Christopherson
2021-12-02  2:00                     ` Sean Christopherson
2021-12-02 10:31                     ` Paolo Bonzini
2021-12-02 10:31                       ` Paolo Bonzini
2021-12-02 10:31                       ` Paolo Bonzini
2021-12-02 10:31                       ` Paolo Bonzini
2021-12-02 10:31                       ` Paolo Bonzini
2021-11-29 17:55         ` Paolo Bonzini
2021-11-29 17:55           ` Paolo Bonzini
2021-11-29 17:55           ` Paolo Bonzini
2021-11-29 17:55           ` Paolo Bonzini
2021-11-29 17:55           ` Paolo Bonzini
2021-11-29 22:55           ` Maxim Levitsky
2021-11-29 22:55             ` Maxim Levitsky
2021-11-29 22:55             ` Maxim Levitsky
2021-11-29 22:55             ` Maxim Levitsky
2021-11-29 22:55             ` Maxim Levitsky
2021-12-02 10:20         ` Maxim Levitsky
2021-12-02 10:20           ` Maxim Levitsky
2021-12-02 10:20           ` Maxim Levitsky
2021-12-02 10:20           ` Maxim Levitsky
2021-12-02 10:20           ` Maxim Levitsky
2021-12-02 10:47           ` Maxim Levitsky
2021-12-02 10:47             ` Maxim Levitsky
2021-12-02 10:47             ` Maxim Levitsky
2021-12-02 10:47             ` Maxim Levitsky
2021-12-02 10:47             ` Maxim Levitsky
2021-12-02 12:02         ` Maxim Levitsky
2021-12-02 12:02           ` Maxim Levitsky
2021-12-02 12:02           ` Maxim Levitsky
2021-12-02 12:02           ` Maxim Levitsky
2021-12-02 12:02           ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 12/43] KVM: x86: Tweak halt emulation helper names to free up kvm_vcpu_halt() Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-27 14:10   ` Maxim Levitsky
2021-10-27 14:10     ` Maxim Levitsky
2021-10-27 14:10     ` Maxim Levitsky
2021-10-27 14:10     ` Maxim Levitsky
2021-10-27 14:10     ` Maxim Levitsky
2021-10-27 14:18     ` Maxim Levitsky
2021-10-27 14:18       ` Maxim Levitsky
2021-10-27 14:18       ` Maxim Levitsky
2021-10-27 14:18       ` Maxim Levitsky
2021-10-27 14:18       ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 13/43] KVM: Rename kvm_vcpu_block() => kvm_vcpu_halt() Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-22 15:04   ` Anup Patel
2021-10-22 15:16     ` Anup Patel
2021-10-22 15:04     ` Anup Patel
2021-10-22 15:04     ` Anup Patel
2021-10-22 15:04     ` Anup Patel
2021-10-09  2:12 ` [PATCH v2 14/43] KVM: Split out a kvm_vcpu_block() helper from kvm_vcpu_halt() Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12 ` [PATCH v2 15/43] KVM: stats: Add stat to detect if vcpu is currently blocking Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12 ` [PATCH v2 16/43] KVM: Don't redo ktime_get() when calculating halt-polling stop/deadline Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:26   ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-27 14:35     ` Maxim Levitsky
2021-10-27 14:35       ` Maxim Levitsky
2021-10-27 14:35       ` Maxim Levitsky
2021-10-27 14:35       ` Maxim Levitsky
2021-10-27 14:35       ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 17/43] KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-27 14:46   ` Maxim Levitsky
2021-10-27 14:46     ` Maxim Levitsky
2021-10-27 14:46     ` Maxim Levitsky
2021-10-27 14:46     ` Maxim Levitsky
2021-10-27 14:46     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 18/43] KVM: x86: Invoke kvm_vcpu_block() directly for non-HALTED wait states Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-27 15:18   ` Maxim Levitsky
2021-10-27 15:18     ` Maxim Levitsky
2021-10-27 15:18     ` Maxim Levitsky
2021-10-27 15:18     ` Maxim Levitsky
2021-10-27 15:18     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 19/43] KVM: Add helpers to wake/query blocking vCPU Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:06   ` Paolo Bonzini
2021-10-25 14:06     ` Paolo Bonzini
2021-10-25 14:06     ` Paolo Bonzini
2021-10-25 14:06     ` Paolo Bonzini
2021-10-25 14:06     ` Paolo Bonzini
2021-10-27 19:27   ` Maxim Levitsky
2021-10-27 19:27     ` Maxim Levitsky
2021-10-27 19:27     ` Maxim Levitsky
2021-10-27 19:27     ` Maxim Levitsky
2021-10-27 19:27     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 20/43] KVM: VMX: Skip Posted Interrupt updates if APICv is hard disabled Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 13:48   ` Paolo Bonzini
2021-10-25 13:48     ` Paolo Bonzini
2021-10-25 13:48     ` Paolo Bonzini
2021-10-25 13:48     ` Paolo Bonzini
2021-10-25 13:48     ` Paolo Bonzini
2021-10-28  9:12   ` Maxim Levitsky
2021-10-28  9:12     ` Maxim Levitsky
2021-10-28  9:12     ` Maxim Levitsky
2021-10-28  9:12     ` Maxim Levitsky
2021-10-28  9:12     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 21/43] KVM: VMX: Clean up PI pre/post-block WARNs Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 10:20   ` Maxim Levitsky
2021-10-28 10:20     ` Maxim Levitsky
2021-10-28 10:20     ` Maxim Levitsky
2021-10-28 10:20     ` Maxim Levitsky
2021-10-28 10:20     ` Maxim Levitsky
2021-10-28 15:34     ` Sean Christopherson
2021-10-28 15:34       ` Sean Christopherson
2021-10-28 15:34       ` Sean Christopherson
2021-10-28 15:34       ` Sean Christopherson
2021-10-09  2:12 ` [PATCH v2 22/43] KVM: VMX: Drop unnecessary PI logic to handle impossible conditions Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 13:53   ` Paolo Bonzini
2021-10-25 13:53     ` Paolo Bonzini
2021-10-25 13:53     ` Paolo Bonzini
2021-10-25 13:53     ` Paolo Bonzini
2021-10-25 13:53     ` Paolo Bonzini
2021-10-28 14:36   ` Maxim Levitsky
2021-10-28 14:36     ` Maxim Levitsky
2021-10-28 14:36     ` Maxim Levitsky
2021-10-28 14:36     ` Maxim Levitsky
2021-10-28 14:36     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 23/43] KVM: VMX: Use boolean returns for Posted Interrupt "test" helpers Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28  6:05   ` Maxim Levitsky
2021-10-28  6:05     ` Maxim Levitsky
2021-10-28  6:05     ` Maxim Levitsky
2021-10-28  6:05     ` Maxim Levitsky
2021-10-28  6:05     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 24/43] KVM: VMX: Drop pointless PI.NDST update when blocking Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:01   ` Paolo Bonzini
2021-10-25 14:01     ` Paolo Bonzini
2021-10-25 14:01     ` Paolo Bonzini
2021-10-25 14:01     ` Paolo Bonzini
2021-10-25 14:01     ` Paolo Bonzini
2021-10-27 14:26     ` Sean Christopherson
2021-10-27 14:26       ` Sean Christopherson
2021-10-27 14:26       ` Sean Christopherson
2021-10-27 14:26       ` Sean Christopherson
2021-10-28 10:53   ` Maxim Levitsky
2021-10-28 10:53     ` Maxim Levitsky
2021-10-28 10:53     ` Maxim Levitsky
2021-10-28 10:53     ` Maxim Levitsky
2021-10-28 10:53     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 25/43] KVM: VMX: Save/restore IRQs (instead of CLI/STI) during PI pre/post block Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 10:54   ` Maxim Levitsky
2021-10-28 10:54     ` Maxim Levitsky
2021-10-28 10:54     ` Maxim Levitsky
2021-10-28 10:54     ` Maxim Levitsky
2021-10-28 10:54     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 26/43] KVM: VMX: Read Posted Interrupt "control" exactly once per loop iteration Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 10:58   ` Maxim Levitsky
2021-10-28 10:58     ` Maxim Levitsky
2021-10-28 10:58     ` Maxim Levitsky
2021-10-28 10:58     ` Maxim Levitsky
2021-10-28 10:58     ` Maxim Levitsky
2021-10-28 15:55     ` Sean Christopherson
2021-10-28 15:55       ` Sean Christopherson
2021-10-28 15:55       ` Sean Christopherson
2021-10-28 15:55       ` Sean Christopherson
2021-10-31 22:48       ` Maxim Levitsky
2021-10-31 22:48         ` Maxim Levitsky
2021-10-31 22:48         ` Maxim Levitsky
2021-10-31 22:48         ` Maxim Levitsky
2021-10-31 22:48         ` Maxim Levitsky
2021-11-01 17:41         ` Sean Christopherson
2021-11-01 17:41           ` Sean Christopherson
2021-11-01 17:41           ` Sean Christopherson
2021-11-01 17:41           ` Sean Christopherson
2021-11-01 17:41           ` Sean Christopherson
2021-10-09  2:12 ` [PATCH v2 27/43] KVM: VMX: Move Posted Interrupt ndst computation out of write loop Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 11:28   ` Maxim Levitsky
2021-10-28 11:28     ` Maxim Levitsky
2021-10-28 11:28     ` Maxim Levitsky
2021-10-28 11:28     ` Maxim Levitsky
2021-10-28 11:28     ` Maxim Levitsky
2021-10-28 16:09     ` Maxim Levitsky
2021-10-28 16:09       ` Maxim Levitsky
2021-10-28 16:09       ` Maxim Levitsky
2021-10-28 16:09       ` Maxim Levitsky
2021-10-28 16:09       ` Maxim Levitsky
2021-10-28 16:12     ` Sean Christopherson
2021-10-28 16:12       ` Sean Christopherson
2021-10-28 16:12       ` Sean Christopherson
2021-10-28 16:12       ` Sean Christopherson
2021-10-31 22:51       ` Maxim Levitsky
2021-10-31 22:51         ` Maxim Levitsky
2021-10-31 22:51         ` Maxim Levitsky
2021-10-31 22:51         ` Maxim Levitsky
2021-10-31 22:51         ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 28/43] KVM: VMX: Remove vCPU from PI wakeup list before updating PID.NV Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 12:53   ` Maxim Levitsky
2021-10-28 12:53     ` Maxim Levitsky
2021-10-28 12:53     ` Maxim Levitsky
2021-10-28 12:53     ` Maxim Levitsky
2021-10-28 12:53     ` Maxim Levitsky
2021-10-28 17:19     ` Sean Christopherson
2021-10-28 17:19       ` Sean Christopherson
2021-10-28 17:19       ` Sean Christopherson
2021-10-28 17:19       ` Sean Christopherson
2021-10-31 22:52       ` Maxim Levitsky
2021-10-31 22:52         ` Maxim Levitsky
2021-10-31 22:52         ` Maxim Levitsky
2021-10-31 22:52         ` Maxim Levitsky
2021-10-31 22:52         ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 29/43] KVM: VMX: Handle PI wakeup shenanigans during vcpu_put/load Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 15:14   ` Maxim Levitsky
2021-10-28 15:14     ` Maxim Levitsky
2021-10-28 15:14     ` Maxim Levitsky
2021-10-28 15:14     ` Maxim Levitsky
2021-10-28 15:14     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 30/43] KVM: Drop unused kvm_vcpu.pre_pcpu field Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 15:16   ` Maxim Levitsky
2021-10-28 15:16     ` Maxim Levitsky
2021-10-28 15:16     ` Maxim Levitsky
2021-10-28 15:16     ` Maxim Levitsky
2021-10-28 15:16     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 31/43] KVM: Move x86 VMX's posted interrupt list_head to vcpu_vmx Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 15:33   ` Maxim Levitsky
2021-10-28 15:33     ` Maxim Levitsky
2021-10-28 15:33     ` Maxim Levitsky
2021-10-28 15:33     ` Maxim Levitsky
2021-10-28 15:33     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 32/43] KVM: VMX: Move preemption timer <=> hrtimer dance to common x86 Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 15:45   ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 33/43] KVM: x86: Unexport LAPIC's switch_to_{hv, sw}_timer() helpers Sean Christopherson
2021-10-09  2:12   ` [PATCH v2 33/43] KVM: x86: Unexport LAPIC's switch_to_{hv,sw}_timer() helpers Sean Christopherson
2021-10-09  2:12   ` [PATCH v2 33/43] KVM: x86: Unexport LAPIC's switch_to_{hv, sw}_timer() helpers Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` [PATCH v2 33/43] KVM: x86: Unexport LAPIC's switch_to_{hv,sw}_timer() helpers Sean Christopherson
2021-10-28 15:45   ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-28 15:45     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 34/43] KVM: x86: Remove defunct pre_block/post_block kvm_x86_ops hooks Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-28 15:46   ` Maxim Levitsky
2021-10-28 15:46     ` Maxim Levitsky
2021-10-28 15:46     ` Maxim Levitsky
2021-10-28 15:46     ` Maxim Levitsky
2021-10-28 15:46     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 35/43] KVM: SVM: Signal AVIC doorbell iff vCPU is in guest mode Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:26   ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-25 14:26     ` Paolo Bonzini
2021-10-27 15:06     ` Sean Christopherson
2021-10-27 15:06       ` Sean Christopherson
2021-10-27 15:06       ` Sean Christopherson
2021-10-27 15:06       ` Sean Christopherson
2021-10-27 15:06       ` Sean Christopherson
2021-10-27 15:36       ` Paolo Bonzini
2021-10-27 15:36         ` Paolo Bonzini
2021-10-27 15:36         ` Paolo Bonzini
2021-10-27 15:36         ` Paolo Bonzini
2021-10-27 15:36         ` Paolo Bonzini
2021-10-27 16:08         ` Sean Christopherson
2021-10-27 16:08           ` Sean Christopherson
2021-10-27 16:08           ` Sean Christopherson
2021-10-27 16:08           ` Sean Christopherson
2021-10-27 16:08           ` Sean Christopherson
2021-10-27 16:14           ` Paolo Bonzini
2021-10-27 16:14             ` Paolo Bonzini
2021-10-27 16:14             ` Paolo Bonzini
2021-10-27 16:14             ` Paolo Bonzini
2021-10-27 16:14             ` Paolo Bonzini
2021-10-28 16:12   ` Maxim Levitsky
2021-10-28 16:12     ` Maxim Levitsky
2021-10-28 16:12     ` Maxim Levitsky
2021-10-28 16:12     ` Maxim Levitsky
2021-10-28 16:12     ` Maxim Levitsky
2021-10-28 17:06     ` Sean Christopherson
2021-10-28 17:06       ` Sean Christopherson
2021-10-28 17:06       ` Sean Christopherson
2021-10-28 17:06       ` Sean Christopherson
2021-10-28 17:06       ` Sean Christopherson
2021-10-09  2:12 ` [PATCH v2 36/43] KVM: SVM: Don't bother checking for "running" AVIC when kicking for IPIs Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-31 14:50   ` Maxim Levitsky
2021-10-31 14:50     ` Maxim Levitsky
2021-10-31 14:50     ` Maxim Levitsky
2021-10-31 14:50     ` Maxim Levitsky
2021-10-31 14:50     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 37/43] KVM: SVM: Unconditionally mark AVIC as running on vCPU load (with APICv) Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:22   ` Paolo Bonzini
2021-10-25 14:22     ` Paolo Bonzini
2021-10-25 14:22     ` Paolo Bonzini
2021-10-25 14:22     ` Paolo Bonzini
2021-10-25 14:22     ` Paolo Bonzini
2021-10-25 15:48     ` Sean Christopherson
2021-10-25 15:48       ` Sean Christopherson
2021-10-25 15:48       ` Sean Christopherson
2021-10-25 15:48       ` Sean Christopherson
2021-10-25 15:57       ` Paolo Bonzini
2021-10-25 15:57         ` Paolo Bonzini
2021-10-25 15:57         ` Paolo Bonzini
2021-10-25 15:57         ` Paolo Bonzini
2021-10-25 15:57         ` Paolo Bonzini
2021-10-25 16:00         ` Sean Christopherson
2021-10-25 16:00           ` Sean Christopherson
2021-10-25 16:00           ` Sean Christopherson
2021-10-25 16:00           ` Sean Christopherson
2021-10-31 16:34   ` Maxim Levitsky
2021-10-31 16:34     ` Maxim Levitsky
2021-10-31 16:34     ` Maxim Levitsky
2021-10-31 16:34     ` Maxim Levitsky
2021-10-31 16:34     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 38/43] KVM: Drop defunct kvm_arch_vcpu_(un)blocking() hooks Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-10 15:20   ` kernel test robot
2021-10-31 16:35   ` Maxim Levitsky
2021-10-31 16:35     ` Maxim Levitsky
2021-10-31 16:35     ` Maxim Levitsky
2021-10-31 16:35     ` Maxim Levitsky
2021-10-31 16:35     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 39/43] KVM: VMX: Don't do full kick when triggering posted interrupt "fails" Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:34   ` Paolo Bonzini
2021-10-25 14:34     ` Paolo Bonzini
2021-10-25 14:34     ` Paolo Bonzini
2021-10-25 14:34     ` Paolo Bonzini
2021-10-25 14:34     ` Paolo Bonzini
2021-10-27 16:04     ` Sean Christopherson
2021-10-27 16:04       ` Sean Christopherson
2021-10-27 16:04       ` Sean Christopherson
2021-10-27 16:04       ` Sean Christopherson
2021-10-27 22:09       ` Paolo Bonzini
2021-10-27 22:09         ` Paolo Bonzini
2021-10-27 22:09         ` Paolo Bonzini
2021-10-27 22:09         ` Paolo Bonzini
2021-10-27 22:09         ` Paolo Bonzini
2021-10-31 22:15         ` Maxim Levitsky
2021-10-31 22:15           ` Maxim Levitsky
2021-10-31 22:15           ` Maxim Levitsky
2021-10-31 22:15           ` Maxim Levitsky
2021-10-31 22:15           ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 40/43] KVM: VMX: Wake vCPU when delivering posted IRQ even if vCPU == this vCPU Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 15:05   ` Paolo Bonzini
2021-10-25 15:05     ` Paolo Bonzini
2021-10-25 15:05     ` Paolo Bonzini
2021-10-25 15:05     ` Paolo Bonzini
2021-10-25 15:05     ` Paolo Bonzini
2021-10-27 15:30     ` Sean Christopherson
2021-10-27 15:30       ` Sean Christopherson
2021-10-27 15:30       ` Sean Christopherson
2021-10-27 15:30       ` Sean Christopherson
2021-10-31 22:19       ` Maxim Levitsky
2021-10-31 22:19         ` Maxim Levitsky
2021-10-31 22:19         ` Maxim Levitsky
2021-10-31 22:19         ` Maxim Levitsky
2021-10-31 22:19         ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 41/43] KVM: VMX: Pass desired vector instead of bool for triggering posted IRQ Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-31 22:25   ` Maxim Levitsky
2021-10-31 22:25     ` Maxim Levitsky
2021-10-31 22:25     ` Maxim Levitsky
2021-10-31 22:25     ` Maxim Levitsky
2021-10-31 22:25     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 42/43] KVM: VMX: Fold fallback path into triggering posted IRQ helper Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-31 22:30   ` Maxim Levitsky
2021-10-31 22:30     ` Maxim Levitsky
2021-10-31 22:30     ` Maxim Levitsky
2021-10-31 22:30     ` Maxim Levitsky
2021-10-31 22:30     ` Maxim Levitsky
2021-10-09  2:12 ` [PATCH v2 43/43] KVM: VMX: Don't do full kick when handling posted interrupt wakeup Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-09  2:12   ` Sean Christopherson
2021-10-25 14:16   ` Paolo Bonzini
2021-10-25 14:16     ` Paolo Bonzini
2021-10-25 14:16     ` Paolo Bonzini
2021-10-25 14:16     ` Paolo Bonzini
2021-10-25 14:16     ` Paolo Bonzini
2021-10-31 22:33     ` Maxim Levitsky
2021-10-31 22:33       ` Maxim Levitsky
2021-10-31 22:33       ` Maxim Levitsky
2021-10-31 22:33       ` Maxim Levitsky
2021-10-31 22:33       ` Maxim Levitsky
2021-10-25 14:13 ` [PATCH v2 00/43] KVM: Halt-polling and x86 APICv overhaul Paolo Bonzini
2021-10-25 14:13   ` Paolo Bonzini
2021-10-25 14:13   ` Paolo Bonzini
2021-10-25 14:13   ` Paolo Bonzini
2021-10-25 14:13   ` Paolo Bonzini
2021-10-27 14:41   ` Sean Christopherson
2021-10-27 14:41     ` Sean Christopherson
2021-10-27 14:41     ` Sean Christopherson
2021-10-27 14:41     ` Sean Christopherson
2021-10-27 14:57     ` Paolo Bonzini
2021-10-27 14:57       ` Paolo Bonzini
2021-10-27 14:57       ` Paolo Bonzini
2021-10-27 14:57       ` Paolo Bonzini
2021-10-27 14:57       ` Paolo Bonzini
2021-10-27 15:28       ` Sean Christopherson
2021-10-27 15:28         ` Sean Christopherson
2021-10-27 15:28         ` Sean Christopherson
2021-10-27 15:28         ` Sean Christopherson
2021-10-27 15:37         ` Paolo Bonzini
2021-10-27 15:37           ` Paolo Bonzini
2021-10-27 15:37           ` Paolo Bonzini
2021-10-27 15:37           ` Paolo Bonzini
2021-10-27 15:37           ` Paolo Bonzini
2021-10-26  7:20 ` Christian Borntraeger
2021-10-26  7:20   ` Christian Borntraeger
2021-10-26  7:20   ` Christian Borntraeger
2021-10-26  7:20   ` Christian Borntraeger
2021-10-26  7:20   ` Christian Borntraeger
2021-10-26 14:48   ` Sean Christopherson
2021-10-26 14:48     ` Sean Christopherson
2021-10-26 14:48     ` Sean Christopherson
2021-10-26 14:48     ` Sean Christopherson
2021-10-26 18:29     ` Christian Borntraeger
2021-10-26 18:29       ` Christian Borntraeger
2021-10-26 18:29       ` Christian Borntraeger
2021-10-26 18:29       ` Christian Borntraeger
2021-10-26 18:29       ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=alexandru.elisei@arm.com \
    --cc=anup.patel@wdc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@wdc.com \
    --cc=borntraeger@de.ibm.com \
    --cc=chenhuacai@kernel.org \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=dmatlack@google.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=james.morse@arm.com \
    --cc=jingzhangos@google.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oupton@google.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulus@ozlabs.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=wei.huang2@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.