public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: joseph.cihula@intel.com
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	arjan@linux.intel.com, chrisw@sous-sol.org, jmorris@namei.org,
	jbeulich@novell.com, peterm@redhat.com, gang.wei@intel.com,
	shane.wang@intel.com
Subject: Re: [RFC v2][PATCH 1/1] intel_txt: Intel(R) TXT and tboot kernel support II
Date: Sat, 18 Apr 2009 22:29:02 +0200	[thread overview]
Message-ID: <878wlxr9ip.fsf_-_@basil.nowhere.org> (raw)
In-Reply-To: <87d4baqnxy.fsf@basil.nowhere.org> (Andi Kleen's message of "Sat, 18 Apr 2009 12:02:49 +0200")

Andi Kleen <andi@firstfloor.org> writes:
>> +	set_pte_at(&tboot_mm, vaddr, pte, pfn_pte(pfn, prot));
>> +	pte_unmap(pte);
>> +	return 0;
>> +}
>> +
>> +static int map_pages_for_tboot(unsigned long vaddr, unsigned long start_pfn,
>> +			       unsigned long nr)
>> +{
>> +	/* Reuse the original kernel mapping */
>> +	tboot_pg_dir = pgd_alloc(&tboot_mm);
>
> That puts the PGD into the pgd_list and then pageattr.c will actually
> walk that list and change ptes, assuming it's a standard kernel 
> mapping. Can you tolerate that? It seems dangerous. Better to use
> a pgd_alloc_kernel(). There's none, but you could add one.

Thought some more about this. I think you're ok on 64bit at least
because the kernel mappings are elsewhere from the identity map and
keeping them in sync with pageattr makes sense and avoids illegal
cache attribute aliases.

But on 32bit it could be potentially a problem in general. e.g.
what happens when the tboot shared page is in the area the kernel
is running? You would crash during the window where you run 
in that pgd.

It would be probably safer to use a low memory trampoline supplied
by the kernel too that then loads the new pgd.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

  reply	other threads:[~2009-04-18 20:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31  5:14 [RFC v2][PATCH 1/1] intel_txt: Intel(R) TXT and tboot kernel support Joseph Cihula
2009-04-18 10:02 ` Andi Kleen
2009-04-18 20:29   ` Andi Kleen [this message]
2009-04-22 20:31   ` Jeremy Fitzhardinge
2009-04-22 20:40     ` Andi Kleen
2009-04-22 20:47       ` Cihula, Joseph
2009-04-24 21:57   ` Cihula, Joseph
2009-04-25 15:56     ` Andi Kleen
2009-04-28 16:50       ` Cihula, Joseph

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=878wlxr9ip.fsf_-_@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=arjan@linux.intel.com \
    --cc=chrisw@sous-sol.org \
    --cc=gang.wei@intel.com \
    --cc=jbeulich@novell.com \
    --cc=jmorris@namei.org \
    --cc=joseph.cihula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterm@redhat.com \
    --cc=shane.wang@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