summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/mtrr.h
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2008-10-09 16:01:53 +0800
committerAvi Kivity <avi@redhat.com>2008-12-31 16:51:44 +0200
commit932d27a7913fc6b3c64c6e6082628b0a1561dec9 (patch)
tree48fd995f548ec76cf09114d3ab10c60b0b9a904b /arch/x86/include/asm/mtrr.h
parentb558bc0a25c82ef2a9d2683b0beb3e4b87cea20b (diff)
downloadlinux-932d27a7913fc6b3c64c6e6082628b0a1561dec9.tar.gz
linux-932d27a7913fc6b3c64c6e6082628b0a1561dec9.tar.bz2
linux-932d27a7913fc6b3c64c6e6082628b0a1561dec9.zip
x86: Export some definition of MTRR
For KVM can reuse the type define, and need them to support shadow MTRR. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/mtrr.h')
-rw-r--r--arch/x86/include/asm/mtrr.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h
index 7c1e4258b31e..cb988aab716d 100644
--- a/arch/x86/include/asm/mtrr.h
+++ b/arch/x86/include/asm/mtrr.h
@@ -57,6 +57,31 @@ struct mtrr_gentry {
};
#endif /* !__i386__ */
+struct mtrr_var_range {
+ u32 base_lo;
+ u32 base_hi;
+ u32 mask_lo;
+ u32 mask_hi;
+};
+
+/* In the Intel processor's MTRR interface, the MTRR type is always held in
+ an 8 bit field: */
+typedef u8 mtrr_type;
+
+#define MTRR_NUM_FIXED_RANGES 88
+#define MTRR_MAX_VAR_RANGES 256
+
+struct mtrr_state_type {
+ struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES];
+ mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES];
+ unsigned char enabled;
+ unsigned char have_fixed;
+ mtrr_type def_type;
+};
+
+#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
+#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
+
/* These are the various ioctls */
#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
#define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry)