Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_RODATA support - alternatives"

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeremy Fitzhardinge <jeremy@...>
Cc: Andi Kleen <ak@...>, H. Peter Anvin <hpa@...>, Ingo Molnar <mingo@...>, Linux Kernel Mailing List <linux-kernel@...>, Zachary Amsden <zach@...>
Date: Tuesday, March 4, 2008 - 12:12 am

* Jeremy Fitzhardinge (jeremy@goop.org) wrote:

Hi Jeremy,

(Connecting brain...)


Ah, it's supposed to be

if (kernel_text_address((unsigned long)addr)) {
  pages[0] = virt_to_page(addr);
  vaddr = vmap(pages, 1, VM_MAP, PAGE_KERNEL);
  memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len);
} else
  memcpy(addr, opcode, len);




Not really :

1-byte changes :

- kprobes is a 1-byte breakpoint
- smp alternatives changes an f0 prefix into a 1-byte nop when a single
  CPU is active (the opposite is done when bringing up a second CPU).

Aligned on word size :
- immediate values are aligned on word size

At boot time only, before kernel pages are marked RO :
- alternatives and paravirt are applied at boot time only

But yes, I guess it's cheap and allows supporting users which does not
have their instructions aligned. I'll change it.


<banging head on the wall> & PAGE_MASK -> & ~PAGE_MASK  :)

Thanks!

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:
bad paravirt/Xen interaction in "x86 - Enhance DEBUG_RODATA ..., Jeremy Fitzhardinge, (Fri Feb 29, 4:39 pm)
Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_ROD..., Jeremy Fitzhardinge, (Fri Feb 29, 5:09 pm)
Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_ROD..., Jeremy Fitzhardinge, (Mon Mar 3, 1:58 pm)
Re: bad paravirt/Xen interaction in "x86 - Enhance , Andi Kleen, (Mon Mar 3, 2:03 pm)
Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_ROD..., Jeremy Fitzhardinge, (Mon Mar 3, 2:05 pm)
Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_ROD..., Jeremy Fitzhardinge, (Mon Mar 3, 6:15 pm)
Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_ROD..., Mathieu Desnoyers, (Tue Mar 4, 12:12 am)