x86/HVM: fix x2APIC APIC_ID read emulation
authorZhenguo Wang <wangzhenguo@huawei.com>
Tue, 11 Jun 2013 07:45:55 +0000 (09:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Jun 2013 07:45:55 +0000 (09:45 +0200)
commit6859874b61d5ddaf5289e72ed2b2157739b72ca5
tree802d566b6482c49e4b75992908424feb25e835aa
parent44434f3c5e998e10b23939755751abb344d80d73
x86/HVM: fix x2APIC APIC_ID read emulation

APIC and x2APIC have different format for APIC_ID register. Need
translation.

Signed-off-by: Zhenguo Wang <wangzhenguo@huawei.com>
Signed-off-by: Xiaowei Yang <xiaowei.yang@huawei.com>
Convert code to use switch(), fixing coding style issue at once, and
use GET_xAPIC_ID() on the value read instead of VLAPIC_ID() (reading
the field again).

In the course of this also properly reject both read and writes on the
non-existing MSR corresponding to APIC_ICR2.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vlapic.c