Linux EDAC development
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Tony Luck <tony.luck@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, y2038@lists.linaro.org,
	"H. Peter Anvin" <hpa@zytor.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: x86: mce: always use 64-bit timestamps
Date: Mon, 18 Jun 2018 14:51:06 +0200	[thread overview]
Message-ID: <20180618125106.GB24921@zn.tnic> (raw)

On Mon, Jun 18, 2018 at 12:06:46PM +0200, Arnd Bergmann wrote:
> The machine check timestamp uses get_seconds(), which returns an 'unsigned long'
> number that might overflow on 32-bit architectures (in the distant future)
> and is therefore deprecated.
> 
> The normal replacement would be ktime_get_real_seconds(), but that needs to
> use a sequence lock that might cause a deadlock if the mce happens at just
> the wrong moment. The __ktime_get_real_seconds() skips that lock and is
> safer here, but has a miniscule risk of returning the wrong time when we read
> it on a 32-bit architecture at the same time as updating the epoch, i.e.
> from before y2106 overflow time to after, or vice versa.
> 
> This seems to be an acceptable risk in this particular case, and is the
> same thing we do in kdb.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/x86/kernel/cpu/mcheck/mce.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

             reply	other threads:[~2018-06-18 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 12:51 Borislav Petkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-18 10:06 x86: mce: always use 64-bit timestamps Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180618125106.GB24921@zn.tnic \
    --to=bp@alien8.de \
    --cc=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=y2038@lists.linaro.org \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox