* [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()"
@ 2018-09-10 14:01 Jan Beulich
2018-09-18 12:43 ` Ping: " Jan Beulich
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jan Beulich @ 2018-09-10 14:01 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper
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@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1371,16 +1371,21 @@ static int alloc_l1_table(struct page_in
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);
--- 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
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
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);
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Ping: [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()"
2018-09-10 14:01 [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()" Jan Beulich
@ 2018-09-18 12:43 ` Jan Beulich
2018-09-20 8:59 ` Wei Liu
2018-09-20 13:38 ` Andrew Cooper
2 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2018-09-18 12:43 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper
>>> On 10.09.18 at 16:01, <JBeulich@suse.com> wrote:
> 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@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -1371,16 +1371,21 @@ static int alloc_l1_table(struct page_in
> 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);
> --- 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
> 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
> 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);
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()"
2018-09-10 14:01 [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()" Jan Beulich
2018-09-18 12:43 ` Ping: " Jan Beulich
@ 2018-09-20 8:59 ` Wei Liu
2018-09-20 13:38 ` Andrew Cooper
2 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2018-09-20 8:59 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Wei Liu, Andrew Cooper
On Mon, Sep 10, 2018 at 08:01:39AM -0600, Jan Beulich wrote:
> 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@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()"
2018-09-10 14:01 [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()" Jan Beulich
2018-09-18 12:43 ` Ping: " Jan Beulich
2018-09-20 8:59 ` Wei Liu
@ 2018-09-20 13:38 ` Andrew Cooper
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2018-09-20 13:38 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 10/09/18 15:01, Jan Beulich wrote:
> 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@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-20 13:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10 14:01 [PATCH] x86/mm: re-indent after "re-arrange get_page_from_l<N>e() vs pv_l1tf_check_l<N>e()" Jan Beulich
2018-09-18 12:43 ` Ping: " Jan Beulich
2018-09-20 8:59 ` Wei Liu
2018-09-20 13:38 ` Andrew Cooper
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.