[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180718153429.GC6348@flask>
Date: Wed, 18 Jul 2018 17:34:29 +0200
From: Radim Krčmář <rkrcmar@...hat.com>
To: KarimAllah Ahmed <karahmed@...zon.de>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH v5 1/2] KVM: Switch 'requests' to be 64-bit (explicitly)
2018-07-10 11:27+0200, KarimAllah Ahmed:
> Switch 'requests' to be explicitly 64-bit and update BUILD_BUG_ON check to
> use the size of "requests" instead of the hard-coded '32'.
>
> That gives us a bit more room again for arch-specific requests as we
> already ran out of space for x86 due to the hard-coded check.
>
> The only exception here is ARM32 as it is still 32-bits.
What do you mean?
I think we're just going to slow down kvm_request_pending() on 32 bit
architectures.
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Radim Krčmář <rkrcmar@...hat.com>
> Cc: kvm@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Reviewed-by: Jim Mattson <jmattson@...gle.com>
> Signed-off-by: KarimAllah Ahmed <karahmed@...zon.de>
> ---
> v1 -> v2:
> - Use FIELD_SIZEOF
> ---
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> @@ -130,7 +130,7 @@ static inline bool is_error_page(struct page *page)
> #define KVM_REQUEST_ARCH_BASE 8
Now that the base is easily moveable, we could also lower it to 4 and
get few more arch flags.
Bumping requests to 64 bits is probably inevitable and this patch looks
good.
In v4, you have proposed the bitmap-array solution that would easily
allow more than 64 requests -- was the problem that possible
implementations of kvm_request_pending were not as efficient for current
amount of requests?
Thanks.
> #define KVM_ARCH_REQ_FLAGS(nr, flags) ({ \
> - BUILD_BUG_ON((unsigned)(nr) >= 32 - KVM_REQUEST_ARCH_BASE); \
> + BUILD_BUG_ON((unsigned)(nr) >= (FIELD_SIZEOF(struct kvm_vcpu, requests) * 8) - KVM_REQUEST_ARCH_BASE); \
> (unsigned)(((nr) + KVM_REQUEST_ARCH_BASE) | (flags)); \
> })
> #define KVM_ARCH_REQ(nr) KVM_ARCH_REQ_FLAGS(nr, 0)
Powered by blists - more mailing lists