Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3139508rdg; Tue, 17 Oct 2023 06:02:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6O9vWQYzBViX/IiJh3/suBZB3Iu3fIT4VtVbdHhhg4z+y26VA1ocC8VobqhQ0tZB1P8uX X-Received: by 2002:a17:903:41cd:b0:1ca:9507:52 with SMTP id u13-20020a17090341cd00b001ca95070052mr2385024ple.67.1697547757840; Tue, 17 Oct 2023 06:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697547757; cv=none; d=google.com; s=arc-20160816; b=r6DmssTbFqJ/Jfen0aftzmKHLwxIaSIUux06+zl1kwWWxzIZkcQDWkbKs9oUWQHjAy hYv3JH98zSVJJa4NbKYHQCgUvkUTmn9N7z/B4QDgzuXqFM4bFbBLziQKC5bIp5LGwyGC y+XBM4sXYFLoOt4pXcqwefDWzINd7dfRTMNpo+yi8wBO5NpXVJwvYA/fcPsjY97rlL8d 8xOeu/dUDDqkAwfuyMbHyFll26sQ6P/Ttqk3J1DqWz9pcoqamfn4F2G2sTZ2Q4LpddrY sqUtWr1L5hvm/iRyrEZx3A15+vS5b5F8uFl/sHOvsUXrLjFp1VasXv2KR6b3HkrVUiSJ 90rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Yye5FSkZ9L4YYqu9GCTL6x1WAdc6AFySQq6k6hTPYC0=; fh=Ma8dV3NztQYedEH7r1m8chDMLEZ4YwjccYvHgoPIU2k=; b=QDfkgDa/YBJYDLmt3A6p/UsVYt9ytcQ7VrFAama/5F7lbbzde0LncQtF5NSrg1shVj ePVsTy4OwPp8cd1bnhoRv1+weO/aMN5/ybHV9PKxm1n9zCR61ivC1jE7GxC1M2Uvx4Fr 9acqvN+q+5X3r9/D0Wgbsy3ywmjpfxYnM2fVef5KEnyhYJALpWZBzvgp/4Gh/ZTtq5Kz HifgV7VkFGh31zpAXeRFKlfOi1kbkJlmeRJfSufNA93OU36VtOooT7ZVAU7dgUIAT/0f JpFpqoOWtVstHi2F4hrXyYjo7jHJkRqep6yX8Kjs6bWP1bnLU6amxGjp96ojmmTgYtPv 6tng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IpevMTN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kx14-20020a170902f94e00b001c9ff840285si1657788plb.414.2023.10.17.06.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IpevMTN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0278C80A73D1; Tue, 17 Oct 2023 06:02:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343610AbjJQNCf (ORCPT + 99 others); Tue, 17 Oct 2023 09:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234868AbjJQNCe (ORCPT ); Tue, 17 Oct 2023 09:02:34 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3115BDB for ; Tue, 17 Oct 2023 06:02:32 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9c2a0725825so389876666b.2 for ; Tue, 17 Oct 2023 06:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697547750; x=1698152550; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=Yye5FSkZ9L4YYqu9GCTL6x1WAdc6AFySQq6k6hTPYC0=; b=IpevMTN+Ol0RpIYKL8T/0PQI+c5U2+a0Td/gDxW4XW2jAsz44YosSibYkSjAolpiOG f1qmfaB4crSAj7JSTZkrwLatvI0gct67g3guLYc9S0Tm7qM6k3ND7XA1JFq+v8NLGYQV dce57BYOELPeW4AhreJ199UP1Qxi+dGzX03xOA2xtBpqR7VcnCIgLaLxIRuvu+ti8+GU Hw0gN3tNOjpE/4eTE4fgsG7DCY+7iDK3D+IQx08mOPV1PEvCVnz4/QT9dzI0Bl7L/aiQ hD/tVnEPYA4C0j87lVtpUSADETVT2U2paHkHWNf9fIJzB/ytXI2tvbMchZGcvJKxRPjU 5a9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697547750; x=1698152550; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yye5FSkZ9L4YYqu9GCTL6x1WAdc6AFySQq6k6hTPYC0=; b=f2uBPHiap0m4FTdbIEpCb4Y3gFACNo4scARY3NDqtsNPT1PJ15JhaML7ta1deBsUA5 0t5pKg3TpaEBLyxHu34AqtI+NH353P9y2nO0AEB1V3oqDLjXDFnMtCQkfB/yKiogsyU7 T4K5IpiPw8DQf7zHvkvFDV1eZCdDkX87rLXsxfogr5SwBVblnYiARt0SRljMOb90LuCR STmuv9lYWPO2jZscoNPc+1hpTUA9tFcnpcXxH3o2WozXebExRy9Fh51nQ6vYogYWcaDk XHxFwPFaM+d7y/8pbxkCMS7xCJwI5LZWk6/BmsVbEkIhxj8nuhEdy98LEpoKEuh678F4 VTSw== X-Gm-Message-State: AOJu0Yygh5QupV8w0nZISBGNlTxNL4HJScoy9B/j0a3M5J/+bzv4xfuR urrhZMYJMc6+JcZB+AlyEIw= X-Received: by 2002:a17:907:928b:b0:9be:54a9:9b4e with SMTP id bw11-20020a170907928b00b009be54a99b4emr1787819ejc.29.1697547750430; Tue, 17 Oct 2023 06:02:30 -0700 (PDT) Received: from gmail.com (1F2EF7B2.nat.pool.telekom.hu. [31.46.247.178]) by smtp.gmail.com with ESMTPSA id qx1-20020a170906fcc100b009c387ff67bdsm1237916ejb.22.2023.10.17.06.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:02:29 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 17 Oct 2023 15:02:27 +0200 From: Ingo Molnar To: Hou Wenlong Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , "H. Peter Anvin" , Josh Poimboeuf , Anshuman Khandual , Mike Rapoport , Pasha Tatashin Subject: Re: [PATCH RFC 1/7] x86/head/64: Mark startup_gdt and startup_gdt_descr as __initdata Message-ID: References: <20231017072311.GA46993@k08j02272.eu95sqa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231017072311.GA46993@k08j02272.eu95sqa> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 06:02:37 -0700 (PDT) * Hou Wenlong wrote: > Hi Ingo, > > I have sent patch #6 separately for x86. Do you have any ideas about > building the head code as PIE? Should I resend the patchset for the PIE > feature? So I had a brief look, and despite reading 0/43 it was unclear to me what the precise advantages of building as PIE are. Ie. could you please outline: - *Exactly* how much PIE based KASLR randomization would gain us in terms of randomization granularity and effective number of randomization bits, compared to the current status quo? - How is code generation changed at the instruction level - how does kernel size change and what are the micro-advantages/disadvantages? - Are there any other advantages/motivation than improving KASLR? Ie. before asking us to apply ~50 patches and add a whole new build mode and the maintainance overhead to support it into infinity and beyond, could you please offer a better list of pros and cons? Thanks, Ingo