From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Froyd Date: Mon, 27 Jul 2009 13:14:08 +0000 Subject: Re: [PATCH 0/5] Message-Id: <20090727131408.GW32566@codesourcery.com> List-Id: References: <1248511217-22681-1-git-send-email-yu.liu@freescale.com> In-Reply-To: <1248511217-22681-1-git-send-email-yu.liu@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Liu Yu Cc: kvm-ppc@vger.kernel.org, jan.kiszka@siemens.com, qemu-devel@nongnu.org, hollisb@us.ibm.com On Sat, Jul 25, 2009 at 04:40:12PM +0800, Liu Yu wrote: > For example booke has a code template for > jumping to and returning from interrupt handlers: > > bl transfer > .long handler_addr > .long ret_addr > > when call transfer, it never return but > in transfer assembly code it will read the handler_addr > and ultimately call the handler. > Gdb doesn't know that and treat it as a normal function call. > so gdb put a software breakpoint instruction at handler_addr, > in order to get trap there when return from transfer. > > Then guest will read software breakpoint as handler_addr and jump to there.. > > I'm not sure if x86 suffer this kind of issue. > Is there any way to avoid this? You would need to modify GDB to recognize this sort of case with the skip_trampoline_code gdbarch method. -Nathan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVQ1z-0004yT-BX for qemu-devel@nongnu.org; Mon, 27 Jul 2009 09:14:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVQ1u-0004xh-Iw for qemu-devel@nongnu.org; Mon, 27 Jul 2009 09:14:19 -0400 Received: from [199.232.76.173] (port=42605 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVQ1t-0004xZ-9I for qemu-devel@nongnu.org; Mon, 27 Jul 2009 09:14:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:31076) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVQ1t-00049W-1c for qemu-devel@nongnu.org; Mon, 27 Jul 2009 09:14:13 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVQ1r-0004Vp-4s for qemu-devel@nongnu.org; Mon, 27 Jul 2009 09:14:11 -0400 Date: Mon, 27 Jul 2009 06:14:08 -0700 From: Nathan Froyd Message-ID: <20090727131408.GW32566@codesourcery.com> References: <1248511217-22681-1-git-send-email-yu.liu@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1248511217-22681-1-git-send-email-yu.liu@freescale.com> Subject: [Qemu-devel] Re: [PATCH 0/5] List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yu Cc: kvm-ppc@vger.kernel.org, jan.kiszka@siemens.com, qemu-devel@nongnu.org, hollisb@us.ibm.com On Sat, Jul 25, 2009 at 04:40:12PM +0800, Liu Yu wrote: > For example booke has a code template for > jumping to and returning from interrupt handlers: > > bl transfer > .long handler_addr > .long ret_addr > > when call transfer, it never return but > in transfer assembly code it will read the handler_addr > and ultimately call the handler. > Gdb doesn't know that and treat it as a normal function call. > so gdb put a software breakpoint instruction at handler_addr, > in order to get trap there when return from transfer. > > Then guest will read software breakpoint as handler_addr and jump to there.. > > I'm not sure if x86 suffer this kind of issue. > Is there any way to avoid this? You would need to modify GDB to recognize this sort of case with the skip_trampoline_code gdbarch method. -Nathan