[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/11] hw/intc/apic: Fixes magic number use, removes outdated com
From: |
phil |
Subject: |
[PATCH 10/11] hw/intc/apic: Fixes magic number use, removes outdated comment |
Date: |
Mon, 9 Dec 2024 21:36:28 +0100 |
From: Phil Dennis-Jordan <phil@philjordan.eu>
This changes replaces the use of an explicit literal constant for
the APIC base address mask with the existing symbolic constant
intended for this purpose.
Additionally, we remove the comment about not being able to
re-enable the APIC after disabling it. This is no longer
the case after the APIC implementation's state machine was
modified in 9.0.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
---
hw/intc/apic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index add99f01e5..d72cbb2a8f 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -350,9 +350,8 @@ static int apic_set_base(APICCommonState *s, uint64_t val)
return -1;
}
- s->apicbase = (val & 0xfffff000) |
+ s->apicbase = (val & MSR_IA32_APICBASE_BASE) |
(s->apicbase & (MSR_IA32_APICBASE_BSP | MSR_IA32_APICBASE_ENABLE));
- /* if disabled, cannot be enabled again */
if (!(val & MSR_IA32_APICBASE_ENABLE)) {
s->apicbase &= ~MSR_IA32_APICBASE_ENABLE;
cpu_clear_apic_feature(&s->cpu->env);
--
2.39.3 (Apple Git-146)
- [PATCH 09/11] i386/hvf: Print hex pairs for each opcode byte in decode error, (continued)
- [PATCH 09/11] i386/hvf: Print hex pairs for each opcode byte in decode error, phil, 2024/12/09
- [PATCH 03/11] i386/hvf: Don't send signal to thread when kicking, phil, 2024/12/09
- [PATCH 06/11] i386/hvf: APIC access exit with fast-path for common mov cases, phil, 2024/12/09
- [PATCH 11/11] hw/intc/apic: Raise exception when setting reserved APICBASE bits, phil, 2024/12/09
- [PATCH 10/11] hw/intc/apic: Fixes magic number use, removes outdated comment,
phil <=