From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKm7f-0006HJ-HX for qemu-devel@nongnu.org; Thu, 30 Jul 2015 07:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKm7c-0002gD-7R for qemu-devel@nongnu.org; Thu, 30 Jul 2015 07:35:39 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:50625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKm7c-0002fx-05 for qemu-devel@nongnu.org; Thu, 30 Jul 2015 07:35:36 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Jul 2015 05:35:35 -0600 From: Michael Roth Date: Thu, 30 Jul 2015 06:32:53 -0500 Message-Id: <1438255988-10418-39-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1438255988-10418-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1438255988-10418-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 38/53] s390x/ipl: Fix boot if no bootindex was specified List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , Christian Borntraeger , qemu-stable@nongnu.org, Paolo Bonzini 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 (cherry picked from commit 6efd2c2a125b4369b8def585b0dac35c849b5eb3) Signed-off-by: Michael Roth --- 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 2e26d2a..754fb19 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) -- 1.9.1