Re: kernel preemption while returning from interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/31/06, Gaurav Dhiman <gauravd.chd@xxxxxxxxx> wrote:
On 1/31/06, MHD.Tayseer Alquoatli <idoit.ief@xxxxxxxxx> wrote:
>
>
>
> On 1/30/06, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx > wrote:
> > Dear Gaurav.....
> >
> > I am not an expert on this issue, but allow me to share my idea...
> >
> > > 186         testl $IF_MASK,EFLAGS(%esp)     # interrupts off
> > > (exception path) ?
> >
> > you mean this check, right? Well IMHO, "cli" certainly masks interrupts,
> > but line 186 above checks whether IF (Interrupt Flag) of EFLAGS saved
> > on kernel stack is disabled. Maybe on exception path, IF flag is
> > cleared first and the handler is called? CMIIW too
>
> i'm not that much familiar with assembly code but the instruction on line
> 186 looks like dealing with some address related to the stack really, as
> Mulyadi said
> but when those values has been put on the stack ? (i.e. when have they been
> saved?)
> thanks

Line 186, checks the IF (interrupt flag) flag of EFLAG register of
CPU, which was pushed on the kernel stack while entering the interrupt
handler or system call stub.  So on this line we are just checking if
the interrupts on local CPU are disabled, if yes then we restore the
context of interrupted kernel execution path else we go and do check
for preemption.

My question was not this ...... plaese read my question again.

Dear Gaurav
Mulyadi has answered your question that the cli instruction on line 179 will not affect the test on line 186 cause the instruction on line 186 is not checking if the interrupts is disabled but checks the interrupts flag which is stored on the stack
i'm asking about another issue just for me to understand the scenario. test on line 186 checks if the interrupts where disabled before we came here (CMIIW) but how could we reach here if the interrupts where disabled and we where executing kernel code (cause we are in resume_kernel) CMIIW please
sorry for interrupting your question with another question but i thought that interrupts where not disabled while discussing idea in the same context ;-)
thanks

MHD.Tayseer

 

regards,
-Gaurav

>
> MHD.Tayseer
>
> > regards
> >
> > Mulyadi
> >
> >
> > --
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive:       http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
> >
> >
>
>


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux