lkml.org 
[lkml]   [2016]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] kexec: Fix kdump failure with notsc
On 07/12/16 at 09:09am, Wei, Jiangang wrote:
> On Tue, 2016-07-12 at 14:52 +0800, Xunlei Pang wrote:
> > On 2016/07/07 at 18:17, Wei Jiangang wrote:

> > > diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
> > > index 469b23d6acc2..c934a7868e6b 100644
> > > --- a/arch/x86/kernel/machine_kexec_32.c
> > > +++ b/arch/x86/kernel/machine_kexec_32.c
> > > @@ -202,14 +202,13 @@ void machine_kexec(struct kimage *image)
> > > local_irq_disable();
> > > hw_breakpoint_disable();
> > >
> > > - if (image->preserve_context) {
> > > + if (image->preserve_context || lapic_disabled()) {
> > > #ifdef CONFIG_X86_IO_APIC
> > > /*
> > > * We need to put APICs in legacy mode so that we can
> > > * get timer interrupts in second kernel. kexec/kdump
> > > * paths already have calls to disable_IO_APIC() in
> > > - * one form or other. kexec jump path also need
> > > - * one.
> > > + * one form or other. kexec jump path also need one.
> > > */
> > > disable_IO_APIC();
> >
> > Hi Wei,
> >
> > As the comment says, kexec/kdump paths already have disable_IO_APIC(), why again here?
> Frankly, I am not very clear about it as well...
>
> Originally the codes and comment added by Huang Ying
> <ying.huang@intel.com>
> There may be some special reason...

Check code again, it might be native_disable_io_apic() is called in
disable_IO_APIC(). See the code comments at the beginning of
native_disable_io_apic(), ioapic_i8259 is used to record the pin of
ioapic which connect to 8259. Here ioapic is configured to virtual wire
mode to pass through interrupt to cpu. That might be why Huang Ying
said it can put it into legacy irq mode with calling with
disable_IO_APIC.

void native_disable_io_apic(void)
{
/*
* If the i8259 is routed through an IOAPIC
* Put that IOAPIC in virtual wire mode
* so legacy interrupts can be delivered.
*/
...
}

Now question is why disable_IO_APIC need be called twice to make ioapic
to be virtual wire mode.

Add Huang Ying to this thread, don't know if he can help explain.

>
> The comment also said that it's used to put APICs in legacy mode so that
> we can get timer interrupts in second kernel. and we also need it in
> kexec jump path.
>
> In fact, the jiffies calibration needs timer interrupts in second
> kernel. and the lapic and timer are not ready when second kernel waits
> them to update the jiffies value.
>
> so I just want to reuse them and enable legacy mode (PIT timer) for
> notsc case.
> kernel.

\
 
 \ /
  Last update: 2016-07-12 12:01    [W:1.285 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site