From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932682AbdJ3Rqe (ORCPT ); Mon, 30 Oct 2017 13:46:34 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:50979 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932115AbdJ3Rqc (ORCPT ); Mon, 30 Oct 2017 13:46:32 -0400 X-Google-Smtp-Source: ABhQp+QfTHKoH6RxyCKgeJWdLGFuVltXAqIGnsH8nRYyLYBm95Nx/nrMwSkpAX5y6DJEhyZwvo1p/CLUOrA84SeSBQs= MIME-Version: 1.0 In-Reply-To: References: <20171029225155.qcum5i75awrt5tzm@wfg-t540p.sh.intel.com> <20171029231835.3725fnd5yehlmqob@wfg-t540p.sh.intel.com> <20171030110511.scfrdtlnf5lbdhu5@pd.tnic> From: Linus Torvalds Date: Mon, 30 Oct 2017 10:46:31 -0700 X-Google-Sender-Auth: XMaEX4W23F_3xSzjzwARzr4rFt0 Message-ID: Subject: Re: [ghes_copy_tofrom_phys] BUG: sleeping function called from invalid context at mm/page_alloc.c:4150 To: Borislav Petkov , Len Brown , Tony Luck Cc: Fengguang Wu , Tyler Baicar , Huang Ying , Chen Gong , Linux Kernel Mailing List , Will Deacon , "Rafael J. Wysocki" , Linux ACPI 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 Mon, Oct 30, 2017 at 10:20 AM, Linus Torvalds wrote: > > I will add a "might_sleep()" to ioremap_page_range() itself, so that > we get this warning more reliably and much eailer. Right now it has > been hidden by the fact that most of the time the time the page tables > may be already allocated, but even then it's broken. Done. It doesn't report anything for me, so _hopefully_ the GHES driver is the only one that does games like this. See commit b39ab98e2f47 ("Mark 'ioremap_page_range()' as possibly sleeping"). So now it should hopefully warn about this bad usage of page remapping reliably, at least if you have CONFIG_DEBUG_ATOMIC_SLEEP enabled. Can somebody who has a working GHES setup (although Borislav seems to think no such thing exists) verify? This obviously won't _fix_ anything, but at least it should make it clear it's not that recent change that broke things - that just happened to expose it. And hopefully somebody who knows that driver will do the proper fixmap thing (or just ioremap once at probe time, rather than at run-time). Linus