lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090527071035.GQ846@one.firstfloor.org>
Date:	Wed, 27 May 2009 09:10:35 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
Cc:	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	hpa@...or.com, x86@...nel.org, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 27/31] x86: MCE: Print header/footer only once for multiple MCEs

On Wed, May 27, 2009 at 01:31:36PM +0900, Hidetoshi Seto wrote:
> I suppose one possible benefit not to have it and do like this is that we
> can suppress printing header if there is no log to print.
> But on the other hand footer is always printed.

If there's a machine check exception there's a hardware error, 
so that message should be printed.

This can happen for example in the "external agent" case.

> >  #define PANIC_TIMEOUT 5 /* 5 seconds */
> 
> And if there is no log, do we still need to run mcelog?

Not manually if it runs correctly, but the kernel doesn't know that in 
advance. So in case someone picks it up from a console log
it might be still needed.

> >  	 * Make sure only one CPU runs in machine check panic
> > @@ -240,7 +246,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
> >  		struct mce *m = &mcelog.entry[i];
> >  		if ((m->status & MCI_STATUS_VAL) &&
> >  			!(m->status & MCI_STATUS_UC))
> > -			print_mce(m);
> > +			print_mce(m, &first);
> >  	}
> >  	/* Now print uncorrected but with the final one last */
> >  	for (i = 0; i < MCE_LOG_LEN; i++) {
> > @@ -248,12 +254,13 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
> >  		if (!(m->status & MCI_STATUS_VAL))
> >  			continue;
> >  		if (!final || memcmp(m, final, sizeof(struct mce)))
> > -			print_mce(m);
> > +			print_mce(m, &first);
> >  	}
> >  	if (final)
> > -		print_mce(final);
> > +		print_mce(final, &first);
> >  	if (cpu_missing)
> >  		printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
> > +	print_mce_tail();
> >  	if (exp)
> >  		printk(KERN_EMERG "Machine check: %s\n", exp);
> >  	if (mce_panic_timeout < panic_timeout)
> 
> If mce_panic is only caller of mce_log_tail (and possible mce_log_head),
> it would be better to use printk directly than having such sub-function.

The coding standard recommends to avoid too long functions, so I split it out.


-Andi

-- 
ak@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ