From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753016AbcFTIRV (ORCPT ); Mon, 20 Jun 2016 04:17:21 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35895 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbcFTIRP (ORCPT ); Mon, 20 Jun 2016 04:17:15 -0400 MIME-Version: 1.0 In-Reply-To: References: <20160617105435.GB15997@pd.tnic> <20160617132943.GA3336@nazgul.tnic> <20160617143346.GA3912@pd.tnic> From: chenyu Date: Mon, 20 Jun 2016 16:17:13 +0800 Message-ID: Subject: Re: ktime_get_ts64() splat during resume To: "Rafael J. Wysocki" Cc: Borislav Petkov , Thomas Gleixner , "Rafael J. Wysocki" , Ingo Molnar , Peter Zijlstra , lkml , John Stultz , Logan Gunthorpe , "Rafael J. Wysocki" , Kees Cook , Stable , Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Linus Torvalds , Linux PM list , Stephen Smalley Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 17, 2016 at 11:28 PM, Rafael J. Wysocki wrote: > On Fri, Jun 17, 2016 at 4:33 PM, Borislav Petkov wrote: >> Ok, >> >> bisect is done, full log below. >> >> Rafael, that fix >> >> 70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes control to the image kernel") >> >> breaks s2disk here. It explodes during resume and a statically allocated >> struct's member is NULL. See >> >> https://lkml.kernel.org/r/20160617105435.GB15997@pd.tnic >> >> for the splat and some debugging attempts. >> >> Reverting 70595b479ce1 fixes the issue here. > > Quite evidently, memory is corrupted in the image kernel, but this > particular commit only affects the boot kernel, so it can't really > corrupt anything in the image one. > In previous patch, before we jump to the new kernel entry, we add the text mapping to temp_level4_pgt, /* switch over to the temporary kernel text mapping */ movq %r8, (%r9) If I understand correctly, r9 contains the virtual address of restore_pgd_addr, since the page table for restore_pgd_addr might be incoherent across hibernation(as NX patch changes the kernel text mapping to dynamically mapping), so we might write pmd entry to an incorrect place in temp_level4_pgt? Yu