public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: will.deacon@arm.com, penberg@kernel.org
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: [PATCH 1/4] kvmtool: ARM: fix initrd functionality
Date: Thu, 11 Dec 2014 16:30:32 +0000	[thread overview]
Message-ID: <1418315435-20342-2-git-send-email-andre.przywara@arm.com> (raw)
In-Reply-To: <1418315435-20342-1-git-send-email-andre.przywara@arm.com>

lkvm -i is currently broken on ARM/ARM64.
We should not try to convert smaller-than-4GB addresses into 64-bit
big endian and then stuff them into u32 variables if we expect to read
anything other than 0 out of it.
Adjust the type to u64 to write the proper address in BE format into
the /chosen node (and also match the address size we formely posted)
and let Linux thus read the right values.
This fixes initrd functionality for ARM and ARM64 guests.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
---
 tools/kvm/arm/fdt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/arm/fdt.c b/tools/kvm/arm/fdt.c
index 5626931..4a33846 100644
--- a/tools/kvm/arm/fdt.c
+++ b/tools/kvm/arm/fdt.c
@@ -149,8 +149,8 @@ static int setup_fdt(struct kvm *kvm)
 
 	/* Initrd */
 	if (kvm->arch.initrd_size != 0) {
-		u32 ird_st_prop = cpu_to_fdt64(kvm->arch.initrd_guest_start);
-		u32 ird_end_prop = cpu_to_fdt64(kvm->arch.initrd_guest_start +
+		u64 ird_st_prop = cpu_to_fdt64(kvm->arch.initrd_guest_start);
+		u64 ird_end_prop = cpu_to_fdt64(kvm->arch.initrd_guest_start +
 					       kvm->arch.initrd_size);
 
 		_FDT(fdt_property(fdt, "linux,initrd-start",
-- 
1.7.9.5


  reply	other threads:[~2014-12-11 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 16:30 [PATCH 0/4] kvmtool: ARM: fixing initrd, serial IRQs and bzImage message Andre Przywara
2014-12-11 16:30 ` Andre Przywara [this message]
2014-12-11 16:30 ` [PATCH 2/4] kvmtool: ARM: allow level interrupts in device tree Andre Przywara
2014-12-11 17:15   ` Will Deacon
2014-12-12 15:19     ` Andre Przywara
2014-12-11 16:30 ` [PATCH 3/4] kvmtool: ARM: advertise 8250 IRQs as level-triggered Andre Przywara
2014-12-11 16:30 ` [PATCH 4/4] kvmtool: remove warning about bzImage on non-x86 architectures Andre Przywara

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=1418315435-20342-2-git-send-email-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=penberg@kernel.org \
    --cc=will.deacon@arm.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