Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread David Hildenbrand
think I'd even prefer here a simple aid = kvm_xapic_id(apic); if (apic_x2apic_mode(apic)) aid = kvm_x2apic_id(apic); that would keep changes minimal and I don't really see any benefit in the code when splitting handling up. It is neccesassary to write an entry for both IDs and I want

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread Radim Krčmář
2016-12-14 17:59+0100, Paolo Bonzini: > On 14/12/2016 17:15, David Hildenbrand wrote: >> >>> kvm_for_each_vcpu(i, vcpu, kvm) >>> if (kvm_apic_present(vcpu)) >>> -max_id = max(max_id, kvm_apic_id(vcpu->arch.apic)); >>> +max_id = max(max_id, kvm_x2apic_id(vcpu->

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread Radim Krčmář
2016-12-14 17:15+0100, David Hildenbrand: >> kvm_for_each_vcpu(i, vcpu, kvm) >> if (kvm_apic_present(vcpu)) >> -max_id = max(max_id, kvm_apic_id(vcpu->arch.apic)); >> +max_id = max(max_id, kvm_x2apic_id(vcpu->arch.apic)); >> >> new = k

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread Paolo Bonzini
On 14/12/2016 17:15, David Hildenbrand wrote: > >> kvm_for_each_vcpu(i, vcpu, kvm) >> if (kvm_apic_present(vcpu)) >> -max_id = max(max_id, kvm_apic_id(vcpu->arch.apic)); >> +max_id = max(max_id, kvm_x2apic_id(vcpu->arch.apic)); >> >> new = kvm_kvzalloc(

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread David Hildenbrand
kvm_for_each_vcpu(i, vcpu, kvm) if (kvm_apic_present(vcpu)) - max_id = max(max_id, kvm_apic_id(vcpu->arch.apic)); + max_id = max(max_id, kvm_x2apic_id(vcpu->arch.apic)); new = kvm_kvzalloc(sizeof(struct kvm_apic_map) +

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread Paolo Bonzini
On 14/12/2016 14:41, Radim Krčmář wrote: > 2016-12-14 13:39+0100, David Hildenbrand: >> Am 13.12.2016 um 17:29 schrieb Radim Krčmář: >>> There were three calls sites: >>> - recalculate_apic_map and kvm_apic_match_physical_addr, where it would >>>only complicate implementation of x2APIC hotpl

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread Radim Krčmář
2016-12-14 13:39+0100, David Hildenbrand: > Am 13.12.2016 um 17:29 schrieb Radim Krčmář: >> There were three calls sites: >> - recalculate_apic_map and kvm_apic_match_physical_addr, where it would >>only complicate implementation of x2APIC hotplug; >> - in apic_debug, where it was still somew

Re: [PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-14 Thread David Hildenbrand
Am 13.12.2016 um 17:29 schrieb Radim Krčmář: There were three calls sites: - recalculate_apic_map and kvm_apic_match_physical_addr, where it would only complicate implementation of x2APIC hotplug; - in apic_debug, where it was still somewhat preserved, but keeping the old function just fo

[PATCH v2 2/4] KVM: x86: replace kvm_apic_id with kvm_{x,x2}apic_id

2016-12-13 Thread Radim Krčmář
There were three calls sites: - recalculate_apic_map and kvm_apic_match_physical_addr, where it would only complicate implementation of x2APIC hotplug; - in apic_debug, where it was still somewhat preserved, but keeping the old function just for apic_debug was not worth it Signed-off-by: R