From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84005C43381 for ; Fri, 1 Mar 2019 04:02:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B2DF2186A for ; Fri, 1 Mar 2019 04:02:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rNYPV1mM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B2DF2186A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zrpkPqLGnJlEw9hATWEe16jqeryuwnwCfkueQeFjixc=; b=rNYPV1mMTAXFgncpYx71WUDOd RzBbzBsAE/d4dJbff82GjH8RYthYYlGDOk19hXMEH8GcFm3VGSlxXo3xeLbWpCj1ssJAkrWPHVwkF 0/ChLfervwlKPBpvOsJF3mVF6wECJeZfOD5FwsMiVEGgc7e79wzet0dRazGOObmOnzNKsTNSdx5u3 V5hA10jy+BAQ0FL6zlf7einQY3WKeZfK2pWmf+19ueP173fBBS1JcjsH+/eZDi8ddrbqbFSF6aFUz 1H2EqYXyfOrmTVbCdzzhMDjsub36bP8J+13cAG/lfAoEWpZ3UIcqTL8zWhb5a9OWntyS9HT2GneCc 9PNzB12Ow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzZN8-00026V-KP; Fri, 01 Mar 2019 04:02:06 +0000 Received: from mail-pg1-f195.google.com ([209.85.215.195]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzZN4-00025L-4C for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2019 04:02:03 +0000 Received: by mail-pg1-f195.google.com with SMTP id q206so10776865pgq.4 for ; Thu, 28 Feb 2019 20:02:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KAorn7JBPE2gE54vP1gQlTIbj9WgZSyhIQJGRD4LQ3I=; b=BE9iFb++LTVfhzJhpbukE5bLikwWSrSwkyWefmUVfFc1ltrzk4ib3VXKfVFUZOIZBK 2L+YvMFcv4OoGCGfId/jExy1afuxevXL+oG377cRXGbuFEUWV+KyL+p14Y5JKLd17anr YNJtvXA8QwReo/CqDmh2+jJTG6SnnoA4O0IJIAVd5Oh2VmmpxPGdOKf5duB7UfzOhoOk EENF8oOLBsighdTv+CiSdLPoravgVbJmIG9pHqMBTAdf6l2TEu6tC21sQWi2YuxDNKUE opbdkbzFcyS9w0WjTEdjGf+EWXHdGqQNspXL0ahbdx+eEbaCpVBiDwSgR9oljQ2AYeu5 Bkow== X-Gm-Message-State: APjAAAUzxJG0qb6TpJz6Z+oabEb0Lk6LDYT3bzUm1+wB2UCAjY8IilgH pkFHkDT5GI5clAbowgj90c/awMewiTk= X-Google-Smtp-Source: AHgI3IYJRGAIX6JbB3tfCmgLWZ7yKdIoXGGuld/xqcRGhbDrg0qRRLuOSjw790j7Rr5u5730HOSksg== X-Received: by 2002:aa7:8186:: with SMTP id g6mr3443374pfi.138.1551412920393; Thu, 28 Feb 2019 20:02:00 -0800 (PST) Received: from localhost.localdomain ([122.177.192.237]) by smtp.gmail.com with ESMTPSA id x8sm41483294pfe.1.2019.02.28.20.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 20:01:58 -0800 (PST) Subject: Re: [PATCH] arm64, vmcoreinfo : Append 'MAX_USER_VA_BITS' and 'MAX_PHYSMEM_BITS' to vmcoreinfo To: Kazuhito Hagio , Dave Anderson References: <1548850991-11879-1-git-send-email-bhsharma@redhat.com> <20190213111552.GA8265@dhcp-128-65.nay.redhat.com> <4AE2DC15AC0B8543882A74EA0D43DBEC03568504@BPXM09GP.gisp.nec.co.jp> <37ed4c14-e4b9-49c0-4816-c289ce65fd76@arm.com> <4AE2DC15AC0B8543882A74EA0D43DBEC03568A9F@BPXM09GP.gisp.nec.co.jp> <891eaf5a-aede-364d-6465-832e377c3e29@redhat.com> <1481013752.3226345.1550767349644.JavaMail.zimbra@redhat.com> <4AE2DC15AC0B8543882A74EA0D43DBEC03568CA1@BPXM09GP.gisp.nec.co.jp> From: Bhupesh Sharma Message-ID: <28504be2-aca1-3bb3-cede-50e33c096273@redhat.com> Date: Fri, 1 Mar 2019 09:31:51 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <4AE2DC15AC0B8543882A74EA0D43DBEC03568CA1@BPXM09GP.gisp.nec.co.jp> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_200202_216064_7F2002C5 X-CRM114-Status: GOOD ( 19.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "lijiang@redhat.com" , "bhe@redhat.com" , ard biesheuvel , catalin marinas , Steve Capper , "kexec@lists.infradead.org" , Will Deacon , AKASHI Takahiro , James Morse , Kristina Martsenko , Borislav Petkov , Dave Young , "linux-arm-kernel@lists.infradead.org" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Kazu, On 02/22/2019 12:32 AM, Kazuhito Hagio wrote: > -----Original Message----- >> ----- Original Message ----- >>> Hi Kazu, >>> >>> On 02/20/2019 02:17 AM, Kazuhito Hagio wrote: >>>> Hi Bhupesh, >>>> >>>> -----Original Message----- >>>>> I am not sure you got a chance to look at the two regression cases I >>>>> reported here: >>>>> >>>>> >>>>> Unfortunately the above suggestion doesn't provide any fix for >>>>> ARMv8.2-LPA regression (see text under heading ' >>>>> (1). Regression Case 1 (ARMv8.2-LPA enabled kernel)') >>>> >>>> As for MAX_PHYSMEM_BITS, I realized that ppc64 makedumpfile can detect >>>> it because there is only one SECTION_SIZE_BITS for ppc64. I think we >>>> can use the same way as set_ppc64_max_physmem_bits() does also for >>>> arm64 for now. I'm going to write it for kernels not having >>>> NUMBER(MAX_PHYSMEM_BITS) in vmcoreinfo. >>> >>> I see two drawbacks with the above approach: >>> >>> a). This means that other user-space tools like crash-utility would >>> still be broken and would probably need to find MAX_PHYSMEM_BITS for >>> arm64 via a similar (hack'ish ?) approach. >>> >>> b). I am looking at the makedumpfile code for 'MAX_PHYSMEM_BITS' >>> determination for two archs as an example: >>> >>> ppc >>> --- >>> >>> int >>> set_ppc64_max_physmem_bits(void) >>> { >>> long array_len = ARRAY_LENGTH(mem_section); >>> /* >>> * The older ppc64 kernels uses _MAX_PHYSMEM_BITS as 42 and the >>> * newer kernels 3.7 onwards uses 46 bits. >>> */ >>> >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_ORIG ; >>> if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) >>> || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) >>> return TRUE; >>> >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7; >>> if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) >>> || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) >>> return TRUE; >>> >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_19; >>> if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) >>> || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) >>> return TRUE; >>> >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_20; >>> if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) >>> || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) >>> return TRUE; >>> >>> return FALSE; >>> } >>> >>> x86_64: >>> ------ >>> >>> int >>> get_versiondep_info_x86_64(void) >>> { >>> /* >>> * On linux-2.6.26, MAX_PHYSMEM_BITS is changed to 44 from 40. >>> */ >>> if (info->kernel_version < KERNEL_VERSION(2, 6, 26)) >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_ORIG; >>> else if (info->kernel_version < KERNEL_VERSION(2, 6, 31)) >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_2_6_26; >>> else if(check_5level_paging()) >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_5LEVEL; >>> else >>> info->max_physmem_bits = _MAX_PHYSMEM_BITS_2_6_31; >>> >>> ... >>> } >>> >>> Looking at the above, two questions come to my mind: >>> >>> - Do we really need all the above complexity in user-space code, to hoop >>> across various kernel versions and perform allocations for something >>> that can be so easily exported via vmcoreinfo? Also we need to see how >>> portable is the above code for a new kernel version - IMO, it will need >>> another fix patch when we update to a new kernel version in near future. >> >> I agree -- not to mention that the "kernel version" way of determining things >> does not account for distribution-specific backports. >> >>> >>> - Also do we need to replicate the above implementations across >>> user-space tools when they can also utilize the vmcoreinfo information >>> to determine the PA_BITS range without any additional arch/kernel >>> version specific details as the single point of obtaining this >>> information from the kernel? >>> >>> So, in view of the above, I would still advocate that we use a >>> vmcoreinfo export for 'MAX_PHYSMEM_BITS' as well to have a uniform >>> interface for the same across all user-land applications. >> >> Again, totally agree. > > I also agree that we should do so. Then it will be better to have > it in kernel core code, not in arch-specific code. > > Although makedumpfile may have to have the kludge for kernels that > support 52-bit PA and don't have the exported MAX_PHYSMEM_BITS > sooner or later.. I was waiting for maintainers Cc'ed in this thread to share their opinions on the above suggestion. We especially need comments from x86 maintainers on this (Boris), since x86 and ppc user-space utilities are currently not broken (no regression reported) due to a lacking export of 'MAX_PHYSMEM_BITS' via vmcore, whereas as I shared earlier arm64 user-space utilities are broken right now with 52-bit address space changes. Thanks, Bhupesh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel