From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5Pbk-0006Cs-2q for qemu-devel@nongnu.org; Fri, 11 Nov 2016 23:08:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5Pbg-0002oO-TM for qemu-devel@nongnu.org; Fri, 11 Nov 2016 23:08:00 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35708) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5Pbg-0002oD-LY for qemu-devel@nongnu.org; Fri, 11 Nov 2016 23:07:56 -0500 Received: by mail-lf0-f67.google.com with SMTP id p100so2498311lfg.2 for ; Fri, 11 Nov 2016 20:07:56 -0800 (PST) Date: Sat, 12 Nov 2016 05:06:52 +0100 From: "Edgar E. Iglesias" Message-ID: <20161112040652.GP9606@toto> References: <537bf4d08be7acf7a89b590cff69e19db7f0a6cd.1478908712.git.alistair.francis@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <537bf4d08be7acf7a89b590cff69e19db7f0a6cd.1478908712.git.alistair.francis@xilinx.com> Subject: Re: [Qemu-devel] [PATCH v1 1/1] 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: Alistair Francis Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, alistair23@gmail.com, edgar.iglesias@xilinx.com On Fri, Nov 11, 2016 at 06:51:20PM -0800, Alistair Francis wrote: > 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. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Alistair Francis > --- > > 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 >