Changeset 13013 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Oct 6, 2008 2:48:49 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r12989 r13013 34 34 #include "EMInternal.h" 35 35 #include <VBox/vm.h> 36 #include <VBox/vmm.h> 36 37 #include <VBox/hwaccm.h> 37 38 #include <VBox/tm.h> … … 2576 2577 #endif 2577 2578 default: 2578 /* We should actually trigger a #GP here, but don't as that might cause more trouble. */ 2579 val = 0; 2580 break; 2579 /* In X2APIC specification this range is reserved for APIC control. */ 2580 if ((pRegFrame->ecx >= MSR_IA32_APIC_START) && (pRegFrame->ecx < MSR_IA32_APIC_END)) 2581 { 2582 rc = PDMApicRDMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, &val); 2583 } 2584 else 2585 { 2586 /* We should actually trigger a #GP here, but don't as that might cause more trouble. */ 2587 val = 0; 2588 break; 2589 } 2581 2590 } 2582 2591 Log(("EMInterpretRdmsr %s (%x) -> val=%VX64\n", emMSRtoString(pRegFrame->ecx), pRegFrame->ecx, val)); 2583 pRegFrame->eax = (uint32_t) val; 2584 pRegFrame->edx = (uint32_t) (val >> 32ULL); 2585 return VINF_SUCCESS; 2592 if (rc == VINF_SUCCESS) 2593 { 2594 pRegFrame->eax = (uint32_t) val; 2595 pRegFrame->edx = (uint32_t) (val >> 32ULL); 2596 } 2597 return rc; 2586 2598 } 2587 2599 … … 2714 2726 2715 2727 default: 2728 /* In X2APIC specification this range is reserved for APIC control. */ 2729 if ((pRegFrame->ecx >= MSR_IA32_APIC_START) && (pRegFrame->ecx < MSR_IA32_APIC_END)) 2730 { 2731 return PDMApicWRMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, val); 2732 } 2716 2733 /* We should actually trigger a #GP here, but don't as that might cause more trouble. */ 2717 2734 break; -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r12989 r13013 253 253 } 254 254 255 /** 256 * WRMSR in APIC range. 257 * 258 * @returns VBox status code. 259 * @param pVM VM handle. 260 * @param iCpu Target CPU. 261 * @param u32Reg MSR to write. 262 * @param u64Value Value to write. 263 */ 264 VMMDECL(int) PDMApicWRMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value) 265 { 266 if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns)) 267 { 268 Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnWRMSR)); 269 pdmLock(pVM); 270 pVM->pdm.s.Apic.CTX_SUFF(pfnWRMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, u64Value); 271 pdmUnlock(pVM); 272 return VINF_SUCCESS; 273 } 274 return VERR_PDM_NO_APIC_INSTANCE; 275 } 276 277 /** 278 * RDMSR in APIC range. 279 * 280 * @returns VBox status code. 281 * @param pVM VM handle. 282 * @param iCpu Target CPU. 283 * @param u32Reg MSR to read. 284 * @param pu64Value Value read. 285 */ 286 VMMDECL(int) PDMApicRDMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value) 287 { 288 if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns)) 289 { 290 Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnRDMSR)); 291 pdmLock(pVM); 292 pVM->pdm.s.Apic.CTX_SUFF(pfnRDMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, pu64Value); 293 pdmUnlock(pVM); 294 return VINF_SUCCESS; 295 } 296 return VERR_PDM_NO_APIC_INSTANCE; 297 } 298 255 299 256 300 /**
Note:
See TracChangeset
for help on using the changeset viewer.