Re: [PATCH] KVM: selftests: Fix sign extension bug in get_desc64_base()
From: MJ Pooladkhay
Date: Mon Dec 22 2025 - 12:27:15 EST
On Mon, Dec 22, 2025, Sean Christopherson wrote:
Ugh, I hate integer promotion rules. I wish there was a more useful version ofTrue! It caused me weeks of grief tracking down these triple faults!
-Wconversion :-/
I don't see any reason to have an intermediate "low", it just makes it harder
to piece the entire thing together. My vote is for:
return (uint64_t)desc->base3 << 32 |
(uint64_t)desc->base2 << 24 |
(uint64_t)desc->base1 << 16 |
(uint64_t)desc->base0;
Thanks for the review. I agree, your version is much cleaner. I will send a v2 with this change shortly.
Best,
MJ Pooladkhay