From: Andrew Cooper Subject: Re: [PATCH] x86emul: improve LOCK handling Date: Tue, 16 Aug 2016 16:01:35 +0100 Message-ID: References: <57B3367B0200007800106590@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2022103793330471225==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZfsd-0007NU-Ew for xen-devel@lists.xenproject.org; Tue, 16 Aug 2016 15:02:15 +0000 In-Reply-To: <57B3367B0200007800106590@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org --===============2022103793330471225== Content-Type: multipart/alternative; boundary="------------68CCF15A049FFE6535AE4D40" --------------68CCF15A049FFE6535AE4D40 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 16/08/16 14:51, Jan Beulich wrote: > Certain opcodes would so far not have got #UD when a LOCK prefix was > present. Adjust this by > - moving the too early generic check into destination operand decoding, > where DstNone and DstReg already have respective handling > - switching source and destination of TEST r,r/m, for it to be taken > care of by aforementioned generic checks > - explicitly dealing with all forms of CMP, SHLD, SHRD, as well as > TEST $imm,r/m > > To make the handling of opcodes F6 and F7 more obvious, reduce the > amount of state set in the table, and adjust the respective switch() > statement accordingly. > > Also eliminate the latent bug of the check in DstNone handling not > considering the opcode extension set. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --------------68CCF15A049FFE6535AE4D40 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
On 16/08/16 14:51, Jan Beulich wrote:
Certain opcodes would so far not have got #UD when a LOCK prefix was
present. Adjust this by
- moving the too early generic check into destination operand decoding,
  where DstNone and DstReg already have respective handling
- switching source and destination of TEST r,r/m, for it to be taken
  care of by aforementioned generic checks
- explicitly dealing with all forms of CMP, SHLD, SHRD, as well as
  TEST $imm,r/m

To make the handling of opcodes F6 and F7 more obvious, reduce the
amount of state set in the table, and adjust the respective switch()
statement accordingly.

Also eliminate the latent bug of the check in DstNone handling not
considering the opcode extension set.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
--------------68CCF15A049FFE6535AE4D40-- --===============2022103793330471225== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============2022103793330471225==--