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:	Sun, 13 Apr 2014 08:51:03 -0400
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Bandan Das <bsd@...hat.com>, kvm@...r.kernel.org
CC:	Marcelo Tosatti <mtosatti@...hat.com>,
	Gleb Natapov <gleb@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 3/6] KVM: emulate: cleanup decode_rm

Il 10/04/2014 20:03, Bandan Das ha scritto:
> -	if (ctxt->rex_prefix) {
> -		ctxt->modrm_reg = (ctxt->rex_prefix & 4) << 1;	/* REX.R */
> -		index_reg = (ctxt->rex_prefix & 2) << 2; /* REX.X */
> -		ctxt->modrm_rm = base_reg = (ctxt->rex_prefix & 1) << 3; /* REG.B */
> -	}
> +	index_reg = (ctxt->rex_prefix << 2) & 8; /* REX.X */
> +	base_reg = (ctxt->rex_prefix << 3) & 8; /* REG.B */

This is REX.B (preexisting typo), and please leave REX.R here too for 
clarity.

Also, the function is "decode_modrm", not "decode_rm" (in the commit 
message).

Otherwise the series seems okay from a somewhat cursory review.

Paolo

>
> -	ctxt->modrm_mod |= (ctxt->modrm & 0xc0) >> 6;
> -	ctxt->modrm_reg |= (ctxt->modrm & 0x38) >> 3;
> -	ctxt->modrm_rm |= (ctxt->modrm & 0x07);
> +	ctxt->modrm_mod = (ctxt->modrm & 0xc0) >> 6;
> +	ctxt->modrm_reg = ((ctxt->rex_prefix << 1) & 8) | /* REX.R */
> +		((ctxt->modrm & 0x38) >> 3);
> +	ctxt->modrm_rm = base_reg | (ctxt->modrm & 0x07);
>  	ctxt->modrm_seg = VCPU_SREG_DS;
>

--
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