3 * (c) Patrick Bridges and Philip Soltero, 2011
6 #include <linux/kernel.h>
8 #include <linux/debugfs.h>
9 #include <linux/uaccess.h>
11 //#include <interfaces/vmm_mcheck.h>
15 #include "linux-exts.h"
17 #define SCRUBBER_MCE 0x1
18 #define V3_VM_INJECT_SCRUBBER_MCE (10224+20)
20 /* Missing the vmm_mcheck.h header file */
24 int v3_mcheck_inject_scrubber_mce(struct v3_vm_info *info, int cpu, uint64_t dst);
26 static int inject_mce(struct v3_guest * guest, unsigned int cmd, unsigned long arg,
29 unsigned long type = (unsigned long)priv_data;
32 return v3_mcheck_inject_scrubber_mce((struct v3_vm_info *)guest->v3_ctx, 0, arg);
35 // TODO: How to print an error in the host OS?
36 //PrintError("Injection of unknown machine check type %lu requested.\n", type);
42 static int guest_init(struct v3_guest * guest, void ** vm_data) {
44 add_guest_ctrl(guest, V3_VM_INJECT_SCRUBBER_MCE, inject_mce, (void *)SCRUBBER_MCE);
48 static int guest_deinit(struct v3_guest * guest, void * vm_data) {
54 struct linux_ext mcheck_ext = {
55 .name = "MACHINE CHECK",
58 .guest_init = guest_init,
59 .guest_deinit = guest_deinit
63 register_extension(&mcheck_ext);