From: Suresh Siddha <suresh.b.siddha@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>
Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [patch] x86, cpa: consider alias mapping changes also in the flush tlb decisions
Date: Wed, 24 Feb 2010 13:54:18 -0800 [thread overview]
Message-ID: <1267048458.5149.34.camel@sbs-t61.sc.intel.com> (raw)
Page attributes like RWX may be different for the kernel mappings
and its aliases. So it is quite possible that the change page attribute of
main mapping may not change any attribute and hence no flush tlb is necessary.
But cpa() of the kernel alias mappings may change the attributes and hence
we need to consider the result of cpa_process_alias() in making a decision
for flushing the tlb.
We haven't seen a problem yet because of this issue, as all the current usages
result in an attribute change of main mapping and the alias mapping may or
maynot change. But the current code can break easily if there is any usage
of cpa() where the main mapping doesn't change the attribute but the alias
mapping can (on 64bit kernel, original cpa() using the kernel identity mapping
vs the kernel text mapping can behave differently because of this bug).
Fix it by forwarding the CPA_FLUSHTLB flag from the alias_cpa to the
original cpa.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index cf07c26..cc62a0d 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -757,6 +757,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
ret = __change_page_attr_set_clr(&alias_cpa, 0);
+ cpa->flags |= (alias_cpa.flags & CPA_FLUSHTLB);
if (ret)
return ret;
}
@@ -780,6 +781,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
* return value.
*/
__change_page_attr_set_clr(&alias_cpa, 0);
+ cpa->flags |= (alias_cpa.flags & CPA_FLUSHTLB);
}
#endif
reply other threads:[~2010-02-24 21:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1267048458.5149.34.camel@sbs-t61.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=venkatesh.pallipadi@intel.com \
/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
all inboxes | Powered by JetHome®