Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1988301ybh; Tue, 14 Jul 2020 12:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjN8Gb62eifNUjx7fANxa1x3G8j7n/9qMej0Fjufa7PA73fXHPTaj67b23Qn1S7nwu/nPr X-Received: by 2002:a17:907:6fc:: with SMTP id yh28mr5924787ejb.267.1594754683921; Tue, 14 Jul 2020 12:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594754683; cv=none; d=google.com; s=arc-20160816; b=b1Su/TuNJowXDrY23XpxUCJtpS1ZBQXNRcp57tYCiYC+vxt1SwX6VQRRooe0lx3d/D rI8Q9GtN+Cnfp8k2wKgLP+zKtKpckoIrDIQMK2Nw+o1Z4O3rfEhNh2+subw/OjdGw1Lf T2m8kVS4fKIXtYk2gvEzMhf0bpg4AoeYkPXGXRDvwDDG6JphpuvKxJxIfn8aas4ggorC 8vM8h4on8uSGy4BjU1dGg+Gzw5cBHsKTaL8Tt/0W+QE65ZW/rqGN8NYiWrR66fmBvfaS vI7m49+fdaJM8XPP8awEMPW6ZCE4eFqLOBuIarNl/ASY2fvqeMDFekDLuyGCY355VkPF 6zuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=6MKTlr7J8Rp2MsMio23TCowkP5+63OkXW2oUskwJZ8w=; b=gBZvIrY8Vz4neAI1ExFVW4LWxJlLj5CR9NTzNe7I054YpAHRtU0MSAvvKpAn3UiTjw FL1vCamJZFdrmVjk5RwxCrh2exzDLSttYEtUNMNjfH4Ohmp3IegIKbFZ34pLPbY+Owhq QEz+hGFXENjNjzOZsbabcyOeS3f/JSHPgAvDeJcvI2w77k/N6N9yqslSAa/roqX9qnLw fFzwRmsHXzZkXmlGVM/axK77CW1XU4J27g4ip9sMjScUGm+5pp01jhlt3NhDuT//cZrg PGhkv3FjAtEVXV3n/DWJOZWtIBqpWMo6FFu31RZSZqDWLOt/QXMoA4kiCgtfgEyY5E4u uWwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kirqayn1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr10si14835932ejc.204.2020.07.14.12.24.18; Tue, 14 Jul 2020 12:24:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kirqayn1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbgGNTVX (ORCPT + 99 others); Tue, 14 Jul 2020 15:21:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727930AbgGNTVW (ORCPT ); Tue, 14 Jul 2020 15:21:22 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 944F2C061755 for ; Tue, 14 Jul 2020 12:21:22 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id l1so18524983ioh.5 for ; Tue, 14 Jul 2020 12:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=6MKTlr7J8Rp2MsMio23TCowkP5+63OkXW2oUskwJZ8w=; b=kirqayn1/3LrfNhHlFjphh3zOb/8tQ1wCoTI8dQbkWi4nEZUI0fTq5CzVJHNt6Nai5 TLe9VCZIBLrCMmsyCGLOm3g4A4iJmYgMwYGZP6MyUQDurP5vDrpC8dqELT9awpkcICtK znZNJ/5OcjuiBAdwxLDcpRQPS5FAXykwRstzDFUwNpVeytro4nmwpDgDa01ubbV5Afj4 59IjcONDDVcfWN2xAB89NPFJZNsDvA3xeQUYNijdIpXxcLUjkns2rrxymX8LaiwZxi+w /fOE366hbMqSGsCckOS70SBm04GOHQsU1iwfNNx/mIK40/t+/bX3harB6nh1uAR1zRdP eACg== 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:reply-to :from:date:message-id:subject:to:cc; bh=6MKTlr7J8Rp2MsMio23TCowkP5+63OkXW2oUskwJZ8w=; b=SFwE77MNjtENxlIalnIpynDcxlcTDZSmPwhkxq5JD8ViuPJV8eSpOMx99bHHMVWgdF nGs+as5Vnj9FjqJn+T83u+G8R/7GygcvVJhpHal0Ni3mP00NgFERHVru3HC4TFqm5+eK XBS1v0zXZctpt2sCu7f/1sKMss5vIi8lVIYNst731bk9B/uZF4/OkMVj6iFUy+1WVCRD u/AmtYW8lZm/HOW+zjkx/iMROhyc0G+5po/HJbyzztGjLY/0rIlEqc6xhMKOQ0BOQgF8 n86qCOjC0bC/iQyAcR3FH9ZJX2DhXpHv5U2tbDsshkxY3qrzq3JNcZmZuZDbkg7mcUmW 2rKw== X-Gm-Message-State: AOAM531M0Er1CEKTRSuK90vsvjdscjecNZcOF1YFoSTmLUXmlOwAVOdK 5H39N9sxKCuElda4P6meWhHnCu1y4+V6/rNQdD8= X-Received: by 2002:a5e:9309:: with SMTP id k9mr6361130iom.135.1594754481750; Tue, 14 Jul 2020 12:21:21 -0700 (PDT) MIME-Version: 1.0 References: <20200629140928.858507-1-nivedita@alum.mit.edu> <20200714023836.2310569-1-nivedita@alum.mit.edu> <20200714141550.GA329060@rani.riverdale.lan> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Tue, 14 Jul 2020 21:21:10 +0200 Message-ID: Subject: Re: [PATCH v4 0/7] x86/boot: Remove runtime relocations from compressed kernel To: Arvind Sankar Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Nick Desaulniers , Fangrui Song , Dmitry Golovin , Clang-Built-Linux ML , Ard Biesheuvel , Masahiro Yamada , Daniel Kiper , Kees Cook , Nathan Chancellor , Arnd Bergmann , "H . J . Lu" , linux-kernel@vger.kernel.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, Jul 14, 2020 at 8:33 PM Sedat Dilek wrote: > > On Tue, Jul 14, 2020 at 8:30 PM Sedat Dilek wrote: > > > > > I did a full new build... > > > > > > ...and it fails with ld.lld-11 as linker: > > > > > > ld.lld-11 -m elf_x86_64 -pie --no-dynamic-linker -r -o > > > arch/x86/boot/compressed/.tmp_misc.o arch/x86/boot/compressed/misc.o > > > -T arch/x86/boot/compressed/.tmp_misc.ver; mv -f > > > arch/x86/boot/compressed/.tmp_misc.o arch/x86/boot/compressed/misc.o; > > > rm -f arch/x86/boot/compressed/.tmp_misc.ver; fi > > > *** ld.lld-11: error: -r and -pie may not be used together *** > > > make[5]: *** [scripts/Makefile.build:281: > > > arch/x86/boot/compressed/misc.o] Error 1 > > > > > > It's annoying to fail on the last minutes of a build. > > > Sorry for being very honest. > > > > > > > I applied this diff... > > > > $ git diff arch/x86/boot/compressed/Makefile > > diff --git a/arch/x86/boot/compressed/Makefile > > b/arch/x86/boot/compressed/Makefile > > index 789d5d14d8b0..9ba52a656838 100644 > > --- a/arch/x86/boot/compressed/Makefile > > +++ b/arch/x86/boot/compressed/Makefile > > @@ -51,7 +51,10 @@ UBSAN_SANITIZE :=n > > KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) > > # Compressed kernel should be built as PIE since it may be loaded at any > > # address by the bootloader. > > +# LLD linker does not allow -r and -pie options to be used together. > > +ifndef CONFIG_LD_IS_LLD > > KBUILD_LDFLAGS += -pie $(call ld-option, --no-dynamic-linker) > > +endif > > LDFLAGS_vmlinux := -T > > > > hostprogs := mkpiggy > > > > ...and was able to build, assemble, link arch/x86/boot/compressed/*. > > > > I checked my last succesfull build without your patchset: > > $ grep no-dynamic-linker build-log_5.8.0-rc5-1-amd64-llvm11-ias.txt > [ EMPTY ] > I was able to boot on bare metal. Feel free to add my... Tested-by: Sedat Dilek ...when you restore "old" behaviour when CONFIG_LD_IS_LLD=y (apply or fold-in my diff with comment)... ...and use one "runtime" in your subject-line: $ git log --oneline v5.8-rc5..for-5.8/x86-boot-compressed-remove-runtime-relocations-nivedita-v4 | egrep 'runtime|run-time' 9547f8f08689 x86/boot: Check that there are no runtime relocations ede02a307b30 x86/boot: Remove runtime relocations from head_{32,64}.S 525a67ac7ea9 x86/boot: Remove run-time relocations from .head.text code Thanks. - Sedat -