Re: [PATCH] KVM: x86 emulator: add bsf/bsr instruction emulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On 08/09/2010 06:00 AM, Wei Yongjun wrote:
> Add bsf/bsr instruction emulation (opcode 0x0f 0xbc~0xbd)
>
> @@ -3464,6 +3464,30 @@ twobyte_insn:
>  	      btc:		/* btc */
>  		emulate_2op_SrcV_nobyte("btc", c->src, c->dst, ctxt->eflags);
>  		break;
> +	case 0xbc: {		/* bsf */
> +		int zf;
> +		__asm__ ("bsf %2, %0; setz %b1"
> +			 : "=r"(c->dst.val), "=q"(zf)
> +			 : "r"(c->src.val), "1" (0));

Won't the high bytes of zf remain clear? Please examine the assembly.

Declaring it u8 is probably better.


-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux