Thread (127 messages) 127 messages, 14 authors, 2022-12-01

Re: [PATCH 38/44] KVM: Disable CPU hotplug during hardware enabling

From: Huang, Kai <hidden>
Date: 2022-11-10 02:21:35
Also in: kvm, kvm-riscv, kvmarm, linux-mips, linux-riscv, linux-s390, linuxppc-dev, lkml

On Thu, 2022-11-10 at 01:08 +0000, Huang, Kai wrote:
quoted
-	WARN_ON(!irqs_disabled());
+	/*
+	 * Compatibility checks are done when loading KVM and when enabling
+	 * hardware, e.g. during CPU hotplug, to ensure all online CPUs are
+	 * compatible, i.e. KVM should never perform a compatibility check
on
+	 * an offline CPU.
+	 */
+	WARN_ON(!irqs_disabled() && cpu_active(cpu));
Comment doesn't match with the code?

"KVM should never perform a compatibility check on on offline CPU" should be
something like:

	WARN_ON(!cpu_online(cpu));

So, should the comment be something like below?

"KVM compatibility check happens before CPU is marked as active".
Also ignore this one as I only thought about hotplug case.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help