From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBML8-0003D0-Lm for qemu-devel@nongnu.org; Mon, 28 Nov 2016 08:51:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBML2-0004eT-Mr for qemu-devel@nongnu.org; Mon, 28 Nov 2016 08:51:26 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBML2-0004au-GC for qemu-devel@nongnu.org; Mon, 28 Nov 2016 08:51:20 -0500 From: Peter Maydell Date: Mon, 28 Nov 2016 13:51:10 +0000 Message-Id: <1480341071-5367-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1480341071-5367-1-git-send-email-peter.maydell@linaro.org> References: <1480341071-5367-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 1/2] generic-loader: file: Only set a PC if a CPU is specified List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi From: Alistair Francis This patch fixes the generic-loader file loading to only set the program counter if a CPU is specified. This follows what is written in the documentation and was always part of the original intention. Signed-off-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Message-id: 537bf4d08be7acf7a89b590cff69e19db7f0a6cd.1478908712.git.alistair.francis@xilinx.com Signed-off-by: Peter Maydell --- hw/core/generic-loader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index 79ab6df..208f549 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -93,7 +93,12 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) "image"); return; } - s->set_pc = true; + /* The user specified a file, only set the PC if they also specified + * a CPU to use. + */ + if (s->cpu_num != CPU_NONE) { + s->set_pc = true; + } } else if (s->addr) { /* User is setting the PC */ if (s->data || s->data_len || s->data_be) { -- 2.7.4