From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753069Ab3FJNg7 (ORCPT ); Mon, 10 Jun 2013 09:36:59 -0400 Received: from mail-ve0-f171.google.com ([209.85.128.171]:44809 "EHLO mail-ve0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752363Ab3FJNg6 (ORCPT ); Mon, 10 Jun 2013 09:36:58 -0400 MIME-Version: 1.0 In-Reply-To: <1370624161-2298-3-git-send-email-holzheu@linux.vnet.ibm.com> References: <1370624161-2298-1-git-send-email-holzheu@linux.vnet.ibm.com> <1370624161-2298-3-git-send-email-holzheu@linux.vnet.ibm.com> Date: Mon, 10 Jun 2013 22:36:57 +0900 Message-ID: Subject: Re: [PATCH v5 2/5] s390/vmcore: Use ELF header in new memory feature From: HATAYAMA Daisuke To: Michael Holzheu Cc: Vivek Goyal , Jan Willeke , Martin Schwidefsky , Heiko Carstens , linux-kernel@vger.kernel.org, kexec@lists.infradead.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2013/6/8 Michael Holzheu : > @@ -417,27 +416,44 @@ static void s390_elf_corehdr_create(char **elfcorebuf, size_t *elfcorebuf_sz) > ptr = notes_init(phdr_notes, ptr, ((unsigned long) hdr) + hdr_off); > /* Init loads */ > hdr_off = PTR_DIFF(ptr, hdr); > - loads_init(phdr_loads, ((unsigned long) hdr) + hdr_off); > - *elfcorebuf_sz = hdr_off; > - *elfcorebuf = (void *) relocate((unsigned long) hdr); > - BUG_ON(*elfcorebuf_sz > alloc_size); > + loads_init(phdr_loads, hdr_off); > + elfcorehdr_addr = (unsigned long long) hdr; > + elfcorehdr_size = (unsigned long long) hdr_off; > + elfcorehdr_newmem = hdr; > + BUG_ON(elfcorehdr_size > alloc_size); > + return 0; > } > > /* > - * Create kdump ELF core header in new kernel, if it has not been passed via > - * the "elfcorehdr" kernel parameter > + * Free ELF core header (new kernel) > */ > -static int setup_kdump_elfcorehdr(void) > +void elfcorehdr_free(void) > { > - size_t elfcorebuf_sz; > - char *elfcorebuf; > - > - if (!OLDMEM_BASE || is_kdump_kernel()) > - return -EINVAL; > - s390_elf_corehdr_create(&elfcorebuf, &elfcorebuf_sz); > - elfcorehdr_addr = (unsigned long long) elfcorebuf; > - elfcorehdr_size = elfcorebuf_sz; > - return 0; > + if (!elfcorehdr_newmem) > + return; > + vfree(elfcorehdr_newmem); kfree is correct here? Thanks. HATAYAMA, Daisuke From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-vc0-f172.google.com ([209.85.220.172]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Um2Hh-0002kN-5I for kexec@lists.infradead.org; Mon, 10 Jun 2013 13:37:21 +0000 Received: by mail-vc0-f172.google.com with SMTP id ib11so4402438vcb.31 for ; Mon, 10 Jun 2013 06:36:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1370624161-2298-3-git-send-email-holzheu@linux.vnet.ibm.com> References: <1370624161-2298-1-git-send-email-holzheu@linux.vnet.ibm.com> <1370624161-2298-3-git-send-email-holzheu@linux.vnet.ibm.com> Date: Mon, 10 Jun 2013 22:36:57 +0900 Message-ID: Subject: Re: [PATCH v5 2/5] s390/vmcore: Use ELF header in new memory feature From: HATAYAMA Daisuke List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=twosheds.infradead.org@lists.infradead.org To: Michael Holzheu Cc: Heiko Carstens , kexec@lists.infradead.org, Jan Willeke , linux-kernel@vger.kernel.org, Martin Schwidefsky , Vivek Goyal 2013/6/8 Michael Holzheu : > @@ -417,27 +416,44 @@ static void s390_elf_corehdr_create(char **elfcorebuf, size_t *elfcorebuf_sz) > ptr = notes_init(phdr_notes, ptr, ((unsigned long) hdr) + hdr_off); > /* Init loads */ > hdr_off = PTR_DIFF(ptr, hdr); > - loads_init(phdr_loads, ((unsigned long) hdr) + hdr_off); > - *elfcorebuf_sz = hdr_off; > - *elfcorebuf = (void *) relocate((unsigned long) hdr); > - BUG_ON(*elfcorebuf_sz > alloc_size); > + loads_init(phdr_loads, hdr_off); > + elfcorehdr_addr = (unsigned long long) hdr; > + elfcorehdr_size = (unsigned long long) hdr_off; > + elfcorehdr_newmem = hdr; > + BUG_ON(elfcorehdr_size > alloc_size); > + return 0; > } > > /* > - * Create kdump ELF core header in new kernel, if it has not been passed via > - * the "elfcorehdr" kernel parameter > + * Free ELF core header (new kernel) > */ > -static int setup_kdump_elfcorehdr(void) > +void elfcorehdr_free(void) > { > - size_t elfcorebuf_sz; > - char *elfcorebuf; > - > - if (!OLDMEM_BASE || is_kdump_kernel()) > - return -EINVAL; > - s390_elf_corehdr_create(&elfcorebuf, &elfcorebuf_sz); > - elfcorehdr_addr = (unsigned long long) elfcorebuf; > - elfcorehdr_size = elfcorebuf_sz; > - return 0; > + if (!elfcorehdr_newmem) > + return; > + vfree(elfcorehdr_newmem); kfree is correct here? Thanks. HATAYAMA, Daisuke _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec