Re: [PATCH] KVM: arm64: selftests: Add arch_timer_edge_cases selftest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023/5/17 5:37, Colton Lewis wrote:

+/*
+ * Should be called with IRQs masked.
+ *
+ * Note that this can hang forever, so we rely on having a timeout mechanism in
+ * the "runner", like: tools/testing/selftests/kselftest/runner.sh.
+ */
+static void wait_for_non_spurious_irq(void)
+{
+	int h;
+
+	spin_lock(&shared_data.lock);

You grab the shared_data.lock here...

+	for (h = shared_data.handled; h == shared_data.handled;) {
+		asm volatile ("wfi\n"
+			      "msr daifclr, #2\n"
+			      /* handle IRQ */

and grab it again in the IRQ handler. How does it work?

+			      "msr daifset, #2\n":::"memory");
+	}
+	spin_unlock(&shared_data.lock);
+}

[...]

+static bool parse_args(int argc, char *argv[])
+{
+	int opt;
+
+	while ((opt = getopt(argc, argv, "bhi:l:pvw:")) != -1) {
+		switch (opt) {
+		case 'b':
+			test_args.test_physical_only = false;
+			test_args.test_virtual_only = false;

Missing a 'break'?

Zenghui



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux