From: Stefan Bader <stefan.bader@canonical.com>
To: Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@kernel.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Andy Whitcroft <apw@canonical.com>, Mel Gorman <mgorman@suse.de>
Subject: Re: x86/mm/pageattr: Code without effect?
Date: Mon, 08 Apr 2013 16:51:13 +0200 [thread overview]
Message-ID: <5162D961.7030206@canonical.com> (raw)
In-Reply-To: <20130408141557.GD4395@pd.tnic>
[-- Attachment #1: Type: text/plain, Size: 1728 bytes --]
On 08.04.2013 16:15, Borislav Petkov wrote:
> On Mon, Apr 08, 2013 at 03:10:00PM +0200, Stefan Bader wrote:
>> * that we limited the number of possible pages already to
>> * the number of pages in the large page.
>> */
>> if (address == (address & pmask) && cpa->numpages == (psize >>
>> PAGE_SHIFT)) {
>> /*
>> * The address is aligned and the number of pages
>> * covers the full page.
>> */
>> new_pte = pfn_pte(pte_pfn(old_pte), new_prot);
>> ^
>>
>> This one. The first patch changed
>>
>> - new_pte = pfn_pte(pte_pfn(old_pte), canon_pgprot(new_prot));
>> + new_pte = pfn_pte(pte_pfn(old_pte), new_prot);
>>
>> The fixup patch drops new_prot completely from being initialized and only works
>> on req_prot. Probably it would be best to also drop the definition of new_prot.
>> I think it then completely unused.
>
> Actually, we do need and initialize new_prot at line 495:
>
> pfn = pte_pfn(old_pte) + ((address & (psize - 1)) >> PAGE_SHIFT);
> cpa->pfn = pfn;
>
> new_prot = static_protections(req_prot, address, pfn); <---
You are right. Seems I missed that and a couble of other places. I can see them
now... Hm, Monday morning or just morning issue... So, yes, its new_prot is
initialized and is still needed, otherwise the loop over the whole range would
be subtly different.
Sorry for the noise.
-Stefan
>
> and we need it for the subsequent loop where we go over the 512 PTEs to
> decide whether to split or not.
>
> So it is needed after all, AFAICT.
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]
next prev parent reply other threads:[~2013-04-08 14:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 9:01 Stefan Bader
2013-04-05 14:21 ` Borislav Petkov
2013-04-06 14:58 ` Andrea Arcangeli
2013-04-06 15:47 ` Borislav Petkov
2013-04-08 11:53 ` Ingo Molnar
2013-04-08 11:59 ` Borislav Petkov
2013-04-08 12:28 ` Stefan Bader
2013-04-08 12:51 ` Borislav Petkov
2013-04-08 13:10 ` Stefan Bader
2013-04-08 14:15 ` Borislav Petkov
2013-04-08 14:51 ` Stefan Bader [this message]
2013-04-08 14:53 ` Andy Whitcroft
2013-04-08 15:32 ` Andrea Arcangeli
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=5162D961.7030206@canonical.com \
--to=stefan.bader@canonical.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome