|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()"
commit 2de083a11848525dd7bfc6383e6033b91f7032ef
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Sep 21 12:21:32 2018 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Sep 21 12:21:32 2018 +0200
x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs
pv_l1tf_check_l<N>e()"
That earlier change introduced two "else switch ()" constructs which now
get converted back to "normal" style (indentation). To limit indentation
depth, a conditional gets inverted in ptwr_emulated_update().
No functional change intended.
Requested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/arch/x86/mm.c | 23 ++++++++++++++---------
xen/arch/x86/pv/ro-page-fault.c | 35 +++++++++++++++++++----------------
2 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d37eea53d1..db7faa9632 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1413,16 +1413,21 @@ static int alloc_l1_table(struct page_info *page)
if ( ret )
goto out;
}
- else switch ( ret = get_page_from_l1e(pl1e[i], d, d) )
+ else
{
- default:
- goto fail;
- case 0:
- break;
- case _PAGE_RW ... _PAGE_RW | PAGE_CACHE_ATTRS:
- ASSERT(!(ret & ~(_PAGE_RW | PAGE_CACHE_ATTRS)));
- l1e_flip_flags(pl1e[i], ret);
- break;
+ switch ( ret = get_page_from_l1e(pl1e[i], d, d) )
+ {
+ default:
+ goto fail;
+
+ case 0:
+ break;
+
+ case _PAGE_RW ... _PAGE_RW | PAGE_CACHE_ATTRS:
+ ASSERT(!(ret & ~(_PAGE_RW | PAGE_CACHE_ATTRS)));
+ l1e_flip_flags(pl1e[i], ret);
+ break;
+ }
}
pl1e[i] = adjust_guest_l1e(pl1e[i], d);
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 1246eeb1c5..e7a7179dda 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -136,12 +136,18 @@ static int ptwr_emulated_update(unsigned long addr,
intpte_t *p_old,
if ( pv_l1tf_check_l1e(d, nl1e) )
return X86EMUL_RETRY;
}
- else switch ( ret = get_page_from_l1e(nl1e, d, d) )
+ else
{
- default:
- if ( is_pv_32bit_domain(d) && (bytes == 4) && (unaligned_addr & 4) &&
- !p_old && (l1e_get_flags(nl1e) & _PAGE_PRESENT) )
+ switch ( ret = get_page_from_l1e(nl1e, d, d) )
{
+ default:
+ if ( !is_pv_32bit_domain(d) || (bytes != 4) ||
+ !(unaligned_addr & 4) || p_old ||
+ !(l1e_get_flags(nl1e) & _PAGE_PRESENT) )
+ {
+ gdprintk(XENLOG_WARNING, "could not get_page_from_l1e()\n");
+ return X86EMUL_UNHANDLEABLE;
+ }
/*
* If this is an upper-half write to a PAE PTE then we assume that
* the guest has simply got the two writes the wrong way round. We
@@ -151,19 +157,16 @@ static int ptwr_emulated_update(unsigned long addr,
intpte_t *p_old,
gdprintk(XENLOG_DEBUG, "ptwr_emulate: fixing up invalid PAE PTE %"
PRIpte"\n", l1e_get_intpte(nl1e));
l1e_remove_flags(nl1e, _PAGE_PRESENT);
+ break;
+
+ case 0:
+ break;
+
+ case _PAGE_RW ... _PAGE_RW | PAGE_CACHE_ATTRS:
+ ASSERT(!(ret & ~(_PAGE_RW | PAGE_CACHE_ATTRS)));
+ l1e_flip_flags(nl1e, ret);
+ break;
}
- else
- {
- gdprintk(XENLOG_WARNING, "could not get_page_from_l1e()\n");
- return X86EMUL_UNHANDLEABLE;
- }
- break;
- case 0:
- break;
- case _PAGE_RW ... _PAGE_RW | PAGE_CACHE_ATTRS:
- ASSERT(!(ret & ~(_PAGE_RW | PAGE_CACHE_ATTRS)));
- l1e_flip_flags(nl1e, ret);
- break;
}
nl1e = adjust_guest_l1e(nl1e, d);
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |