Messages in this thread | | | Date | Fri, 2 Jan 2004 16:26:57 +0530 | From | Srivatsa Vaddagiri <> | Subject | Re: [lhcs-devel] Re: in_atomic doesn't count local_irq_disable? |
| |
On Fri, Jan 02, 2004 at 01:52:07AM +0100, Manfred Spraul wrote: > Could you write a test module that reads cr2, executes a few prefetch > instructions and then checks if cr2 changed? I won't have access to my > P3 SMP system in the next few days.
Hi Manfred, I wrote a test module and found that CR2 remains same across the prefetch. The module source I used is as below. Note that I had to used "my_prefetch" because the original prefetch (in asm/processor.h) has been disabled in my tree to do nothing.
inline void my_prefetch(const void *x) { alternative_input(ASM_NOP4, "prefetchnta (%1)", X86_FEATURE_XMM, "r" (x)); }
int array[10];
static int __init dummy_init_module(void) { unsigned long address; int i=0; int x;
/* get the address */ __asm__("movl %%cr2,%0":"=r" (address));
printk ("CR2 before prefetch is %x \n", address);
for (i=0; i<10; ++i) my_prefetch(array+i);
for (i=0; i<10; ++i) x = *(array+i);
/* get the address */ __asm__("movl %%cr2,%0":"=r" (address));
printk ("CR2 after prefetch is %x \n", address);
return 0;
}
static void __exit dummy_cleanup_module(void) { }
module_init(dummy_init_module); module_exit(dummy_cleanup_module); MODULE_LICENSE("GPL");
Output of the above printk is :
CR2 before prefetch is 40017000 CR2 after prefetch is 40017000
--
Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560017 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |