I believe the problem lies somewhere in here:
Code: Select all
// descriptor.h
#define IS_DATA_SEGMENT_WRITEABLE (Is64BitMode() || (((type) >> 1) & 0x1))
// iret.cc
/* AR byte must indicate a writable data segment,
* else #GP(SS selector) */
if (ss_descriptor.valid==0 || ss_descriptor.segment==0 ||
IS_CODE_SEGMENT(ss_descriptor.type))// ||
!IS_DATA_SEGMENT_WRITEABLE(ss_descriptor.type)) // <---
{
BX_ERROR(("iret64: SS AR byte not writable code segment"));
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
}
Regardless, I've got to wonder why it's checking it at all - according to the AMD64 Architecture Programmer's Manual, the 'writeable' attribute is ignored.
I've fixed the problem for now, but I just want to make sure it's not something dumb I've done. Is there something I've overlooked?