[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdkjAHv_=+167x6paXpO6QsEEPivZd=tj+WGpzg+pKjgtg@mail.gmail.com>
Date: Wed, 16 Sep 2020 11:28:26 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Arvind Sankar <nivedita@...m.mit.edu>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Rong Chen <rong.a.chen@...el.com>,
kernel test robot <lkp@...el.com>,
"Li, Philip" <philip.li@...el.com>, x86-ml <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Marco Elver <elver@...gle.com>
Subject: Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e
On Wed, Sep 16, 2020 at 4:34 AM Borislav Petkov <bp@...en8.de> wrote:
>
> On Tue, Sep 15, 2020 at 05:50:54PM -0400, Arvind Sankar wrote:
> > On Tue, Sep 15, 2020 at 10:49:12PM +0200, Borislav Petkov wrote:
> > >
> > > (Btw, clang doesn't need to add that "xor %eax,%eax" - panic() should not be
> > > returning, ever. :-))
> > >
> >
> > I think this is because panic() is varargs, and clang doesn't support
> > gcc's -mskip-rax-setup. The normal ABI requires the caller to set RAX to
> > the number of arguments in vector registers.
> >
> > https://patchwork.ozlabs.org/project/gcc/patch/20141218131150.GA32638@intel.com/
>
> Ah, good point. Found this in the ABI doc:
>
> "For calls that may call functions that use varargs or stdargs
> (prototype-less calls or calls to functions containing ellipsis (...) in
> the declaration) %al is used as hidden argument to specify the number of
> vector registers used. The contents of %al do not need to match exactly
> the number of registers, but must be an upper bound on the number of
> vector registers used and is in the range 0–8 inclusive."
pt. 3 https://nickdesaulniers.github.io/blog/2014/04/18/lets-write-some-x86-64/
...2014, jesus...
"But you never can tell exactly what the compiler is doing. It doesn’t
always come out the way you want. Like a dusty pane or warped mirror."
Seems I'd learn more about that than I'd could have ever envisioned...
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists