linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>,
	"Lan, Tianyu" <tianyu.lan@intel.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Jan Kiszka <jan.kiszka@web.de>, Peter Xu <peterx@redhat.com>,
	Yang Zhang <yang.zhang.wz@gmail.com>
Subject: Re: [PATCH v3 04/14] KVM: x86: dynamic kvm_apic_map
Date: Tue, 2 Aug 2016 21:15:56 +0800	[thread overview]
Message-ID: <CANRm+CyGw8kmrCDuRpwg+EW_+C=NYG6MxrE-y+FZqs2HvrqEkQ@mail.gmail.com> (raw)
In-Reply-To: <20160802122207.GC3758@potion>

2016-08-02 20:22 GMT+08:00 Radim Krčmář <rkrcmar@redhat.com>:
> 2016-08-02 19:39+0800, Wanpeng Li:
>> 2016-07-13 4:09 GMT+08:00 Radim Krčmář <rkrcmar@redhat.com>:
>> [...]
>>> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
>>> @@ -152,14 +152,22 @@ static void recalculate_apic_map(struct kvm *kvm)
>>>         struct kvm_apic_map *new, *old = NULL;
>>>         struct kvm_vcpu *vcpu;
>>>         int i;
>>> -
>>> -       new = kzalloc(sizeof(struct kvm_apic_map), GFP_KERNEL);
>>> +       u32 max_id = 255;
>>
>> If this should be max_id = KVM_MAX_VCPU_ID? I have a patch on hand to
>> fix it, but I didn't know whether it is your desired behavior or not.
>
> No, we could just have static array then.  KVM_MAX_VCPU_ID is expected
> to be raised to INT_MAX and eventually UINT_MAX, so it would not be
> practical.  The dynamic array is there to avoid wasting space in the
> common case, where VMs have only low APIC IDs.
>
> Inintial patches had 255 to minimize a chance of regressions as the
> static array was that big, but starting with max_id = 0 is our goal and
> should be ok even without other changes.

I see, thanks. :)

Regards,
Wanpeng Li

  reply	other threads:[~2016-08-02 13:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 20:09 [PATCH v3 00/14] KVM: x86: break the xAPIC barrier Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 01/14] KVM: x86: bump KVM_SOFT_MAX_VCPUS to 240 Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 02/14] KVM: x86: add kvm_apic_map_get_dest_lapic Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 03/14] KVM: x86: use physical LAPIC array for logical x2APIC Radim Krčmář
2016-08-02 13:46   ` Wanpeng Li
2016-08-02 14:22     ` Radim Krčmář
2016-08-02 16:40       ` Nadav Amit
2016-07-12 20:09 ` [PATCH v3 04/14] KVM: x86: dynamic kvm_apic_map Radim Krčmář
2016-07-13  8:29   ` Paolo Bonzini
2016-07-13 14:37     ` Radim Krčmář
2016-08-02 11:39   ` Wanpeng Li
2016-08-02 12:22     ` Radim Krčmář
2016-08-02 13:15       ` Wanpeng Li [this message]
2016-07-12 20:09 ` [PATCH v3 05/14] KVM: x86: use generic function for MSI parsing Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 06/14] KVM: x86: use hardware-compatible format for APIC ID register Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 07/14] KVM: x86: reset APIC ID when enabling LAPIC Radim Krčmář
2016-08-02 13:26   ` Wanpeng Li
2016-08-02 13:52     ` Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 08/14] KVM: VMX: optimize APIC ID read with APICv Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 09/14] KVM: x86: reset lapic base in kvm_lapic_reset Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 10/14] KVM: pass struct kvm to kvm_set_routing_entry Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 11/14] KVM: x86: add KVM_CAP_X2APIC_API Radim Krčmář
2016-07-13  8:41   ` Paolo Bonzini
2016-07-13 14:40     ` Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 12/14] KVM: x86: add a flag to disable KVM x2apic broadcast quirk Radim Krčmář
2016-07-13  8:38   ` Paolo Bonzini
2016-07-13 15:14     ` Radim Krčmář
2016-07-13 15:30       ` Paolo Bonzini
2016-07-13 10:15   ` Paolo Bonzini
2016-07-13 14:52     ` Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 13/14] KVM: x86: bump MAX_VCPUS to 288 Radim Krčmář
2016-07-12 20:09 ` [PATCH v3 14/14] KVM: x86: bump KVM_MAX_VCPU_ID to 1023 Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANRm+CyGw8kmrCDuRpwg+EW_+C=NYG6MxrE-y+FZqs2HvrqEkQ@mail.gmail.com' \
    --to=kernellwp@gmail.com \
    --cc=imammedo@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tianyu.lan@intel.com \
    --cc=yang.zhang.wz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).