From: Ingo Molnar <mingo@elte.hu>
To: "Cihula, Joseph" <joseph.cihula@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"arjan@linux.intel.com" <arjan@linux.intel.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"andi@firstfloor.org" <andi@firstfloor.org>,
"chrisw@sous-sol.org" <chrisw@sous-sol.org>,
"jmorris@namei.org" <jmorris@namei.org>,
"jbeulich@novell.com" <jbeulich@novell.com>,
"peterm@redhat.com" <peterm@redhat.com>,
"Wei, Gang" <gang.wei@intel.com>,
"Wang, Shane" <shane.wang@intel.com>
Subject: Re: [RFC v3][PATCH 2/2] intel_txt: Intel(R) TXT and tboot kernel support
Date: Tue, 12 May 2009 11:45:44 +0200 [thread overview]
Message-ID: <20090512094544.GE32292@elte.hu> (raw)
In-Reply-To: <4F65016F6CB04E49BFFA15D4F7B798D998BA8303@orsmsx506.amr.corp.intel.com>
* Cihula, Joseph <joseph.cihula@intel.com> wrote:
> > From: Ingo Molnar [mailto:mingo@elte.hu]
> > Sent: Friday, May 08, 2009 2:58 AM
> >
> > * Joseph Cihula <joseph.cihula@intel.com> wrote:
> >
> > > + /* if we're being called before the 1:1 mapping is set up then just
> > > + return and let the normal shutdown happen; this should only be
> > > + due to very early panic() */
> > > + if (!tboot_pg_dir)
> > > + return;
> >
> > Please use the customary comment style:
> >
> > /*
> > * Comment .....
> > * ...... goes here:
> > */
> >
> > specified in Documentation/CodingStyle. Please fix this in all other
> > multi-line comments in your patch as well.
>
> Will do.
>
> > > + if (shutdown_type == TB_SHUTDOWN_S3) {
> > > + tboot_shared->num_mac_regions = 3;
> > > + /* S3 resume code */
> > > + tboot_shared->mac_regions[0].start =
> > > + PFN_PHYS(PFN_DOWN(acpi_wakeup_address));
> > > + tboot_shared->mac_regions[0].size =
> > > + PFN_UP(WAKEUP_SIZE) << PAGE_SHIFT;
> > > + /* AP trampoline code */
> > > + tboot_shared->mac_regions[1].start =
> > > + PFN_PHYS(PFN_DOWN(virt_to_phys(trampoline_base)));
> > > + tboot_shared->mac_regions[1].size =
> > > + PFN_UP(TRAMPOLINE_SIZE) << PAGE_SHIFT;
> > > + /* kernel code + data + bss */
> > > + tboot_shared->mac_regions[2].start =
> > > + PFN_PHYS(PFN_DOWN(virt_to_phys(&_text)));
> > > + tboot_shared->mac_regions[2].size =
> > > + PFN_PHYS(PFN_UP(virt_to_phys(&_end))) -
> > > + PFN_PHYS(PFN_DOWN(virt_to_phys(&_text)));
> > > + }
> > > +
> > > + tboot_shared->shutdown_type = shutdown_type;
> > > +
> > > + switch_to_tboot_pt();
> > > +
> > > + ((void(*)(void))(unsigned long)tboot_shared->shutdown_entry)();
> >
> > shutdown_entry should probably have a proper function pointer
> > type, to avoid this ugliness.
>
> Since pointer types are different lengths depending on whether it
> is a 32b or 64b build environment, that would not allow a
> separately-compiled tboot to be used with both 32b and 64b
> kernels.
then the sign extension is done slightly wrong/unclean i guess.
Wouldnt:
> > > + ((void(*)(void))(long)tboot_shared->shutdown_entry)();
be better? Or is shutdown_entry always mapped into [0..2GB) on
64-bit? Even then, not sign-extending RIP addresses is wrong and
invites bugs/restrictions.
Ingo
next prev parent reply other threads:[~2009-05-12 9:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 4:49 [RFC v3][PATCH 2/2] intel_txt: Intel(R) TXT and tboot kernel support Joseph Cihula
2009-05-08 6:53 ` Andrew Morton
2009-05-29 1:02 ` Cihula, Joseph
2009-05-08 9:57 ` Ingo Molnar
2009-05-12 5:26 ` Cihula, Joseph
2009-05-12 9:45 ` Ingo Molnar [this message]
2009-05-12 9:55 ` Andi Kleen
2009-05-12 21:01 ` Theodore Tso
2009-05-14 15:52 ` Heinz Diehl
2009-05-15 0:17 ` James Morris
2009-05-15 1:45 ` Cihula, Joseph
2009-05-15 1:51 ` Joe Perches
2009-05-15 2:49 ` Cihula, Joseph
2009-05-28 1:12 ` James Morris
2009-05-15 12:07 ` Theodore Tso
2009-05-15 12:26 ` Theodore Tso
2009-05-24 19:42 ` Pavel Machek
2009-05-24 19:42 ` Pavel Machek
[not found] ` <E1M8kJQ-0000W3-TE@fencepost.gnu.org>
2009-05-26 2:31 ` Theodore Tso
[not found] ` <E1M9Mig-0003Q4-S1@fencepost.gnu.org>
2009-05-29 9:47 ` Pavel Machek
2009-05-19 20:30 ` Pavel Machek
2009-05-22 16:59 ` H. Peter Anvin
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=20090512094544.GE32292@elte.hu \
--to=mingo@elte.hu \
--cc=andi@firstfloor.org \
--cc=arjan@linux.intel.com \
--cc=chrisw@sous-sol.org \
--cc=gang.wei@intel.com \
--cc=hpa@zytor.com \
--cc=jbeulich@novell.com \
--cc=jmorris@namei.org \
--cc=joseph.cihula@intel.com \
--cc=linux-kernel@vger.kernel.org \
--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