From: Keir Fraser Subject: Re: [PATCH] [Firmware] TCG BIOS extensions for the Bochs BIOS Date: Mon, 11 Dec 2006 15:43:27 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0102642416==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefan Berger , Keir Fraser Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --===============0102642416== Content-type: multipart/alternative; boundary="B_3248696607_19430710" > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3248696607_19430710 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable I would imagine this working by having generic real-mode/32-bit gateway routines in rombios, and then getting the hell out to 32-bit protected mode asap for new code. The advantages are that you get to code in C, compiled with a modern optimising compiler (gcc), and that you avoid the silly 64kB limitation. As you say, hvmloader would be responsible for poking the routines into high memory, marking them as E820_RESERVED, and then doing some jump-table poking in rombios (which might more generically, and grandiosely, be termed =8Clinking=B9 of the BIOS and its extensions :-). TBH I=B9m not happy to check in big gobs of assembly code, or even really bcc C/asm code. We should do the leg work to be able to use gcc. An hvmloader type of environment is what we should aim for -- another way of looking at this is removing hvmloader=B9s restriction of only running at bootstrap so that it can also provide ongoing run-time services. -- Keir On 11/12/06 15:26, "Stefan Berger" wrote: > Someone who wants to add new functionality to the Bochs BIOS might care a= bout > the amount of free space in that 64kb segment. Currently there's enough r= oom > left even with the TPM extensions. > Even if we move these extensions to some 32bit area, the hook into the 1A= h > interrupt and all those other function calls surrounded by #if BX_TCGBIOS= in > rombios.c are needed as well as later on some code that switches into > protected mode and jumps up into the 32 bit area. The BIOS code should at= some > point be compiled with those TPM extensions independent of whether a TPM = is > available in the VM or not. The extensions don't influence the BIOS if a = TPM > is not available. >=20 > How would you connect the two code areas and the functions? Would hvmload= er > write the 32 bit address somewhere into the Bochs BIOS and the to reach t= he 32 > bit area one uses a jump table to call all those functions up there? I'd > really rather leave the TPM extensions in the BIOS segment for now. The b= ulk > of the code is located in its own file anyway. I will convert parts of th= e > code to 'C', though. --B_3248696607_19430710 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Re: [Xen-devel] [PATCH] [Firmware] TCG BIOS extensions for the Bochs= BIOS
I would imagine this working by having generic real-mode/32-bit gateway rou= tines in rombios, and then getting the hell out to 32-bit protected mode asa= p for new code. The advantages are that you get to code in C, compiled with = a modern optimising compiler (gcc), and that you avoid the silly 64kB limita= tion. As you say, hvmloader would be responsible for poking the routines int= o high memory, marking them as E820_RESERVED, and then doing some jump-table= poking in rombios (which might more generically, and grandiosely, be termed= ‘linking’ of the BIOS and its extensions :-).

TBH I’m not happy to check in big gobs of assembly code, or even real= ly bcc C/asm code. We should do the leg work to be able to use gcc. An hvmlo= ader type of environment is what we should aim for --  another way of l= ooking at this is removing hvmloader’s restriction of only running at = bootstrap so that it can also provide ongoing run-time services.

 -- Keir

On 11/12/06 15:26, "Stefan Berger" <stefanb@us.ibm.com> wro= te:

Someone who wants to add new functionality to the Bochs BIOS = might care about the amount of free space in that 64kb segment. Currently th= ere's enough room left even with the TPM extensions.
Even if we move these extensions to= some 32bit area, the hook into the 1Ah interrupt and all those other functi= on calls surrounded by #if BX_TCGBIOS in rombios.c are needed as well as lat= er on some code that switches into protected mode and jumps up into the 32 b= it area. The BIOS code should at some point be compiled with those TPM exten= sions independent of whether a TPM is available in the VM or not. The extens= ions don't influence the BIOS if a TPM is not available.

How would you connect the two code = areas and the functions? Would hvmloader write the 32 bit address somewhere = into the Bochs BIOS and the to reach the 32 bit area one uses a jump table t= o call all those functions up there? I'd really rather leave the TPM extensi= ons in the BIOS segment for now. The bulk of the code is located in its own = file anyway. I will convert parts of the code to 'C', though.

--B_3248696607_19430710-- --===============0102642416== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0102642416==--