git: 754e1308ce1d - stable/13 - arm64: Add a macro to find a VM fault address

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 15 Jul 2024 12:38:03 UTC
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=754e1308ce1de66f3097cb7f38e81c62faa87804

commit 754e1308ce1de66f3097cb7f38e81c62faa87804
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-02-21 18:17:47 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-07-15 12:34:28 +0000

    arm64: Add a macro to find a VM fault address
    
    Add a macro to find which bits from far_el2 are needed to be copied
    to get the full intermediate physical address (IPA).
    
    The hpfar_el2 register only contains a 4k aligned fault address. We
    need to include the lower bits from far_el2 if we need the full
    faulting IPA.
    
    (cherry picked from commit b3bbec37ba039a46f7166f6fa3571f38da4253e9)
---
 sys/arm64/include/hypervisor.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h
index f3c871191688..ff6aff00e226 100644
--- a/sys/arm64/include/hypervisor.h
+++ b/sys/arm64/include/hypervisor.h
@@ -122,6 +122,8 @@
 /* HPFAR_EL2_FIPA holds the 4k page address */
 #define	HPFAR_EL2_FIPA_ADDR(x)	\
     (HPFAR_EL2_FIPA_GET(x) << 12)
+/* The bits from FAR_EL2 we need to add to HPFAR_EL2_FIPA_ADDR */
+#define	FAR_EL2_HPFAR_PAGE_MASK	(0xffful)
 
 /* ICC_SRE_EL2 */
 #define	ICC_SRE_EL2_SRE		(1UL << 0)