Interrupt handling in multi-processor environment
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=BnGISGZTTh2/ROYuuUWzgUdUp4rSHR9GfHAkLg/HiSM=; b=X0g7ax/RRl6/hwwWuwl+gzSLgsSizZ2joUJS8mv404w5Zvm1joXf8XWY3askOPdAWO CxIZ+/PfDigh1Xl/38V1Baf9SCD54WcLjmHW8KVCvH4JDbsSPzdq80o1wdxr3LA2oPxK P5juKNOsN5wnlaZ8OA8VuJrl9gx6PhYixB2eU= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=OFf++/bEEDRhqs8vCu/ZlNXuMpwC7UBz1ehi8DOD0m3b2rPqpMyNGygP4DLrhsLLY4 EjqrCIT/1w1oyWhUTu/n2jMsHDuMFYxETgAUlnH4753DsxnfxtK4mR87nUNV7a6gb+9C 6610vyk6cP376QPPRMp+j2oxlDiET+SAVXa0s= Hi, I'm trying to understand how IOSimpleLockLockDisableInterrupt works to prevent interrupt preemption in a multi-processor environment. Perhaps somebody could help clarify my (mis)understandings. IOSimpleLockLockDisableInterrupt() appears to disable interrupts (via ml_set_interrupts_enabled()) using the sti/cli instructions which act only on a single CPU. Does this mean that if such a lock is held by a task on the same workloop as an IOFilterInterruptEventSource, it is still possible for an interrupt filter function to be called via an interrupt occurring on a different CPU? Looking at how interrupts are delivered/controlled inside IOKit via IOInterruptControllers/IOSharedInterruptControllers, IOFilterInterruptEventSource, etc it looks like there is just a single 'master' interrupt controller (AppleACPICPUInterruptController) attached to just one of the CPUs that (ultimately) causes interrupts to be dispatched to the filter functions of IOFilterInterruptEventSources. Are interrupts from all CPUs somehow routed through to this single master interrupt controller? (The context of this query is trying to serialise access to registers (including register reads) on a PCI device. An alternative approach that occurs to me (if IOSimpleLockLockDisableInterrupt is not suitable) is to disable the IOFilterInterruptEventSource temporarily whilst the registers are accessed outside of the interrupt filter function, which has the side-effect of calling disableInterrupt() on the shared interrupt controller, thus preventing preemption by the interrupt filter function. I'm not sure whether disabling a shared interrupt controller for very brief times is a good idea though - will it have an adverse impact on other parts of the system sharing those interrupts. ) Thanks in advance, Rob. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Rob Cas