[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BLU436-SMTP223B03D71DB3B9D9097F476805B0@phx.gbl>
Date: Wed, 16 Sep 2015 11:58:07 +0800
From: Wanpeng Li <wanpeng.li@...mail.com>
To: Paolo Bonzini <pbonzini@...hat.com>
CC: Jan Kiszka <jan.kiszka@...mens.com>, Bandan Das <bsd@...hat.com>,
Wincy Van <fanwenyi0529@...il.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] KVM: nVMX: enhance allocate/free_vpid to handle
shadow vpid
On 9/15/15 8:54 PM, Paolo Bonzini wrote:
>
> On 15/09/2015 12:30, Wanpeng Li wrote:
>> + if (!nested) {
>> + vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);
>> + if (vpid < VMX_NR_VPIDS) {
>> vmx->vpid = vpid;
>> __set_bit(vpid, vmx_vpid_bitmap);
>> + }
>> + } else {
>> + vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);
>> + if (vpid < VMX_NR_VPIDS) {
>> + vmx->nested.vpid02 = vpid;
>> + __set_bit(vpid, vmx_vpid_bitmap);
>> + }
> Messy indentation, and a lot of duplicate code. Can you instead have
> (which I think was Jan's suggestion too):
>
> static int allocate_vpid(void);
> static void free_vpid(int vpid);
I see, done in v3.
>
> That said, I like the simple solution to the "too many VPIDs for each L1
> VCPU" processor.
Thanks. :-)
Regards,
Wanpeng Li
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists