Re: [PATCH] KVM: x86/mmu: x86: Don't overflow lpage_info when checking attributes

From: Edgecombe, Rick P
Date: Wed Mar 13 2024 - 17:23:17 EST


On Wed, 2024-03-13 at 14:11 -0700, Sean Christopherson wrote:
> I wouldn't prioritize speed, I would prioritize overall complexity. 
> And my gut
> reaction is that the overall complexity would go up because we'd need
> to make
> multiple paths aware that lpage_info could be NULL.  There are other
> side effects
> to making something conditionally valid too, e.g. in the unlikely
> scenario where
> we mucked up the allocation, KVM would silently fall back to 4KiB
> mappings, versus
> today KVM would explode (bad for production, but good for
> development).

Fair enough, I won't hurry up and try. I'm not sure there would be too
many places that would have to handle the out-of-bounds case once
everything was suitable wrapped up, though.