Merge branch 'x86-mtrr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-mtrr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: Convert set_atomicity_lock to raw_spinlock x86, mtrr: Kill over the top warn x86, mtrr: Constify struct mtrr_ops
This commit is contained in:
commit
0091945b47
|
@ -108,7 +108,7 @@ amd_validate_add_page(unsigned long base, unsigned long size, unsigned int type)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtrr_ops amd_mtrr_ops = {
|
static const struct mtrr_ops amd_mtrr_ops = {
|
||||||
.vendor = X86_VENDOR_AMD,
|
.vendor = X86_VENDOR_AMD,
|
||||||
.set = amd_set_mtrr,
|
.set = amd_set_mtrr,
|
||||||
.get = amd_get_mtrr,
|
.get = amd_get_mtrr,
|
||||||
|
|
|
@ -110,7 +110,7 @@ centaur_validate_add_page(unsigned long base, unsigned long size, unsigned int t
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtrr_ops centaur_mtrr_ops = {
|
static const struct mtrr_ops centaur_mtrr_ops = {
|
||||||
.vendor = X86_VENDOR_CENTAUR,
|
.vendor = X86_VENDOR_CENTAUR,
|
||||||
.set = centaur_set_mcr,
|
.set = centaur_set_mcr,
|
||||||
.get = centaur_get_mcr,
|
.get = centaur_get_mcr,
|
||||||
|
|
|
@ -265,7 +265,7 @@ static void cyrix_set_all(void)
|
||||||
post_set();
|
post_set();
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtrr_ops cyrix_mtrr_ops = {
|
static const struct mtrr_ops cyrix_mtrr_ops = {
|
||||||
.vendor = X86_VENDOR_CYRIX,
|
.vendor = X86_VENDOR_CYRIX,
|
||||||
.set_all = cyrix_set_all,
|
.set_all = cyrix_set_all,
|
||||||
.set = cyrix_set_arr,
|
.set = cyrix_set_arr,
|
||||||
|
|
|
@ -464,7 +464,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
|
||||||
tmp |= ~((1<<(hi - 1)) - 1);
|
tmp |= ~((1<<(hi - 1)) - 1);
|
||||||
|
|
||||||
if (tmp != mask_lo) {
|
if (tmp != mask_lo) {
|
||||||
WARN_ONCE(1, KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
|
printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
|
||||||
mask_lo = tmp;
|
mask_lo = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -570,7 +570,7 @@ static unsigned long set_mtrr_state(void)
|
||||||
|
|
||||||
|
|
||||||
static unsigned long cr4;
|
static unsigned long cr4;
|
||||||
static DEFINE_SPINLOCK(set_atomicity_lock);
|
static DEFINE_RAW_SPINLOCK(set_atomicity_lock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since we are disabling the cache don't allow any interrupts,
|
* Since we are disabling the cache don't allow any interrupts,
|
||||||
|
@ -590,7 +590,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock)
|
||||||
* changes to the way the kernel boots
|
* changes to the way the kernel boots
|
||||||
*/
|
*/
|
||||||
|
|
||||||
spin_lock(&set_atomicity_lock);
|
raw_spin_lock(&set_atomicity_lock);
|
||||||
|
|
||||||
/* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */
|
/* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */
|
||||||
cr0 = read_cr0() | X86_CR0_CD;
|
cr0 = read_cr0() | X86_CR0_CD;
|
||||||
|
@ -627,7 +627,7 @@ static void post_set(void) __releases(set_atomicity_lock)
|
||||||
/* Restore value of CR4 */
|
/* Restore value of CR4 */
|
||||||
if (cpu_has_pge)
|
if (cpu_has_pge)
|
||||||
write_cr4(cr4);
|
write_cr4(cr4);
|
||||||
spin_unlock(&set_atomicity_lock);
|
raw_spin_unlock(&set_atomicity_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void generic_set_all(void)
|
static void generic_set_all(void)
|
||||||
|
@ -752,7 +752,7 @@ int positive_have_wrcomb(void)
|
||||||
/*
|
/*
|
||||||
* Generic structure...
|
* Generic structure...
|
||||||
*/
|
*/
|
||||||
struct mtrr_ops generic_mtrr_ops = {
|
const struct mtrr_ops generic_mtrr_ops = {
|
||||||
.use_intel_if = 1,
|
.use_intel_if = 1,
|
||||||
.set_all = generic_set_all,
|
.set_all = generic_set_all,
|
||||||
.get = generic_get_mtrr,
|
.get = generic_get_mtrr,
|
||||||
|
|
|
@ -60,14 +60,14 @@ static DEFINE_MUTEX(mtrr_mutex);
|
||||||
u64 size_or_mask, size_and_mask;
|
u64 size_or_mask, size_and_mask;
|
||||||
static bool mtrr_aps_delayed_init;
|
static bool mtrr_aps_delayed_init;
|
||||||
|
|
||||||
static struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
|
static const struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
|
||||||
|
|
||||||
struct mtrr_ops *mtrr_if;
|
const struct mtrr_ops *mtrr_if;
|
||||||
|
|
||||||
static void set_mtrr(unsigned int reg, unsigned long base,
|
static void set_mtrr(unsigned int reg, unsigned long base,
|
||||||
unsigned long size, mtrr_type type);
|
unsigned long size, mtrr_type type);
|
||||||
|
|
||||||
void set_mtrr_ops(struct mtrr_ops *ops)
|
void set_mtrr_ops(const struct mtrr_ops *ops)
|
||||||
{
|
{
|
||||||
if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
|
if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
|
||||||
mtrr_ops[ops->vendor] = ops;
|
mtrr_ops[ops->vendor] = ops;
|
||||||
|
|
|
@ -32,7 +32,7 @@ extern int generic_get_free_region(unsigned long base, unsigned long size,
|
||||||
extern int generic_validate_add_page(unsigned long base, unsigned long size,
|
extern int generic_validate_add_page(unsigned long base, unsigned long size,
|
||||||
unsigned int type);
|
unsigned int type);
|
||||||
|
|
||||||
extern struct mtrr_ops generic_mtrr_ops;
|
extern const struct mtrr_ops generic_mtrr_ops;
|
||||||
|
|
||||||
extern int positive_have_wrcomb(void);
|
extern int positive_have_wrcomb(void);
|
||||||
|
|
||||||
|
@ -53,10 +53,10 @@ void fill_mtrr_var_range(unsigned int index,
|
||||||
u32 base_lo, u32 base_hi, u32 mask_lo, u32 mask_hi);
|
u32 base_lo, u32 base_hi, u32 mask_lo, u32 mask_hi);
|
||||||
void get_mtrr_state(void);
|
void get_mtrr_state(void);
|
||||||
|
|
||||||
extern void set_mtrr_ops(struct mtrr_ops *ops);
|
extern void set_mtrr_ops(const struct mtrr_ops *ops);
|
||||||
|
|
||||||
extern u64 size_or_mask, size_and_mask;
|
extern u64 size_or_mask, size_and_mask;
|
||||||
extern struct mtrr_ops *mtrr_if;
|
extern const struct mtrr_ops *mtrr_if;
|
||||||
|
|
||||||
#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
|
#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
|
||||||
#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
|
#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
|
||||||
|
|
Loading…
Reference in a new issue