kvm-ppc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org
Cc: kvm-ppc@vger.kernel.org, "Laurent Vivier" <lvivier@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [kvm-unit-tests PATCH] powerpc: Fix running the kvm-unit-tests with recent versions of QEMU
Date: Tue, 06 Dec 2022 10:14:55 +0000	[thread overview]
Message-ID: <20221206101455.145258-1-thuth@redhat.com> (raw)

Starting with version 7.0, QEMU starts the pseries guests in 32-bit mode
instead of 64-bit (see QEMU commit 6e3f09c28a - "spapr: Force 32bit when
resetting a core"). This causes our test_64bit() in powerpc/emulator.c
to fail. Let's switch to 64-bit in our startup code instead to fix the
issue.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 powerpc/cstart64.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S
index 972851f9..206c518f 100644
--- a/powerpc/cstart64.S
+++ b/powerpc/cstart64.S
@@ -23,6 +23,12 @@
 .globl start
 start:
 	FIXUP_ENDIAN
+	/* Switch to 64-bit mode */
+	mfmsr	r1
+	li	r2,1
+	sldi	r2,r2,63
+	or	r1,r1,r2
+	mtmsrd	r1
 	/*
 	 * We were loaded at QEMU's kernel load address, but we're not
 	 * allowed to link there due to how QEMU deals with linker VMAs,
-- 
2.31.1

             reply	other threads:[~2022-12-06 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 10:14 Thomas Huth [this message]
2022-12-06 10:40 ` [kvm-unit-tests PATCH] powerpc: Fix running the kvm-unit-tests with recent versions of QEMU Cédric Le Goater
2022-12-06 10:58   ` Thomas Huth

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=20221206101455.145258-1-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=clg@kaod.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).