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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Nov 2020 12:10:00 -0600
From:   Segher Boessenkool <segher@...nel.crashing.org>
To:     Borislav Petkov <bp@...en8.de>
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

Hi!

On Mon, Nov 02, 2020 at 06:19:50PM +0100, Borislav Petkov wrote:
> On Mon, Nov 02, 2020 at 10:09:01AM -0600, Segher Boessenkool wrote:
> > I think that will work for x86_64.  But it won't matter much, most of
> > the time you give an immediate number.
> 
> Yeah, my question is more along the lines of "is this constraint somehow
> special, i.e., 'ir' (and not 'm') or can it be whatever, i.e., 'g'"?

movl works for moving anything g->r.  This is not true for most insns,
and not for most architectures at all (usually loading from memory has a
separate mnemonic; moving an immediate number often as well (and it does
not usually allow *every* immediate anyway, not even all numbers!)

> > It is a tiny bit neater of course (if anyone still remembers what "g"
> > is, you cannot use it much these days).
> 
> Oh I always remember what it is because it is right there in the docs:
> 
> "6.47.3.1 Simple Constraints
> 
> ...
> 
> ā€˜gā€™	Any register, memory or immediate integer operand is allowed,
> 	except for registers that are not general registers."

Most people do not read the documentation, they just copy from (bad)
examples (and arguably, any example you do not really understand is a
bad example).

(It does not allow *all* memory and *all* constants, btw...  And the
condition for registers is not really "general register", whatever that
means...  I hope no one ever told you our documentation does not have
white lies!)


Segher

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ