Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Bhupesh Sharma <bhsharma@redhat.com>
To: linux-arm-kernel@lists.infradead.org
Cc: mark.rutland@arm.com, steve.capper@arm.com,
	catalin.marinas@arm.com, bhsharma@redhat.com,
	ard.biesheuvel@linaro.org, will.deacon@arm.com,
	bhupesh.linux@gmail.com, kexec@lists.infradead.org,
	suzuki.poulose@arm.com
Subject: [PATCH 0/2] arm64: Expose physical and virtual address capabilities to user-space
Date: Tue, 29 Jan 2019 02:27:54 +0530
Message-ID: <1548709076-22317-1-git-send-email-bhsharma@redhat.com> (raw)

With ARMv8.2-LVA and LPA architecture extensions, arm64 hardware which
supports these extensions can support upto 52-bit virtual and 52-bit
physical addresses respectively.

Since at the moment we enable the support of these extensions via CONFIG
flags, e.g.
 - LPA via CONFIG_ARM64_PA_BITS_52
   
there are no clear mechanisms in user-space right now to
deteremine these CONFIG flag values and also determine the PARange and
VARange address values.

This patchset proposes two mechanisms to provide a user/user-space
application more information on the same:

1. For a non-expert user, getting an idea about the virtual/physical
   address capabilities on an arm64 hardware via executing:
   $ cat /proc/cpuinfo

   can be quite useful as it provides a similar mechanism as available
   already on x86_64.

   PATCH 1/2 implements the same.

2. For a more involved user/user-space application, the Appendix I:
   Example in 'Documentation/arm64/cpu-feature-registers.txt' is pretty
   useful.

   If we can expose the PARange and VARange values via the MRS register
   reads to user-space, we can use them in user-space programs as a
   standard ABI.

   I already have a 'makedumpfile' user-space example that uses the same
   to determine ARMv8.2-LPA support. See [0].
   
   PATCH 2/2 implements the same.

[0]. https://github.com/bhupesh-sharma/makedumpfile/blob/9d7da4aad3efe79b448f48cc3454fcae46a316d6/arch/arm64.c#L499

Bhupesh Sharma (2):
  arm64: Expose address bits (physical/virtual) via cpuinfo
  arm64: Expose PARange via ID_AA64MMFR0_EL1 and VARange via
    ID_AA64MMFR2_EL1

 arch/arm64/include/asm/cpufeature.h | 59 ++++++++++++++++++++++++-------------
 arch/arm64/include/asm/sysreg.h     | 19 ++++++++++++
 arch/arm64/kernel/cpufeature.c      |  4 +--
 arch/arm64/kernel/cpuinfo.c         |  4 ++-
 4 files changed, 63 insertions(+), 23 deletions(-)

-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 20:57 Bhupesh Sharma [this message]
2019-01-28 20:57 ` [PATCH 1/2] arm64: Expose address bits (physical/virtual) via cpuinfo Bhupesh Sharma
2019-01-29 10:09   ` Suzuki K Poulose
2019-01-30 19:48     ` Bhupesh Sharma
2019-02-04 16:54       ` James Morse
2019-01-28 20:57 ` [PATCH 2/2] arm64: Expose PARange via ID_AA64MMFR0_EL1 and VARange via ID_AA64MMFR2_EL1 Bhupesh Sharma
2019-01-29 10:14   ` Suzuki K Poulose
2019-01-30 20:27     ` Bhupesh Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1548709076-22317-1-git-send-email-bhsharma@redhat.com \
    --to=bhsharma@redhat.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bhupesh.linux@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=steve.capper@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git