From: "Jan Beulich" Subject: Re: [PATCH for-4.5] x86/stack: Avoid peeking into unmapped guard pages when dumping Xens stack Date: Thu, 04 Dec 2014 13:32:55 +0000 Message-ID: <54807097020000780004CBC7@mail.emea.novell.com> References: <1417697910-19824-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417697910-19824-1-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Tim Deegan , Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 04.12.14 at 13:58, wrote: > Konrad: I am requesting a release ack for this change. It aids the clarity of > certain crash information, and prevents cascade pagefaults in certain > circumstances, which would prevent execution of the crash kernel or a system > reboot. With #ifndef NDEBUG #define MEMORY_GUARD #endif I don't think this qualifies as a necessary bug fix at this point of 4.5. > +unsigned long get_stack_trace_bottom(unsigned long sp) > +{ > + switch ( get_stack_page(sp) ) > + { > + case 0 ... 2: > + return ROUNDUP(sp, PAGE_SIZE) - > + offsetof(struct cpu_user_regs, es) - sizeof(unsigned long); The only concern I have here is that this may wrongly truncate a dump/trace when one of the IST stacks overflowed. But I think we can live with that - an overflow of the first one would already have similar behavior today. > + > +#ifndef MEMORY_GUARD > + case 3 ... 5: > +#endif > + case 6 ... 7: > + return ROUNDUP(sp, STACK_SIZE) - > + sizeof(struct cpu_info) - sizeof(unsigned long); > + > +#ifdef MEMORY_GUARD > + case 3 ... 5: > +#endif > + default: What is the #ifdef good for when this is "default:" anyway? With this dropped (also from the other function) Reviewed-by: Jan Beulich Jan