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 static int inject_mce(struct v3_guest * guest, unsigned int cmd, unsigned long arg,
23 unsigned long type = (unsigned long)priv_data;
26 return v3_mcheck_inject_scrubber_mce((struct v3_vm_info *)guest->v3_ctx, 0, arg);
29 // TODO: How to print an error in the host OS?
30 //PrintError("Injection of unknown machine check type %lu requested.\n", type);
36 static int guest_init(struct v3_guest * guest, void ** vm_data) {
38 add_guest_ctrl(guest, V3_VM_INJECT_SCRUBBER_MCE, inject_mce, (void *)SCRUBBER_MCE);
42 static int guest_deinit(struct v3_guest * guest, void * vm_data) {
48 struct linux_ext mcheck_ext = {
49 .name = "MACHINE CHECK",
52 .guest_init = guest_init,
53 .guest_deinit = guest_deinit
57 register_extension(&mcheck_ext);