Received: from eggs.gnu.org ([2001:4830:134:3::10]:56989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQa9A-0003P2-0M for qemu-devel@nongnu.org; Fri, 22 Jul 2016 09:05:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQa97-0003FU-NX for qemu-devel@nongnu.org; Fri, 22 Jul 2016 09:05:42 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:50098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQa97-0003FO-Bc for qemu-devel@nongnu.org; Fri, 22 Jul 2016 09:05:41 -0400 Date: Fri, 22 Jul 2016 15:05:39 +0200 From: Aurelien Jarno Message-ID: <20160722130539.GA5564@aurel32.net> References: <20160722095540.5887-1-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160722095540.5887-1-paul.burton@imgtec.com> Subject: Re: [Qemu-devel] [PATCH] hw/mips_malta: Fix YAMON API print routine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Burton Cc: qemu-devel@nongnu.org, Leon Alrae On 2016-07-22 10:55, Paul Burton wrote: > The print routine provided as part of the in-built bootloader had a bug > in that it attempted to use a jump instruction as part of a loop, but > the target has its upper bits zeroed leading to control flow > transferring to 0xb0000814 rather than the intended 0xbfc00814. Fix this > by using a branch instruction instead, which seems more fit for purpose. > > A simple way to test this is to build a Linux kernel with EVA enabled & > attempt to boot it in QEMU. It will attempt to print a message > indicating the configuration mismatch but QEMU would previously > incorrectly jump & wind up printing a continuous stream of the letter E. > > Signed-off-by: Paul Burton > Cc: Aurelien Jarno > Cc: Leon Alrae > --- > hw/mips/mips_malta.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c > index 34d41ef..e90857e 100644 > --- a/hw/mips/mips_malta.c > +++ b/hw/mips/mips_malta.c > @@ -727,7 +727,7 @@ static void write_bootloader(uint8_t *base, int64_t run_addr, > stl_p(p++, 0x00000000); /* nop */ > stl_p(p++, 0x0ff0021c); /* jal 870 */ > stl_p(p++, 0x00000000); /* nop */ > - stl_p(p++, 0x08000205); /* j 814 */ > + stl_p(p++, 0x1000fff9); /* b 814 */ > stl_p(p++, 0x00000000); /* nop */ > stl_p(p++, 0x01a00009); /* jalr t5 */ > stl_p(p++, 0x01602021); /* move a0,t3 */ This looks fine. The switch from jump to branch is questionable given there are other jumps around in the code, but that's just nitpicking. Reviewed-by: Aurelien Jarno -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net