x86/PV: split a get_unsafe() invocation

Misra C:2012 rule 13.6 takes issue with the gdt_ldt_desc_ptr() call
appearing (deep) inside sizeof(), as used by get_unsafe().

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2026-05-22 08:19:54 +02:00
1 parent 91ea85ec12
commit bcbef3bdbd
1 file changed
+8 -2
+8 -2
View File
@@ -29,8 +29,14 @@ int pv_emul_read_descriptor(unsigned int sel, const struct vcpu *v,
*/
((sel & 4) && (sel >> 3) >= v->arch.pv.ldt_ents) )
desc.b = desc.a = 0;
else if ( get_unsafe(desc, gdt_ldt_desc_ptr(sel)) )
return 0;
else
{
const seg_desc_t *pdesc = gdt_ldt_desc_ptr(sel);
if ( get_unsafe(desc, pdesc) )
return 0;
}
if ( !insn_fetch )
desc.b &= ~_SEGMENT_L;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.