> > This looks like an essential piece for the check introduced in the > series. I could follow the logic, and it looks sane to me. If allowed, > > Reviewed-by: Chang S. Bae <[email protected]> >
Thanks! > The code also looks to be written according to Sean's comment in: > > https://lore.kernel.org/kvm/[email protected] > Yes, that's exactly the reason I didn't modify it much. But 3 years is a long time. So Sean's preference may have changed. > Yes, this could be a matter of taste as taking and going to maintain the > code. But as a reader looking at this, the logic was not that easy to > capture at a high level. > At first look, I found it a bit hard to follow as well. But instead of splitting out the logic into 4 static functions (which have limited value to the rest of the file), how about we add a high level comment on top of the function? I'll let Sean comment whether he prefers to change anything here or leave it as-is. Note, some function names in the proposed diff could be misleading. For example, is_user_mode() checks the IMPLICIT flag in addition to the CPL which feels odd. And, is_lass_enforced() seems like a generic LASS check but in reality it only covers the supervisor data rule.

