From: "Jan Beulich" Subject: [PATCH v2 2/2] x86/HVM: fix ID handling of x2APIC emulation Date: Wed, 10 Sep 2014 14:44:31 +0100 Message-ID: <541071DF0200007800033534@mail.emea.novell.com> References: <541070390200007800033519@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartD6E39FAF.1__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XRiCI-00066H-Jt for xen-devel@lists.xenproject.org; Wed, 10 Sep 2014 13:44:34 +0000 In-Reply-To: <541070390200007800033519@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Ian Campbell , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartD6E39FAF.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline - properly change ID when switching into x2APIC mode (instead of mimicking necessary behavior in hvm_x2apic_msr_read()) - correctly (meaningfully) set LDR (so far it ended up being 1 on all vCPU-s) - even if we don't support more than 128 vCPU-s in a HVM guest for now, we should properly handle IDs as 32-bit values (i.e. not ignore the top 24 bits) - with that, properly do cluster ID and bit mask check in vlapic_match_logical_addr() - slightly adjust other parameter types of vlapic_match_dest() and vlapic_lowest_prio() (and related local variable ones) Signed-off-by: Jan Beulich --- v2: Some changes broken out to separate patch. Correct ID and LDR after domain restore (if necessary); as stated previously the only compatibility problem this creates is when migrating a VM _to_ an unfixed (i.e. old) hypervisor, a scenario which supposedly isn't supported. --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -173,18 +173,17 @@ uint32_t vlapic_set_ppr(struct vlapic *v return ppr; } =20 -static int vlapic_match_logical_addr(struct vlapic *vlapic, uint8_t mda) +static int vlapic_match_logical_addr(struct vlapic *vlapic, uint32_t mda) { int result =3D 0; - uint32_t logical_id; + uint32_t logical_id =3D vlapic_get_reg(vlapic, APIC_LDR); =20 if ( vlapic_x2apic_mode(vlapic) ) - { - logical_id =3D vlapic_get_reg(vlapic, APIC_LDR); - return !!(logical_id & mda); - } + return ((logical_id >> 16) =3D=3D (mda >> 16)) && + (uint16_t)(logical_id & mda); =20 - logical_id =3D GET_xAPIC_LOGICAL_ID(vlapic_get_reg(vlapic, APIC_LDR));= + logical_id =3D GET_xAPIC_LOGICAL_ID(logical_id); + mda =3D (uint8_t)mda; =20 switch ( vlapic_get_reg(vlapic, APIC_DFR) ) { @@ -207,8 +206,8 @@ static int vlapic_match_logical_addr(str } =20 bool_t vlapic_match_dest( - struct vlapic *target, struct vlapic *source, - int short_hand, uint8_t dest, uint8_t dest_mode) + struct vlapic *target, const struct vlapic *source, + int short_hand, uint32_t dest, bool_t dest_mode) { HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest %#x, " "dest_mode %#x, short_hand %#x", @@ -219,7 +218,8 @@ bool_t vlapic_match_dest( case APIC_DEST_NOSHORT: if ( dest_mode ) return vlapic_match_logical_addr(target, dest); - return ((dest =3D=3D 0xFF) || (dest =3D=3D VLAPIC_ID(target))); + return (dest =3D=3D _VLAPIC_ID(target, 0xffffffff)) || + (dest =3D=3D VLAPIC_ID(target)); =20 case APIC_DEST_SELF: return (target =3D=3D source); @@ -286,7 +286,7 @@ static void vlapic_init_sipi_action(unsi uint32_t icr =3D vcpu_vlapic(origin)->init_sipi.icr; uint32_t dest =3D vcpu_vlapic(origin)->init_sipi.dest; uint32_t short_hand =3D icr & APIC_SHORT_MASK; - uint32_t dest_mode =3D !!(icr & APIC_DEST_MASK); + bool_t dest_mode =3D !!(icr & APIC_DEST_MASK); struct vcpu *v; =20 if ( icr =3D=3D 0 ) @@ -352,8 +352,8 @@ static void vlapic_accept_irq(struct vcp } =20 struct vlapic *vlapic_lowest_prio( - struct domain *d, struct vlapic *source, - int short_hand, uint8_t dest, uint8_t dest_mode) + struct domain *d, const struct vlapic *source, + int short_hand, uint32_t dest, bool_t dest_mode) { int old =3D d->arch.hvm_domain.irq.round_robin_prev_vcpu; uint32_t ppr, target_ppr =3D UINT_MAX; @@ -414,13 +414,11 @@ void vlapic_ipi( { unsigned int dest; unsigned int short_hand =3D icr_low & APIC_SHORT_MASK; - unsigned int dest_mode =3D !!(icr_low & APIC_DEST_MASK); + bool_t dest_mode =3D !!(icr_low & APIC_DEST_MASK); =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "icr =3D 0x%08x:%08x", icr_high, = icr_low); =20 - dest =3D (vlapic_x2apic_mode(vlapic) - ? icr_high - : GET_xAPIC_DEST_FIELD(icr_high)); + dest =3D _VLAPIC_ID(vlapic, icr_high); =20 switch ( icr_low & APIC_MODE_MASK ) { @@ -593,10 +591,6 @@ int hvm_x2apic_msr_read(struct vcpu *v,=20 vlapic_read_aligned(vlapic, offset, &low); switch ( offset ) { - case APIC_ID: - low =3D GET_xAPIC_ID(low); - break; - case APIC_ICR: vlapic_read_aligned(vlapic, APIC_ICR2, &high); break; @@ -891,6 +885,15 @@ const struct hvm_mmio_handler vlapic_mmi .write_handler =3D vlapic_write }; =20 +static void set_x2apic_id(struct vlapic *vlapic) +{ + u32 id =3D vlapic_vcpu(vlapic)->vcpu_id; + u32 ldr =3D ((id & ~0xf) << 12) | (1 << (id & 0xf)); + + vlapic_set_reg(vlapic, APIC_ID, id * 2); + vlapic_set_reg(vlapic, APIC_LDR, ldr); +} + bool_t vlapic_msr_set(struct vlapic *vlapic, uint64_t value) { if ( (vlapic->hw.apic_base_msr ^ value) & MSR_IA32_APICBASE_ENABLE ) @@ -918,11 +921,7 @@ bool_t vlapic_msr_set(struct vlapic *vla vlapic->hw.apic_base_msr =3D value; =20 if ( vlapic_x2apic_mode(vlapic) ) - { - u32 id =3D vlapic_get_reg(vlapic, APIC_ID); - u32 ldr =3D ((id & ~0xf) << 16) | (1 << (id & 0xf)); - vlapic_set_reg(vlapic, APIC_LDR, ldr); - } + set_x2apic_id(vlapic); =20 vmx_vlapic_msr_changed(vlapic_vcpu(vlapic)); =20 @@ -1209,6 +1208,7 @@ static int lapic_load_hidden(struct doma return -EINVAL; } s =3D vcpu_vlapic(v); + s->loaded =3D 1; =20 if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) !=3D 0 )=20 return -EINVAL; @@ -1237,6 +1237,7 @@ static int lapic_load_regs(struct domain return -EINVAL; } s =3D vcpu_vlapic(v); + s->loaded =3D 1; =20 if ( hvm_load_entry(LAPIC_REGS, h, s->regs) !=3D 0 )=20 return -EINVAL; @@ -1254,6 +1255,29 @@ HVM_REGISTER_SAVE_RESTORE(LAPIC, lapic_s HVM_REGISTER_SAVE_RESTORE(LAPIC_REGS, lapic_save_regs, lapic_load_regs, 1, HVMSR_PER_VCPU); =20 +void vlapic_domain_unpause(const struct domain *d) +{ + /* + * Following lapic_load_hidden()/lapic_load_regs() we may need to + * correct ID and LDR when they come from an old, broken hypervisor. + */ + struct vcpu *v; + + for_each_vcpu ( d, v ) + { + struct vlapic *vlapic =3D vcpu_vlapic(v); + u32 id =3D vlapic_get_reg(vlapic, APIC_ID); + + if ( vlapic->loaded && vlapic_x2apic_mode(vlapic) && + id && GET_xAPIC_ID(id) =3D=3D v->vcpu_id * 2 && + id =3D=3D SET_xAPIC_ID(GET_xAPIC_ID(id)) && + vlapic_get_reg(vlapic, APIC_LDR) =3D=3D 1 ) + set_x2apic_id(vlapic); + + vlapic->loaded =3D 0; + } +} + int vlapic_init(struct vcpu *v) { struct vlapic *vlapic =3D vcpu_vlapic(v); --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -952,8 +952,11 @@ void domain_unpause(struct domain *d) struct vcpu *v; =20 if ( atomic_dec_and_test(&d->pause_count) ) + { + arch_domain_unpause(d); for_each_vcpu( d, v ) vcpu_wake(v); + } } =20 int __domain_pause_by_systemcontroller(struct domain *d, --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -241,6 +241,8 @@ struct arch_vcpu void vcpu_show_execution_state(struct vcpu *); void vcpu_show_registers(const struct vcpu *); =20 +#define arch_domain_unpause(d) ((void)(d)) + #endif /* __ASM_DOMAIN_H__ */ =20 /* --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -500,6 +500,12 @@ void domain_cpuid(struct domain *d, unsigned int *ecx, unsigned int *edx); =20 +#define arch_domain_unpause(d) ({ \ + const struct domain *d_ =3D (d); \ + if ( is_hvm_domain(d_) ) \ + vlapic_domain_unpause(d_); \ +}) + #endif /* __ASM_DOMAIN_H__ */ =20 /* --- a/xen/include/asm-x86/hvm/vlapic.h +++ b/xen/include/asm-x86/hvm/vlapic.h @@ -30,8 +30,9 @@ #define vlapic_vcpu(x) (container_of((x), struct vcpu, arch.hvm_vcpu.vla= pic)) #define vlapic_domain(x) (vlapic_vcpu(x)->domain) =20 -#define VLAPIC_ID(vlapic) \ - (GET_xAPIC_ID(vlapic_get_reg((vlapic), APIC_ID))) +#define _VLAPIC_ID(vlapic, id) (vlapic_x2apic_mode(vlapic) \ + ? (id) : GET_xAPIC_ID(id)) +#define VLAPIC_ID(vlapic) _VLAPIC_ID(vlapic, vlapic_get_reg(vlapic, = APIC_ID)) =20 /* * APIC can be disabled in two ways: @@ -70,6 +71,7 @@ struct vlapic { struct hvm_hw_lapic hw; struct hvm_hw_lapic_regs *regs; + bool_t loaded; struct periodic_time pt; s_time_t timer_last_update; struct page_info *regs_page; @@ -123,11 +125,13 @@ void vlapic_ipi(struct vlapic *vlapic, u int vlapic_apicv_write(struct vcpu *v, unsigned int offset); =20 struct vlapic *vlapic_lowest_prio( - struct domain *d, struct vlapic *source, - int short_hand, uint8_t dest, uint8_t dest_mode); + struct domain *d, const struct vlapic *source, + int short_hand, uint32_t dest, bool_t dest_mode); =20 bool_t vlapic_match_dest( - struct vlapic *target, struct vlapic *source, - int short_hand, uint8_t dest, uint8_t dest_mode); + struct vlapic *target, const struct vlapic *source, + int short_hand, uint32_t dest, bool_t dest_mode); + +void vlapic_domain_unpause(const struct domain *); =20 #endif /* __ASM_X86_HVM_VLAPIC_H__ */ --=__PartD6E39FAF.1__= Content-Type: text/plain; name="x86-HVM-x2APIC-id.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-HVM-x2APIC-id.patch" x86/HVM: fix ID handling of x2APIC emulation=0A=0A- properly change ID = when switching into x2APIC mode (instead of=0A mimicking necessary = behavior in hvm_x2apic_msr_read())=0A- correctly (meaningfully) set LDR = (so far it ended up being 1 on all=0A vCPU-s)=0A- even if we don't = support more than 128 vCPU-s in a HVM guest for now,=0A we should = properly handle IDs as 32-bit values (i.e. not ignore the=0A top 24 = bits)=0A- with that, properly do cluster ID and bit mask check in=0A = vlapic_match_logical_addr()=0A- slightly adjust other parameter types of = vlapic_match_dest() and=0A vlapic_lowest_prio() (and related local = variable ones)=0A=0ASigned-off-by: Jan Beulich =0A---=0A= v2: Some changes broken out to separate patch. Correct ID and=0A LDR = after domain restore (if necessary); as stated previously the=0A only = compatibility problem this creates is when migrating a VM _to_=0A an = unfixed (i.e. old) hypervisor, a scenario which supposedly isn't=0A = supported.=0A=0A--- a/xen/arch/x86/hvm/vlapic.c=0A+++ b/xen/arch/x86/hvm/vl= apic.c=0A@@ -173,18 +173,17 @@ uint32_t vlapic_set_ppr(struct vlapic *v=0A = return ppr;=0A }=0A =0A-static int vlapic_match_logical_addr(struct = vlapic *vlapic, uint8_t mda)=0A+static int vlapic_match_logical_addr(struct= vlapic *vlapic, uint32_t mda)=0A {=0A int result =3D 0;=0A- = uint32_t logical_id;=0A+ uint32_t logical_id =3D vlapic_get_reg(vlapic, = APIC_LDR);=0A =0A if ( vlapic_x2apic_mode(vlapic) )=0A- {=0A- = logical_id =3D vlapic_get_reg(vlapic, APIC_LDR);=0A- return = !!(logical_id & mda);=0A- }=0A+ return ((logical_id >> 16) = =3D=3D (mda >> 16)) &&=0A+ (uint16_t)(logical_id & mda);=0A = =0A- logical_id =3D GET_xAPIC_LOGICAL_ID(vlapic_get_reg(vlapic, = APIC_LDR));=0A+ logical_id =3D GET_xAPIC_LOGICAL_ID(logical_id);=0A+ = mda =3D (uint8_t)mda;=0A =0A switch ( vlapic_get_reg(vlapic, APIC_DFR) = )=0A {=0A@@ -207,8 +206,8 @@ static int vlapic_match_logical_addr(str= =0A }=0A =0A bool_t vlapic_match_dest(=0A- struct vlapic *target, = struct vlapic *source,=0A- int short_hand, uint8_t dest, uint8_t = dest_mode)=0A+ struct vlapic *target, const struct vlapic *source,=0A+ = int short_hand, uint32_t dest, bool_t dest_mode)=0A {=0A HVM_DBG_LOG(= DBG_LEVEL_VLAPIC, "target %p, source %p, dest %#x, "=0A = "dest_mode %#x, short_hand %#x",=0A@@ -219,7 +218,8 @@ bool_t vlapic_match_= dest(=0A case APIC_DEST_NOSHORT:=0A if ( dest_mode )=0A = return vlapic_match_logical_addr(target, dest);=0A- return = ((dest =3D=3D 0xFF) || (dest =3D=3D VLAPIC_ID(target)));=0A+ return = (dest =3D=3D _VLAPIC_ID(target, 0xffffffff)) ||=0A+ (dest = =3D=3D VLAPIC_ID(target));=0A =0A case APIC_DEST_SELF:=0A = return (target =3D=3D source);=0A@@ -286,7 +286,7 @@ static void vlapic_ini= t_sipi_action(unsi=0A uint32_t icr =3D vcpu_vlapic(origin)->init_sipi.i= cr;=0A uint32_t dest =3D vcpu_vlapic(origin)->init_sipi.dest;=0A = uint32_t short_hand =3D icr & APIC_SHORT_MASK;=0A- uint32_t dest_mode = =3D !!(icr & APIC_DEST_MASK);=0A+ bool_t dest_mode =3D !!(icr & = APIC_DEST_MASK);=0A struct vcpu *v;=0A =0A if ( icr =3D=3D 0 = )=0A@@ -352,8 +352,8 @@ static void vlapic_accept_irq(struct vcp=0A }=0A = =0A struct vlapic *vlapic_lowest_prio(=0A- struct domain *d, struct = vlapic *source,=0A- int short_hand, uint8_t dest, uint8_t dest_mode)=0A+= struct domain *d, const struct vlapic *source,=0A+ int short_hand, = uint32_t dest, bool_t dest_mode)=0A {=0A int old =3D d->arch.hvm_domain= .irq.round_robin_prev_vcpu;=0A uint32_t ppr, target_ppr =3D = UINT_MAX;=0A@@ -414,13 +414,11 @@ void vlapic_ipi(=0A {=0A unsigned = int dest;=0A unsigned int short_hand =3D icr_low & APIC_SHORT_MASK;=0A-= unsigned int dest_mode =3D !!(icr_low & APIC_DEST_MASK);=0A+ = bool_t dest_mode =3D !!(icr_low & APIC_DEST_MASK);=0A =0A HVM_DBG_LOG(D= BG_LEVEL_VLAPIC, "icr =3D 0x%08x:%08x", icr_high, icr_low);=0A =0A- = dest =3D (vlapic_x2apic_mode(vlapic)=0A- ? icr_high=0A- = : GET_xAPIC_DEST_FIELD(icr_high));=0A+ dest =3D _VLAPIC_ID(vlapic, = icr_high);=0A =0A switch ( icr_low & APIC_MODE_MASK )=0A {=0A@@ = -593,10 +591,6 @@ int hvm_x2apic_msr_read(struct vcpu *v, =0A = vlapic_read_aligned(vlapic, offset, &low);=0A switch ( offset )=0A = {=0A- case APIC_ID:=0A- low =3D GET_xAPIC_ID(low);=0A- = break;=0A-=0A case APIC_ICR:=0A vlapic_read_aligned(vlapic, = APIC_ICR2, &high);=0A break;=0A@@ -891,6 +885,15 @@ const struct = hvm_mmio_handler vlapic_mmi=0A .write_handler =3D vlapic_write=0A = };=0A =0A+static void set_x2apic_id(struct vlapic *vlapic)=0A+{=0A+ u32 = id =3D vlapic_vcpu(vlapic)->vcpu_id;=0A+ u32 ldr =3D ((id & ~0xf) << = 12) | (1 << (id & 0xf));=0A+=0A+ vlapic_set_reg(vlapic, APIC_ID, id * = 2);=0A+ vlapic_set_reg(vlapic, APIC_LDR, ldr);=0A+}=0A+=0A bool_t = vlapic_msr_set(struct vlapic *vlapic, uint64_t value)=0A {=0A if ( = (vlapic->hw.apic_base_msr ^ value) & MSR_IA32_APICBASE_ENABLE )=0A@@ = -918,11 +921,7 @@ bool_t vlapic_msr_set(struct vlapic *vla=0A = vlapic->hw.apic_base_msr =3D value;=0A =0A if ( vlapic_x2apic_mode(vlap= ic) )=0A- {=0A- u32 id =3D vlapic_get_reg(vlapic, APIC_ID);=0A- = u32 ldr =3D ((id & ~0xf) << 16) | (1 << (id & 0xf));=0A- = vlapic_set_reg(vlapic, APIC_LDR, ldr);=0A- }=0A+ set_x2apic_id(vl= apic);=0A =0A vmx_vlapic_msr_changed(vlapic_vcpu(vlapic));=0A =0A@@ = -1209,6 +1208,7 @@ static int lapic_load_hidden(struct doma=0A = return -EINVAL;=0A }=0A s =3D vcpu_vlapic(v);=0A+ s->loaded =3D = 1;=0A =0A if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) !=3D 0 = ) =0A return -EINVAL;=0A@@ -1237,6 +1237,7 @@ static int lapic_load= _regs(struct domain=0A return -EINVAL;=0A }=0A s =3D = vcpu_vlapic(v);=0A+ s->loaded =3D 1;=0A =0A if ( hvm_load_entry(= LAPIC_REGS, h, s->regs) !=3D 0 ) =0A return -EINVAL;=0A@@ -1254,6 = +1255,29 @@ HVM_REGISTER_SAVE_RESTORE(LAPIC, lapic_s=0A HVM_REGISTER_SAVE_R= ESTORE(LAPIC_REGS, lapic_save_regs, lapic_load_regs,=0A = 1, HVMSR_PER_VCPU);=0A =0A+void vlapic_domain_unpause(const struct = domain *d)=0A+{=0A+ /*=0A+ * Following lapic_load_hidden()/lapic_loa= d_regs() we may need to=0A+ * correct ID and LDR when they come from = an old, broken hypervisor.=0A+ */=0A+ struct vcpu *v;=0A+=0A+ = for_each_vcpu ( d, v )=0A+ {=0A+ struct vlapic *vlapic =3D = vcpu_vlapic(v);=0A+ u32 id =3D vlapic_get_reg(vlapic, APIC_ID);=0A+= =0A+ if ( vlapic->loaded && vlapic_x2apic_mode(vlapic) &&=0A+ = id && GET_xAPIC_ID(id) =3D=3D v->vcpu_id * 2 &&=0A+ id = =3D=3D SET_xAPIC_ID(GET_xAPIC_ID(id)) &&=0A+ vlapic_get_reg(vla= pic, APIC_LDR) =3D=3D 1 )=0A+ set_x2apic_id(vlapic);=0A+=0A+ = vlapic->loaded =3D 0;=0A+ }=0A+}=0A+=0A int vlapic_init(struct vcpu = *v)=0A {=0A struct vlapic *vlapic =3D vcpu_vlapic(v);=0A--- a/xen/commo= n/domain.c=0A+++ b/xen/common/domain.c=0A@@ -952,8 +952,11 @@ void = domain_unpause(struct domain *d)=0A struct vcpu *v;=0A =0A if ( = atomic_dec_and_test(&d->pause_count) )=0A+ {=0A+ arch_domain_unpa= use(d);=0A for_each_vcpu( d, v )=0A vcpu_wake(v);=0A+ = }=0A }=0A =0A int __domain_pause_by_systemcontroller(struct domain = *d,=0A--- a/xen/include/asm-arm/domain.h=0A+++ b/xen/include/asm-arm/domain= .h=0A@@ -241,6 +241,8 @@ struct arch_vcpu=0A void vcpu_show_execution_state= (struct vcpu *);=0A void vcpu_show_registers(const struct vcpu *);=0A = =0A+#define arch_domain_unpause(d) ((void)(d))=0A+=0A #endif /* __ASM_DOMAI= N_H__ */=0A =0A /*=0A--- a/xen/include/asm-x86/domain.h=0A+++ b/xen/include= /asm-x86/domain.h=0A@@ -500,6 +500,12 @@ void domain_cpuid(struct domain = *d,=0A unsigned int *ecx,=0A unsigned = int *edx);=0A =0A+#define arch_domain_unpause(d) ({ \=0A+ const = struct domain *d_ =3D (d); \=0A+ if ( is_hvm_domain(d_) ) \=0A+ = vlapic_domain_unpause(d_); \=0A+})=0A+=0A #endif /* __ASM_DOMAIN_H__ = */=0A =0A /*=0A--- a/xen/include/asm-x86/hvm/vlapic.h=0A+++ b/xen/include/a= sm-x86/hvm/vlapic.h=0A@@ -30,8 +30,9 @@=0A #define vlapic_vcpu(x) = (container_of((x), struct vcpu, arch.hvm_vcpu.vlapic))=0A #define = vlapic_domain(x) (vlapic_vcpu(x)->domain)=0A =0A-#define VLAPIC_ID(vlapic) = \=0A- (GET_xAPIC_ID(vlapic_get_reg((vlapic), APIC_ID)))=0A+#define = _VLAPIC_ID(vlapic, id) (vlapic_x2apic_mode(vlapic) \=0A+ = ? (id) : GET_xAPIC_ID(id))=0A+#define VLAPIC_ID(vlapic) = _VLAPIC_ID(vlapic, vlapic_get_reg(vlapic, APIC_ID))=0A =0A /*=0A * APIC = can be disabled in two ways:=0A@@ -70,6 +71,7 @@=0A struct vlapic {=0A = struct hvm_hw_lapic hw;=0A struct hvm_hw_lapic_regs *regs;=0A+ = bool_t loaded;=0A struct periodic_time pt;=0A = s_time_t timer_last_update;=0A struct page_info = *regs_page;=0A@@ -123,11 +125,13 @@ void vlapic_ipi(struct vlapic = *vlapic, u=0A int vlapic_apicv_write(struct vcpu *v, unsigned int = offset);=0A =0A struct vlapic *vlapic_lowest_prio(=0A- struct domain = *d, struct vlapic *source,=0A- int short_hand, uint8_t dest, uint8_t = dest_mode);=0A+ struct domain *d, const struct vlapic *source,=0A+ = int short_hand, uint32_t dest, bool_t dest_mode);=0A =0A bool_t vlapic_matc= h_dest(=0A- struct vlapic *target, struct vlapic *source,=0A- int = short_hand, uint8_t dest, uint8_t dest_mode);=0A+ struct vlapic = *target, const struct vlapic *source,=0A+ int short_hand, uint32_t = dest, bool_t dest_mode);=0A+=0A+void vlapic_domain_unpause(const struct = domain *);=0A =0A #endif /* __ASM_X86_HVM_VLAPIC_H__ */=0A --=__PartD6E39FAF.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartD6E39FAF.1__=--