xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ma JieYue <majieyue@gmail.com>
To: "Pasi Kärkkäinen" <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: dom0 alignment check panic due to EFLAGS.AC been set
Date: Fri, 7 Jun 2013 16:57:08 +0800	[thread overview]
Message-ID: <CAJppPSak9EC3kLSg3kL0__fu3HvkB93wGd7Tp9rhstujwsxMHQ@mail.gmail.com> (raw)
In-Reply-To: <20130601105955.GJ11427@reaktio.net>

Thank you for your reply.

I admit xen4.0.1 is old, but from other bug reports in xen-devel,

> http://lists.xen.org/archives/html/xen-devel/2013-01/msg02285.html
> http://old-list-archives.xen.org/archives/html/xen-devel/2011-11/msg00827.html
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660425

I tend to believe it still exists, and from
http://lists.xen.org/archives/html/xen-devel/2013-01/msg02285.html, I
think maybe there hasn't been any specific patch to fix this EFLAGS.AC
problem.

It is obviously this EFLAGS.AC panic is caused by 3 conditions:

1. CPU EFLAGS reg AC bit been set, which I don't know why
2. CR0 AM mask allow this alignment check panic, which is by default behavior
3. Current CPL is 3, in which Dom0 is running

I tried to study the arch/x86/x86_64/entry.S, I guess the
create_bounce_frame is called when Xen switch to dom0, and it did
unset the CPU EFLAGS AC bit

create_bounce_frame:
...
.Lft13: movq  %rax,(%rsi)               # RCX
        /* Rewrite our stack frame and return to guest-OS mode. */
        /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
        /* Also clear AC: alignment checks shouldn't trigger in kernel mode. */
        movl  $TRAP_syscall,UREGS_entry_vector+8(%rsp)
        andl  $~(X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|\
                 X86_EFLAGS_NT|X86_EFLAGS_TF),UREGS_eflags+8(%rsp)
...

and also alignment check won't happen when running in Xen, which CPL is 0.

Someone also reported in mail list that a 2.6.24 pv kernel never panic
in alignment check, but when he changed to 2.6.32 pv kernel, it
happened often. So, I guess it is a dom0 kernel bug, isn't it?

jeremy, konrad, could you take a look at this?


BRgs
jerry


On Sat, Jun 1, 2013 at 6:59 PM, Pasi Kärkkäinen <pasik@iki.fi> wrote:
> On Sat, Jun 01, 2013 at 05:27:27PM +0800, Ma JieYue wrote:
>>
>> We found some mail may be related to this problem,
>>
>> http://lists.xen.org/archives/html/xen-devel/2013-01/msg02285.html
>> http://old-list-archives.xen.org/archives/html/xen-devel/2011-11/msg00827.html
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660425
>>
>> but all these posts reported a domU panic (maybe PV domU) , while mine
>> is related to dom0
>>
>>
>> The Xen version is 4.0.1 and dom0 kernel comes from jeremy's git tree
>>
>
> I suggest upgrading your Xen hypervisor.. 4.0.1 is very old,
> and not even the latest on 4.0.x branch.
>
> Currently Xen 4.2.2 is the latest stable release.
>
>> http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=commit;h=ae333e97552c81ab10395ad1ffc6d6daaadb144a
>>
>> It is xen-2.6.32.36 version of jeremy's dom0 git tree, so I guess
>> maybe it is too old to be related with CPU SMAP feature
>>
>
> Jeremy's xen.git is not maintained anymore, so it doesn't have the latest
> xen related fixes and features, and also it's lacking security fixes,
> so I don't recommend using it anymore.
>
> You should switch to mainline Linux 3.x kernel, which should be better in every way.
>
>>
>>
>> Any help is appreciated, thanks.
>>
>>
>> Best regards,
>>
>> jerry
>>
>
>
> -- Pasi
>

      reply	other threads:[~2013-06-07  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  9:27 dom0 alignment check panic due to EFLAGS.AC been set Ma JieYue
2013-06-01 10:59 ` Pasi Kärkkäinen
2013-06-07  8:57   ` Ma JieYue [this message]

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=CAJppPSak9EC3kLSg3kL0__fu3HvkB93wGd7Tp9rhstujwsxMHQ@mail.gmail.com \
    --to=majieyue@gmail.com \
    --cc=pasik@iki.fi \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).