From: Oliver Upton <oupton@google.com>
To: Ricardo Koller <ricarkol@google.com>
Cc: kvm@vger.kernel.org, maz@kernel.org, bgardon@google.com,
pbonzini@redhat.com, axelrasmussen@google.com,
kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH v3 07/13] KVM: selftests: aarch64: Construct DEFAULT_MAIR_EL1 using sysreg.h macros
Date: Thu, 19 May 2022 04:17:04 +0000 [thread overview]
Message-ID: <YoXEwEaxVat7XTl1@google.com> (raw)
In-Reply-To: <20220408004120.1969099-8-ricarkol@google.com>
On Thu, Apr 07, 2022 at 05:41:14PM -0700, Ricardo Koller wrote:
> Define macros for memory type indexes and construct DEFAULT_MAIR_EL1
> with macros from asm/sysreg.h. The index macros can then be used when
> constructing PTEs (instead of using raw numbers).
>
> Signed-off-by: Ricardo Koller <ricarkol@google.com>
> ---
> .../selftests/kvm/include/aarch64/processor.h | 24 ++++++++++++++-----
> .../selftests/kvm/lib/aarch64/processor.c | 2 +-
> 2 files changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h
> index 3965a5ac778e..16753a1f28e3 100644
> --- a/tools/testing/selftests/kvm/include/aarch64/processor.h
> +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h
> @@ -38,12 +38,24 @@
> * NORMAL 4 1111:1111
> * NORMAL_WT 5 1011:1011
> */
> -#define DEFAULT_MAIR_EL1 ((0x00ul << (0 * 8)) | \
> - (0x04ul << (1 * 8)) | \
> - (0x0cul << (2 * 8)) | \
> - (0x44ul << (3 * 8)) | \
> - (0xfful << (4 * 8)) | \
> - (0xbbul << (5 * 8)))
> +
> +/* Linux doesn't use these memory types, so let's define them. */
> +#define MAIR_ATTR_DEVICE_GRE UL(0x0c)
> +#define MAIR_NORMAL_WT UL(0xbb)
nit: MAIR_ATTR_NORMAL_WT
Might be annoying if these are actually defined at a later date and
someone tries to refresh the tools/ header copy. A bit more work, but
how about adding these to the real asm/sysreg.h then catching tools/ up
in a subsequent commit?
Modulo the nit, fine with this as is:
Reviewed-by: Oliver Upton <oupton@google.com>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2022-05-19 4:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 0:41 [PATCH v3 00/13] KVM: selftests: Add aarch64/page_fault_test Ricardo Koller
2022-04-08 0:41 ` [PATCH v3 01/13] KVM: selftests: Add a userfaultfd library Ricardo Koller
2022-04-08 0:41 ` [PATCH v3 02/13] KVM: selftests: aarch64: Add vm_get_pte_gpa library function Ricardo Koller
2022-05-19 3:48 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 03/13] KVM: selftests: Add vm_alloc_page_table_in_memslot " Ricardo Koller
2022-05-19 3:53 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 04/13] KVM: selftests: aarch64: Export _virt_pg_map with a pt_memslot arg Ricardo Koller
2022-05-19 4:05 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 05/13] KVM: selftests: Add missing close and munmap in __vm_mem_region_delete Ricardo Koller
2022-05-19 4:06 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 06/13] KVM: selftests: Add vm_mem_region_get_src_fd library function Ricardo Koller
2022-05-19 4:08 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 07/13] KVM: selftests: aarch64: Construct DEFAULT_MAIR_EL1 using sysreg.h macros Ricardo Koller
2022-05-19 4:17 ` Oliver Upton [this message]
2022-04-08 0:41 ` [PATCH v3 08/13] tools: Copy bitfield.h from the kernel sources Ricardo Koller
2022-05-19 4:25 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 09/13] KVM: selftests: aarch64: Add aarch64/page_fault_test Ricardo Koller
2022-05-25 19:43 ` Oliver Upton
2022-04-08 0:41 ` [PATCH v3 10/13] KVM: selftests: aarch64: Add userfaultfd tests into page_fault_test Ricardo Koller
2022-04-08 0:41 ` [PATCH v3 11/13] KVM: selftests: aarch64: Add dirty logging " Ricardo Koller
2022-04-08 0:41 ` [PATCH v3 12/13] KVM: selftests: aarch64: Add readonly memslot " Ricardo Koller
2022-04-08 0:41 ` [PATCH v3 13/13] KVM: selftests: aarch64: Add mix of " Ricardo Koller
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=YoXEwEaxVat7XTl1@google.com \
--to=oupton@google.com \
--cc=axelrasmussen@google.com \
--cc=bgardon@google.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=maz@kernel.org \
--cc=pbonzini@redhat.com \
--cc=ricarkol@google.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox