Received: by 10.223.176.46 with SMTP id f43csp1043571wra; Sat, 20 Jan 2018 09:36:00 -0800 (PST) X-Google-Smtp-Source: AH8x226NEDOCWatQfesmt/dd22jEHRycarY6tYgsK0c21lx7ZzbolT6bw1ywOw3EWhhL02gf44qW X-Received: by 10.98.153.2 with SMTP id d2mr3111657pfe.44.1516469760076; Sat, 20 Jan 2018 09:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516469760; cv=none; d=google.com; s=arc-20160816; b=xsC4JzckOV7oyBbm6hnAl6njoR72/veCWnrF/xfgPkkmOTxkGFn55Eu92r/RuUDgY3 QrClHsV9bwmEBNUia56FRdoJLgtXn0j5RPo8UA5oiZN/0sBzEbSCPcgBGOTAgXd2o2DL x/pFQoQqSBSjLvhdDryyzFdo0sBpEVRqH7U2lnUH5eEDQiScM/3ImR9m6OD3hH3eY+tn PuVg4R+zLQqxhD8Yz80wYKudwSA4TrA03vMeRUZ/QV/MJD9FKm1t48cWDaGtDH1trtzw 2hHbrHKnIDzUkiMG9eJRv4GZAT9XtXDjw5zohmab8y4cRURhHEzMAAw/K+wsp6gC9thX bw6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=OFmldV1vdI6UZQZnH7dc4YQWspdkqF1T77ky5J5kuKI=; b=F0jnPtkDXsT7f2zcJuLfA1hmcPxDLOMhLGmOIzqZIcm71tgPMAz8JzncNBSI3LtThw GdlW5DpDyxWInTVdzFmhBSoPlv7p0+9dHd79NpUaNf1BtHYk7KFOjjbwk75UzuQfs/k6 M87H/QSEt/mN9RDSbNHF8B1+Rk3vMc1b1Up+Vn2pN16/QFaf/9O683Dr/40rlg8bkrIM z1LJ86zszK4sy0KWsECBOmLzwvfrT16QKGJoJNMrlRgdltZN55ZCywcVJujNgG+kijyp IXh6gkfg7bKGRmM+ayhfs61DBfa59jpjRqNqdS0lpuVSqf634/yst16Ezi1Ylateuy5k 7fxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=mlwZeJqJ; 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 k7si7045225pgq.759.2018.01.20.09.35.34; Sat, 20 Jan 2018 09:36:00 -0800 (PST) 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=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=mlwZeJqJ; 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 S1756499AbeATReZ (ORCPT + 99 others); Sat, 20 Jan 2018 12:34:25 -0500 Received: from mail-bn3nam01on0054.outbound.protection.outlook.com ([104.47.33.54]:25021 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754913AbeATReS (ORCPT ); Sat, 20 Jan 2018 12:34:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OFmldV1vdI6UZQZnH7dc4YQWspdkqF1T77ky5J5kuKI=; b=mlwZeJqJCfKM43g/FAMpodz+Cao9HHlZ2cd448Xc31QNcy4wAG5W8KIKtIVqbrdKfT4JANnY3ux1HiUN1SvtopbZdG0u1d5Y7F4KFTH6hoxc2Eh1jCCO877zJfSiGrfy8VJkmyopIcI3FRyN9trf4wn6tqK0JKQoUAhUErWl7os= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.65.116] (165.204.78.1) by CY4PR12MB1143.namprd12.prod.outlook.com (10.168.164.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Sat, 20 Jan 2018 17:34:15 +0000 Subject: Re: Boot regression with bacf6b499e11 ("x86/mm: Use a struct to reduce parameters for SME PGD mapping") on top of -rc8 To: Laura Abbott , Ingo Molnar Cc: Gabriel C , Borislav Petkov , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Brijesh Singh , X86 ML , Linux Kernel Mailing List References: <9fdddcb1-d122-7d52-9204-7066ada5ccba@redhat.com> <44505ab1-237b-88ea-1fb1-f80de9b3025a@redhat.com> <6277b77a-d4a0-5669-e5aa-7a850436227c@amd.com> <6b616ebc-1a8f-0bd7-68be-3674ff99500b@redhat.com> <20180120123338.buixvrhlxqo3ev5p@gmail.com> <20180120131308.bfm5cxxigw2xzgw2@gmail.com> From: Tom Lendacky Message-ID: Date: Sat, 20 Jan 2018 11:34:10 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR1201CA0019.namprd12.prod.outlook.com (10.174.238.29) To CY4PR12MB1143.namprd12.prod.outlook.com (10.168.164.135) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 96ae44c7-bd15-4775-f363-08d5602c0770 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:CY4PR12MB1143; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;3:lVXS3Q7MFpKaMnRIKpSs2NGAlNBvhV70h3seNKnaSPk9PmJF9O0BCL6Nj+uOK2eRnF9Mi/+bG12almRt/s+Va08kVNIwVmPo6zvDijmbeyRVZcjoGlj7D0DC3ml59G172glh7pAGJJlzxKLSPDkE4grfaNWW9OiGCC/E46ywZq9BbmU8XyOwUuX4mpc/ec8yP+V8ipEPIwzgsmeVHnIupcqguxSWho8TRzJRHO99ggJ+E0nsxTryau/uw9O3r4s0;25:j3sPY9334zyBi9cm3SYS5y9E2oTjeKqhma2qNY1/Sx7dkmjejoLK4P58k1wfJ/vy2wcCM/Jf5qadO1rcy8FJg6xqSWhMLoXXYu8nsiAZN5/CgQt8zdBryRjTKDv1Bl+c0TTpWc9QT1w10p6Wuhe3tGPbB7JlArNSffTh0+tq+/cX7RFoA5xcgkEGrEK5bwyhIiyGHXaCPw1ujg6f2HQjeJcAsK5pJeWvqFv8qDXu9i55jdGGdQary7qYTaAOKad0T2GwOXRf2dIiaAs95yCi3zE2GS1k8Vw3BUDxo+5Tz+ISbEA2TO8jxJTaVIAYum1tVAEm2utlaRMcgW5Vgz1nrQ==;31:Q7dIG4buswk2NCl2mLZUkjIwx52fgvrztwSSb3KPpcz+wyyUdTxyN1ZLIQS0BRQT8QgMQ5FvwL5VlPrcms2Dhi2FfM8WtM9vgiq9TMATOFFDmROpkIrN+vSDDlzDLYKUYLzUlcZ8y0E+lpPEXtLgpu77nP4mBih/87QROTCCRe2INW3pChsxgMTME5Cyd5gVTVv962BvG9yi0v7vjMus/MJN/Y2ruQzIeeIMlv2US8g= X-MS-TrafficTypeDiagnostic: CY4PR12MB1143: X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;20:2fSecBI/dVYXuEpympwYNnZ2IWZSoEsKyASadLZbVKl7pwk5rQkU5J68PYlS/c8YVb+MdG/CNyLfMLqqOTN5pPMKL3ypCmhU+D1SkaPiv21BV4B4Z4pow9XqDB6rX64h2zxPN6dfeBEBX1e0HPa8uJyAAJEC++N4AfIqkJCUJFns3e4Btv0Mtf+0dfBid01vT5bPsdy0ehzSt8jG72mKnxh4HIJ7viy1kAtgw6Pci/ydn68ZYZcTEDmjPTEBz76s6q1v0R/U/Yu8IZAgYzjPXMkgEQqMUq2Ibu3nH90nnRb6ZIOUG/H/Y6NWzmAGuySORQz+fh5NWBo1hmeZ/dndtnEO4wRAH+JBPlxhlV9ObNX9qx9lDE2jE2MpiGu/Sg+5baCYqv8KF3PutaDn1X943obJXu4moAxkvS4X6yfxQxQeUpU88ThN5w0fmY3zayYBCS7+zpkXt05IRJnuZNg/tgcVDYYTNQi0g7+ZBjvz4KRssRql3QmgXZROmqhxCYJm;4:mZDO1lGfMoG66JfZsxfITWeFvy50oECN+7NkcsJQtn5DK5bGOJd7mvJn1YlBxbw/r3vC22s651qhf84q56UQA7w0gMEXdfwMqIs17Z2Oi2L9//sXQgNGrE/hshCeBShjwe6mU6gDqlqdY1qPeGdess5HLg+yQGvBHVmdg2HJ0eYeIrWXdjea0j/aFXwUftuFBro+T7OrSGPLreSpLAMyV3llWKLWsakoLEq61ppZtz853A9yThSfTqWOPDC2ppKzgx8ymX32Kt9nbJFV8UXETg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231023)(2400081)(944501161)(6055026)(6041288)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:CY4PR12MB1143;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY4PR12MB1143; X-Forefront-PRVS: 0558D3C5AC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(366004)(376002)(39860400002)(396003)(346002)(39380400002)(199004)(189003)(5660300001)(97736004)(86362001)(31686004)(25786009)(65826007)(3260700006)(77096007)(110136005)(64126003)(47776003)(229853002)(65806001)(65956001)(386003)(8936002)(2906002)(53936002)(23676004)(26005)(90366009)(305945005)(16576012)(58126008)(16526018)(52146003)(66066001)(2486003)(54906003)(39060400002)(53546011)(6486002)(2870700001)(3846002)(36756003)(478600001)(68736007)(52116002)(31696002)(7736002)(81166006)(81156014)(2950100002)(93886005)(316002)(6246003)(83506002)(6666003)(6116002)(8676002)(50466002)(106356001)(105586002)(4326008)(76176011)(72206003)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1143;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQzOzIzOmpqYXpmUjV2QTVqTFROUHBVbVc1UHJnZEtR?= =?utf-8?B?cVI0S1dMNHNBS3dra0FBZXNtb2JXNWdHMzdkWWVROSsyOWE4NWExTk9INDlD?= =?utf-8?B?eDhNaUFncVh1c2xGdHVzdytSS0ZBeHZEWm5SOFEvSUlEK0lsZjZFd2VkQ1Ar?= =?utf-8?B?Y0tsaTliQ0UvaW9WNGxxUFZ2cm5sSHhPVXNaRVlVOXR3Uno5UXM2WlFKV2tk?= =?utf-8?B?UStJQW1vUmV0aXA4VmJxclpzOHZKS0ZReWlGb25KTWU3blpzTzY3dUI4am1D?= =?utf-8?B?WjFaOFppUXNydU9NdXRvTjMvc1Y0UTBrY1RpM0FVV2t6aU1yQzNCMTlNZTkz?= =?utf-8?B?S2xmTVZtTm1kQWtYcTFGUWtNT1J6R1RKTnhmcFZjYnRMYTY3V3lqem5kZ1pp?= =?utf-8?B?U1ZWYjA5eXp1U0twTkVvazErdC9HRC9hRVVjTTN5V2ZncmJ4c01Ib0tNRlZL?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6m1ArfpUMaX0bWo1X9mWb6lIj1lQHz6cJ5/14mLou+iwcSTogZsi4VEFA4PokQROUQf5ymVAABrQcauWoAXNhXBViEw1X7C2Gau9KsAQZJzRDjxMfkK4vt+ZmPykvAaAdX55TiY51+oW14WHB7mEHcGHIpnpGiflj5cH65mx/w=;5:cX908hcWdbUfI2RfC4pb2nw+xb7rgQG1qH8Pk7IwLRHfVTmW6HlkyDrldWhfzhWSNYo3yKNEMWimiYWG4JFr7JWWeUJGA0NesoiPQu/gZNreByYsO8k2GEkP/LzByly+1xrMdpwd/yzs2/aDdo4santA6g+P3UiAfS/kBrFCJ5I=;24:qrncYQA8pplnWkDgGwJ5mkVqRC2rsu77A9cAFk1OgPZG/7qfi21EXgwK3S1LZfK298JwDxQ07EcBypAvcvCileavx3KkZAYJQCR3zesZ/m8=;7:B6Dos8K2vFfswJv9ML9g7WlIv+qPG7+fjE5huzT9FO6uDh5XPFAuwJmf0FPwwH+n/fgyWavvJmXBq6pkcRMynLqgnczI/XVdpn/0k1lhMEttRV3P8APzPfESyddaOHNontmzRWZYXDdkCOEkW36Q3hXAN2UTOE3S2NOnB9j/C6BYooO7JAv7trCrBrnp2IDsHrW7r3uxV7QKyGEFkdBPFSOw6va0eHpISTG00dPTwe1J3a3njjcW2Le8pKHFm68h SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;20:dBCq88pwdpXegel0h+yQWicSs8bidM7WHMH8/y+iWBMJnRVOrJM/XVGctKptVf2gnu8YbEhD6xcHMPuIQCuUpCHgd4BThceyHNh+5Gc3pb2OknHs5Im3RKGOQ8AeTR0gN7mp394AF3RH9cswDZeZk4rYppn28wrqLMxOtNIzwdpdffwVRdEoUn1hin3+UYhC6YMZZiIlgX8OJ3LW4al0heTXsN+eP/tJ8OqhpxgsQJGnxUp6Sz9SZjhPyPZNsLgL X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2018 17:34:15.0119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96ae44c7-bd15-4775-f363-08d5602c0770 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1143 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/20/2018 10:52 AM, Laura Abbott wrote: > On 01/20/2018 05:13 AM, Ingo Molnar wrote: >> >> * Ingo Molnar wrote: >> >>> 2) >>> >>> using global variables, which is unsafe in early code if the kernel is >>> relocatable. >>> >>> The bisected to commit uses a new sme_populate_pgd_data to collect >>> variables that >>> were already on the stack, which should be position independent and safe. >>> >>> But the other commits use sme_active(), which does: >>> >>> bool sme_active(void) >>> { >>>          return sme_me_mask && !sev_enabled; >>> } >>> EXPORT_SYMBOL(sme_active); >>> >>> And that looks PIC-unsafe to me, as both are globals: >>> >>> u64 sme_me_mask __section(.data) = 0; >>> EXPORT_SYMBOL(sme_me_mask); >>> >>> Does the code start working if you force sme_active() to 0 while >>> keeping the >>> function call, i.e. something like the hack below? >> >> BTW., this aspect of the boot code is really fragile, and depending on >> compiler >> there could be unsafe relocations generated without it being 'obvious' >> from the >> patch itself. It's also pretty compiler and code layout dependent ... >> >> A good way to check this I think would be to turn off >> CONFIG_RELOCATABLE=y in the >> .config - does that make the kernel boot again? >> >> If that makes a difference then we need to take a look at the >> relocations in the >> two key files, with CONFIG_RELOCATABLE=y turned back on: >> >>    objdump -r arch/x86/kernel/head64.o >>    objdump -r arch/x86/mm/mem_encrypt.o >> >> There's three types of relocations that should be there normally: >> >> #define R_X86_64_64             1       /* Direct 64 bit  */ >> #define R_X86_64_PC32           2       /* PC relative 32 bit signed */ >> #define R_X86_64_32S            11      /* Direct 32 bit sign extended */ >> >> Only R_X86_64_PC32 is safe as-is, R_X86_64_32S needs to be used via >> fixup_pointer(). >> >> What makes this difficult in the SME context is that the early boot >> portion of >> arch/x86/mm/mem_encrypt.c is not separated out, but mixed in with later >> code. >> >> I missed this aspect when reviewing and merging this code :-( >> >> Maybe a diff of the list of relocations of the before/after commit >> points would be >> nice. >> >> I.e. does something like: >> >>    git checkout >>    objdump -r arch/x86/mm/mem_encrypt.o  | grep R_X86 | cut -d' ' -f2- > >> working.relocs >> >>    git checkout >>    objdump -r arch/x86/mm/mem_encrypt.o  | grep R_X86 | cut -d' ' -f2- > >> broken.relocs >> >>    diff -up working.relocs broken.relocs >> >> show any changes to the relocations? >> >> Side note: >> >> Regardless of whether it's the root cause for this regression we >> definitely need >> to improve the relocations robustness of early boot code: at minimum we >> should >> isolate all critical functionality into a separate section, and then add >> tooling >> checks to make sure all relocations are safe. >> >> Thanks, >> >>     Ingo >> > > For the previous question, changing it to sme_active _does_ make the > kernel work. Unfortunately, I can't test without relocations since > I need to boot with CONFIG_EFI_STUB, but the relocations did show > something interesting: > > +R_X86_64_PC32     __stack_chk_fail-0x0000000000000004 > > There's a new call to __stack_chk_fail and if I dump the end of > sme_encrypt_kernel I do see that stuck in there. I bet the size > of struct sme_populate_pgd_data is now large enough to trigger > a stack check. If I add __nostackprotector to sme_encrypt_kernel > like sme_enable has, it boots fine. This would explain why that > particular commit showed as the problem in bisection. Great find Laura. It must have something to do with compiler levels since my level didn't insert that check. Thanks, Tom > > Thanks, > Laura