From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40B8DC432C0 for ; Tue, 19 Nov 2019 12:09:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D28F222CD for ; Tue, 19 Nov 2019 12:09:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RSaaXLGG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727926AbfKSMJP (ORCPT ); Tue, 19 Nov 2019 07:09:15 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33352 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbfKSMJO (ORCPT ); Tue, 19 Nov 2019 07:09:14 -0500 Received: by mail-wr1-f67.google.com with SMTP id w9so23553864wrr.0 for ; Tue, 19 Nov 2019 04:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ivBxIQiw/QvtMfmpR5iQrO/2f3Dutvsc0GR6a8pfJQ0=; b=RSaaXLGGQlX7yfXlu5Z0jagMZpyaCg6RuPa26b20m/OvaqlU5ocVtDiZCnVIEt8kMu ZvwwC3bFBzFqAWIVjrZTaobfuXs5UZnbmdfsiILEmizj50l29O+7U4uYt1ArPz+kNZRh hDiWZwZexe9ifx4uU/MBeZAVyBde6hOCmojuRoP08SVjUDBKnsX1uP3WiQ/IvYIIueUg UXNL+Q3Nbdjx43nM2xHZl4aj1ft4lWWVIY8rA9tK6fxYdMTA/kSD/z6lHBLjBo3Phl+q L89HkBiLMWoxtzjTSRZTZlbePnCR7tHPJRkk8PtkPvIV3udwFbVA0RFT4JGDzmIEZEQa fY9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ivBxIQiw/QvtMfmpR5iQrO/2f3Dutvsc0GR6a8pfJQ0=; b=J/ZJneKaECdlYx5xC++8FXn+2qgquC0dkx16Cju7tKXnocRB2KAqdGlD+umSIRgvGa EfqFav4vF5gkQWIRBLiT9vNY103G2qnJJS6/i7zJhayadxmERC5TgSVbu4v+yLluwjwu v2j1rROBQeebTn2YKuLogmRfXXoh2kCv7vY8yy4E1qiMmtufWcJl3kyjaQAZkFCo6JLc u/hmsAWzjISrDL9OE+jxCphtrDn8tIn1+ktOOHz8Bx3MMUc7rN4G8orEHf6tB+zPU+oy eSGoy1k4yw+L21+Ysh7V9rSqLmNh9KExZU5UC5A1hKHIgnkWxvEOcLhm85DR4QF8utCb 5erA== X-Gm-Message-State: APjAAAUQa+1cNgYfMbsjd0JgABuD69oS9Qn/2D3PhYybAPy1X3gGM2nH CamZTQR2mdgXfVkqjIxi9DZqwMGq/wNN1p3my8jGuw== X-Google-Smtp-Source: APXvYqzVh5wmA90P19s7zmbb2x7Na4wJQqfpSJjjGSz8H0l9CWz1oPf8pw9K4u4+qFJI0+MGYo/t6MxvnfJIJ9zAjTc= X-Received: by 2002:adf:b1cb:: with SMTP id r11mr400801wra.246.1574165351430; Tue, 19 Nov 2019 04:09:11 -0800 (PST) MIME-Version: 1.0 References: <20191119002121.4107-1-sean.j.christopherson@intel.com> <20191119111012.GA109842@gmail.com> In-Reply-To: <20191119111012.GA109842@gmail.com> From: Ard Biesheuvel Date: Tue, 19 Nov 2019 12:09:07 +0000 Message-ID: Subject: Re: [PATCH 00/12] treewide: break dependencies on x86's RM header To: Ingo Molnar Cc: Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "the arch/x86 maintainers" , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Tony Luck , Fenghua Yu , Peter Zijlstra , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "H. Peter Anvin" , Steven Rostedt , Ard Biesheuvel , Darren Hart , Andy Shevchenko , Nadav Amit , "VMware, Inc." , Arnd Bergmann , Greg Kroah-Hartman , Hans de Goede , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-ia64@vger.kernel.org, Linux Kernel Mailing List , linux-pm , linux-efi , platform-driver-x86@vger.kernel.org, ACPI Devel Maling List , alsa-devel@alsa-project.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Nov 2019 at 12:10, Ingo Molnar wrote: > > > * Sean Christopherson wrote: > > > x86's asm/realmode.h, which defines low level structures, variables and > > helpers used to bring up APs during SMP boot, ends up getting included in > > practically every nook and cranny of the kernel because the address used > > by ACPI for resuming from S3 also happens to be stored in the real mode > > header, and ACPI bleeds the dependency into its widely included headers. > > > > As a result, modifying realmode.h for even the most trivial change to the > > boot code triggers a full kernel rebuild, which is frustrating to say the > > least as it some of the most difficult code to get exactly right *and* is > > also some of the most functionally isolated code in the kernel. > > > > To break the kernel's widespread dependency on realmode.h, add a wrapper > > in the aforementioned ACPI S3 code to access the real mode header instead > > of derefencing the header directly in asm/acpi.h and thereby exposing it > > to the world via linux/acpi.h. > > > > Build tested on x86 with allyesconfig and allmodconfig, so hopefully there > > aren't more build issues lurking, but at this point it wouldn't surprise > > me in the least if this somehow manages to break the build. > > > > Based on tip/master, commit ceceaf1f12ba ("Merge branch 'WIP.x86/cleanups'"). > > > > Patch Synopsis: > > - Patches 01-09 fix a variety of build errors that arise when patch 12 > > drops realmode.h from asm/acpi.h. Most of the errors are quite absurb > > as they have no relation whatsoever to x86's RM boot code, but occur > > because realmode.h happens to include asm/io.h. > > Yeah, these kind of parasitic header dependencies are the main driving > force behind kernel header spaghetti hell: it's super easy to add a new > header, but very hard to remove them... > > Hence they practically only accumulate. > > As a result header removal patches get priority, from me at least. :-) > > > - Patch 10 removes a spurious include of realmode.h from an ACPI header. > > > > - Patches 11 and 12 implement the wrapper and move it out of acpi.h. > > So if the ACPI maintainers are fine with -tip carrying patches #11 and #12 > then I'd be glad to route these patches upstream. > > I've applied them to tip:WIP.core/headers as a work-in-progress tree, and > I'm testing them on randconfigs to make sure there's no broken > dependencies. I'll wait for the ACPI acks. > > I edited the title of patch 12 slightly, to: > > c8bceb321209: x86/ACPI/sleep: Move acpi_wakeup_address() definition into sleep.c, remove from > > to make sure the big header dependency change is obvious at first sight. > I'm fine with the patches but can we drop the fixes headers please? This doesn't actually fix anything, and touching early boot stuff for no good reason should be avoided imo.