mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-13 22:06:49 +00:00
hv: vlapic: local APIC ID related code cleaning up
From SDM Vol3 10.4.6: Some processors permit software to modify the APIC ID. However, the ability of software to modify the APIC ID is processor model specific. Because of this, operating system software should avoid writing to the local APIC ID register. So to permit change APIC ID is not one *must* feature. Keep it simple, we are also reject to modify it. This patch does code cleaning up for LAPIC ID related emulation. Signed-off-by: Yu Wang <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
c43d0e4f01
commit
74ff712085
@ -216,16 +216,10 @@ vlapic_ldr_write_handler(struct acrn_vlapic *vlapic)
|
||||
}
|
||||
|
||||
static void
|
||||
vlapic_id_write_handler(struct acrn_vlapic *vlapic)
|
||||
vlapic_id_write_handler(__unused struct acrn_vlapic *vlapic)
|
||||
{
|
||||
struct lapic_regs *lapic;
|
||||
|
||||
/*
|
||||
* We don't allow the ID register to be modified so reset it back to
|
||||
* its default value.
|
||||
*/
|
||||
lapic = &(vlapic->apic_page);
|
||||
lapic->id = vlapic_get_id(vlapic);
|
||||
/* Force APIC ID as readonly */
|
||||
return;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
@ -1479,7 +1473,6 @@ vlapic_write(struct acrn_vlapic *vlapic, uint32_t offset,
|
||||
retval = 0;
|
||||
switch (offset) {
|
||||
case APIC_OFFSET_ID:
|
||||
lapic->id = data32;
|
||||
vlapic_id_write_handler(vlapic);
|
||||
break;
|
||||
case APIC_OFFSET_TPR:
|
||||
|
Loading…
Reference in New Issue
Block a user