All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ingo Molnar" <mingo@kernel.org>
Cc: <mingo@elte.hu>, <tglx@linutronix.de>,
	"xen-devel" <xen-devel@lists.xenproject.org>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Juergen Gross" <jgross@suse.com>, <linux-kernel@vger.kernel.org>,
	<hpa@zytor.com>
Subject: Re: [PATCH 2/2] x86-64/Xen: eliminate W+X mappings
Date: Tue, 12 Dec 2017 03:48:56 -0700	[thread overview]
Message-ID: <5A2FC2280200007800196BB8@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20171212103819.an2xxafjv3cdkuy7@gmail.com>

>>> On 12.12.17 at 11:38, <mingo@kernel.org> wrote:
> * Jan Beulich <JBeulich@suse.com> wrote:
>> --- 4.15-rc3/arch/x86/xen/mmu_pv.c
>> +++ 4.15-rc3-x86_64-Xen-avoid-W+X/arch/x86/xen/mmu_pv.c
>> @@ -1902,6 +1902,16 @@ void __init xen_setup_kernel_pagetable(p
>>  	/* Graft it onto L4[511][510] */
>>  	copy_page(level2_kernel_pgt, l2);
>>  
>> +	/* Zap execute permission from the ident map. Due to the sharing of
>> +	 * L1 entries we need to do this in the L2. */
> 
> please use the customary (multi-line) comment style:
> 
>   /*
>    * Comment .....
>    * ...... goes here.
>    */
> 
> specified in Documentation/CodingStyle.

I would have but didn't because all other comments in this function
use this (wrong) style. I've concluded that consistency is better
here than matching the style doc. If the Xen maintainers tell me
otherwise, I'll happily adjust the patch.

>> +	if (__supported_pte_mask & _PAGE_NX)
>> +		for (i = 0; i < PTRS_PER_PMD; ++i) {
>> +			if (pmd_none(level2_ident_pgt[i]))
>> +				continue;
>> +			level2_ident_pgt[i] =
>> +				pmd_set_flags(level2_ident_pgt[i], _PAGE_NX);
> 
> So the line break here is quite distracting, especially considering how similar it 
> is to the alignment of the 'continue' statement. I.e. visually it looks like 
> control flow alignment.
> 
> Would be much better to just leave it a single page and ignore checkpatch 
> here.

Again I'll wait to see what the Xen maintainers think. I too dislike
line splits like this one, but the line ended up quite a bit too long,
not just a character or two. I also wasn't sure whether splitting
between the function arguments would be okay, leaving the first
line just slightly too long.

Jan

  parent reply	other threads:[~2017-12-12 10:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 10:24 [PATCH 0/2] x86: deal with remaining W+X pages on Xen Jan Beulich
2017-12-12 10:31 ` [PATCH 1/2] x86: consider effective protection attributes in W+X check Jan Beulich
2017-12-12 10:36   ` Ingo Molnar
2017-12-12 10:36   ` Ingo Molnar
2017-12-12 10:43     ` Jan Beulich
2017-12-12 10:43     ` Jan Beulich
2017-12-12 10:31 ` Jan Beulich
2017-12-12 10:32 ` [PATCH 2/2] x86-64/Xen: eliminate W+X mappings Jan Beulich
2017-12-12 10:38   ` Ingo Molnar
2017-12-12 10:38   ` Ingo Molnar
2017-12-12 10:48     ` Jan Beulich
2017-12-12 10:48     ` Jan Beulich [this message]
2017-12-12 10:54       ` Ingo Molnar
2017-12-12 10:54       ` Ingo Molnar
     [not found]     ` <5A2FC2280200007800196BB8@suse.com>
2017-12-12 13:14       ` Juergen Gross
2017-12-12 13:14       ` Juergen Gross
2017-12-18 11:11   ` [PATCH v2] " Jan Beulich
2017-12-18 12:28     ` Ingo Molnar
2017-12-18 15:52       ` Joe Perches
2017-12-18 15:52       ` Joe Perches
2017-12-18 12:28     ` Ingo Molnar
2017-12-18 11:11   ` Jan Beulich
2017-12-18 16:37   ` [PATCH v3] " Jan Beulich
2017-12-18 16:37   ` Jan Beulich
2017-12-12 10:32 ` [PATCH 2/2] " Jan Beulich
     [not found] ` <5A2FBE0A0200007800196B4F@suse.com>
2017-12-14 14:04   ` [PATCH 1/2] x86: consider effective protection attributes in W+X check Juergen Gross
2017-12-14 14:12     ` Thomas Gleixner
2017-12-14 14:12     ` Thomas Gleixner
2017-12-14 14:15     ` Jan Beulich
2017-12-14 14:17       ` Thomas Gleixner
2017-12-14 14:17         ` Thomas Gleixner
2017-12-14 14:21       ` Juergen Gross
2017-12-14 14:21       ` Juergen Gross
2017-12-14 14:15     ` Jan Beulich
2017-12-14 14:04   ` Juergen Gross

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=5A2FC2280200007800196BB8@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --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.