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] [day] [month] [year] [list]
Date:	Thu, 04 Jul 2013 13:08:08 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Denys Vlasenko <dvlasenk@...hat.com>
CC:	Gleb Natapov <gleb@...hat.com>, linux-kernel@...r.kernel.org,
	Avi Kivity <avi.kivity@...il.com>
Subject: Re: [PATCH] x86/kvm/emulate.c: simplify NOP (opcode 0x90) check

Il 04/07/2013 13:06, Denys Vlasenko ha scritto:
>>> >> -	case 0x90 ... 0x97: /* nop / xchg reg, rax */
>>> >> -		if (ctxt->dst.addr.reg == reg_rmw(ctxt, VCPU_REGS_RAX))
>>> >> -			break;
>>> >> +	case 0x90: /* nop */
>>> >> +		break;
>> > This does not work on 64bit and REX prefix.
> Can you elaborate?
> 
> 0x90 is special-cased in CPU to be a NOP regardless of bit width.
> IOW, xchg %eax,%eax ordinarily would clear upper 32 bits of %rax,
> but 0x90 doesn't do that.
> 
> Do you mean that with REX.R==1, 0x90 will refer to R8?

Yes.

$ echo 'xchg %rax,%r8' | as
$ objdump -d a.out

a.out:     file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <.text>:
   0:	49 90                	xchg   %rax,%r8


Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ