All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atom2 <ariel.atom2@web2web.at>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: Doug Goldstein <cardoe@cardoe.com>, xen-devel@lists.xen.org
Subject: Re: HVM domains crash after upgrade from XEN 4.5.1 to 4.5.2
Date: Thu, 19 Nov 2015 20:51:15 +0100	[thread overview]
Message-ID: <564E2833.2010709@web2web.at> (raw)
In-Reply-To: <564DA69C.9070809@citrix.com>

Am 19.11.15 um 11:38 schrieb Andrew Cooper:
> On 19/11/15 10:24, Jan Beulich wrote:
>>>>> On 19.11.15 at 00:17, <andrew.cooper3@citrix.com> wrote:
>>> The disassembly of do_IRQ now looks like a plausible function, but the
>>> consistently faulting address has no plausible way of generating a
>>> double fault.  I suspect therefore that something has caused memory
>>> corruption in Xen .text section.
>> Dump of assembler code for function do_IRQ:
>>     0xffff82d080176577 <+0>:	push   %rbp
>>     0xffff82d080176578 <+1>:	mov    %rsp,%rbp
>>     0xffff82d08017657b <+4>:	push   %r15
>>     0xffff82d08017657d <+6>:	push   %r14
>>     0xffff82d08017657f <+8>:	push   %r13
>>     0xffff82d080176581 <+10>:	push   %r12
>>     0xffff82d080176583 <+12>:	push   %rbx
>>     0xffff82d080176584 <+13>:	lea    -0x1058(%rsp),%rsp
>>     0xffff82d08017658c <+21>:	orq    $0x0,(%rsp)
>>     0xffff82d080176591 <+26>:	lea    0x1020(%rsp),%rsp
>>
>> The orq surely has potential for causing a double fault, if %rsp is
>> near the stack limit. The two LEAs look suspect, presumably a
>> result of some non-standard option passed to gcc. Removing that
>> option might already be a step forward.

Andrew, Jan - thanks again.
In terms of non-standard options passed to gcc I have tried to make sense of what flags are actually being used during the build process. I am not absolutely sure, but I think the options passed to gcc are as follows:

I do have system wide flags which are used for non-debug builds:
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"

for builds with debug symbols (using splitdebug) there are system wide overrides as follows:
CFLAGS="-march=native -O2 -pipe -ggdb"
CXXFLAGS="${CFLAGS}"
LDFLAGS: I'd assume that this inherits its value from the system wide setting of LDFLAGS

for xen (the hypervisor) the build system seems to do the following:
CFLAGS="" (i.e. unset CFLAGS)
to me this indicates that the rest stays untouched (i.e. either standard or debug flags)

for xen-tools (includes e.g. hvmloader) the build system appears to to the following:
CFLAGS="" (i.e. unset CFLAGS)
CXXFLAGS="${CXXFLAGS} -fno-strict-overflow"
LDFLAGS="" (i.e. unset LDFLAGS)

So I think there's probably nothing really fancy in my options to gcc.

> Actually yes - that is a huge quantity of stack usage.
>
> (The actual behaviour looks very suspect - it appears to be completely
> pointless).
>
> The #DF handler reports that %rsp in the exception frame is within
> range.  Having said that,
>
> (XEN) [    2.788209] rbp: ffff83080ca8ed78   rsp: ffff83080ca8dcf8
> r8:  ffff83080ca9d558
> ...
> (XEN) [    2.837474] Valid stack range:
> ffff83080ca8e000-ffff83080ca90000, sp=ffff83080ca8dcf8,
> tss.esp0=ffff83080ca8ffc0
> (XEN) [    2.848969] No stack overflow detected. Skipping stack trace.
>
> In this case, the stack pointer *is* out of range, and has hit the guard
> page.
>
> This means:
> 1) There is some bug in the stack overflow detection in the #DF handler.
> 2) Whatever options Gentoo compiles Xen with is sufficient to overflow
> the 8K hypervisor stack.
Thanks Atom2

  reply	other threads:[~2015-11-19 19:51 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12  1:08 HVM domains crash after upgrade from XEN 4.5.1 to 4.5.2 Atom2
2015-11-12 12:52 ` Jan Beulich
2015-11-12 13:01   ` Andrew Cooper
2015-11-12 14:29     ` Atom2
2015-11-12 15:32       ` Jan Beulich
2015-11-12 16:43       ` Andrew Cooper
2015-11-12 23:00         ` Atom2
2015-11-13  7:25           ` Jan Beulich
2015-11-13 10:09             ` Andrew Cooper
2015-11-14  0:16               ` Atom2
2015-11-14 20:32                 ` Andrew Cooper
2015-11-15  0:14                   ` Atom2
2015-11-15 15:12                     ` Andrew Cooper
2015-11-16  0:39                       ` Atom2
2015-11-16 10:02                         ` Andrew Cooper
2015-11-15 20:12                     ` Doug Goldstein
2015-11-16  1:05                       ` Atom2
2015-11-16 15:31                         ` Konrad Rzeszutek Wilk
2015-11-16 19:16                           ` Atom2
2015-11-16 19:25                             ` Konrad Rzeszutek Wilk
2015-11-16 19:39                               ` Doug Goldstein
2015-11-16 19:47                                 ` Konrad Rzeszutek Wilk
2015-11-16 19:45                               ` Atom2
2015-11-16 23:01                             ` Andrew Cooper
2015-11-16 23:10                               ` Atom2
2015-11-18 22:51                                 ` Atom2
2015-11-18 23:17                                   ` Andrew Cooper
2015-11-19  0:31                                     ` Atom2
2015-11-19  1:06                                       ` Andrew Cooper
2015-11-19 20:02                                         ` Atom2
2015-11-19 23:53                                           ` Andrew Cooper
2015-11-24 11:53                                             ` Atom2
2015-11-19 10:24                                     ` Jan Beulich
2015-11-19 10:38                                       ` Andrew Cooper
2015-11-19 19:51                                         ` Atom2 [this message]
2015-11-20  7:57                                           ` Jan Beulich
2015-11-24 10:32                                             ` Atom2
2015-11-24 10:43                                               ` Jan Beulich
2015-11-27 22:51                                                 ` Atom2
2015-11-30  9:04                                                   ` Jan Beulich
2015-11-16 19:47                         ` Doug Goldstein
2015-11-16 20:14                           ` Atom2
2015-11-12 14:12   ` Atom2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564E2833.2010709@web2web.at \
    --to=ariel.atom2@web2web.at \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.