From patchwork Thu Jul 2 10:14:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 490574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 16C2E1402B5 for ; Thu, 2 Jul 2015 20:21:20 +1000 (AEST) Received: from localhost ([::1]:35793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAbcM-0000Ti-7M for incoming@patchwork.ozlabs.org; Thu, 02 Jul 2015 06:21:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAbW3-0006nA-AQ for qemu-devel@nongnu.org; Thu, 02 Jul 2015 06:14:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAbVz-00048S-A4 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 06:14:47 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:59965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAbVz-00048B-0h for qemu-devel@nongnu.org; Thu, 02 Jul 2015 06:14:43 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Jul 2015 11:14:41 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 2 Jul 2015 11:14:40 +0100 X-Helo: d06dlp01.portsmouth.uk.ibm.com X-MailFrom: cornelia.huck@de.ibm.com X-RcptTo: qemu-stable@nongnu.org Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1B69317D8067; Thu, 2 Jul 2015 11:15:52 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t62AEcln29556744; Thu, 2 Jul 2015 10:14:38 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t62AEc9I013108; Thu, 2 Jul 2015 04:14:38 -0600 Received: from gondolin.ibm.com (sig-9-81-25-227.evts.uk.ibm.com [9.81.25.227]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t62AEOX8012493; Thu, 2 Jul 2015 04:14:37 -0600 From: Cornelia Huck To: peter.maydell@linaro.org Date: Thu, 2 Jul 2015 12:14:20 +0200 Message-Id: <1435832062-19112-10-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1435832062-19112-1-git-send-email-cornelia.huck@de.ibm.com> References: <1435832062-19112-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070210-0041-0000-0000-000004CBBAED X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.106 Cc: qemu-stable@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, Cornelia Huck , Paolo Bonzini Subject: [Qemu-devel] [PULL v2 for-2.4 09/11] s390x/ipl: Fix boot if no bootindex was specified 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 From: Christian Borntraeger commit fa92e218df1d ("s390x/ipl: avoid sign extension") introduced a regression: qemu-system-s390x -drive file=image.qcow,format=qcow2 does not boot, the bios states "No virtio-blk device found!" adding bootindex=1 does boot. The reason is that the uint32_t as return value will not do the right thing for the return -1 (default without bootindex). The bios itself, will interpret a 64bit -1 as autodetect (but it will interpret 32bit -1 as ccw device address ff.ff.ffff) Signed-off-by: Christian Borntraeger Cc: Paolo Bonzini Cc: Cornelia Huck Cc: qemu-stable@nongnu.org # v2.3.0 Tested-by: Aurelien Jarno Reviewed-by: Aurelien Jarno Signed-off-by: Cornelia Huck --- hw/s390x/ipl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 132004a..2e0a8b6 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -218,7 +218,7 @@ static Property s390_ipl_properties[] = { * - -1 if no valid boot device was found * - ccw id of the boot device otherwise */ -static uint32_t s390_update_iplstate(CPUS390XState *env, S390IPLState *ipl) +static uint64_t s390_update_iplstate(CPUS390XState *env, S390IPLState *ipl) { DeviceState *dev_st; @@ -248,7 +248,7 @@ static uint32_t s390_update_iplstate(CPUS390XState *env, S390IPLState *ipl) return -1; out: - return ipl->cssid << 24 | ipl->ssid << 16 | ipl->devno; + return (uint32_t) (ipl->cssid << 24 | ipl->ssid << 16 | ipl->devno); } int s390_ipl_update_diag308(IplParameterBlock *iplb)