From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.26; helo=mail-in4.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in4.apple.com (mail-out4.apple.com [17.151.62.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A392921B00DC4 for ; Wed, 15 Nov 2017 20:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1510808481; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NfKhLZvbdtHmz7yRhxCCcExgkx8avo3wgKdRJ14U4xw=; b=acb4R9m7Cp232aOb44DKVz18B79DPe7cKmV+rTGz69VaY85pCQg92Rk9QurrWCTD eGQDPoHF1I+umKoXmXhgDwDvPDJGbfeYfY2z40xrsxuP/TEzZpKdf+dXBqBrpzE6 3Vvq9capOrOF+ciGIGGNJh7HYkraRiIBAfoL+ztjB5Uz8FARqcDkfHWAN8CCq5V3 4eBWcNFD2FE0Fa2UWgSBHqRTL3dVfdEW/qHSs0pHy6mW9IU+pfk1A5AnuYfy34g7 ZjaJlaF7GZQl7jlb8Ny7plsxVizX2wzbXtB3fgsCoKV4sHEzPF4NHtc6aYbJLcp3 hOoFOUvPoCsu9KB9g91FRw==; Received: from relay7.apple.com (relay7.apple.com [17.128.113.101]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in4.apple.com (Apple Secure Mail Relay) with SMTP id 66.10.16042.1AB1D0A5; Wed, 15 Nov 2017 21:01:21 -0800 (PST) X-AuditID: 11973e12-355ff70000003eaa-69-5a0d1ba1e47f Received: from nwk-mmpp-sz10.apple.com (nwk-mmpp-sz10.apple.com [17.128.115.122]) by relay7.apple.com (Apple SCV relay) with SMTP id D4.9B.05443.1AB1D0A5; Wed, 15 Nov 2017 21:01:21 -0800 (PST) MIME-version: 1.0 Received: from [17.234.9.94] by nwk-mmpp-sz10.apple.com (Oracle Communications Messaging Server 8.0.1.3.20170825 64bit (built Aug 25 2017)) with ESMTPSA id <0OZH00J4JVA84UB0@nwk-mmpp-sz10.apple.com>; Wed, 15 Nov 2017 21:01:21 -0800 (PST) Sender: afish@apple.com From: Andrew Fish Message-id: Date: Wed, 15 Nov 2017 21:01:19 -0800 In-reply-to: <4c77020a-e01e-f048-9410-f474c6128601@zytor.com> Cc: edk2-devel@lists.01.org, Rick Bramley , Eric Dong , Laszlo Ersek , Jeff Fan To: Paulo Alcantara References: <4c77020a-e01e-f048-9410-f474c6128601@zytor.com> X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsUi2FCYqrtQmjfK4OQHZYs9h44yW2x+EWxx cv0SRotlx3awWOx7/ZHR4vLa8+wObB67tu1k8li85yWTR/fsfywe7/ddZfM40fKFNYA1issm JTUnsyy1SN8ugSvj4NYp7AXvZzBWPL31hKWB8WErYxcjB4eEgInE7tc5XYxcHEICa5gkvnyb wdTFyAkWX7fwOhNE4hCjRP+RFawgCV4BQYkfk++xgNjMAmESPWuWgtlCAp8ZJfZcFAWxhQXE Jd6d2cQMYrMJKEusmP+BHaLXRqJr5xIWiBo/iU1NU9hAbBYBVYnnp66C1XMK2Eq8vjSJFWQx s8AKRolVk7aBNYsIqElc3nOXFeKiCYwSLXunsEKcKitxa/YlZpCEhMB1Non9c04yTWAUmoXk 2llIroWwtSS+P2oFsjmAbHmJg+dlIcKaEs/ufWKHsLUlnry7wLqAkW0Vo1BuYm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ePGzB8j9usxu+x7c3V8/9utBsqsRRnJBpqMRcVJwIAGT6a 2H8CAAA= X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: [RFC v2 0/3] Stack trace support in X64 exception handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 04:57:12 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Paulo, Those attached stack traces don't look right. Thanks, Andrew Fish > On Nov 15, 2017, at 5:46 PM, Paulo Alcantara wrote: > > Hi, > > On 11/15/2017 11:18 PM, Paulo Alcantara wrote: >> Hi, >> This series adds stack trace support during a X64 CPU exception. >> Informations like back trace, stack contents and image module names >> (that were part of the call stack) will be dumped out. >> We already have such support in ARM/AArch64 (IIRC) exception handling >> (thanks to Ard), and then I thought we'd also deserve it in X64 and >> IA-32 platforms. >> What do you think guys? >> BTW, I've tested this only with OVMF (X64 only), using: >> - gcc-6.3.0, GCC5, NOOPT >> Any other tests would be really appreciable. >> Thanks! >> Paulo >> Repo: https://github.com/pcacjr/edk2.git >> Branch: stacktrace_v2 >> Cc: Rick Bramley >> Cc: Andrew Fish >> Cc: Eric Dong >> Cc: Laszlo Ersek >> Cc: "Brian J. Johnson" >> Cc: Jeff Fan >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Paulo Alcantara >> --- >> v1 -> v2: >> * Add IA32 arch support (GCC toolchain only) >> * Replace hard-coded stack alignment value (16) with >> CPU_STACK_ALIGNMENT. >> * Check for proper stack and frame pointer alignments. >> * Fix initialization of UnwoundStacksCount to 1. >> * Move GetPdbFileName() to common code since it will be used by both >> IA32 and X64 implementations. > > Sorry for the delay in sending v2. It's holiday here :-) > > FWIW, I've attached two files which contain stack trace dumps of IA32 and X64 exceptions. > > The new IA32 arch support is still limited to GCC only (that is, relying on frame pointers), but I'll start investing in a new solution that would work on both MSVC and GCC toolchains -- probably this weekend. If I come up with something, I'll let you know. > > On IA32, I performed the same test as in X64 to trigger an NMI interrupt manually with: asm ("int $0x2") in PartitionDxe driver and watched out the call stack. The difference between the two dumps, regardless the CPU context, etc. is that we don't see the calls from PeiCore.dll. Then I figured out that the EIP gets a value of 0 before jumping to PartitionDxe's entry point. > > I guess that's related to the "push $0" that Andrew mentioned earlier so the debugger knows when to stop unwinding. Although I can't see a "push 0" equivalent neither in SwitchStack.nasm nor in SwitchStack.asm for X64 > -- so we're able to see the calls within PeiCore.dll. > > Thanks! > Paulo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel