Re: [kvm-unit-tests PATCH v5 25/29] powerpc: Add rtas stop-self support

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

 



On 16/12/2023 14.42, Nicholas Piggin wrote:
In preparation for improved SMP support, add stop-self support to the
harness. This is non-trivial because it requires an unlocked rtas
call: a CPU can't be holding a spin lock when it goes offline or it
will deadlock other CPUs. rtas permits stop-self to be called without
serialising all other rtas operations.

Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
---
  lib/powerpc/asm/rtas.h |  2 ++
  lib/powerpc/rtas.c     | 78 +++++++++++++++++++++++++++++++++---------
  2 files changed, 64 insertions(+), 16 deletions(-)
...
+void rtas_stop_self(void)
+{
+	struct rtas_args args;
+	uint32_t token;
+	int ret;
+
+	ret = rtas_token("stop-self", &token);
+	if (ret) {
+		puts("RTAS stop-self not available\n");
+		return;
+	}
+
+	ret = rtas_call_unlocked(&args, token, 0, 1, NULL);
+	printf("RTAS stop-self returnd %d\n", ret);

s/returnd/returned/

+}

With the typo fixed:

Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>





[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