13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24594 Rev. 3.10 February 2005 AMD64 TechnologyEXCEPTION [#GP(0)]}RFLAGS.VM,NT,TF,RF clearedRFLAGS.IF cleared if interrupt gateRIP = temp_RIPEXITINT_N_VIRTUAL:temp_int_n_vector = byte-sized interrupt vector specified in the instruction,zero-extended to 64 bitsIF (CR4.VME=0)// vme isn’t enabled{IF (RFLAGS.IOPL=3)INT_N_VIRTUAL_TO_PROTECTEDELSEEXCEPTION [#GP(0)]}temp_IRB_BASE = READ_MEM.w [tss:102] - 32// check the vme Int-n Redirection Bitmap (IRB), to see// if we should redirect this interrupt to a virtual-mode// h<strong>and</strong>lertemp_VME_REDIRECTION_BIT = READ_BIT_ARRAY ([tss:temp_IRB_BASE],temp_int_n_vector)IF (temp_VME_REDIRECTION_BIT=1){ // the virtual-mode int-n bitmap bit is set, so don’t// redirect this interruptIF (RFLAGS.IOPL=3)INT_N_VIRTUAL_TO_PROTECTEDELSEEXCEPTION [#GP(0)]}ELSE// redirect interrupt through virtual-mode idt{temp_RIP = READ_MEM.w [0:temp_int_n_vector*4]// read target CS:RIP from the virtual-mode idt at// linear address 0temp_CS = READ_MEM.w [0:temp_int_n_vector*4+2]IF (RFLAGS.IOPL < 3)old_RFLAGS = old_RFLAGS with VIF bit shifted into IF bit, <strong>and</strong> IOPL = 3PUSH.w old_RFLAGSPUSH.w old_CSPUSH.w next_RIPINT 159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!