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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C938C433F5 for ; Tue, 4 Oct 2022 17:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJDRbG (ORCPT ); Tue, 4 Oct 2022 13:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiJDRas (ORCPT ); Tue, 4 Oct 2022 13:30:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0438F65551; Tue, 4 Oct 2022 10:30:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B508BB81B54; Tue, 4 Oct 2022 17:30:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5818C433C1; Tue, 4 Oct 2022 17:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664904644; bh=a1iNRf+UMxlHWdHG1vJfQgc5A3fOfcVJMeUSiTuInao=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=i1UrysBgTNEurj+pJZFNIgA0T6322DnBpKcEzJWsznmn/b7iisMWwyUrtXutKOyxS ZNepKS4mkfwo8qZNwIth91rp3WOxfmW6Y8ZcqnB9TeVDkHccLEz1/2KcuHdI/RBexy novzrVc5a1J3wboTgHKpfFbdNaWGj6gVib6vo6yXzKroEnAULgwDffddHT3+S7NV9t gQA3fURP4HjiFESNkGIW7BLQpMkv9BNl0oOCnJJ4EVoDzZsqtu/rKFGVKc/J5WL1x2 1Ja5ZiwqClfeWT5ZoF6omEny9HJR7tIfTWtNS58Qsf+lGS7QCl0JWwlsxTtxVWmhPm zo/qiHC6em/AQ== Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id A383127C005A; Tue, 4 Oct 2022 13:30:41 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Tue, 04 Oct 2022 13:30:41 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeiuddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet nhguhicunfhuthhomhhirhhskhhifdcuoehluhhtoheskhgvrhhnvghlrdhorhhgqeenuc ggtffrrghtthgvrhhnpedvhfeuvddthfdufffhkeekffetgffhledtleegffetheeugeej ffduhefgteeihfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrnhguhidomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduiedu keehieefvddqvdeifeduieeitdekqdhluhhtoheppehkvghrnhgvlhdrohhrgheslhhinh hugidrlhhuthhordhush X-ME-Proxy: Feedback-ID: ieff94742:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E2FCB31A0062; Tue, 4 Oct 2022 13:30:38 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1015-gaf7d526680-fm-20220929.001-gaf7d5266 Mime-Version: 1.0 Message-Id: In-Reply-To: <20221003222133.20948-3-aliraza@bu.edu> References: <20221003222133.20948-1-aliraza@bu.edu> <20221003222133.20948-3-aliraza@bu.edu> Date: Tue, 04 Oct 2022 10:30:18 -0700 From: "Andy Lutomirski" To: "Ali Raza" , "Linux Kernel Mailing List" Cc: "Jonathan Corbet" , masahiroy@kernel.org, michal.lkml@markovi.net, "Nick Desaulniers" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Eric W. Biederman" , "Kees Cook" , "Peter Zijlstra (Intel)" , "Al Viro" , "Arnd Bergmann" , juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, "Steven Rostedt" , "Ben Segall" , mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, "Paolo Bonzini" , jpoimboe@kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, "the arch/x86 maintainers" , rjones@redhat.com, munsoner@bu.edu, tommyu@bu.edu, drepper@redhat.com, lwoodman@redhat.com, mboydmcse@gmail.com, okrieg@bu.edu, rmancuso@bu.edu Subject: Re: [RFC UKL 02/10] x86/boot: Load the PT_TLS segment for Unikernel configs Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Oct 3, 2022, at 3:21 PM, Ali Raza wrote: > The kernel normally skips loading this segment as it is not inlcuded in > standard builds. However, when linked with an application in the Unikernel > configuration the segment will be present. Load PT_TLS when configured as a > unikernel. > > Cc: Jonathan Corbet > Cc: Masahiro Yamada > Cc: Michal Marek > Cc: Nick Desaulniers > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: "H. Peter Anvin" > Cc: Andy Lutomirski > Cc: Eric Biederman > Cc: Kees Cook > Cc: Peter Zijlstra > Cc: Alexander Viro > Cc: Arnd Bergmann > Cc: Juri Lelli > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Cc: Steven Rostedt > Cc: Ben Segall > Cc: Mel Gorman > Cc: Daniel Bristot de Oliveira > Cc: Valentin Schneider > Cc: Paolo Bonzini > Cc: Josh Poimboeuf > > Signed-off-by: Ali Raza > --- > arch/x86/boot/compressed/misc.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c > index cf690d8712f4..0d07b5661c9c 100644 > --- a/arch/x86/boot/compressed/misc.c > +++ b/arch/x86/boot/compressed/misc.c > @@ -310,6 +310,9 @@ static void parse_elf(void *output) > phdr = &phdrs[i]; > > switch (phdr->p_type) { > +#ifdef CONFIG_UNIKERNEL_LINUX > + case PT_TLS: > +#endif Can you explain why exactly a Linux boot image would have a TLS segment? What does it do? > case PT_LOAD: > #ifdef CONFIG_X86_64 > if ((phdr->p_align % 0x200000) != 0) > -- > 2.21.3