Messages in this thread |  | | Date | Fri, 29 Feb 2008 13:09:28 -0800 | | From | Jeremy Fitzhardinge <> | | Subject | Re: bad paravirt/Xen interaction in "x86 - Enhance DEBUG_RODATA support - alternatives" |
| |
H. Peter Anvin wrote: > Jeremy Fitzhardinge wrote: >> The patch "x86 - Enhance DEBUG_RODATA support - alternatives" enables >> the kernel for writing by clearing X86_CR0_WP allow privileged >> writes. This won't work in a paravirt environment for two reasons: >> >> 1. the kernel may not be running in ring 0, so writes will still be >> prevented >> 2. the hypervisor prevents X86_CR0_WP from being cleared anyway (it >> GPFs the cr0 update) >> >> This crashes on Xen, and it would probably break VMI too.
(lguest too, of course)
>> The only safe way to allow writes is to change the page permissions >> (either on the page itself, or create a temporary writable alias for >> that page). Perhaps something you could do it with kmap_atomic. >> > > A properly implemented hypervisor should arguably emulate this. > > Doesn't really mean the patch is worth the pain.
No, it would be irritating to implement.
Seems to me that doing the update in a temporary kmap_atomic mapping would be a more straightforward way to go, anyway. How would you implement this on a processor without something like X86_CR0_WP?
J
|  |