From patchwork Wed Sep 19 15:29:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 185084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7F9E52C0084 for ; Thu, 20 Sep 2012 01:29:56 +1000 (EST) Received: from localhost ([::1]:57318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEMDq-00084J-GS for incoming@patchwork.ozlabs.org; Wed, 19 Sep 2012 11:29:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEMDk-00083o-O2 for qemu-devel@nongnu.org; Wed, 19 Sep 2012 11:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEMDe-0005CN-Jm for qemu-devel@nongnu.org; Wed, 19 Sep 2012 11:29:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60181 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEMDe-0005C3-Dc for qemu-devel@nongnu.org; Wed, 19 Sep 2012 11:29:42 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 98D19A329C; Wed, 19 Sep 2012 17:29:41 +0200 (CEST) From: Alexander Graf To: qemu-devel qemu-devel Date: Wed, 19 Sep 2012 17:29:38 +0200 Message-Id: <1348068578-24375-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Christian Borntraeger , Richard Henderson Subject: [Qemu-devel] [PATCH] s390x: fix -initrd in virtio machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When using -initrd in the virtio machine, we need to indicate the initrd start and size inside the kernel image. These parameters need to be stored in native endianness. Signed-off-by: Alexander Graf Acked-by: Christian Borntraeger Tested-by: Richard Henderson --- hw/s390-virtio.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 47eed35..12ae612 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -284,8 +284,8 @@ static void s390_init(ram_addr_t my_ram_size, } /* we have to overwrite values in the kernel image, which are "rom" */ - memcpy(rom_ptr(INITRD_PARM_START), &initrd_offset, 8); - memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8); + stq_p(rom_ptr(INITRD_PARM_START), initrd_offset); + stq_p(rom_ptr(INITRD_PARM_SIZE), initrd_size); } if (rom_ptr(KERN_PARM_AREA)) {