Help with Linux APIC Features

I am trying to play with local APIC features in the Linux kernel 2.6.32.40, but I am having some problems. I want to try sending Non-Maskable Interrupts (NMI) to all the processors on my system (I use Intel i7 Q740). I first read the documentation in the Intel Software Developer Manual Volume 3 on APIC features. It states that interrupts can be sent to all processors using the interrupt instruction register (ICR) located at 0xFEE00300. So I wrote a kernel module with the following init function to try and write to this register:

#include <linux/init.h> #include <linux/module.h> #include <linux/fs.h> MODULE_LICENSE("GPL"); #define SUCCESS 0 #define ICR_ADDRESS 0xFEE00300 #define ICR_PROGRAM 0x000C4C89 static int icr_init(void){ int * ICR = (int *)ICR_ADDRESS; printk(KERN_ALERT "Programing ICR\n"); *ICR = ICR_PROGRAM; return SUCCESS; } static void icr_exit(void){ printk(KERN_ALERT "Removing ICR Programing module removed"); } module_init(icr_init); module_exit(icr_exit); 

However, when I insert this module, the kernel crashes and complains that it cannot process the swap request @address 00000000fee00300. If you look in / proc / iomem, I can see that this address is in the range marked as "reserved"

 fee00000-fee00fff : reserved 

I also tried using the following functions:

 static inline void __default_local_send_IPI_allbutself(int vector) 

but the kernel still throws the message "unable to process search requests" and crashes. Anyone have any suggestions? Why is this memory range marked as β€œreserved” and not marked as used by the local APIC? Thanks in advance.

+4
source share
1 answer

The APIC address is a physical memory address, but you are trying to access it as a linear memory address - why your first approach does not work. The memory is marked as β€œreserved” precisely because it belongs to APIC, not real memory.

You must use the internal functions of the kernel. To do this, you must include <asm/apic.h> and use:

 apic->send_IPI_allbutself(vector); 
+3
source

All Articles