From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GEvmC-0001Bz-RF for qemu-devel@nongnu.org; Sun, 20 Aug 2006 18:28:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GEvmA-00019X-Rr for qemu-devel@nongnu.org; Sun, 20 Aug 2006 18:28:16 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GEvmA-00019C-MO for qemu-devel@nongnu.org; Sun, 20 Aug 2006 18:28:14 -0400 Received: from [66.249.92.168] (helo=ug-out-1314.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GEvtP-0003Op-Uz for qemu-devel@nongnu.org; Sun, 20 Aug 2006 18:35:44 -0400 Received: by ug-out-1314.google.com with SMTP id s2so1508750uge for ; Sun, 20 Aug 2006 15:28:13 -0700 (PDT) Message-ID: Date: Mon, 21 Aug 2006 02:28:13 +0400 From: "Igor Kovalenko" Subject: Re: [Qemu-devel] [PATCH] handle multibyte NOPs In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_25479_19532527.1156112893265" References: <200608190128.12476.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_25479_19532527.1156112893265 Content-Type: multipart/alternative; boundary="----=_Part_25480_20180276.1156112893265" ------=_Part_25480_20180276.1156112893265 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/21/06, malc wrote: > > On Mon, 21 Aug 2006, Igor Kovalenko wrote: > > > On 8/19/06, Paul Brook wrote: > >> > >> On Saturday 19 August 2006 00:40, Igor Kovalenko wrote: > >> > Hi! > >> > > >> > This patch adds handling of multi-byte NOPs, recent gcc/gas uses them > >> for > >> > x86 code padding. > >> > Patch checked with current opensuse-factory x86 guest installation > which > >> is > >> > built with new gcc/gas tools. > >> > >> According to my amd64 documentation all of the opcodes 0f 19 through 0f > 1f > >> should be implemented as a NOP. Also, I suspect the "invalid" prefetch > ops > >> (0f 18) should also be implemented as nops. > >> The same implementation should be useable to all these opcodes. > >> > >> > > Updated patch, extracted noop modrm processing into separate function > and > > used it for 0f 18 case as well. I also removed reg sense from noop > > processing. > > Case labels in your `switch (mod)' statement are incorrect. I guess you > wanted 0x to behave like 0b, while it works for 0 and 1, for everything > else it's way of. > Right. Here is the real one with correct case labels. -- Kind Regards, Igor V. Kovalenko ------=_Part_25480_20180276.1156112893265 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/21/06, malc <malc@pulsesoft.com> wrote:
On Mon, 21 Aug 2006, Igor Kovalenko wrote:

> On 8/19/06, Paul Brook <paul@codesourcery.com> wrote:
>>
>> On Saturday 19 August 2006 00:40, Igor Kovalenko wrote:
>> > Hi!
>> >
>> > This patch adds handling of multi-byte NOPs, recent gcc/gas uses them
>> for
>> > x86 code padding.
>> > Patch checked with current opensuse-factory x86 guest installation which
>> is
>> > built with new gcc/gas tools.
>>
>> According to my amd64 documentation all of the opcodes 0f 19 through 0f 1f
>> should be implemented as a NOP. Also, I suspect the "invalid" prefetch ops
>> (0f 18) should also be implemented as nops.
>> The same implementation should be useable to all these opcodes.
>>
>>
> Updated patch, extracted noop modrm processing into separate function and
> used it for 0f 18 case as well. I also removed reg sense from noop
> processing.

Case labels in your `switch (mod)' statement are incorrect. I guess you
wanted 0x to behave like 0b, while it works for 0 and 1, for everything
else it's way of.

Right. Here is the real one with correct case labels.

--
Kind Regards,
Igor V. Kovalenko ------=_Part_25480_20180276.1156112893265-- ------=_Part_25479_19532527.1156112893265 Content-Type: text/plain; name=x86-multibyte-noop-5.diff; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_er3zr1s8 Content-Disposition: attachment; filename="x86-multibyte-noop-5.diff" SW5kZXg6IHRhcmdldC1pMzg2L3RyYW5zbGF0ZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnNy b290L3FlbXUvcWVtdS90YXJnZXQtaTM4Ni90cmFuc2xhdGUuYyx2CnJldHJpZXZpbmcgcmV2aXNp b24gMS41OQpkaWZmIC11IC1yMS41OSB0cmFuc2xhdGUuYwotLS0gdGFyZ2V0LWkzODYvdHJhbnNs YXRlLmMJMTAgSnVsIDIwMDYgMTk6NTM6MDQgLTAwMDAJMS41OQorKysgdGFyZ2V0LWkzODYvdHJh bnNsYXRlLmMJMjAgQXVnIDIwMDYgMjI6Mjc6MzIgLTAwMDAKQEAgLTE2MTUsNiArMTYxNSw0MyBA QAogICAgICpvZmZzZXRfcHRyID0gZGlzcDsKIH0KIAorc3RhdGljIHZvaWQgZ2VuX25vcF9tb2Ry bShEaXNhc0NvbnRleHQgKnMsIGludCBtb2RybSkKK3sKKyAgICBpbnQgcm0sIG1vZDsKKyAgICBy bSAgPSBtb2RybSAmIDc7CisgICAgbW9kID0gKG1vZHJtID4+IDYpICYgMzsKKworICAgIGlmIChy bSA9PSAweDA0KQorICAgIHsKKyAgICAgICAgLyogU0lCIGJ5dGUgZm9sbG93cyAqLworICAgICAg ICBzLT5wYyArPSAxOworICAgIH0KKworICAgIHN3aXRjaCAobW9kKQorICAgIHsKKyAgICAgICAg Y2FzZSAwOgorICAgICAgICAgICAgaWYgKHJtID09IDB4MDUpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgLyogMzJiaXQgZGF0YSBmb2xsb3dzICovCisgICAgICAgICAgICAgICAgcy0+ cGMgKz0gNDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIGVsc2UgcmVnaXN0ZXIgaXMg c3BlY2lmaWVkICovCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAxOgorICAgICAg ICAgICAgLyogOGJpdCBkYXRhIGZvbGxvd3MgKi8KKyAgICAgICAgICAgIHMtPnBjICs9IDE7Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgLyogMzJiaXQg ZGF0YSBmb2xsb3dzICovCisgICAgICAgICAgICBzLT5wYyArPSA0OworICAgICAgICAgICAgYnJl YWs7CisgICAgICAgIGNhc2UgMzoKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIC8qIHJl Z2lzdGVyIGlzIHNwZWNpZmllZCAqLworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorfQorCiAv KiB1c2VkIGZvciBMRUEgYW5kIE1PViBBWCwgbWVtICovCiBzdGF0aWMgdm9pZCBnZW5fYWRkX0Ew X2RzX3NlZyhEaXNhc0NvbnRleHQgKnMpCiB7CkBAIC01NzkyLDkgKzU4MjksMTUgQEAKICAgICAg ICAgICAgIC8qIG5vdGhpbmcgbW9yZSB0byBkbyAqLwogICAgICAgICAgICAgYnJlYWs7CiAgICAg ICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBnb3RvIGlsbGVnYWxfb3A7CisgICAgICAgICAgICBn ZW5fbm9wX21vZHJtKHMsIG1vZHJtKTsKKyAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAg ICAgICAgIGJyZWFrOworICAgIGNhc2UgMHgxMTkgLi4uIDB4MTFmOgorICAgICAgICAvKiBtdWx0 aS1ieXRlIG5vb3AgKi8KKyAgICAgICAgbW9kcm0gPSBsZHViX2NvZGUocy0+cGMrKyk7CisgICAg ICAgIGdlbl9ub3BfbW9kcm0ocywgbW9kcm0pOworICAgICAgICBicmVhazsKICAgICBjYXNlIDB4 MTIwOiAvKiBtb3YgcmVnLCBjck4gKi8KICAgICBjYXNlIDB4MTIyOiAvKiBtb3YgY3JOLCByZWcg Ki8KICAgICAgICAgaWYgKHMtPmNwbCAhPSAwKSB7Cg== ------=_Part_25479_19532527.1156112893265--