Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp802844ybh; Thu, 12 Mar 2020 11:24:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtkEowNPTLqoe/MJ6s4WAiwo//EMsNcj65Ubqxu98GEIgg7pBq+KGcU0FAG1dLCoF+RMEEZ X-Received: by 2002:a9d:6443:: with SMTP id m3mr7330332otl.20.1584037456069; Thu, 12 Mar 2020 11:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584037456; cv=none; d=google.com; s=arc-20160816; b=ZQ65hnFuChpiNX3T8eUXLaBPJAyh6pHy/pUhDzH+dvgH/9z5zcHMhZYaXdGt9CWPKQ VzKG89jkmG2Q6TvFferHkOYEqg8J2h2wweNnEHNpWY7YZUQG6PQMOoOh4DcWSS7JjCGA D8fyl1OJ2s6AzrVrbHD4CZGgzNG2IY7JyajKzGf6+0yT+tB1vhQhvpnLi1mEbvfXFnuA GB/BjZ6CWcPNluWtd72rt5Pr28O4v9BQKTdm06GppmDVvjwP38QeBv7gfUSE2ScuR3Fq sOcIfbrTXf3UFGkxVxLNMyeYKkYWlX0z59ybA6M3ShN7rr6GfGtT58a9XYLFr7kA1fhq Trtw== 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=KxnAiQqGtQG3PAEgS1iE2wCQbvzYL1ksqjGBfgm+opI=; b=WT9Hyn/gR6ZBUPp3dt1+wDXhaK3wagmBGwHJN1yZ28fkSeSJpZpebtVrO8g0qu2lUY udOeyitGmTdsxk/fzGQmLWbwzdPGfODQCYML2B7fOwDdgVanFBBmPGTMjBLLM8rON/bG m+XStoRlV2Ht1k31oAjIkIQ6iBBELpBwJJuhPcYuTS1dNBD6w+uQ02ILd2U8/0eMVmXz nmEfN4nASQdApR5kLrZur+fxQlyRduTIy8vVlYYHuEZS6+l6WLQDE1u+FX/C1VoC8ijA 52gO4kb7mkoI9DFFhDIAhsNsTKMuZIIMo1ci5GYBs7I9HximHCBumhWuZr2Bs4hPN3dk KPMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GFtRQJZS; 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 i7si3097371oth.143.2020.03.12.11.24.03; Thu, 12 Mar 2020 11:24:16 -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=GFtRQJZS; 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 S1726610AbgCLSX1 (ORCPT + 99 others); Thu, 12 Mar 2020 14:23:27 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:43715 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgCLSX1 (ORCPT ); Thu, 12 Mar 2020 14:23:27 -0400 Received: by mail-qk1-f196.google.com with SMTP id x1so3041551qkx.10 for ; Thu, 12 Mar 2020 11:23:26 -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=KxnAiQqGtQG3PAEgS1iE2wCQbvzYL1ksqjGBfgm+opI=; b=GFtRQJZSHmlsoDyEoCHGWkgNm7BH3WIpjbXqhmdiheyppLCNcGmx2NSx0oSMzW5JZC RghZcr5DJf9CxKQWwxiSXD8jI0qVSBVwcZ+MwJdAx5im2mG0WhWl9jyNlNV1nE+Odjzv 2Q3Vr1LTiu+q2WYSYUmkSWaktgJHehPVvgRzCqQAjVq4J7WcGndJtaYZVrapfrXx2RCa YM6opjYUX9T5I/aWoButEjM77tw2nPkQs+x8enJpbaWUtiiLqtTiWnhBJnkYILiwJqzI CWxPItbYZJ1G+S9t6vE/ZBFqMN7ICm0VRFAqYiLR1xk4br6kwzc6v6fAUB+AbRGVt8ng hUbw== 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=KxnAiQqGtQG3PAEgS1iE2wCQbvzYL1ksqjGBfgm+opI=; b=I3EXskNG+JYqXRDQK7obDvOuNSPYxQAg90n+8kc2fSEAH/+XdQ1T0iJeLAxw4eRg0Z rnSpuwAlkwQu3ckJHGdUfA3BuOk3+oBNoTYgj08ZVXnZRn41S7Q0x48iNNUdX5mZ3Ax/ VvpD2mOmsWLmKyF3Etc8gcx6gaBV+b8IXS9Wrzs8Kq0HqPwgJ6/DWByBQECEzVA8hRKh 4U8J86KfXmdInDIARxDiQyWVcbm1zOAWflVzTOlMjBlOd3jwDJKLjfwGzwxE3Wlvf/Hr PAy2XPMgpzO8Wxchqc58LgTR+wiMPQWd7Zf9+KBmh+j9E7Og7s2RzkTeyKTE9v6UyqpT WcDg== X-Gm-Message-State: ANhLgQ2tcD4j56UHhhHBdJ30WwlWMZKmIQ60+yHDSnxuu/HIW2yNknL4 wv2/E1T5yuII1pgO+CEcq2o= X-Received: by 2002:a37:aa46:: with SMTP id t67mr2232127qke.43.1584037405678; Thu, 12 Mar 2020 11:23:25 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id v126sm10740727qkb.107.2020.03.12.11.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 11:23:25 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Thu, 12 Mar 2020 14:23:23 -0400 To: Hans de Goede Cc: Arvind Sankar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "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: <20200312182322.GA506594@rani.riverdale.lan> References: <20200311214601.18141-1-hdegoede@redhat.com> <20200311214601.18141-3-hdegoede@redhat.com> <20200312001006.GA170175@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 06:46:44PM +0100, Hans de Goede wrote: > Hi, > > On 3/12/20 1:10 AM, Arvind Sankar wrote: > > On Wed, Mar 11, 2020 at 10:46:01PM +0100, Hans de Goede wrote: > >> Since we link purgatory.ro with -r aka we enable "incremental linking" > >> no checks for unresolved symbols is done while linking purgatory.ro. > >> > > > > Do we actually need to link purgatory with -r? We could use > > --emit-relocs to get the relocation sections generated the way the main > > x86 kernel does, no? > > > > Eg like the below? This would avoid the double-link creating > > purgatory.chk. > > So I've changed the patch for this in my local tree over to the version > suggested below and tested kexec with this (and I can confirm that it > still works) > > I'm wondering though if it would not be better to keep the purgatory.ro name ? : > > 1. The generated ELF binary should still be relocatable > 2. .ro files are part of the global .gitignore settings, for the > new purgatory name we need to add an arch/x86/purgatory/.gitignore file > 3. Keeping the purgatory.ro name will make the diff easier to read > > Regards, > > Hans > No objections to the name, we can change it later to purgatory.elf or something if we want in a separate patch. There is one issue I noticed -- x86_64 kernel default LDFLAGS have max-page-size=0x200000. If purgatory is linked into a real executable this makes kexec-purgatory.o become quite large, from about 25k to just over 4Mb. Adding -z max-page-size=4096 to the LDFLAGS lowers this back down to around 29k. arch/x86/entry/vdso/Makefile adds this flag too.