Date: Tue, 23 Oct 2012 20:13:36 +0300 From: Andriy Gapon <avg@FreeBSD.org> To: Peter Grehan <grehan@FreeBSD.org> Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, Jilles Tjoelker <jilles@stack.nl> Subject: Re: svn commit: r241744 - projects/bhyve/usr.sbin/bhyve Message-ID: <5086D040.1090307@FreeBSD.org> In-Reply-To: <5086C976.9060705@freebsd.org> References: <201210191811.q9JIBIQu049356@svn.freebsd.org> <20121021121006.GA96141@stack.nl> <5085D433.4020101@freebsd.org> <20121023095549.GA27951@stack.nl> <5086C976.9060705@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
on 23/10/2012 19:44 Peter Grehan said the following: > On 10/23/12 3:55 AM, Jilles Tjoelker wrote: >> On Mon, Oct 22, 2012 at 05:18:11PM -0600, Peter Grehan wrote: >>>> Case 4 looks wrong. A 32-bit write clears the top 32 bits of the >>>> register instead of preserving them. >> >>> Yep, you're right. How about: >> >>> > + case 4: >>> > + val = (reg & ~0xffffffffUL) | (operand & 0xffffffffUL); >>> > + break; >> >> I think you mean: >> val = operand & 0xffffffffUL; >> >> Right? > > Don't think so - the high 32 bits of the target register need to be or'd in, as > you originally mentioned. If this code emulates something like mov into %eax on AMDD64, then it should clear upper 32-bits of %rax. Which I think your original code already did, but in a less obvious way than Jilles suggested above. But I could be very well confused... -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5086D040.1090307>