static void ctxt_switch_to(struct vcpu *n)
{
+ uint32_t vpidr;
+
/* When the idle VCPU is running, Xen will always stay in hypervisor
* mode. Therefore we don't need to restore the context of an idle VCPU.
*/
p2m_restore_state(n);
- WRITE_SYSREG32(n->domain->arch.vpidr, VPIDR_EL2);
+ vpidr = READ_SYSREG32(MIDR_EL1);
+ WRITE_SYSREG32(vpidr, VPIDR_EL2);
WRITE_SYSREG(n->arch.vmpidr, VMPIDR_EL2);
/* VGIC */
if ( (d->shared_info = alloc_xenheap_pages(0, 0)) == NULL )
goto fail;
- /* Default the virtual ID to match the physical */
- d->arch.vpidr = boot_cpu_data.midr.bits;
-
clear_page(d->shared_info);
share_xen_page_with_guest(
virt_to_page(d->shared_info), d, XENSHARE_writable);
{
const struct hsr_cp32 cp32 = hsr.cp32;
int regidx = cp32.reg;
- struct domain *d = current->domain;
if ( !check_conditional_instr(regs, hsr) )
{
* - Variant and Revision bits match MDIR
*/
val = (1 << 24) | (5 << 16);
- val |= ((d->arch.vpidr >> 20) & 0xf) | (d->arch.vpidr & 0xf);
+ val |= ((current_cpu_data.midr.bits >> 20) & 0xf) |
+ (current_cpu_data.midr.bits & 0xf);
set_user_reg(regs, regidx, val);
break;