x86/PVH: only set accessed/busy bits for present segments Commit 366ff5f1b3 ("x86: segment attribute handling adjustments" went a little too far: We must not do such adjustments for non-present segments. Reported-by: Roger Pau Monné Signed-off-by: Jan Beulich --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1374,8 +1374,10 @@ int arch_set_info_hvm_guest(struct vcpu #define SEG(s, r) ({ \ s = (struct segment_register){ .base = (r)->s ## _base, \ .limit = (r)->s ## _limit, \ - .attr.bytes = (r)->s ## _ar | \ - (x86_seg_##s != x86_seg_tr ? 1 : 2) }; \ + .attr.bytes = (r)->s ## _ar }; \ + /* Set accessed / busy bit for present segments. */ \ + if ( s.attr.fields.p ) \ + s.attr.fields.type |= (x86_seg_##s != x86_seg_tr ? 1 : 2); \ check_segment(&s, x86_seg_ ## s); }) rc = SEG(cs, regs);