分别KeSetAffinityThread绑定cpu以后,提升irql,我的双核机器,得到两张IDT表
打印发现,两张表的ISR都是一样的,想请问一下,windows下面,多核的isr都是一样的还是只是偶然?
资料上说,每个处理器都有独立的IDT,不同的处理器可以运行不同的ISR。但是打印测试的好像没出现过不一样的isr
看了下源码,自己回答一下吧
PKPRCBKiInitProcessorState( PKPROCESSOR_STATE pProcessorState, PVOID PerProcessorAllocation, ULONG NewProcessorNumber, UCHAR NodeNumber, ULONG IdtOffset, ULONG GdtOffset, PVOID *ppStack, PVOID *ppDpcStack );
里面,看到这个
KiCloneDescriptor (&Descriptor, &pProcessorState->SpecialRegisters.Idtr, Base + IdtOffset);
继续看下去
static VOIDKiCloneDescriptor ( IN PKDESCRIPTOR pSrcDescriptor, IN PKDESCRIPTOR pDestDescriptor, IN PVOID Base )
/*++
Routine Description:
Makes a copy of the specified descriptor, and supplies a return descriptor for the new copy
Arguments:
pSrcDescriptor - descriptor to clone pDescDescriptor - the cloned descriptor Base - Base memory for the new descriptor.
Return Value:
None.
--*/{ ULONG Size;
Size = pSrcDescriptor->Limit + 1; pDestDescriptor->Limit = (USHORT) Size -1; pDestDescriptor->Base = (ULONG) Base;
RtlCopyMemory(Base, (PVOID)pSrcDescriptor->Base, Size);}
也就是说,多核下面的IDTR是多份,但是ISR应该是一样的,连猜带摸,如果不对,跟帖纠正吧~~~
今天调试其它问题顺便收集了下面的信息。
系统中是一个四核的CPU,0号的时钟中断ISR是HalpRtcClockInterrupt,而其它三个CPU的时钟中断ISR都是hal!HalpClockInterruptPn:
0: kd> !idt
Dumping IDT:
...
d1: 833a4614 hal!HalpRtcClockInterrupt
df: 833b51c0 hal!HalpApicRebootService
e1: 833b5934 hal!HalpIpiHandler
e3: 833b56d4 hal!HalpLocalApicErrorService
fd: 833b5edc hal!HalpProfileInterrupt
fe: 833b6148 hal!HalpPerfInterrupt
2: kd> ~3s
3: kd> !idt
d1: 833a497c hal!HalpClockInterruptPn