From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@arm.com>, sstabellini@kernel.org
Subject: [PATCH 08/15] xen/arm: Rename lpae_valid to lpae_is_valid
Date: Mon, 16 Jul 2018 18:27:05 +0100 [thread overview]
Message-ID: <20180716172712.20294-9-julien.grall@arm.com> (raw)
In-Reply-To: <20180716172712.20294-1-julien.grall@arm.com>
This will help to keep the naming consistent accross all lpae helpers.
No functional change intended.
Signed-off-by: Julien Grall <julien.grall@arm.com>
---
xen/arch/arm/guest_walk.c | 2 +-
xen/arch/arm/mm.c | 6 +++---
xen/arch/arm/p2m.c | 20 ++++++++++----------
xen/include/asm-arm/lpae.h | 8 ++++----
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c
index 4d1ea0cdc1..a7c7e05603 100644
--- a/xen/arch/arm/guest_walk.c
+++ b/xen/arch/arm/guest_walk.c
@@ -546,7 +546,7 @@ static int guest_walk_ld(const struct vcpu *v,
* - The PTE is not valid.
* - If (level < 3) and the PTE is valid, we found a block descriptor.
*/
- if ( level == 3 || !lpae_valid(pte) || lpae_is_superpage(pte, level) )
+ if ( level == 3 || !lpae_is_valid(pte) || lpae_is_superpage(pte, level) )
break;
/*
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b7f2dabd05..de9b965d2f 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1005,7 +1005,7 @@ static int create_xen_entries(enum xenmap_operation op,
}
}
- BUG_ON(!lpae_valid(*entry));
+ BUG_ON(!lpae_is_valid(*entry));
third = __mfn_to_virt(entry->pt.base);
entry = &third[third_table_offset(addr)];
@@ -1013,7 +1013,7 @@ static int create_xen_entries(enum xenmap_operation op,
switch ( op ) {
case INSERT:
case RESERVE:
- if ( lpae_valid(*entry) )
+ if ( lpae_is_valid(*entry) )
{
printk("%s: trying to replace an existing mapping addr=%lx mfn=%"PRI_mfn"\n",
__func__, addr, mfn_x(mfn));
@@ -1030,7 +1030,7 @@ static int create_xen_entries(enum xenmap_operation op,
break;
case MODIFY:
case REMOVE:
- if ( !lpae_valid(*entry) )
+ if ( !lpae_is_valid(*entry) )
{
printk("%s: trying to %s a non-existing mapping addr=%lx\n",
__func__, op == REMOVE ? "remove" : "modify", addr);
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 72a84a33fd..a80ac301c5 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -250,7 +250,7 @@ static int p2m_next_level(struct p2m_domain *p2m, bool read_only,
entry = *table + offset;
- if ( !lpae_valid(*entry) )
+ if ( !lpae_is_valid(*entry) )
{
if ( read_only )
return GUEST_TABLE_MAP_FAILED;
@@ -342,7 +342,7 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
entry = table[offsets[level]];
- if ( lpae_valid(entry) )
+ if ( lpae_is_valid(entry) )
{
*t = entry.p2m.type;
@@ -546,7 +546,7 @@ static int p2m_create_table(struct p2m_domain *p2m, lpae_t *entry)
lpae_t *p;
lpae_t pte;
- ASSERT(!lpae_valid(*entry));
+ ASSERT(!lpae_is_valid(*entry));
page = alloc_domheap_page(NULL, 0);
if ( page == NULL )
@@ -610,7 +610,7 @@ static int p2m_mem_access_radix_set(struct p2m_domain *p2m, gfn_t gfn,
*/
static void p2m_put_l3_page(const lpae_t pte)
{
- ASSERT(lpae_valid(pte));
+ ASSERT(lpae_is_valid(pte));
/*
* TODO: Handle other p2m types
@@ -638,7 +638,7 @@ static void p2m_free_entry(struct p2m_domain *p2m,
struct page_info *pg;
/* Nothing to do if the entry is invalid. */
- if ( !lpae_valid(entry) )
+ if ( !lpae_is_valid(entry) )
return;
/* Nothing to do but updating the stats if the entry is a super-page. */
@@ -908,12 +908,12 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
* sequence when updating the translation table (D4.7.1 in ARM DDI
* 0487A.j).
*/
- if ( lpae_valid(orig_pte) )
+ if ( lpae_is_valid(orig_pte) )
p2m_remove_pte(entry, p2m->clean_pte);
if ( mfn_eq(smfn, INVALID_MFN) )
/* Flush can be deferred if the entry is removed */
- p2m->need_flush |= !!lpae_valid(orig_pte);
+ p2m->need_flush |= !!lpae_is_valid(orig_pte);
else
{
lpae_t pte = mfn_to_p2m_entry(smfn, t, a);
@@ -928,7 +928,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
* Although, it could be defered when only the permissions are
* changed (e.g in case of memaccess).
*/
- if ( lpae_valid(orig_pte) )
+ if ( lpae_is_valid(orig_pte) )
{
if ( likely(!p2m->mem_access_enabled) ||
P2M_CLEAR_PERM(pte) != P2M_CLEAR_PERM(orig_pte) )
@@ -950,11 +950,11 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
* Free the entry only if the original pte was valid and the base
* is different (to avoid freeing when permission is changed).
*/
- if ( lpae_valid(orig_pte) && entry->p2m.base != orig_pte.p2m.base )
+ if ( lpae_is_valid(orig_pte) && entry->p2m.base != orig_pte.p2m.base )
p2m_free_entry(p2m, orig_pte, level);
if ( need_iommu(p2m->domain) &&
- (lpae_valid(orig_pte) || lpae_valid(*entry)) )
+ (lpae_is_valid(orig_pte) || lpae_is_valid(*entry)) )
rc = iommu_iotlb_flush(p2m->domain, gfn_x(sgfn), 1UL << page_order);
else
rc = 0;
diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
index c803569c2d..1d86020d07 100644
--- a/xen/include/asm-arm/lpae.h
+++ b/xen/include/asm-arm/lpae.h
@@ -128,19 +128,19 @@ typedef union {
lpae_walk_t walk;
} lpae_t;
-static inline bool lpae_valid(lpae_t pte)
+static inline bool lpae_is_valid(lpae_t pte)
{
return pte.walk.valid;
}
static inline bool lpae_is_table(lpae_t pte, unsigned int level)
{
- return (level < 3) && lpae_valid(pte) && pte.walk.table;
+ return (level < 3) && lpae_is_valid(pte) && pte.walk.table;
}
static inline bool lpae_is_mapping(lpae_t pte, unsigned int level)
{
- if ( !lpae_valid(pte) )
+ if ( !lpae_is_valid(pte) )
return false;
else if ( level == 3 )
return pte.walk.table;
@@ -155,7 +155,7 @@ static inline bool lpae_is_superpage(lpae_t pte, unsigned int level)
static inline bool lpae_is_page(lpae_t pte, unsigned int level)
{
- return (level == 3) && lpae_valid(pte) && pte.walk.table;
+ return (level == 3) && lpae_is_valid(pte) && pte.walk.table;
}
/*
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-07-16 17:27 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 17:26 [PATCH 00/15] xen/arm: Bunch of clean-up/improvement Julien Grall
2018-07-16 17:26 ` [PATCH 01/15] xen/arm: cpregs: Allow HSR_CPREG* to receive more than 1 parameter Julien Grall
2018-08-14 21:47 ` Stefano Stabellini
2018-07-16 17:26 ` [PATCH 02/15] xen/arm: cpregs: Fix typo in the documentation of TTBCR Julien Grall
2018-08-14 20:39 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 03/15] xen/arm: Introduce helpers to clear/flags flags in HCR_EL2 Julien Grall
2018-08-14 20:46 ` Stefano Stabellini
2018-08-14 21:23 ` Julien Grall
2018-08-14 21:49 ` Stefano Stabellini
2018-08-14 22:53 ` Julien Grall
2018-08-14 23:03 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 04/15] xen/arm: p2m: Reduce the locking section in get_page_from_gva Julien Grall
2018-08-14 20:49 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 05/15] xen/arm: p2m: Limit call to mem access code use " Julien Grall
2018-07-17 9:54 ` Razvan Cojocaru
2018-08-14 20:59 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 06/15] xen/arm: Rework lpae_mapping Julien Grall
2018-08-14 21:04 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 07/15] xen/arm: Rework lpae_table Julien Grall
2018-08-14 21:07 ` Stefano Stabellini
2018-07-16 17:27 ` Julien Grall [this message]
2018-08-14 21:09 ` [PATCH 08/15] xen/arm: Rename lpae_valid to lpae_is_valid Stefano Stabellini
2018-07-16 17:27 ` [PATCH 09/15] xen/arm: guest_walk: Use lpae_is_mapping to simplify the code Julien Grall
2018-08-14 21:14 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 10/15] xen/arm: Introduce helpers to get/set an MFN from/to an LPAE entry Julien Grall
2018-08-14 21:25 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 11/15] xen/arm: Allow lpae_is_{table, mapping} helpers to work on invalid entry Julien Grall
2018-08-14 21:33 ` Stefano Stabellini
2018-08-14 22:51 ` Julien Grall
2018-08-15 19:13 ` Stefano Stabellini
2018-08-16 8:51 ` Julien Grall
2018-07-16 17:27 ` [PATCH 12/15] xen/arm: p2m: Rename ret to mfn in p2m_lookup Julien Grall
2018-08-14 21:35 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 13/15] xen/arm: p2m: Introduce a new variable removing_mapping in __p2m_set_entry Julien Grall
2018-08-14 21:37 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 14/15] xen/arm: guest_walk_tables: Switch the return to bool Julien Grall
2018-08-14 21:41 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 15/15] xen/arm: traps: Move the implementation of GUEST_BUG_ON in traps.h Julien Grall
2018-08-14 21:43 ` Stefano Stabellini
2018-08-16 8:54 ` Julien Grall
2018-08-16 18:17 ` Stefano Stabellini
2018-08-20 9:17 ` Julien Grall
2018-08-20 22:02 ` Stefano Stabellini
2018-07-23 17:12 ` [PATCH 00/15] xen/arm: Bunch of clean-up/improvement Julien Grall
2018-08-22 15:45 ` Julien Grall
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=20180716172712.20294-9-julien.grall@arm.com \
--to=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.