Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13469005rwl; Wed, 4 Jan 2023 08:33:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtNX0BNmaPX1LRLLB0/maPPbVv+EPGRhoQExakXCn7HNGs7aiyYpCc1uz1Pc28yQu7oDr1b X-Received: by 2002:a17:906:1410:b0:7c0:dfb7:4476 with SMTP id p16-20020a170906141000b007c0dfb74476mr38262048ejc.57.1672850001373; Wed, 04 Jan 2023 08:33:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672850001; cv=pass; d=google.com; s=arc-20160816; b=ymuCdeMEVhUaJFXgatqI+RcEMtNX/N1bsxF79uxqz5mDOTincjjWEzexb1ZNSp+aoE IbFxl7FD3QxzTUHSX/0LIc6DLWtmqQhKoarM2L/RNAxK9oUiDgEVRb6cCrsHA1DA3KZY vJDCSHAjHqeecBQVx6zXOXG0B1V/tWj0I04stMJcqYW88YFU7Rno1R+7yDl7CzelU4fk HTRRXSwlsr81QeO1B/s0+C/B8ZFHOX+X4glJ+j1WqlguRr1EXYGv0Cf+NdRh0M+XFtvc jPU5tKsqABFsLGUnn/bHHdganoiXQTobrfKPSSAOJmtRVL5WWJ0qYmZNifv1ruVj6bib Z4Vw== 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:dkim-signature; bh=N4hZ41BRRT0K3RKUPnen23ZLHJ2kkFzyh9xSOFFadAs=; b=Q6JYE++qJxlZEVuqRtXrE0QiAnfDjraShdmYaG2BbrO5IgG8rWY1E4YbvG3OsNeMwZ 6Wb1/NgSG7ZN7LP3BoiwxVPudeZ6dBLCE4H+B04YsehaDPnXNChAoqsfN8miBbJBoxiY PDeFjqdWK6BEweZzNShWhGrO3MaQQBMTrj780W5VOoNtBG2rnuL7RJdz3I9nQpoW6c5f n3YVCFZyxZFABsiumXtkOBJDz/VDoC3dDEbGLtGVt7LSBQ/9svmZ+qu/gWtSHnj6DH/L LuqyCj1phAnq1YytFZKv8OvIqd/J1BnQjxmqo9MBRyZupSD9zv51JSbSBBQeUFiLePrb 36jA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=pjZGX7kp; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=l9gZPrwI; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xg6-20020a170907320600b0084c41de8235si27247990ejb.334.2023.01.04.08.33.07; Wed, 04 Jan 2023 08:33:21 -0800 (PST) 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=@oracle.com header.s=corp-2022-7-12 header.b=pjZGX7kp; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=l9gZPrwI; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239938AbjADQTc (ORCPT + 57 others); Wed, 4 Jan 2023 11:19:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239976AbjADQT0 (ORCPT ); Wed, 4 Jan 2023 11:19:26 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68729167CF for ; Wed, 4 Jan 2023 08:19:25 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 304FO8Ri025769; Wed, 4 Jan 2023 16:18:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=N4hZ41BRRT0K3RKUPnen23ZLHJ2kkFzyh9xSOFFadAs=; b=pjZGX7kprmJQH41TpG+To2BgXTeVIClA5LOr94BgU0YJ2HtPC7UuU20YtvyjaXKcN3sE smfAd7GcIpTsW8v+65ddTXDXiRLvKNHLorAI3sGNnjmI6LaoQ1QRPZIUNN7Oy/H1Eua2 ATUlr2jxNTO2o7y3OB9gm8HCLn6Br1WhegaMqrPoiIiJOu65SA4TD1QZ3dUduvA8A4OO pmtEReSIh6Q/zQIYMuZmAkoMrjBnfGhLnLNVYWWj3xFV64Ig/BVBpgzrTpydJ71s+gt+ rZdRUxbEMMVZsmkfastZ2vqSnvOD9MmG+SZSFRWq4qM7QfxYJk3aQCTjAjUSTo1orZwH 4Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mtcpt6w7g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Jan 2023 16:18:57 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 304FrnTa002666; Wed, 4 Jan 2023 16:18:56 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mwcghh340-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Jan 2023 16:18:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Axbr8yO0UlwNQRdS7XAz5Jwlk/42A5w7HTNrJVMP0W5qkVqTHaveQe6oMQ/YwGwHZR91OyCVnyepohwfs4tTJ8Xbx1RQ27T/LrjoHwE/JqXc+1AQHYdZmf4lK7x29b+I7mUVAgserqxxirhlto6GkuyrKi9bcCimmqZf7xM8FDn3cg7O70cYYBeoCpTMICHdI89ZexmMxSYDhvkm1ESiQszGDapr+xMt7nG7KfvSF6SjZseHwdTPiswZ6QvyrTKHHHbyQSn4jK0t1+4H8Qcq/QlBOg/ZGlq/Xu9v/zYwx7yq34JvKrd0WlYbE+JTNXcharN2OHP10bHwT/Xiyin4rw== 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=N4hZ41BRRT0K3RKUPnen23ZLHJ2kkFzyh9xSOFFadAs=; b=Ec8cCF8QDi6bNWfG1DSACV37L2+ZjbiDEg8yhbJTfNiv05FyXaDjivq4Nr84MFsAKbZBdmFwPi6AQ2Sl5cwt8TaRmDbGGYmOvcSqcGA2oqNC8wDlH/5i799UCbzGtUyPS39C9RoYHtV86ImmoYR/Z/oMRGQ3YZluvVhCYazebSpY8FVDAf0pZ3nS/S1Q069C2LF0dPJ9ZZObSi0WLAu4NmJItFltguWKBGv3K4Aws8rFQZeqAsM15FrgbCon6G7MR9eF/CtdEQ/9Stvuh6/B1pKTL+vgLhjM5RFJn3/+DsZZeX+7Ha0Ny/rVISJbF8pQBwjmVZ+OcpVXUIgfe7Nd6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N4hZ41BRRT0K3RKUPnen23ZLHJ2kkFzyh9xSOFFadAs=; b=l9gZPrwIiT4BvPwXiidJSEYWoFLniC+bySo+nq1BFovE2H+Yeg+CH2N9+IQC6btPlL5ughw2ebmC8Sn8dY/DVTCOPqpTEzadY11fEnOl6F3oLfJEm88juLHYNwCCaHmDHI9aSZTY2lcVIWi7sv6a0uWPTf1/DMuHc1oZ4TYpW3U= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by SJ0PR10MB4575.namprd10.prod.outlook.com (2603:10b6:a03:2da::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 16:18:54 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::e301:fde6:85e5:b45a]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::e301:fde6:85e5:b45a%5]) with mapi id 15.20.5944.019; Wed, 4 Jan 2023 16:18:53 +0000 Message-ID: Date: Wed, 4 Jan 2023 10:18:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v15 3/7] crash: add generic infrastructure for crash hotplug support Content-Language: en-US To: Baoquan He Cc: linux-kernel@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, ebiederm@xmission.com, dyoung@redhat.com, vgoyal@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, nramas@linux.microsoft.com, thomas.lendacky@amd.com, robh@kernel.org, efault@gmx.de, rppt@kernel.org, david@redhat.com, sourabhjain@linux.ibm.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com References: <20221209153656.3284-1-eric.devolder@oracle.com> <20221209153656.3284-4-eric.devolder@oracle.com> From: Eric DeVolder In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9P223CA0023.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::28) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4531:EE_|SJ0PR10MB4575:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f8c29b9-9541-4839-0e54-08daee6f5f62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aHopYjnmnQkNONKdaFMTbncpJShe3ClhICGHmsil/IpACtIoB3KSN/vBZzmodEoJcHShkbNtd+xwZtZp3IzTT8S42eIOgKv87LCfOX1FEMV7dNn4XF/A9gbiELB7wzvzHYRQ0RyVMHVmwcJXC4PQpvksKf8gioGuEw1Z4SrMdAoM+LUu5Znj+PqA7JfslMvvykI1KWxz/6/HHG1rv8FLfoVuPJ8pKAFrrwaOpI2b6f8q9Av8QA96ZML2PPEQOQHJxHXrS722l9K81Bt4pWrg6hJCRTm4hixO0hwu+CcXe6D+lJmfs6N3pmU4poTne4GtKdU0yJ4TLrtJk4wZCf89ZDZlulxn4ynCnDQNMlOovPb6xQch+BLknRVmOcuo58SInKVKvhc2MnggZTBxvrKFQo0oH6N4jxO7sOL6FUpeaY2lyzZw0qjlFtMipLZgv4bCd98iftMacHrGFXmgUbCLJ3gBlBWCOkNfmiKb4UswWRBQs7Tb8eMqd3JvAWYXBSH/qOYjJhgGrMWG1XntxJX2LE+YJAQDFJzwPKYi6AbnW9sZwMeWem1w5JMomBJPz6D1pdlc60HCE+C350qM9KUM/hxCmUX2AbOuo5+2ZjEF2ceE+HnWcMxkToAHf4fF41cKX0GlSEsFregPlz4U5CDOcPAri3Ka8LZ+IgdPI8ZR/+4cdcaPcwC1ks5obUMk43TR1kUWwK3VDy9ISVW6IEixZ7/GAZ5dV8+BnQk/C8Bu2lpAUAylKX09OPQqX6CLovbJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR10MB4531.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(396003)(376002)(366004)(346002)(136003)(451199015)(41300700001)(8936002)(66946007)(5660300002)(8676002)(7416002)(316002)(2906002)(6916009)(66556008)(31686004)(4326008)(53546011)(6486002)(6506007)(107886003)(6666004)(478600001)(66476007)(2616005)(86362001)(31696002)(83380400001)(186003)(6512007)(38100700002)(36756003)(41533002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K2JueFpsZWhFVExwQVZvR2hGQkZxRkNUdjRNWnNndjBNRFUwVlgrUjdTZE44?= =?utf-8?B?aHVsSUhReWc1cDFMQkN6WlZ6QUFzOWNIenoxQVJ4cm5DRUdkVXVrSUV4QjJp?= =?utf-8?B?V0hxUDFJdkpvS1JVMERUdXdzKytnOHFtYlRuSEJ5cVUrVjVwd2Q0bTg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lZMRlVlU0luaGVVTkR4NTNUTFVWeHB1emdBZ2puY01IRFdTUEk0aGdn?= =?utf-8?B?MkJxTFk1cEVINXdkZXV6VWJZU2FiUGhVV0xXVnRIRGtQQUpzZDdWTmh4eng1?= =?utf-8?B?QmhIblBicVI5YVdXY05yWVhudTM3OHlHSTdNWkR1ejlyUFFCNi8xdlptSy84?= =?utf-8?B?SnNIWm02TkhTMEJja1RGNjl5RUNiUDQ0MElmS2doaHFJU29JT0FJbmhxN3hn?= =?utf-8?B?S09OeHRob3Q1eHptWWJ6c2xtc25oRkQ2Sm5PMlEvbDdLaEFCaW1PQkxvMGNh?= =?utf-8?B?Nk8vQjBXMy9iOVh2dUwreWlvd0F5Y2pBZFFQWWJ3TEJMbmdzWW5kSGJJclNE?= =?utf-8?B?UDJ6VFVQaHdNdmhyUTBZUT09?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f8c29b9-9541-4839-0e54-08daee6f5f62 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 16:18:53.7732 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: INvicvwMmBMY2qp7EbAM8PkIwTBf7iaG4KbdDbjCwBWtwwy168ReuWJAZ+uoaxOYPyRyjfJdvMO+ei8eAHl336J1aclj3GQky7lAbey4Qt4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4575 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-04_07,2023-01-04_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301040136 X-Proofpoint-ORIG-GUID: 1oee5eA7ZXAzZZBrkxG7tfGyViQeTOtx X-Proofpoint-GUID: 1oee5eA7ZXAzZZBrkxG7tfGyViQeTOtx X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 1/4/23 02:34, Baoquan He wrote: > On 12/09/22 at 10:36am, Eric DeVolder wrote: >> CPU and memory change notifications are received in order to >> regenerate the elfcorehdr. >> >> To support cpu hotplug, a callback is registered to capture the >> CPUHP_AP_ONLINE_DYN online and offline events via >> cpuhp_setup_state_nocalls(). >> >> To support memory hotplug, a notifier is registered to capture the >> MEM_ONLINE and MEM_OFFLINE events via register_memory_notifier(). >> >> The cpu callback and memory notifiers call handle_hotplug_event() >> which performs needed tasks and then dispatches the event to the >> architecture specific arch_crash_handle_hotplug_event(). During the >> process, the kexec_lock is held. >> >> Signed-off-by: Eric DeVolder > > This looks good to me, thx. > > Acked-by: Baoquan He Thank you! eric > >> --- >> include/linux/crash_core.h | 8 +++ >> include/linux/kexec.h | 12 ++++ >> kernel/crash_core.c | 138 +++++++++++++++++++++++++++++++++++++ >> 3 files changed, 158 insertions(+) >> >> diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h >> index de62a722431e..a270f8660538 100644 >> --- a/include/linux/crash_core.h >> +++ b/include/linux/crash_core.h >> @@ -84,4 +84,12 @@ int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, >> int parse_crashkernel_low(char *cmdline, unsigned long long system_ram, >> unsigned long long *crash_size, unsigned long long *crash_base); >> >> +#define KEXEC_CRASH_HP_REMOVE_CPU 0 >> +#define KEXEC_CRASH_HP_ADD_CPU 1 >> +#define KEXEC_CRASH_HP_REMOVE_MEMORY 2 >> +#define KEXEC_CRASH_HP_ADD_MEMORY 3 >> +#define KEXEC_CRASH_HP_INVALID_CPU -1U >> + >> +struct kimage; >> + >> #endif /* LINUX_CRASH_CORE_H */ >> diff --git a/include/linux/kexec.h b/include/linux/kexec.h >> index ebf46c3b8f8b..389444cb03cc 100644 >> --- a/include/linux/kexec.h >> +++ b/include/linux/kexec.h >> @@ -32,6 +32,7 @@ extern note_buf_t __percpu *crash_notes; >> #include >> #include >> #include >> +#include >> #include >> >> /* Verify architecture specific macros are defined */ >> @@ -374,6 +375,13 @@ struct kimage { >> struct purgatory_info purgatory_info; >> #endif >> >> +#ifdef CONFIG_CRASH_HOTPLUG >> + bool hotplug_event; >> + unsigned int offlinecpu; >> + bool elfcorehdr_index_valid; >> + int elfcorehdr_index; >> +#endif >> + >> #ifdef CONFIG_IMA_KEXEC >> /* Virtual address of IMA measurement buffer for kexec syscall */ >> void *ima_buffer; >> @@ -503,6 +511,10 @@ static inline int arch_kexec_post_alloc_pages(void *vaddr, unsigned int pages, g >> static inline void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages) { } >> #endif >> >> +#ifndef arch_crash_handle_hotplug_event >> +static inline void arch_crash_handle_hotplug_event(struct kimage *image) { } >> +#endif >> + >> #else /* !CONFIG_KEXEC_CORE */ >> struct pt_regs; >> struct task_struct; >> diff --git a/kernel/crash_core.c b/kernel/crash_core.c >> index 8c648fd5897a..fcb642a03d7b 100644 >> --- a/kernel/crash_core.c >> +++ b/kernel/crash_core.c >> @@ -11,6 +11,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> >> #include >> #include >> @@ -18,6 +20,7 @@ >> #include >> >> #include "kallsyms_internal.h" >> +#include "kexec_internal.h" >> >> /* vmcoreinfo stuff */ >> unsigned char *vmcoreinfo_data; >> @@ -612,3 +615,138 @@ static int __init crash_save_vmcoreinfo_init(void) >> } >> >> subsys_initcall(crash_save_vmcoreinfo_init); >> + >> +#ifdef CONFIG_CRASH_HOTPLUG >> +#undef pr_fmt >> +#define pr_fmt(fmt) "crash hp: " fmt >> +/* >> + * To accurately reflect hot un/plug changes, the elfcorehdr (which >> + * is passed to the crash kernel via the elfcorehdr= parameter) >> + * must be updated with the new list of CPUs and memories. >> + * >> + * In order to make changes to elfcorehdr, two conditions are needed: >> + * First, the segment containing the elfcorehdr must be large enough >> + * to permit a growing number of resources; the elfcorehdr memory size >> + * is based on NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. >> + * Second, purgatory must explicitly exclude the elfcorehdr from the >> + * list of segments it checks (since the elfcorehdr changes and thus >> + * would require an update to purgatory itself to update the digest). >> + */ >> +static void handle_hotplug_event(unsigned int hp_action, unsigned int cpu) >> +{ >> + /* Obtain lock while changing crash information */ >> + if (kexec_trylock()) { >> + >> + /* Check kdump is loaded */ >> + if (kexec_crash_image) { >> + struct kimage *image = kexec_crash_image; >> + >> + if (hp_action == KEXEC_CRASH_HP_ADD_CPU || >> + hp_action == KEXEC_CRASH_HP_REMOVE_CPU) >> + pr_debug("hp_action %u, cpu %u\n", hp_action, cpu); >> + else >> + pr_debug("hp_action %u\n", hp_action); >> + >> + /* >> + * When the struct kimage is allocated, it is wiped to zero, so >> + * the elfcorehdr_index_valid defaults to false. Find the >> + * segment containing the elfcorehdr, if not already found. >> + * This works for both the kexec_load and kexec_file_load paths. >> + */ >> + if (!image->elfcorehdr_index_valid) { >> + unsigned long mem; >> + unsigned char *ptr; >> + unsigned int n; >> + >> + for (n = 0; n < image->nr_segments; n++) { >> + mem = image->segment[n].mem; >> + ptr = kmap_local_page(pfn_to_page(mem >> PAGE_SHIFT)); >> + if (ptr) { >> + /* The segment containing elfcorehdr */ >> + if (memcmp(ptr, ELFMAG, SELFMAG) == 0) { >> + image->elfcorehdr_index = (int)n; >> + image->elfcorehdr_index_valid = true; >> + } >> + kunmap_local(ptr); >> + } >> + } >> + } >> + >> + if (!image->elfcorehdr_index_valid) { >> + pr_err("unable to locate elfcorehdr segment"); >> + goto out; >> + } >> + >> + /* Needed in order for the segments to be updated */ >> + arch_kexec_unprotect_crashkres(); >> + >> + /* Flag to differentiate between normal load and hotplug */ >> + image->hotplug_event = true; >> + >> + /* Now invoke arch-specific update handler */ >> + arch_crash_handle_hotplug_event(image); >> + >> + /* No longer handling a hotplug event */ >> + image->hotplug_event = false; >> + >> + /* Change back to read-only */ >> + arch_kexec_protect_crashkres(); >> + } >> + >> +out: >> + /* Release lock now that update complete */ >> + kexec_unlock(); >> + } >> +} >> + >> +static int crash_memhp_notifier(struct notifier_block *nb, unsigned long val, void *v) >> +{ >> + switch (val) { >> + case MEM_ONLINE: >> + handle_hotplug_event(KEXEC_CRASH_HP_ADD_MEMORY, >> + KEXEC_CRASH_HP_INVALID_CPU); >> + break; >> + >> + case MEM_OFFLINE: >> + handle_hotplug_event(KEXEC_CRASH_HP_REMOVE_MEMORY, >> + KEXEC_CRASH_HP_INVALID_CPU); >> + break; >> + } >> + return NOTIFY_OK; >> +} >> + >> +static struct notifier_block crash_memhp_nb = { >> + .notifier_call = crash_memhp_notifier, >> + .priority = 0 >> +}; >> + >> +static int crash_cpuhp_online(unsigned int cpu) >> +{ >> + handle_hotplug_event(KEXEC_CRASH_HP_ADD_CPU, cpu); >> + return 0; >> +} >> + >> +static int crash_cpuhp_offline(unsigned int cpu) >> +{ >> + handle_hotplug_event(KEXEC_CRASH_HP_REMOVE_CPU, cpu); >> + return 0; >> +} >> + >> +static int __init crash_hotplug_init(void) >> +{ >> + int result = 0; >> + >> + if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG)) >> + register_memory_notifier(&crash_memhp_nb); >> + >> + if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) >> + result = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, >> + "crash/cpuhp", >> + crash_cpuhp_online, >> + crash_cpuhp_offline); >> + >> + return result; >> +} >> + >> +subsys_initcall(crash_hotplug_init); >> +#endif >> -- >> 2.31.1 >> >