Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2012 07:40:01 GMT
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-amd64@FreeBSD.org
Subject:   Re: amd64/174409: stopping during resume caused by io_apic.c change(r243764)
Message-ID:  <201212230740.qBN7e16e083735@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR amd64/174409; it has been noted by GNATS.

From: Andriy Gapon <avg@FreeBSD.org>
To: KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Cc: bug-followup@FreeBSD.org
Subject: Re: amd64/174409: stopping during resume caused by io_apic.c change(r243764)
Date: Sun, 23 Dec 2012 09:32:02 +0200

 on 19/12/2012 03:47 KAHO Toshikazu said the following:
 >   Hello,
 > 
 >>  Are you set up for crash dumps (minidumps are ok) ?
 >>  Could you please add a call to panic("ioapic_resume"); at the beginning of
 >>  ioapic_resume function in sys/x86/x86/io_apic.c and save a crash dump for debugging?
 > 
 >   The machine now panics, but any keyboard operation makes nothing
 > in debugger. If sysctl debug.debugger_on_panic=0 , kernel was
 > trying to save a dump but failed by ahci error. All devices seem
 > to be sleeping yet.
 
 Oh, I should have realized that this won't work.  Sorry about that.
 Could you please revert all patches from me and put your source tree into the
 working shape (head minus r243764) and the try the following purely diagnostic
 patch?  The patch presumes that you have DDB in your kernel config.
 Please report output produced after resuming.
 Thank you.
 
 diff --git a/sys/x86/x86/io_apic.c b/sys/x86/x86/io_apic.c
 index 4df27c2..1f82816 100644
 --- a/sys/x86/x86/io_apic.c
 +++ b/sys/x86/x86/io_apic.c
 @@ -486,14 +486,30 @@ ioapic_config_intr
  }
 
  static void
 +ioapic_dump(struct ioapic *io)
 +{
 +	int i;
 +
 +	printf("ioapic%u:\n", io->io_id);
 +	for (i = 0; i < io->io_numintr; i++)
 +		printf("pin%d: %08x:%08x\n", i,
 +		    ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(i)),
 +		    ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(i)));
 +}
 +
 +static void
  ioapic_resume(struct pic *pic)
  {
  	struct ioapic *io = (struct ioapic *)pic;
  	int i;
 
  	mtx_lock_spin(&icu_lock);
 +	printf("before re-programming ioapic\n");
 +	ioapic_dump(io);
  	for (i = 0; i < io->io_numintr; i++)
  		ioapic_program_intpin(&io->io_pins[i]);
 +	printf("after re-programming ioapic\n");
 +	ioapic_dump(io);
  	mtx_unlock_spin(&icu_lock);
  }
 
 diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
 index 0df973a..13e4b4f 100644
 --- a/sys/x86/x86/local_apic.c
 +++ b/sys/x86/x86/local_apic.c
 @@ -342,6 +342,8 @@ lapic_dump(const char* str)
  		printf("   cmci: 0x%08x\n", lapic->lvt_cmci);
  }
 
 +static db_cmdfcn_t db_show_lapic;
 +
  void
  lapic_setup(int boot)
  {
 @@ -353,6 +355,10 @@ lapic_setup(int boot)
  	la = &lapics[lapic_id()];
  	KASSERT(la->la_present, ("missing APIC structure"));
  	saveintr = intr_disable();
 +
 +	printf("before setup\n");
 +	db_show_lapic(0, 0, 0, NULL);
 +
  	maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT;
 
  	/* Initialize the TPR to allow all interrupts. */
 @@ -398,6 +404,9 @@ lapic_setup(int boot)
  	if (maxlvt >= LVT_CMCI)
  		lapic->lvt_cmci = lvt_mode(la, LVT_CMCI, lapic->lvt_cmci);
  	
 +	printf("after setup\n");
 +	db_show_lapic(0, 0, 0, NULL);
 +
  	intr_restore(saveintr);
  }
 
 
 -- 
 Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212230740.qBN7e16e083735>