From patchwork Mon Nov 11 08:01:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 11236671 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F8DB1599 for ; Mon, 11 Nov 2019 08:04:12 +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 4385420818 for ; Mon, 11 Nov 2019 08:04:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MISbR7bt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ae2bnJsv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4385420818 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+patchwork-linux-arm=patchwork.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-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XzYiSrSj95drSkyIVn/2gc7bePp28Ua00H9oYNFQH/I=; b=MISbR7btzK7/tBkpWn9hkEAqW5 nu61H0KGDwwqOgEKRcFzNkQPRAbPLuMHauf5Zi2AMrSO97QCfO/tP9Z5JWkB0iHRy5f3oqbfaOlKb uFy7LCh41zUKHIQ29Q6mDmgVXK5mwN1ksD2228OLQo6QGq9QZrpFP9aeiaRwPCpyWRc25dnCLFUx8 A1lGauKg12/JsClgG2TxDNiqLSFIQIQekBG5kzNIs/LH8aXZ/gNtTy5OrRn79IlP+qZRgPZbNDBF8 F8X5ArzT13Ae0nWf8K+ZBLHUvot16B8bK1IhtUTOFxsH+RGXfkXxQVILQcaoJ71zKMsgCwstgbkMi Iy9Bxjtg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4gF-0003eN-7P; Mon, 11 Nov 2019 08:04:11 +0000 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4g7-0003bT-46 for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 08:04:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573459441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/y8p7TWJ4+9dx0qZYntYI0vqqca78jHSFlqFEn+6Y9I=; b=Ae2bnJsvuVP6avUPrVQ0dOl6YqAitaPPcAWAwEWRr3EfehY0J/D3Fz4OBVCEZ9BskGWArl wAE3ycLB0Z2vKndVaDrRRjUIer7HhfzRdueUueZNyRlM2fvyFWvcjhlp8G0zx6nNH752ky YOJBqZk7766T31j2divPgzXncdujEB8= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-GmCfQmb7OOOwKfl-hSwzFQ-1; Mon, 11 Nov 2019 03:01:45 -0500 Received: by mail-pl1-f198.google.com with SMTP id a5so10120879pln.13 for ; Mon, 11 Nov 2019 00:01:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D7Q1sNAJK7KGCeC1/osi4u/yd8LMbojW2DcAg7eyhwk=; b=JALCuT18H2jk6zohDzktYQDeI85h1nsXRq3sTkHnmo0cYIlVHxlVVxFxycSlpE6NkL CxyH7iWdIO591Twoj/MfwYXVu9LmehQ+RBALOJdvuA4kDxBVOrWM7cIpeGDOeh5I9tY7 EpECnOaCviIRmP0ptBHw9+7kL9YgXd4CrdHms7fULBWdxcIoHJyzTuVt/YMFCoLa3LOL YZC70RKfw21QyW505JUJKm5GkgQQLytjgxbOsXV2um1KRMTsfEz0H/wa/ATl3emJIj2p p4NX1nAmO+d7+GPo9ni8pwW/UWE6nC0Uf/5+cCAFJbap/kzPJYW9/yprM5QdlTvz/nn5 gnpA== X-Gm-Message-State: APjAAAXgmFL+J9WFjRlGgRHA1VVNx+muIj/xJSGY6X1u5CdHNePRvDZ3 nnb8KIAafUO/nol+4Dqa/od4qlHrsqO82fKvMMnJ4BvMzULU0XceWbVBUiTRoyj98pJ6UADcjfe 0sS8MBydv2UXpLEoF5voB6EHT++jX2ysw++M= X-Received: by 2002:a62:fcd2:: with SMTP id e201mr404507pfh.52.1573459301444; Mon, 11 Nov 2019 00:01:41 -0800 (PST) X-Google-Smtp-Source: APXvYqw/PM/uE1YEEDp1OQcYhDW64ur/c96jF9ficCBtta087Mx43bjXxmhjovhzV8sTDdZdS3kXpw== X-Received: by 2002:a62:fcd2:: with SMTP id e201mr404459pfh.52.1573459301055; Mon, 11 Nov 2019 00:01:41 -0800 (PST) Received: from localhost ([122.177.0.15]) by smtp.gmail.com with ESMTPSA id r33sm12736180pjb.5.2019.11.11.00.01.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2019 00:01:39 -0800 (PST) From: Bhupesh Sharma To: linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo Date: Mon, 11 Nov 2019 13:31:20 +0530 Message-Id: <1573459282-26989-2-git-send-email-bhsharma@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573459282-26989-1-git-send-email-bhsharma@redhat.com> References: <1573459282-26989-1-git-send-email-bhsharma@redhat.com> X-MC-Unique: GmCfQmb7OOOwKfl-hSwzFQ-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191111_000403_235929_49AFB086 X-CRM114-Status: GOOD ( 16.96 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [205.139.110.120 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kazuhito Hagio , Benjamin Herrenschmidt , Steve Capper , Catalin Marinas , bhsharma@redhat.com, Ard Biesheuvel , kexec@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, James Morse , linux-arm-kernel@lists.infradead.org, Michael Ellerman , Boris Petkov , Thomas Gleixner , bhupesh.linux@gmail.com, Will Deacon , Ingo Molnar , Paul Mackerras , Dave Anderson MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Right now user-space tools like 'makedumpfile' and 'crash' need to rely on a best-guess method of determining value of 'MAX_PHYSMEM_BITS' supported by underlying kernel. This value is used in user-space code to calculate the bit-space required to store a section for SPARESMEM (similar to the existing calculation method used in the kernel implementation): #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) Now, regressions have been reported in user-space utilities like 'makedumpfile' and 'crash' on arm64, with the recently added kernel support for 52-bit physical address space, as there is no clear method of determining this value in user-space (other than reading kernel CONFIG flags). As per suggestion from makedumpfile maintainer (Kazu), it makes more sense to append 'MAX_PHYSMEM_BITS' to vmcoreinfo in the core code itself rather than in arch-specific code, so that the user-space code for other archs can also benefit from this addition to the vmcoreinfo and use it as a standard way of determining 'SECTIONS_SHIFT' value in user-land. A reference 'makedumpfile' implementation which reads the 'MAX_PHYSMEM_BITS' value from vmcoreinfo in a arch-independent fashion is available here: [0]. https://github.com/bhupesh-sharma/makedumpfile/blob/remove-max-phys-mem-bit-v1/arch/ppc64.c#L471 Cc: Boris Petkov Cc: Ingo Molnar Cc: Thomas Gleixner Cc: James Morse Cc: Mark Rutland Cc: Will Deacon Cc: Steve Capper Cc: Catalin Marinas Cc: Ard Biesheuvel Cc: Michael Ellerman Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Dave Anderson Cc: Kazuhito Hagio Cc: x86@kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org Signed-off-by: Bhupesh Sharma --- kernel/crash_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 9f1557b98468..18175687133a 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -413,6 +413,7 @@ static int __init crash_save_vmcoreinfo_init(void) VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS); VMCOREINFO_STRUCT_SIZE(mem_section); VMCOREINFO_OFFSET(mem_section, section_mem_map); + VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS); #endif VMCOREINFO_STRUCT_SIZE(page); VMCOREINFO_STRUCT_SIZE(pglist_data); From patchwork Mon Nov 11 08:04:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 11236675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4E6F1390 for ; Mon, 11 Nov 2019 08:05:00 +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 822B62075C for ; Mon, 11 Nov 2019 08:05:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fgizNrcV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P5eho0RS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 822B62075C 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+patchwork-linux-arm=patchwork.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-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=zGgAHmTLGcsgdHIPx5E/NKnbm7kHmHIyCkzOFd+8EAA=; b=fgi zNrcVaKnsOPi059v1YR2Y9WUeIbKfdmkIrzBd7JIRlASAlrNZ6IIZ67+k1uXCcZuEVmp0BTr3i0bj E0NCeqt7g1SyZSJXHi1kuYxyzJNGcoTuIOvNgsWLoj2Ae4ITl382ILRT5GKoJvlrhFggVmuGumd6b CIobV371vYYuTJw0HsnEVtocc4fasrLgTDnw3nE93AxtfeMDypL8k3WFFMIKg9gxzD5pPMhbdHdqC ChMNvMVTkYLP6li4Z7Qkt509T0VRvjgrsvvkE9uJ5vKw6giOeWHPV8Ozs4/9qALUY+dp3AbDZcbdS VUh3yRUO5LSr0gXOyxFoc0rRSCmG89A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4h1-0004ER-Au; Mon, 11 Nov 2019 08:04:59 +0000 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4gy-0004DY-HS for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 08:04:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573459495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A9dYMCoBKwMezl1qACKOOLgxGxk0IE3Nin8lXmnvd8M=; b=P5eho0RSvcAfgYUEmO2kfqjfq4zGW2KPOXjhnnkKxy/QhOyZJvGEUVbKw8NhWwiUBYNfVw 58lQwUsWo5oPSmH19/J7GoZAQmsm3swYRtv/FhtyLKvD4vARjUGmP5r8JPvA7hlC1xjr6H 7v2jHhjzE2NS7Vw5j3IuqWEtgWs/UGM= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-57-vq7BtKS2OKacuguRUad4Vg-1; Mon, 11 Nov 2019 03:04:52 -0500 Received: by mail-pg1-f200.google.com with SMTP id k7so11381979pgq.10 for ; Mon, 11 Nov 2019 00:04:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CQAhTC/o2YJhj0AZfjwdsGhelqoKVj50q9FveL4NL08=; b=dUiyNJtUt++3lmc7dT0bzYLX5RwqGHzdNGuV98Fvzl9HeMoj5k+oh66o0a/qDdus/r aGnvL8T8gYUkbw0y3EpIbcxMAXXLqReWI+SXUuYNnhqopgVExeJFlbz67DMOkTZU8aLx HYwv8kyHRVHYudOI3L7VPykf5ovtKFPdb4XPX6G0FHB/5qWK1jpImAREvJCj0gMinh4i cQt/bZ8QpRgZeJZ1+cmthMwE1R6ht02i4I1n4syHM/3IYZ6FBoNvRVrGM0MZLQEJgFC2 cAGu9VJYxslhIJid3V5PAEsJ20Wu34ys/xPDFbN/xPXlCQMztAB9NW+7ZzwWighXfIdc PuWg== X-Gm-Message-State: APjAAAU45fCorpWYHFns8NRyNtSvsf993YflfY/oZ7gpik0PFpRnIV5k 91T8Kz/Q8gOgKcaJSeCrGuOc3BKS2h3mYgaqHm8jzGLDKAO6HCMN8XY+cizYF8S65W6ku2lQpz5 GJ6mU1leEIMH0liFU3QsA3GT5ku+din95C5g= X-Received: by 2002:a17:90a:cc18:: with SMTP id b24mr31115540pju.141.1573459491917; Mon, 11 Nov 2019 00:04:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwYn3i3YBnhT+ZAxJ1SZwxD2hnT8z5SmG2cTnSfOAsjmdb/sBRMzhcOXON77fu4WCIQlrVPaQ== X-Received: by 2002:a17:90a:cc18:: with SMTP id b24mr31115508pju.141.1573459491651; Mon, 11 Nov 2019 00:04:51 -0800 (PST) Received: from localhost ([122.177.0.15]) by smtp.gmail.com with ESMTPSA id y1sm15008239pfq.138.2019.11.11.00.04.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2019 00:04:50 -0800 (PST) From: Bhupesh Sharma To: linux-kernel@vger.kernel.org Subject: [PATCH v4 2/3] arm64/crash_core: Export TCR_EL1.T1SZ in vmcoreinfo Date: Mon, 11 Nov 2019 13:34:44 +0530 Message-Id: <1573459485-27219-1-git-send-email-bhsharma@redhat.com> X-Mailer: git-send-email 2.7.4 X-MC-Unique: vq7BtKS2OKacuguRUad4Vg-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191111_000456_651711_C513259F X-CRM114-Status: GOOD ( 16.49 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [207.211.31.120 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kazuhito Hagio , Steve Capper , Catalin Marinas , bhsharma@redhat.com, Ard Biesheuvel , kexec@lists.infradead.org, James Morse , Dave Anderson , bhupesh.linux@gmail.com, Will Deacon , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org vabits_actual variable on arm64 indicates the actual VA space size, and allows a single binary to support both 48-bit and 52-bit VA spaces. If the ARMv8.2-LVA optional feature is present, and we are running with a 64KB page size; then it is possible to use 52-bits of address space for both userspace and kernel addresses. However, any kernel binary that supports 52-bit must also be able to fall back to 48-bit at early boot time if the hardware feature is not present. Since TCR_EL1.T1SZ indicates the size offset of the memory region addressed by TTBR1_EL1 (and hence can be used for determining the vabits_actual value) it makes more sense to export the same in vmcoreinfo rather than vabits_actual variable, as the name of the variable can change in future kernel versions, but the architectural constructs like TCR_EL1.T1SZ can be used better to indicate intended specific fields to user-space. User-space utilities like makedumpfile and crash-utility, need to read/write this value from/to vmcoreinfo for determining if a virtual address lies in the linear map range. The user-space computation for determining whether an address lies in the linear map range is the same as we have in kernel-space: #define __is_lm_address(addr) (!(((u64)addr) & BIT(vabits_actual - 1))) Cc: James Morse Cc: Mark Rutland Cc: Will Deacon Cc: Steve Capper Cc: Catalin Marinas Cc: Ard Biesheuvel Cc: Dave Anderson Cc: Kazuhito Hagio Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org Signed-off-by: Bhupesh Sharma --- arch/arm64/include/asm/pgtable-hwdef.h | 1 + arch/arm64/kernel/crash_core.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index d9fbd433cc17..d2e7aff5821e 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h @@ -215,6 +215,7 @@ #define TCR_TxSZ(x) (TCR_T0SZ(x) | TCR_T1SZ(x)) #define TCR_TxSZ_WIDTH 6 #define TCR_T0SZ_MASK (((UL(1) << TCR_TxSZ_WIDTH) - 1) << TCR_T0SZ_OFFSET) +#define TCR_T1SZ_MASK (((UL(1) << TCR_TxSZ_WIDTH) - 1) << TCR_T1SZ_OFFSET) #define TCR_EPD0_SHIFT 7 #define TCR_EPD0_MASK (UL(1) << TCR_EPD0_SHIFT) diff --git a/arch/arm64/kernel/crash_core.c b/arch/arm64/kernel/crash_core.c index ca4c3e12d8c5..f78310ba65ea 100644 --- a/arch/arm64/kernel/crash_core.c +++ b/arch/arm64/kernel/crash_core.c @@ -7,6 +7,13 @@ #include #include +static inline u64 get_tcr_el1_t1sz(void); + +static inline u64 get_tcr_el1_t1sz(void) +{ + return (read_sysreg(tcr_el1) & TCR_T1SZ_MASK) >> TCR_T1SZ_OFFSET; +} + void arch_crash_save_vmcoreinfo(void) { VMCOREINFO_NUMBER(VA_BITS); @@ -15,5 +22,7 @@ void arch_crash_save_vmcoreinfo(void) kimage_voffset); vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n", PHYS_OFFSET); + vmcoreinfo_append_str("NUMBER(tcr_el1_t1sz)=0x%llx\n", + get_tcr_el1_t1sz()); vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset()); } From patchwork Mon Nov 11 08:04:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 11236677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B17814ED for ; Mon, 11 Nov 2019 08:05:23 +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 4884D2075C for ; Mon, 11 Nov 2019 08:05:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cloADmLL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YzL85NUQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4884D2075C 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+patchwork-linux-arm=patchwork.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-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=3czr7DZ6cD9WlPeQYvyMOsGAb9ivMfNdkbT+3/2p2ZU=; b=cloADmLLabuknZZ6rrI9b/yW1s 0SzHgOqNTozsd4XgLwcEQzIECAec1NVbbp4Om5pm0Zf9rPeG5eEMVMD8x7cOEjbKkp4MySZqLMYft ozQCakSJsHvm7M5aG9wSPNf68Q7UBGzSfFsetCefGNVqjaqDV+x9ME2ayP/P6Lk5Wprq7ITsg40Yo 8/6vAU/Am3F+K5Sugs4S2o4FE8DQd1+/hRXFw5bO7BS3RjDqx6ZslgsB8+mlaNN4avkl9L8J9nFkA kOraegMGEXkxzW542OQdsgeXJN0C53r2vxKsk3CQ+/J/o//dS710L61S6Xp4v3Q91FSZyQMo0D0B5 yfVUow9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4hM-0005iJ-LX; Mon, 11 Nov 2019 08:05:20 +0000 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4h1-0004EM-HK for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 08:05:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573459498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2FRKI5+6EDUKwn2QzAstv2u6dW0Q8/ilQLcz5atGxuE=; b=YzL85NUQPYbV3CULNH5NR1+PPEfYPyWQXAfwXEWi7yJ4neLhUp3MBpFGLWQvSwW1Yt7B9g VUy7ympG6dTWDPJTp6P+yrE+12NDnAw8y0nE9FtTv8nVJo6GIkgpFsCJrb4wcJVidE2Cth hrAOj52Q7eHBahdg26Njs7XtWVGjEAU= Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-ZrAZpJetPoWjHqz-nH5t5w-1; Mon, 11 Nov 2019 03:04:57 -0500 Received: by mail-pg1-f199.google.com with SMTP id t11so11364694pgm.2 for ; Mon, 11 Nov 2019 00:04:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BgAr5VVOQXh1yien5qVgdgmIL5RHbScoYGF2ala0/ak=; b=E+/7N448xhKi9BT3sC02EdO1p43Uef3BvYDasgWAbf1xVerV2nZlCAnkntwwLfRtOm Dj/Y5WvDFRSEj3LjfRhqVW0NS6S7jogaJFu/w7OZH5xM38DhMU0JGeMA+PWDOVaDyQ9H zbMC5pHpao3HMJO7ckP4owHWkV7PY9gqjmr295P8evCNYK10+ZyFcRJrQ/nbPZeGD8m9 9P60aTjFrhlNWRF9NgO9czvt068TYL8rr/Rn/xYPTFa26/xiLnKWR7yZIcXMAb219TxU kSKz73eCExuOrGITpDsLkwKDHCPgJqGhPz/XP9k1nsZhNZkcd3XkaDCoLFmXGCR1BXP8 nIjQ== X-Gm-Message-State: APjAAAWubMQKKNm3WecgFVdZwcKG9wWiDNmGmLM606p7bcDWLgki99OL OI/c5j/RtKpB912WlthXrHb657n400/wzZVUt2pNMMu8/vQnJXhdOIr1uiFVmeZtnj3B1gkLIBI eJAnCbdkqxORHiEpPVEkiS4FlAIPqcLxJ3TI= X-Received: by 2002:a63:cc17:: with SMTP id x23mr27009230pgf.446.1573459496119; Mon, 11 Nov 2019 00:04:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzJWpQcBQvquc5dbnGBM6G4yNAtHiqFdXD409t0Q0+sK5yPSXKJEhVQvzS4/XbjlsLJyg9EHQ== X-Received: by 2002:a63:cc17:: with SMTP id x23mr27009207pgf.446.1573459495818; Mon, 11 Nov 2019 00:04:55 -0800 (PST) Received: from localhost ([122.177.0.15]) by smtp.gmail.com with ESMTPSA id m123sm15397699pfb.133.2019.11.11.00.04.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2019 00:04:54 -0800 (PST) From: Bhupesh Sharma To: linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] Documentation/arm64: Fix a simple typo in memory.rst Date: Mon, 11 Nov 2019 13:34:45 +0530 Message-Id: <1573459485-27219-2-git-send-email-bhsharma@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573459485-27219-1-git-send-email-bhsharma@redhat.com> References: <1573459485-27219-1-git-send-email-bhsharma@redhat.com> X-MC-Unique: ZrAZpJetPoWjHqz-nH5t5w-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191111_000459_679573_D92480A8 X-CRM114-Status: GOOD ( 15.54 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [205.139.110.120 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Ard Biesheuvel , Jonathan Corbet , Catalin Marinas , bhsharma@redhat.com, Steve Capper , linux-doc@vger.kernel.org, James Morse , bhupesh.linux@gmail.com, Will Deacon , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fix a simple typo in arm64/memory.rst Cc: Jonathan Corbet Cc: James Morse Cc: Mark Rutland Cc: Will Deacon Cc: Steve Capper Cc: Catalin Marinas Cc: Ard Biesheuvel Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Bhupesh Sharma --- Documentation/arm64/memory.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/arm64/memory.rst b/Documentation/arm64/memory.rst index 02e02175e6f5..cf03b3290800 100644 --- a/Documentation/arm64/memory.rst +++ b/Documentation/arm64/memory.rst @@ -129,7 +129,7 @@ this logic. As a single binary will need to support both 48-bit and 52-bit VA spaces, the VMEMMAP must be sized large enough for 52-bit VAs and -also must be sized large enought to accommodate a fixed PAGE_OFFSET. +also must be sized large enough to accommodate a fixed PAGE_OFFSET. Most code in the kernel should not need to consider the VA_BITS, for code that does need to know the VA size the variables are