projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4ad77e
)
KVM: lapic: Split out x2apic ldr calculation
author
Dr. David Alan Gilbert
<
[email protected]
>
Fri, 17 Nov 2017 11:52:49 +0000
(11:52 +0000)
committer
Paolo Bonzini
<
[email protected]
>
Mon, 27 Nov 2017 16:32:52 +0000
(17:32 +0100)
Split out the ldr calculation from kvm_apic_set_x2apic_id
since we're about to reuse it in the following patch.
Signed-off-by: Dr. David Alan Gilbert <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Paolo Bonzini <
[email protected]
>
arch/x86/kvm/lapic.c
patch
|
blob
|
history
diff --git
a/arch/x86/kvm/lapic.c
b/arch/x86/kvm/lapic.c
index 943acbf00c69d8f423289116bc363159144f883a..e2edb110300251710bfddf1c75b162af7df42c79 100644
(file)
--- a/
arch/x86/kvm/lapic.c
+++ b/
arch/x86/kvm/lapic.c
@@
-266,9
+266,14
@@
static inline void kvm_apic_set_ldr(struct kvm_lapic *apic, u32 id)
recalculate_apic_map(apic->vcpu->kvm);
}
+static inline u32 kvm_apic_calc_x2apic_ldr(u32 id)
+{
+ return ((id >> 4) << 16) | (1 << (id & 0xf));
+}
+
static inline void kvm_apic_set_x2apic_id(struct kvm_lapic *apic, u32 id)
{
- u32 ldr =
((id >> 4) << 16) | (1 << (id & 0xf)
);
+ u32 ldr =
kvm_apic_calc_x2apic_ldr(id
);
WARN_ON_ONCE(id != apic->vcpu->vcpu_id);