[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878wlxr9ip.fsf_-_@basil.nowhere.org>
Date: Sat, 18 Apr 2009 22:29:02 +0200
From: Andi Kleen <andi@...stfloor.org>
To: joseph.cihula@...el.com
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, arjan@...ux.intel.com,
chrisw@...s-sol.org, jmorris@...ei.org, jbeulich@...ell.com,
peterm@...hat.com, gang.wei@...el.com, shane.wang@...el.com
Subject: Re: [RFC v2][PATCH 1/1] intel_txt: Intel(R) TXT and tboot kernel support II
Andi Kleen <andi@...stfloor.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@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists