Skip to contentSkip to conversation

size of ctxt.gdt_frames?

DISCUSSION Tim Wood 1 participant 1 message Dec 19, 2006

lore
Share & tools
lore

Tim Wood

author
#0 lore raw

I think I'm either confused about the gdt_frames variable, or there is a bug here:

In xen/public/arch-x86_32.h the gdt_frames array is allocated with 16 entries:

189 struct vcpu_guest_context {
...
204 unsigned long gdt_frames[16], gdt_ents; /* GDT (machine
frames, # ents) */
...

however, in the save/restore code, it is referenced as being much larger:

712 for (i = 0; i < ctxt.gdt_ents; i += 512) {
713 pfn = ctxt.gdt_frames[i];
714 if ((pfn >= max_pfn) || (pfn_type[pfn] !=
XEN_DOMCTL_PFINFO_NOTAB)) {
715 ERROR("GDT frame number is bad");
716 goto out;
717 }
718 ctxt.gdt_frames[i] = p2m[pfn];
719 }

(and there is a similar loop in xc_linux_save)

Should lines 713/718 use ctxt.gdt_frames[i/512] ??

-Tim