Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5625689iog; Thu, 23 Jun 2022 01:55:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tgTDBk/MT7xKgh2T3ncBsmuxjgYMobxioDjOWdZGGiE8ouuXnjurVDFuy6cyDmDEAQpd5Z X-Received: by 2002:a05:6402:42d3:b0:435:2c49:313d with SMTP id i19-20020a05640242d300b004352c49313dmr9283020edc.86.1655974509585; Thu, 23 Jun 2022 01:55:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655974509; cv=pass; d=google.com; s=arc-20160816; b=Lyf0Tk2Q0fvrqs+lEdz10PppTVzjfx2Z4Y5HKAmDxqX8iWSVabiw+1cahFJfNceqCM klpDul62VCuQgXSUe6B6Rt/blNjAREAXw5EOHW5SxQX1RtL2pxbp7RcQtLKHr/gXV2vb rmIT1lZ2xUD+8zD6JMhJ2vknLh/0sLceybKr2b4ZMQoC6xyt4VKcfxlaSJybFVGzzuXL WVN5L4f79Y2bWxeHZwiW3CWkPer06QWY/svODX9uaIJxf4DgjKwKK2Ng3DeB8vxPKh1i TIFYXTeCj91prjQ0ZA88B3MXv9R4pJ/KNdahTGtI9S1TOBWyNYBDy/SLsE1YMksZCdMC vGew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=tJntYUc7/9EMUW5ebl5CjETPcg+UXjq6Lx4oGSxkdEw=; b=zqUvnR/o12KLBtFI/gwsORTjmBivlNlXBo77uSC8dev8nT2gohcbGO1OM11wJEls40 p7Fuy+WoGQeqEnmsTbD1Jc9WHUHvA1Op2NS3aQ3VH5uvqlxOaU4zCCQz2eCSVb5r2EXw OSNa/Wk5KNp3vapu+Q8y80/QP+4riuo/ztdcordb5l58NLx4Om2oF8cNrEXqBNtP40/R RHPr6BDih9Ikt0FxcPnOdVlpbl1NR+zXLWLO9wIBJjP2HeIKlOVQcP8Ig/UJw3NhXcBu XElZdJhhjEe7iyMsyQT6AN2hYfMOJDR8orwX5X8vI1Wp66vR9viChTZKxhxTjDuobzOL bh0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=VFb+Jehf; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz30-20020a1709077d9e00b007123ba1f12asi3092505ejc.552.2022.06.23.01.54.41; Thu, 23 Jun 2022 01:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=VFb+Jehf; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbiFWIu0 (ORCPT + 99 others); Thu, 23 Jun 2022 04:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiFWIuX (ORCPT ); Thu, 23 Jun 2022 04:50:23 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60077.outbound.protection.outlook.com [40.107.6.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71A0F49265 for ; Thu, 23 Jun 2022 01:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f7+wIYL73JutarJJhDTigzhedtuJVKfCooNHDPP1cUcWSNR35bta/YolXXYmNkZDx9WaWuGZ9fgrnFZgB5/9MnWjnqzxr/WT2EWso/CVSczIZ6NDOskyyo1mjXTj3GJaq8kT9kr9wz8HUfCliW+ia34fZiMqdGetVULAE0WkFCtRadze6jBdcBWO1BnkTyvt+fwczFDaP064R1vIgJTN4BrA0alRC9VVFXUJeACy5b2qv4Y9wkGRxEOkdKDijQn/WpWH7wofIxkFiWEcpRZoPTh1O72kwIP6/E/mqNUOZMJux0QvUHj3e9VmScxrjL8JFY7mSXAx9JV65IoNsC188g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tJntYUc7/9EMUW5ebl5CjETPcg+UXjq6Lx4oGSxkdEw=; b=YpEYbv13R/CphFyBtNDy87sGfkyqDitCdRxSwT2jqG509m7Temk/gCvm4b+lJqRRj/7XbVfdOW3h1pcT/KDaY7ofdMtWgP+gzvQ27awnp8eLe3vU/DYY3iXcPWvXlY0P+rE1W27G96zU4Smv3ZhWQknapwgBsfuCLl9BKP8ablHdDTE58cJ1+LVQcuyGYOhAM9IikkvsE+nIQ/fXN7t1lZ35BhgikeKfZvto5DdZY4l+RzH+7ir/GGsgKK2XkogGtu3tQxFQce4vnNslWMTU0/rGmzfqGh60YC9X2e5CQ3gR9sv2sPUDOMsbwCLQhXTy2RE4qlXfRtbHjteze1/pPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tJntYUc7/9EMUW5ebl5CjETPcg+UXjq6Lx4oGSxkdEw=; b=VFb+Jehfd0DgU17a40xjZbvMl8Jry0nVvXIfWNZ9JQP4I/WhYkq39ssONfOBErK9eHv+FFOofA7yTRw+UnSlN7G1rFEOeosIh7ENYeQ49pLVKpq8FccU9ECUxvDCkp4gDEO35lOOj/r5GQ8W1r97Bwhtt4+WaXT4jYVLs14fv9K3IrRQXKAZqUoZjn8Oz1fbEhKnEocB8LPskJu7u5jsXG1BJaBlclS4v9WhT2BJGkU+61aAjNQFlqV4gnw9vcPUTJUcM5ZvXvE85ehRSUTSpqSHB6lyDsvzwwv/ViYgOAmumkX0z4i2OkdxRx7hhWvEIU2Xd7L1yyCeXBIjCZfaSQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PAXPR04MB8861.eurprd04.prod.outlook.com (2603:10a6:102:20c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.16; Thu, 23 Jun 2022 08:50:19 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::dfa:a64a:432f:e26b]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::dfa:a64a:432f:e26b%7]) with mapi id 15.20.5353.022; Thu, 23 Jun 2022 08:50:19 +0000 Message-ID: Date: Thu, 23 Jun 2022 10:50:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 2/2] x86: fix setup of brk area Content-Language: en-US To: Juergen Gross Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org References: <20220622161048.4483-1-jgross@suse.com> <20220622161048.4483-3-jgross@suse.com> <594866df-ef56-055f-c13c-64fac5797164@suse.com> From: Jan Beulich In-Reply-To: <594866df-ef56-055f-c13c-64fac5797164@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM6PR08CA0038.eurprd08.prod.outlook.com (2603:10a6:20b:c0::26) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2eb37b4-4247-4f80-dd23-08da54f56699 X-MS-TrafficTypeDiagnostic: PAXPR04MB8861:EE_ X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WjTJUnsRuEjzKxndfdmS3/amHNqxXsmN7bNcStQZ9EMHLhyV1UnP+XZfDISXPQ1efI8IsMah5B5fNAv38axhEJ+RlZnP264f+bZte9+K8D76YdsfEW+zsrEer/o/9qpi3pAmp6Vxe2tQb/BvlD1Z8AabTJddgzSx4n5DD+HtPkjKZ14RWBFCXu6kJmbNRvGURwKTKrTB3JgMqxRESmGrpAEftkcK7oIwbh6oEC+KdXtN2/1zbKPQEJLctp37YlLh1nnj7MpVCYeqY84rxhAJr0nzU5PbsrsmsAr1W8vLZT1IQSrCPhlIA+a5M5L0Ajz/pB7XOFtE0nAbB5SMvJTFw/rqNfU4uDUzUGWx78i3M+/QZ4IXb+j6oiUb5pYVXHMvIjnAnPi2TUdYE05fU02EMkD+hJO13hg521reJ1CF3BfrcgEADyMFjomQ9yp4aVHiWB7cjAC76q+lknAyp22fYRf2gGaO/pBq1ZKTy50C7nDkkcSKgXM6TxakjWFq37M6k+D8UK9uHEGQ5A6wP2t05M00qHx2kySt4c4Cw7F4UFHPyhFAy0bIlPyNsIhAXFmzqUsB9p3ttrKYCOKbrOA/lswQH5PWqC1QjsqP1mYaH8Cu2YhZsV4+008nmr9xIE3rSEP4nGy4Uch6g7+lfYSpJ59AhEmjw91X2EpuTyPNSDo+NyxZO959H+IQ5GOhMEFP7/hLyQPhv1CuPzLrB/sufeGWPE20XWtArvqWtZpr/9jmDqm6InLoe++mN+bsbuatvOZgofShe1PlRmFg+0w1iMUkJaOjfEywM0ysBzxgiIU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(396003)(136003)(346002)(376002)(39860400002)(6486002)(66946007)(2906002)(478600001)(41300700001)(4326008)(66476007)(54906003)(6636002)(86362001)(8676002)(36756003)(66556008)(31696002)(31686004)(53546011)(6506007)(26005)(6512007)(316002)(38100700002)(83380400001)(2616005)(186003)(37006003)(5660300002)(8936002)(6862004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b0ErbXByNmJ3ZjFoMktlVTI1MGpwRXBvSlI5cXZIbUxzRllZZWJsVVZxM0Vs?= =?utf-8?B?OE1tWmhSa3FZS1lNTVZ6TWt2WjdBVUlHUHBlN2kzbFQ1ZTdQVDFHL3MzU2Rx?= =?utf-8?B?NEFpYXIrVzBNN05xVDg4d01sR0VxaDV3aSszcXBpMWs2S0lCY3NqYVBXNWVu?= =?utf-8?B?ZXlZQzBiam95V0V5UnZvUEwza2F5M09jNHVrMkp6Q0EyUXNhZDlDVTk4a3Aw?= =?ut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mx2ODhJZE0ybkVPazdaSXNMWkVxbHRn?= =?utf-8?B?WG5uU05xSTF5LzRyZjhFK1ZIeHBVa1NzcGhCb29TUHIwWTFjTmROVXJzOEEr?= =?utf-8?Q?O39ntoBPMV33DECEdJKT9MW3x?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2eb37b4-4247-4f80-dd23-08da54f56699 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2022 08:50:19.3145 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l0rXk9th8nDlKt2bRpgHLp5uv4UYmfM9CGwe2dWxjsY+hOG8lY6NN7f2REBcC26MFdLrfNyxOSRN1tQ3uGFPwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8861 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 23.06.2022 10:14, Juergen Gross wrote: > On 23.06.22 10:09, Jan Beulich wrote: >> On 22.06.2022 18:10, Juergen Gross wrote: >>> Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils") >>> put the brk area into the .bss segment, causing it not to be cleared >>> initially. >> >> This reads contradictively: If the area was put in .bss, it would be >> cleared. Thing is it is put in .bss..brk in the object files, while >> the linker script puts it in .brk (i.e. outside of .bss). > > Hmm, yes, this should be reworded. > >> >>> As the brk area is used to allocate early page tables, these >>> might contain garbage in not explicitly written entries. >> >> I'm surprised this lack of zero-initialization didn't cause any issue >> outside of PV Xen. Unless of course there never was the intention for >> users of the facility to assume blank pages coming from there, in >> which case Xen's use for early page tables would have been wrong (in >> not explicitly zeroing the space first). > > Fun fact: Its not Xen's use for early page tables, but the kernel's > init code. It is used for bare metal, too. > > The use case for initial page tables is the problematic one. Only the > needed page table entries are written by the kernel, so the other ones > keep their initial garbage values. As normally no uninitialized entries > are ever referenced, this will have no real impact. Are you sure there couldn't surface user-mode accessible page table entries pointing at random pages? Jan