Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1067782imm; Tue, 15 May 2018 13:20:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoDylv/E8zaHPU8uF8G6A5rJm7vNiU3UpgfXI0Ld3JhjZEPkfXx2pB0qdu75siVIZ0+3bjy X-Received: by 2002:a65:66d4:: with SMTP id c20-v6mr12832994pgw.402.1526415602565; Tue, 15 May 2018 13:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526415602; cv=none; d=google.com; s=arc-20160816; b=wqMzU8e0kukmwX9fN1HLbKdwgzY7v/KVFsjhy6TQhc9xGZ3TzqvC95qmAsr8cbJcRr 8a6PRitSrPr+DPCVA40wnuMCD+6D4vCDBePx7M5B9Z9Y14BHGbNhm96DYUcWSnwhskhC TATcF18F+jntIofHQWQX9eoywwsmhdtNy/B7GyzxHjMalIfDQ2xgAkjVQS6/IGfbCKs6 AJO58yoHOKnBQyMA0zWyjy0RDiyA1TFfu9vVU2px2sdVQVQwo3v24TdXKV2/+OCWoxGW Crlye80e7T5y6bLiJBFeUyG8utHC9Ispbf7SsWAJ4WpFP2UJCsfOvroL6wBP9h1X/1Km UFGA== 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:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=hezr49VH01WB41cWMSaNANnm0GXOqIN2j/drA1n87lc=; b=bAFLA3FwFdbPKwFpLhEOb1n5soQNMC5HvzlCnrN9nA0p6ifMYWl1jE2eLYR2HuLIRt Ro3FM5sO6f7f3Er5JoSxtZ3uFU8yM5mAoNlDyFaylo9A8yw2Upjr/hufqn5uwRPDghoT OvUvlS/c7gpS9dvFaGCo+r/ZpdHmWweOW+vq7twqEoZ3DUuB0EScXlRCTkHHvRLHxVXy vvbBMwGkAUy+pdSdkhY4vmTNkHrtSniO42XQKnMLeV+epb4jXSBJzVWuNYN3dFd9rbIu YIwAZu3RR4BzkAZ6qnv7Pb0/BqSWkPF2oH3xCYlaNB0nXYVC7iw3mwchPIl0j/XUtYTE 6gVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=ThtFO8Tg; 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 b16-v6si794860pfd.240.2018.05.15.13.19.47; Tue, 15 May 2018 13:20:02 -0700 (PDT) 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=ThtFO8Tg; 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 S1752537AbeEOUTM (ORCPT + 99 others); Tue, 15 May 2018 16:19:12 -0400 Received: from mail-sn1nam01on0082.outbound.protection.outlook.com ([104.47.32.82]:1049 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751149AbeEOUTJ (ORCPT ); Tue, 15 May 2018 16:19:09 -0400 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:X-MS-Exchange-SenderADCheck; bh=hezr49VH01WB41cWMSaNANnm0GXOqIN2j/drA1n87lc=; b=ThtFO8TguvdDhOKI4kAdm5Lj2NEEONkTHCyCMxMt2UkQwRZS9WVROD2xy5CiBBaUNgqFlgqjLUbMFEAbU6M6+wNIYWwqU3w5vIcmGR1fpLU/Y0MO9T5Kj2Km6UohL6zsMpOKBOd+ce6wBF746dXGWjwBhn/Op3yNB5V4dHZ140g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.64.67] (165.204.78.1) by DM2PR12MB0169.namprd12.prod.outlook.com (2a01:111:e400:50ce::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 15 May 2018 20:19:03 +0000 Subject: Re: [PATCH 2/2] support kdump when AMD secure memory encryption is active To: Lianbo Jiang , linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, dyoung@redhat.com References: <20180515015133.4363-1-lijiang@redhat.com> <20180515015133.4363-3-lijiang@redhat.com> From: Tom Lendacky Openpgp: preference=signencrypt Autocrypt: addr=thomas.lendacky@amd.com; prefer-encrypt=mutual; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH98EmVJsADuq0RBcIEkojnme4wVDoFt1EG93YOnqMuif76YGEl3iv9tYcESEeL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It76L1basrRMY7urJm8 4VM6MeG2mfa92FfrMeL0pnD5ONg1FIuleGlvvKdQdFnE4AlwGcKid5GUD+vNNj/pbZyUpe4r zBFsc21/8jXSlR6zJS4mgkNDIIBGiPny3tvKINMZ8VK00mR6INpd+NErd2LxwZ/DQ5ejVyVL 080CbiD55mxxhqkbd5fHSfdhvvXIIYN+nM/RFLwaQGW9g62iFWlqeNRXezkERDV5ahFqZMP4 YDdodn0nRVZYu2kaXfOclKPcH58HlrRb8pKTE3t/TNKGY3SmKoznH0QtM27TWeZ9R9RgTYiV zSNqP+QUNp6BotWI Message-ID: <96b6d169-de5c-7ca8-df87-3d316526733a@amd.com> Date: Tue, 15 May 2018 15:18:52 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180515015133.4363-3-lijiang@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0701CA0019.namprd07.prod.outlook.com (2603:10b6:803:28::29) To DM2PR12MB0169.namprd12.prod.outlook.com (2a01:111:e400:50ce::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020);SRVR:DM2PR12MB0169; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0169;3:1vAW9TYpqjYxsDm/X4YYVwLPwq4+DE3U3U6VOvMibiYwH49Zj9UYpJ71h56ijQbZMA1kgi3uaNib+4sLU1lLwSiyKZO3wp7i7SRKo5vpcxUtAbxlk2rmPqky59cDwIPLzSq10BASoooVZxT4TdkspYuPExn/O06XDxrEYmyPQTiCisk5C1wDxXdMJOvK5V1cpi8AS0uoDp6CRm1sCGVKurgc8rwNreN0iss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LWX0QSQTTEjxpImgCbYDYxUqiGCCONXOBPjp4u0dk5Ne/7SVu9OJ8yYzJWAH4zme7z3vE5/ftJIpneh7Mw0tORfIpHYeagMssF0lhoYVeZ05qyQw5ZQ+IXCGXcrMR5vv0pw;4:NUvPWxHSxUrgiyMOINgBf9WjkhVCaLSGeWobGzOHbx2CF9g4q7ARSJQTPt8DOFcrFlyqny7NRHYxYLDi1xyky2urFGVc+h5R8gG7JlnpsEniWIm/2oqcu58IPbNDiz4PXRLlKi7iet+eL2luOYvf850VTk7ccz6vXhm53D6/Bjf0VuecrVgnuXFJxKIkwlP4iAAqp3F5G/luloQo99605cpvEFNt7OrFL+OKOgUsQVn7DQtxn1KhG84fxFPUq4AdM9NhvesHPO1MLSCUOoArXmtmF3OLUkhllIm9bpCAdLSllGp6XrgYn9CRDsaz8CguIetmBZ0JJuQ7xK8hLjqvWQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM2PR12MB0169;BCL:0;PCL:0;RULEID:;SRVR:DM2PR12MB0169; X-Forefront-PRVS: 0673F5BE31 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(366004)(376002)(346002)(39380400002)(396003)(39860400002)(199004)(54094003)(189003)(3846002)(575784001)(86362001)(65826007)(6116002)(105586002)(76176011)(81156014)(7736002)(230700001)(31696002)(97736004)(8676002)(106356001)(52146003)(2486003)(23676004)(64126003)(6666003)(50466002)(486006)(52116002)(2906002)(5660300001)(305945005)(81166006)(8936002)(59450400001)(31686004)(6246003)(2616005)(956004)(53936002)(476003)(4326008)(446003)(68736007)(6486002)(386003)(316002)(58126008)(229853002)(11346002)(53546011)(16576012)(186003)(77096007)(16526019)(25786009)(3260700006)(26005)(47776003)(65806001)(65956001)(66066001)(72206003)(36756003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR12MB0169;H:[10.236.64.67];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTJQUjEyTUIwMTY5OzIzOlNiZ3Ewc3ZTQlpzWm0rSzg0MVZUZkFkNlBN?= =?utf-8?B?VWduYnZjRVpHQkVJb3BJWDVBOGp4cldvTEVDTjdFcS9NNW1pTkkxU1NtdVNR?= =?utf-8?B?UWIxQy9qK0tPdUxIZjlnMFVEeElmOHRLSm5GRzJteDREZzBNRjJDUTFJUWYr?= =?utf-8?B?R05DdWpXeFZEMWhUeC9VVWhDdVNZOCtZYVhtb2hFWXgzLzJXR05aK1dabVpn?= =?utf-8?B?c2VUMHBWS1VjaHN3Ri82K1BSUDU1c1lhbTdIaDNucjhLQ05HTklPQUtSbndw?= =?utf-8?B?NWhkZnNTcWUrOWxGQ1JSUTcxd2NHbWJwZTVoNm9iTmVuWFRlKzZjOTRXOGVo?= =?utf-8?B?UFdadS9sREw1d0lRZldhbzdoS3d5akc1ZUVoYVBtdEpHYlFTZnFSVUtiSzJj?= =?utf-8?B?RDdMZmNvbXBNY0xBbk5nUGIxNmY3UiswYzUwUzRRNTRoVmdpc0E0NUVoM0Nw?= =?utf-8?B?NnhKSG1aeURUV1BJMnRlVmV6QlcyejN3eDRhNE5NZjk5KzdKQWJKZWxTdjZO?= =?utf-8?B?TjVLakZ2ekdZV0hzZnJyMkhkM0R4SXUrcHMvTEdPdEtOTmZCYUo3b1N0TzUr?= =?utf-8?B?aFZla1hhNWZJVGFZTGYvNmliM1k4azRiUFZDNXEzLyszT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nk0n8bZGM2HfU8lTB0ZUg8mi/G5atO2p1rEtCwO2gz+38kU+VEgTeoRV7RqmZgrZ8AfI+Wne72qQj4kz9svOK+tpU2gfKC X-MS-Office365-Filtering-Correlation-Id: c9bc7612-2c3b-4107-a916-08d5baa11aa4 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2018 20:19:03.8699 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9bc7612-2c3b-4107-a916-08d5baa11aa4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0169 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/14/2018 8:51 PM, Lianbo Jiang wrote: > When sme enabled on AMD server, we also need to support kdump. Because > the memory is encrypted in the first kernel, we will remap the old memory > encrypted to the second kernel(crash kernel), and sme is also enabled in > the second kernel, otherwise the old memory encrypted can not be decrypted. > Because simply changing the value of a C-bit on a page will not > automatically encrypt the existing contents of a page, and any data in the > page prior to the C-bit modification will become unintelligible. A page of > memory that is marked encrypted will be automatically decrypted when read > from DRAM and will be automatically encrypted when written to DRAM. > > For the kdump, it is necessary to distinguish whether the memory is > encrypted. Furthermore, we should also know which part of the memory is > encrypted or decrypted. We will appropriately remap the memory according > to the specific situation in order to tell cpu how to deal with the data( > encrypted or unencrypted). For example, when sme enabled, if the old memory > is encrypted, we will remap the old memory in encrypted way, which will > automatically decrypt the old memory encrypted when we read those data from > the remapping address. > > ---------------------------------------------- > | first-kernel | second-kernel | kdump support | > | (mem_encrypt=on|off) | (yes|no) | > |--------------+---------------+---------------| > | on | on | yes | > | off | off | yes | > | on | off | no | > | off | on | no | > |______________|_______________|_______________| > > Signed-off-by: Lianbo Jiang > --- > arch/x86/include/asm/dmi.h | 14 +++++++++++++- > arch/x86/kernel/acpi/boot.c | 8 ++++++++ > arch/x86/kernel/crash_dump_64.c | 27 +++++++++++++++++++++++++++ > drivers/acpi/tables.c | 14 +++++++++++++- > drivers/iommu/amd_iommu_init.c | 9 ++++++++- > fs/proc/vmcore.c | 36 +++++++++++++++++++++++++++++++----- > include/linux/crash_dump.h | 4 ++++ > kernel/kexec_core.c | 12 ++++++++++++ > 8 files changed, 116 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h > index 0ab2ab2..a5663b4 100644 > --- a/arch/x86/include/asm/dmi.h > +++ b/arch/x86/include/asm/dmi.h > @@ -7,6 +7,10 @@ > > #include > #include > +#ifdef CONFIG_AMD_MEM_ENCRYPT I don't think you need all of the #ifdef stuff throughout this patch. Everything should work just fine without it. > +#include > +#include > +#endif > > static __always_inline __init void *dmi_alloc(unsigned len) > { > @@ -14,7 +18,15 @@ static __always_inline __init void *dmi_alloc(unsigned len) > } > > /* Use early IO mappings for DMI because it's initialized early */ > -#define dmi_early_remap early_memremap > +static __always_inline __init void *dmi_early_remap(resource_size_t > + phys_addr, unsigned long size) > +{ > +#ifdef CONFIG_AMD_MEM_ENCRYPT Again, no need for the #ifdef here. You should probably audit the code for all of these and truly determine if they are really needed. > + if (sme_active() && is_kdump_kernel()) Use of sme_active() here is good since under SEV, this area will be encrypted. > + return early_memremap_decrypted(phys_addr, size); > +#endif > + return early_memremap(phys_addr, size); Instead of doing this, maybe it makes more sense to put this logic somewhere in the early_memremap() path. Possibly smarten up the early_memremap_pgprot_adjust() function with some kdump kernel related logic. Not sure it's possible, but would be nice since you have this logic in a couple of places. > +} > #define dmi_early_unmap early_memunmap > #define dmi_remap(_x, _l) memremap(_x, _l, MEMREMAP_WB) > #define dmi_unmap(_x) memunmap(_x) > diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c > index 3b20607..354ad66 100644 > --- a/arch/x86/kernel/acpi/boot.c > +++ b/arch/x86/kernel/acpi/boot.c > @@ -48,6 +48,10 @@ > #include > #include > #include > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +#include > +#include > +#endif > > #include "sleep.h" /* To include x86_acpi_suspend_lowlevel */ > static int __initdata acpi_force = 0; > @@ -124,6 +128,10 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size) > if (!phys || !size) > return NULL; > > +#ifdef CONFIG_AMD_MEM_ENCRYPT > + if (sme_active() && is_kdump_kernel()) > + return early_memremap_decrypted(phys, size); > +#endif Same as previous comment(s). > return early_memremap(phys, size); > } > > diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c > index 4f2e077..2ef67fc 100644 > --- a/arch/x86/kernel/crash_dump_64.c > +++ b/arch/x86/kernel/crash_dump_64.c > @@ -48,3 +48,30 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, > iounmap(vaddr); > return csize; > } > + > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +ssize_t copy_oldmem_page_encrypted(unsigned long pfn, char *buf, > + size_t csize, unsigned long offset, int userbuf) > +{ > + void *vaddr; > + > + if (!csize) > + return 0; > + > + vaddr = ioremap_encrypted(pfn << PAGE_SHIFT, PAGE_SIZE); > + if (!vaddr) > + return -ENOMEM; > + > + if (userbuf) { > + if (copy_to_user(buf, vaddr + offset, csize)) { > + iounmap(vaddr); > + return -EFAULT; > + } > + } else > + memcpy(buf, vaddr + offset, csize); > + > + set_iounmap_nonlazy(); > + iounmap(vaddr); > + return csize; > +} > +#endif This seems exactly the same as copy_oldmem_page() with the difference being the type of ioremap done. Might be better to make the code after the ioremap's a common piece of code that each of the copy_oldmem functions would call. > diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c > index 849c4fb..6da9b0c 100644 > --- a/drivers/acpi/tables.c > +++ b/drivers/acpi/tables.c > @@ -36,6 +36,10 @@ > #include > #include > #include "internal.h" > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +#include > +#include > +#endif > > #ifdef CONFIG_ACPI_CUSTOM_DSDT > #include CONFIG_ACPI_CUSTOM_DSDT_FILE > @@ -566,7 +570,15 @@ void __init acpi_table_upgrade(void) > clen = size; > if (clen > MAP_CHUNK_SIZE - slop) > clen = MAP_CHUNK_SIZE - slop; > - dest_p = early_memremap(dest_addr & PAGE_MASK, > +#ifdef CONFIG_AMD_MEM_ENCRYPT > + if (sme_active() && is_kdump_kernel()) > + dest_p = early_memremap_decrypted( > + dest_addr & PAGE_MASK, > + clen + slop); > + else > +#endif > + dest_p = early_memremap( > + dest_addr & PAGE_MASK, So if the dest_addr (based off of acpi_tables_addr) was added to the e820 map as an ACPI area (which it will be), then it would be mapped properly (in both SME and SEV) without needing the if/then/else. > clen + slop); > memcpy(dest_p + slop, src_p, clen); > early_memunmap(dest_p, clen + slop); > diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c > index 904c575..8ecbddb 100644 > --- a/drivers/iommu/amd_iommu_init.c > +++ b/drivers/iommu/amd_iommu_init.c > @@ -889,11 +889,18 @@ static bool copy_device_table(void) > } > > old_devtb_phys = entry & PAGE_MASK; > + if (sme_active() && is_kdump_kernel()) Use mem_encrypt_active() here to cover both SME and SEV. > + old_devtb_phys = __sme_clr(old_devtb_phys); > if (old_devtb_phys >= 0x100000000ULL) { > pr_err("The address of old device table is above 4G, not trustworthy!\n"); > return false; > } > - old_devtb = memremap(old_devtb_phys, dev_table_size, MEMREMAP_WB); > + if (sme_active() && is_kdump_kernel()) > + old_devtb = ioremap_encrypted(old_devtb_phys, > + dev_table_size); > + else > + old_devtb = memremap(old_devtb_phys, > + dev_table_size, MEMREMAP_WB); What happens to the memremap here, does it fall back to the ioremap and end up getting mapped decrypted? It would be nice to do the right thing under the covers of memremap. Not sure what that would take, but it would keep the code nice and clean. > if (!old_devtb) > return false; > > diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c > index a45f0af..316e2b0 100644 > --- a/fs/proc/vmcore.c > +++ b/fs/proc/vmcore.c > @@ -25,6 +25,10 @@ > #include > #include > #include "internal.h" > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +#include > +#include > +#endif > > /* List representing chunks of contiguous memory areas and their offsets in > * vmcore file. > @@ -86,7 +90,8 @@ static int pfn_is_ram(unsigned long pfn) > > /* Reads a page from the oldmem device from given offset. */ > static ssize_t read_from_oldmem(char *buf, size_t count, > - u64 *ppos, int userbuf) > + u64 *ppos, int userbuf, > + bool encrypted) > { > unsigned long pfn, offset; > size_t nr_bytes; > @@ -108,8 +113,15 @@ static ssize_t read_from_oldmem(char *buf, size_t count, > if (pfn_is_ram(pfn) == 0) > memset(buf, 0, nr_bytes); > else { > - tmp = copy_oldmem_page(pfn, buf, nr_bytes, > +#ifdef CONFIG_AMD_MEM_ENCRYPT > + if (encrypted) > + tmp = copy_oldmem_page_encrypted(pfn, buf, > + nr_bytes, offset, userbuf); > + else > +#endif > + tmp = copy_oldmem_page(pfn, buf, nr_bytes, > offset, userbuf);> + > if (tmp < 0) > return tmp; > } > @@ -143,7 +155,7 @@ void __weak elfcorehdr_free(unsigned long long addr) > */ > ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos) > { > - return read_from_oldmem(buf, count, ppos, 0); > + return read_from_oldmem(buf, count, ppos, 0, false); For SEV, this will likely be encrypted, so you can probably replace the "false" with sev_active() so that under SME it is un-encrypted but under SEV it is encrypted. Where is the elfcorehdr stored? I wonder if it could be created as encrypted under SME and then you could actually remove the encrypted parameter from read_from_oldmem() and always map encrypted. If SME or SEV are active it will be mapped encrypted and if they aren't then it is mapped normally. > } > > /* > @@ -151,7 +163,11 @@ ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos) > */ > ssize_t __weak elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos) > { > - return read_from_oldmem(buf, count, ppos, 0); > + bool flag = false; > +#ifdef CONFIG_AMD_MEM_ENCRYPT > + flag = sme_active(); > +#endif > + return read_from_oldmem(buf, count, ppos, 0, flag); > } > > /* > @@ -161,6 +177,10 @@ int __weak remap_oldmem_pfn_range(struct vm_area_struct *vma, > unsigned long from, unsigned long pfn, > unsigned long size, pgprot_t prot) > { > +#ifdef CONFIG_AMD_MEM_ENCRYPT > + if (sme_active()) No need for the sme_active() check here, the encryption will be applied, for both SME and SEV, if memory encryption is active, otherwise it won't. > + prot = __pgprot(pgprot_val(prot) | _PAGE_ENC); prot = pgprot_encrypted(prot); > +#endif> return remap_pfn_range(vma, from, pfn, size, prot); > } > > @@ -188,6 +208,11 @@ static ssize_t __read_vmcore(char *buffer, size_t buflen, loff_t *fpos, > size_t tsz; > u64 start; > struct vmcore *m = NULL; > + bool sme_flag = false; > + > +#ifdef CONFIG_AMD_MEM_ENCRYPT > + sme_flag = sme_active();> +#endif Probably just want mem_encrypt_active() here to get both SME and SEV cases mapped as encrypted. Thanks, Tom > > if (buflen == 0 || *fpos >= vmcore_size) > return 0; > @@ -235,7 +260,8 @@ static ssize_t __read_vmcore(char *buffer, size_t buflen, loff_t *fpos, > m->offset + m->size - *fpos, > buflen); > start = m->paddr + *fpos - m->offset; > - tmp = read_from_oldmem(buffer, tsz, &start, userbuf); > + tmp = read_from_oldmem(buffer, tsz, &start, > + userbuf, sme_flag); > if (tmp < 0) > return tmp; > buflen -= tsz; > diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h > index f7ac2aa..024ae9e 100644 > --- a/include/linux/crash_dump.h > +++ b/include/linux/crash_dump.h > @@ -25,6 +25,10 @@ extern int remap_oldmem_pfn_range(struct vm_area_struct *vma, > > extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, > unsigned long, int); > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +extern ssize_t copy_oldmem_page_encrypted(unsigned long, char *, size_t, > + unsigned long, int); > +#endif > void vmcore_cleanup(void); > > /* Architecture code defines this if there are other possible ELF > diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c > index 20fef1a..3c22a9b 100644 > --- a/kernel/kexec_core.c > +++ b/kernel/kexec_core.c > @@ -471,6 +471,16 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image, > } > } > > + if (pages) { > + unsigned int count, i; > + > + pages->mapping = NULL; > + set_page_private(pages, order); > + count = 1 << order; > + for (i = 0; i < count; i++) > + SetPageReserved(pages + i); > + arch_kexec_post_alloc_pages(page_address(pages), 1 << order, 0); > + } > return pages; > } > > @@ -865,6 +875,7 @@ static int kimage_load_crash_segment(struct kimage *image, > result = -ENOMEM; > goto out; > } > + arch_kexec_post_alloc_pages(page_address(page), 1, 0); > ptr = kmap(page); > ptr += maddr & ~PAGE_MASK; > mchunk = min_t(size_t, mbytes, > @@ -882,6 +893,7 @@ static int kimage_load_crash_segment(struct kimage *image, > result = copy_from_user(ptr, buf, uchunk); > kexec_flush_icache_page(page); > kunmap(page); > + arch_kexec_pre_free_pages(page_address(page), 1); > if (result) { > result = -EFAULT; > goto out; >