|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 3/3] x86/vLAPIC: vlapic_init() runs only once for a vCPU
Hence there's no need to guard allocation / mapping by checks whether
the same action has been done before. I assume this was a transient
change which should have been undone before 509529e99148 ("x86 hvm: Xen
interface and implementation for virtual S3") got committed.
While touching this code, switch dprintk()-s to use %pv.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1610,27 +1610,21 @@ int vlapic_init(struct vcpu *v)
vlapic->pt.source = PTSRC_lapic;
- if (vlapic->regs_page == NULL)
+ vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
+ if ( !vlapic->regs_page )
{
- vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
- if ( vlapic->regs_page == NULL )
- {
- dprintk(XENLOG_ERR, "alloc vlapic regs error: %d/%d\n",
- v->domain->domain_id, v->vcpu_id);
- return -ENOMEM;
- }
+ dprintk(XENLOG_ERR, "%pv: alloc vlapic regs error\n", v);
+ return -ENOMEM;
}
- if (vlapic->regs == NULL)
+
+ vlapic->regs = __map_domain_page_global(vlapic->regs_page);
+ if ( vlapic->regs == NULL )
{
- vlapic->regs = __map_domain_page_global(vlapic->regs_page);
- if ( vlapic->regs == NULL )
- {
- free_domheap_page(vlapic->regs_page);
- dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
- v->domain->domain_id, v->vcpu_id);
- return -ENOMEM;
- }
+ free_domheap_page(vlapic->regs_page);
+ dprintk(XENLOG_ERR, "%pv: map vlapic regs error\n", v);
+ return -ENOMEM;
}
+
clear_page(vlapic->regs);
vlapic_reset(vlapic);
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |