Re: [patch 13/17] Immediate Values - x86 Optimization (updated)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: H. Peter Anvin <hpa@...>
Cc: <akpm@...>, Ingo Molnar <mingo@...>, <linux-kernel@...>, Andi Kleen <andi@...>, Rusty Russell <rusty@...>, Andi Kleen <ak@...>, Chuck Ebbert <cebbert@...>, Christoph Hellwig <hch@...>, Jeremy Fitzhardinge <jeremy@...>, Thomas Gleixner <tglx@...>, Ingo Molnar <mingo@...>, Adrian Bunk <bunk@...>, Alexey Dobriyan <adobriyan@...>, <akpm@...>
Date: Wednesday, April 9, 2008 - 7:15 pm

* H. Peter Anvin (hpa@zytor.com) wrote:

Ah, right. I remembered there was something that made us use =q, but
could not remember what. I'll describe it correctly.

Therefore, this updated patch is bogus. The original one was ok, given
that we change the header to :


Immediate Values - x86 Optimization

x86 optimization of the immediate values which uses a movl with code patching
to set/unset the value used to populate the register used as variable source.

Note : a movb needs to get its value froma =q constraint.

Quoting "H. Peter Anvin" <hpa@zytor.com>

Using =r for single-byte values is incorrect for 32-bit code -- that would  
permit %spl, %bpl, %sil, %dil which are illegal in 32-bit mode. 

Changelog:
- Use text_poke_early with cr0 WP save/restore to patch the bypass. We are doing
  non atomic writes to a code region only touched by us (nobody can execute it
  since we are protected by the imv_mutex).
- Put imv_set and _imv_set in the architecture independent header.
- Use $0 instead of %2 with (0) operand.
- Add x86_64 support, ready for i386+x86_64 -> x86 merge.
- Use asm-x86/asm.h.
- Bugfix : 8 bytes 64 bits immediate value was declared as "4 bytes" in the
  immediate structure.
- Change the immediate.c update code to support variable length opcodes.
- Vastly simplified, using a busy looping IPI with interrupts disabled.
  Does not protect against NMI nor MCE.
- Pack the __imv section. Use smallest types required for size (char).
- Use imv_* instead of immediate_*.


Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 13/17] Immediate Values - x86 Optimization, Mathieu Desnoyers, (Wed Apr 9, 11:08 am)
Re: [patch 13/17] Immediate Values - x86 Optimization, H. Peter Anvin, (Wed Apr 9, 2:01 pm)
Re: [patch 13/17] Immediate Values - x86 Optimization (updat..., Mathieu Desnoyers, (Wed Apr 9, 7:15 pm)
Re: [patch 13/17] Immediate Values - x86 Optimization, Mathieu Desnoyers, (Wed Apr 9, 3:08 pm)
Re: [patch 13/17] Immediate Values - x86 Optimization, H. Peter Anvin, (Wed Apr 9, 6:33 pm)
Re: [patch 13/17] Immediate Values - x86 Optimization, Mathieu Desnoyers, (Wed Apr 9, 8:42 pm)
Re: [patch 13/17] Immediate Values - x86 Optimization, H. Peter Anvin, (Wed Apr 9, 8:47 pm)