[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/vMTRR: pass domain to mtrr_*_msr_set()
commit 226bc8ee4e0fd26bd3cbdb533eb447fdcd7a90bf Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Fri Mar 28 13:44:44 2014 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Fri Mar 28 13:44:44 2014 +0100 x86/vMTRR: pass domain to mtrr_*_msr_set() This is in preparation for the next patch, and mtrr_def_type_msr_set() and mtrr_fix_range_msr_set() in sync with mtrr_var_range_msr_set() in this regard. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Tim Deegan <tim@xxxxxxx> --- xen/arch/x86/hvm/hvm.c | 10 ++++++---- xen/arch/x86/hvm/mtrr.c | 11 ++++++----- xen/include/asm-x86/mtrr.h | 12 ++++++------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 0eb5b28..15bf7b7 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3294,13 +3294,15 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content) case MSR_MTRRdefType: if ( !mtrr ) goto gp_fault; - if ( !mtrr_def_type_msr_set(&v->arch.hvm_vcpu.mtrr, msr_content) ) + if ( !mtrr_def_type_msr_set(v->domain, &v->arch.hvm_vcpu.mtrr, + msr_content) ) goto gp_fault; break; case MSR_MTRRfix64K_00000: if ( !mtrr ) goto gp_fault; - if ( !mtrr_fix_range_msr_set(&v->arch.hvm_vcpu.mtrr, 0, msr_content) ) + if ( !mtrr_fix_range_msr_set(v->domain, &v->arch.hvm_vcpu.mtrr, 0, + msr_content) ) goto gp_fault; break; case MSR_MTRRfix16K_80000: @@ -3308,7 +3310,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content) if ( !mtrr ) goto gp_fault; index = msr - MSR_MTRRfix16K_80000 + 1; - if ( !mtrr_fix_range_msr_set(&v->arch.hvm_vcpu.mtrr, + if ( !mtrr_fix_range_msr_set(v->domain, &v->arch.hvm_vcpu.mtrr, index, msr_content) ) goto gp_fault; break; @@ -3316,7 +3318,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content) if ( !mtrr ) goto gp_fault; index = msr - MSR_MTRRfix4K_C0000 + 3; - if ( !mtrr_fix_range_msr_set(&v->arch.hvm_vcpu.mtrr, + if ( !mtrr_fix_range_msr_set(v->domain, &v->arch.hvm_vcpu.mtrr, index, msr_content) ) goto gp_fault; break; diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index df52a54..45c8e7b 100644 --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -412,7 +412,8 @@ static inline bool_t valid_mtrr_type(uint8_t type) return 0; } -bool_t mtrr_def_type_msr_set(struct mtrr_state *m, uint64_t msr_content) +bool_t mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m, + uint64_t msr_content) { uint8_t def_type = msr_content & 0xff; uint8_t enabled = (msr_content >> 10) & 0x3; @@ -436,8 +437,8 @@ bool_t mtrr_def_type_msr_set(struct mtrr_state *m, uint64_t msr_content) return 1; } -bool_t mtrr_fix_range_msr_set(struct mtrr_state *m, uint32_t row, - uint64_t msr_content) +bool_t mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m, + uint32_t row, uint64_t msr_content) { uint64_t *fixed_range_base = (uint64_t *)m->fixed_ranges; @@ -669,7 +670,7 @@ static int hvm_load_mtrr_msr(struct domain *d, hvm_domain_context_t *h) mtrr_state->mtrr_cap = hw_mtrr.msr_mtrr_cap; for ( i = 0; i < NUM_FIXED_MSR; i++ ) - mtrr_fix_range_msr_set(mtrr_state, i, hw_mtrr.msr_mtrr_fixed[i]); + mtrr_fix_range_msr_set(d, mtrr_state, i, hw_mtrr.msr_mtrr_fixed[i]); for ( i = 0; i < MTRR_VCNT; i++ ) { @@ -681,7 +682,7 @@ static int hvm_load_mtrr_msr(struct domain *d, hvm_domain_context_t *h) hw_mtrr.msr_mtrr_var[i * 2 + 1]); } - mtrr_def_type_msr_set(mtrr_state, hw_mtrr.msr_mtrr_def_type); + mtrr_def_type_msr_set(d, mtrr_state, hw_mtrr.msr_mtrr_def_type); return 0; } diff --git a/xen/include/asm-x86/mtrr.h b/xen/include/asm-x86/mtrr.h index c0afb4f..1b5993e 100644 --- a/xen/include/asm-x86/mtrr.h +++ b/xen/include/asm-x86/mtrr.h @@ -82,12 +82,12 @@ extern void mtrr_aps_sync_begin(void); extern void mtrr_aps_sync_end(void); extern void mtrr_bp_restore(void); -extern bool_t mtrr_var_range_msr_set( - struct domain *d, struct mtrr_state *m, - uint32_t msr, uint64_t msr_content); -extern bool_t mtrr_fix_range_msr_set(struct mtrr_state *v, - uint32_t row, uint64_t msr_content); -extern bool_t mtrr_def_type_msr_set(struct mtrr_state *v, uint64_t msr_content); +extern bool_t mtrr_var_range_msr_set(struct domain *, struct mtrr_state *, + uint32_t msr, uint64_t msr_content); +extern bool_t mtrr_fix_range_msr_set(struct domain *, struct mtrr_state *, + uint32_t row, uint64_t msr_content); +extern bool_t mtrr_def_type_msr_set(struct domain *, struct mtrr_state *, + uint64_t msr_content); extern bool_t pat_msr_set(uint64_t *pat, uint64_t msr); bool_t is_var_mtrr_overlapped(struct mtrr_state *m); -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |