Hello, I'm writing a small module to be used on 64bit systems with number of cores > 1. I'd like to read the IDT address on the requested core. I see that there's this function to be used, smp_call_function_any(), which requires the cpumask to specify on which CPU the function should be run. I'm setting this cpumask by using cpumask_set_cpu() function. then issuing smp_call_function_any(). The function which I'm trying to invoke is just 3 lines: int c = get_cpu(), printk(KERN_DEBUG "%d", c) and put_cpu().

Now, in the console I see that this function gets called, because the number of a proper CPU gets printed onto the screen, but immediately after this I'm getting an Oops DEBUG_PAGEALLOC. Could anyone tell me what am I doing wrong?