lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Nov 2020 17:44:35 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Segher Boessenkool <segher@...nel.crashing.org>
Cc:     shuo.a.liu@...el.com, linux-kernel@...r.kernel.org, x86@...nel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "H . Peter Anvin" <hpa@...or.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        Yu Wang <yu1.wang@...el.com>,
        Reinette Chatre <reinette.chatre@...el.com>,
        Yakui Zhao <yakui.zhao@...el.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Fengwei Yin <fengwei.yin@...el.com>,
        Zhi Wang <zhi.a.wang@...el.com>,
        Zhenyu Wang <zhenyuw@...ux.intel.com>,
        Arvind Sankar <nivedita@...m.mit.edu>,
        Peter Zijlstra <peterz@...radead.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH v5 04/17] x86/acrn: Introduce hypercall interfaces

On Mon, Nov 02, 2020 at 05:18:09PM -0600, Segher Boessenkool wrote:
> That is invalid actually: local register asm as input to an inline asm
> should use *that* register!
> 
> This is all correct until LRA ("reload").  Not that "movl %xmm0,$eax"
> works, but at least it screams its head off, as it should.

Screams how?

It builds fine without a single peep with -Wall here.

Btw, that's a MOVD - not a MOVL. MOVD can do xmm -> gpr moves. And
singlestepping it with gdb does, well, something, which is clearly
wrong but nothing complains:

=> 0x555555555131 <main+12>:    movd   %xmm0,%eax

and %xmm0 has:

(gdb) p $xmm0
$2 = {v4_float = {0.99000001, 0, 0, 0}, v2_double = {5.2627153433055495e-315, 0}, v16_int8 = {-92, 112, 125, 63, 
		  ^^^^^^^^^^

so that is correct.

    0 <repeats 12 times>}, v8_int16 = {28836, 16253, 0, 0, 0, 0, 0, 0}, v4_int32 = {1065185444, 0, 0, 0}, v2_int64 = {
    1065185444, 0}, uint128 = 1065185444}

Then:

movd   %xmm0,%eax
rax            0x3f7d70a4

and that's the hex representation of the 0.99 float.

and that same value goes into %r8d:

mov    %eax,%r8d
r8             0x3f7d70a4

:-)

> Yes.  But GCC doing what you should have said instead of doing what you
> said, is not good.

Oh well, should I open a low prio bug, would that help?

I probably should test with the latest gcc first, though...

> Now if only we had time to document what we wrote!  We *do* write docs
> to go with new code (maybe not enough always), but no one spends a lot
> of time on documenting the existing compiler, or with a larger view than
> just a single aspect of the compiler.  Alas.

The problem every big project has.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ