Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1292607ybh; Thu, 12 Mar 2020 21:45:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs6+7qS2gQg2V0EEQrksv7QfcrnCQbZFQw3zQUwrgV9tBVXOuvYtWwWXphoHtobkZ3RmcYU X-Received: by 2002:a05:6830:10b:: with SMTP id i11mr7492013otp.99.1584074719683; Thu, 12 Mar 2020 21:45:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584074719; cv=none; d=google.com; s=arc-20160816; b=rEeRFC/rQ6mPHGnJ2tXtldiu9bpPVBOBHU11rcEat+Z2BwUBMrbuJ6lAXoPQvBsg19 Jzyk1fB23wGnEYq4Mms59GTtbyQBXYx0g3PcJxsEbWvfK9A5VVyEU5Tu/ut4vo2PtHPb R7rjmhhUcTZWg/26yOelCY7EidIgh8wu8m+dqyTvChJKjNVvi35LXuUq2X94QhnNr6vp NDQNHteu7d/Sn+FwK+mJuSL7fuKGOgfk8IKoP2ARxrmqpENWBKxJ27jiYhRUhalkLns3 bokqQo9tLT4oZivvfdgg5BaviYkh2LGTMSQqhT08jrQ2KYUYsttYug0gaL/RpRnTOPSs 2i9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=GLO+PjvWxExQm34tUxvZtx7Ot6/kONxQ6xKJ24fbboE=; b=tYMgH3nE7QIR9zfGCYHNAVKmoyqQ9v0vb9vuLobAsgo/8VajZ8KD4a0nIItvkw6thv xS0K+a+zJTi7oB4cvrmUBHIv4uht0tkE4MXC1v6Ewj5Y6mr86/2u0Su7JIJ13UhpL4zm MgBgN1cQrgF68qIZTlut+rnmGX9l2lCdQhL6VQ4l809IbTjGdIIPQ65LdbQvtCAZgYim 7YxrUa+IbADdtrEGaCItaQEX24zy188wHFK6Zwjy5ub0oj0mxqqrgZIL1pdrRHs0g9eZ 0gTl6YndsLd0AzRRoPgHcWWiPfvGvvOjESb7RDiYg1RAEfgR+qoUaqRJcX9vh4vZ54V9 7NaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AF9ObVvR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i24si3986040otp.282.2020.03.12.21.45.06; Thu, 12 Mar 2020 21:45:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AF9ObVvR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbgCMEmk (ORCPT + 99 others); Fri, 13 Mar 2020 00:42:40 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:39400 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbgCMEmk (ORCPT ); Fri, 13 Mar 2020 00:42:40 -0400 Received: by mail-qk1-f196.google.com with SMTP id e16so10457209qkl.6 for ; Thu, 12 Mar 2020 21:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GLO+PjvWxExQm34tUxvZtx7Ot6/kONxQ6xKJ24fbboE=; b=AF9ObVvRrbANzSPcxQHeQgmhUNpo4rxvEp/uUASaHO3BaeC+Ie3ECyKFqJPB+dcVNf gkuSxtWj58rFxgY+hwDYy84GXSJeUl2AhTxMB5XRntEtcv40Kzfe/Zu+pl9QWXIYsnRR fxpDVoRyqmOEOqMhmBtXvC6enfo+phRYdcyR4mKROd3KsF6/kXROU1b7Q/j206YWlF5a LcLIzI2uGGYfCYSU9muof6C9p1eWWfdZwhtl/xGgXHA2975GXTU/fCge5G81mxHouKlT L0xslV/qizyG15HXnqZCyeijBpmhSgIqAhA0ZElrfdzO5ie1Yj7nuM4V5UvF+4cjas1g zrwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GLO+PjvWxExQm34tUxvZtx7Ot6/kONxQ6xKJ24fbboE=; b=Hw0w2MVlHDkV525pJxYYCNB8CNUBhL+2PscFJJWV0n18LkcaVI/arLvAB7Xm70lUZh Cx+1+WPGkG4oUI++RcaQJVrjeEeSqsd2tZPmUIrrU52yWT5c/3p5eBzghawAwq8s+thd +Fuo9BKzMbdlpvv0Oh/MOgf0Xa7FEtRV3+I4TPt0hyBYKYbTrhQ4AItA6MY7zelZ5PAo LpzMl7nYhj2cUt+AShriO5OhdyT1n5DeHerGDDTz2KHKb6/UUSoiQtDhOIB/vk+79d/O H1nT3a5KFh5Yi9wFvwbfn9UIDyrHLhxb1J7C2EzdpQe8lwdDq7+qqk0g5T9Duo6mVx2e kKyQ== X-Gm-Message-State: ANhLgQ2C7qBWw0+7j+V6bsobbi2m2kcMOsPzp8mKG/88xmGv4AybgCz3 +0KsO3yemTwVAZehOIGYjPU= X-Received: by 2002:a05:620a:141a:: with SMTP id d26mr11196200qkj.312.1584074558697; Thu, 12 Mar 2020 21:42:38 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id f13sm15211886qte.53.2020.03.12.21.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 21:42:38 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Fri, 13 Mar 2020 00:42:36 -0400 To: Borislav Petkov Cc: Hans de Goede , Arvind Sankar , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] x86/purgatory: Make sure we fail the build if purgatory.ro has missing symbols Message-ID: <20200313044235.GA1159234@rani.riverdale.lan> References: <20200311214601.18141-1-hdegoede@redhat.com> <20200311214601.18141-3-hdegoede@redhat.com> <20200312001006.GA170175@rani.riverdale.lan> <3d58e77d-41e5-7927-fe84-4c058015e469@redhat.com> <20200312114225.GB15619@zn.tnic> <899f366e-385d-bafa-9051-4e93dc9ba321@redhat.com> <20200312125032.GC15619@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200312125032.GC15619@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 01:50:39PM +0100, Borislav Petkov wrote: > On Thu, Mar 12, 2020 at 12:58:24PM +0100, Hans de Goede wrote: > > My version of this patch has already been tested this way. It is > > Tested with kexec maybe but if the 0day bot keeps finding breakage, that > ain't good enough. > > > 1. Things are already broken, my patch just exposes the brokenness > > of some configs, it is not actually breaking things (well it breaks > > the build, changing a silent brokenness into an obvious one). > > As I already explained, that is not good enough. > > > 2. I send out the first version of this patch on 7 October 2019, it > > has not seen any reaction until now. So I'm sending out new versions > > quickly now that this issue is finally getting some attention... > > And that is never the right approach. > > Maintainers are busy as hell so !urgent stuff gets to wait. Spamming > them with more patchsets does not help - fixing stuff properly does. > > So, to sum up: if Arvind's approach is the better one, then we should do > that and s390 should be fixed this way too. And all tested. And we will > remove the hurry element from it all since it has not been noticed so > far so it is not urgent and we can take our time and fix it properly. > > Ok? > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette If I could try to summarize the situation here: - the purgatory requires filtering out certain CFLAGS/other settings set for the generic kernel in order to work correctly - the patch proposed by Hans de Goede will detect missing filters at build time rather than when kexec is executed - the filtering is currently not perfect as demonstrated by issues that 0day bot is finding -- but the patchset will find these problems at build time rather than runtime - there might be a slight optimization as proposed by me [1] but it might have problems as in [2] even if it seems to work I think the patch as of v5 [0] is useful right now, to catch CFLAGS additions that aren't currently being filtered correctly. The real problem is that there exist CFLAGS that should be used for all source files in the kernel, and there are CFLAGS (eg tracing, stack check etc) that should only be used for the kernel proper. For special compilations, such as boot stubs, vdso's, purgatory we should have the generic CFLAGS but not the kernel-proper CFLAGS. The issue currently is that these special compilations need to filter out all the flags added for kernel-proper, and this is a moving target as more tracing/sanity flags get added. Neither the solution of simply re-initializing CFLAGS (which will miss generic CFLAGS) nor trying to filter out CFLAGS (which will miss new kernel-proper CFLAGS) works very well. I think ideally splitting these into independent variables, i.e. BASE_FLAGS that can be used for everything, and KERNEL_FLAGS only to be used for the kernel proper is likely eventually the better solution, rather than conflating both into KBUILD_CFLAGS. But to move forward incrementally, patch v5 is probably the cleanest. My suggestion in [1] I'm thinking is changing things significantly for kexec, by changing the purgatory from a relocatable object file into an actual executable, and might have knock-on implications that need to be reviewed and tested carefully before it can be merged, as shown by [2]. [0] https://lore.kernel.org/lkml/20200312114951.56009-1-hdegoede@redhat.com/ [1] https://lore.kernel.org/lkml/20200312001006.GA170175@rani.riverdale.lan/ [2] https://lore.kernel.org/lkml/20200312182322.GA506594@rani.riverdale.lan/