Skip to contentSkip to conversation

Support for BIOS interrupt handler

PATCH Xu, Quan 3 participants 10 messages Mar 27, 2015 – May 22, 2015 15 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 945CA011AD5F084CBEA3E851C0AB28890E8C9AB6@SHSMSX101.ccr.corp.intel.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

Xu, Quan

author
#8 lore raw
Quoted 55 lines

-----Original Message-----
From: Xu, Quan
Sent: Friday, March 27, 2015 10:01 AM
To: 'Stefan Berger'; Kevin O'Connor
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 36 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:04 PM
To: Xu, Quan; Kevin O'Connor
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 28 lines · Quan
Quoted 28 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Thursday, March 26, 2015 6:18 PM
To: Kevin O'Connor; Xu, Quan
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 9 lines · Kevin O'Connor
Quoted 8 lines · Stefan Berger
Quoted 2 lines · Kevin O'Connor

Because of the mixed 16bit/32bit code in SeaBIOS, all assembler must use size suffixes - so the above should be "roll" instead of "rol".

Ok, fixed.

Quoted 3 lines

As before - both issues are minor and can be addressed after merge (as long as there is agreement that the sha1.c file can be licensed as LGPLv3).

Quoted 8 lines
Quoted 2 lines

It can have that license. I can post v11 or you can modify it, either way is fine.

Thanks. I pushed the first three patches into a test branch at:

https://github.com/KevinOConnor/seabios/tree/tcg-testing

I'd like to get confirmation that this works for the Xen requirements before merging.

I don't use Xen. I hope that Quan will provide feedback.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Stefan

Sure, I am glad to help you test it :):) Try to
https://github.com/KevinOConnor/seabios/tree/tcg-testing ??

Yes.

Stefan

Quoted 7 lines

Just for check,
I can NOT git clone https://github.com/KevinOConnor/seabios/tree/tcg-testing
I can clone https://github.com/KevinOConnor/seabios and checkout * tcg-testing branch.
Correct?

Quan

Share the test result first. It is not working with Xen vTPM. The log from vtpm mini-os:

[.. ]
tpm_testing.c:229: Debug: verify plain text
tpm_testing.c:261: Info: Self-Test succeeded
tpm_startup.c:43: Info: TPM_Startup(1)
Tpmback:Info Frontend 0/0 connected
tpm_cmd_handler.c:4217: Debug: tpm_handle_command(0)
tpm_cmd_handler.c:3514: Debug: [TPM_TAG_RQU_COMMAND]
tpm_cmd_handler.c:3537: Debug: [TPM_ORD_Startup]
tpm_startup.c:43: Info: TPM_Startup(1)
tpm_cmd_handler.c:4151: Info: TPM command failed: (0x26) The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup.
[..]

In my opinion, we need this patch for Xen vTPM too.
now Xen vTPM is working with two basic functions: TPM TCPA / SSDT and registers reset in my previous seabios patch.

Quan

Quoted 2 lines

A message that is not in the archive (sent off-list or not yet received): 945CA011AD5F084CBEA3E851C0AB28890E8CA80B@SHSMSX101.ccr.corp.intel.com

#10 lore raw
Quoted 75 lines · Quan
Quoted 50 lines

-----Original Message-----
From: Xu, Quan
Sent: Friday, March 27, 2015 10:01 AM
To: 'Stefan Berger'; Kevin O'Connor
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 40 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:04 PM
To: Xu, Quan; Kevin O'Connor
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 23 lines · Quan
Quoted 23 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Thursday, March 26, 2015 6:18 PM
To: Kevin O'Connor; Xu, Quan
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 15 lines · Kevin O'Connor
Quoted 10 lines · Stefan Berger
Quoted 2 lines · Kevin O'Connor

Because of the mixed 16bit/32bit code in SeaBIOS, all assembler must use size suffixes - so the above should be "roll" instead of "rol".

Ok, fixed.

Quoted 3 lines

As before - both issues are minor and can be addressed after merge (as long as there is agreement that the sha1.c file can be licensed as LGPLv3).

It can have that license. I can post v11 or you can modify it, either way is fine.

Thanks. I pushed the first three patches into a test branch at:

https://github.com/KevinOConnor/seabios/tree/tcg-testing

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I'd like to get confirmation that this works for the Xen requirements before merging.

I don't use Xen. I hope that Quan will provide feedback.

Stefan

Sure, I am glad to help you test it :):) Try to
https://github.com/KevinOConnor/seabios/tree/tcg-testing ??

Yes.

Quoted 8 lines
Quoted 1 line

Stefan

Just for check,
I can NOT git clone https://github.com/KevinOConnor/seabios/tree/tcg-testing
I can clone https://github.com/KevinOConnor/seabios and checkout * tcg-testing branch.
Correct?

Quan

Share the test result first. It is not working with Xen vTPM. The log from vtpm mini-os:

[.. ]
tpm_testing.c:229: Debug: verify plain text
tpm_testing.c:261: Info: Self-Test succeeded
tpm_startup.c:43: Info: TPM_Startup(1)
Tpmback:Info Frontend 0/0 connected
tpm_cmd_handler.c:4217: Debug: tpm_handle_command(0)
tpm_cmd_handler.c:3514: Debug: [TPM_TAG_RQU_COMMAND]
tpm_cmd_handler.c:3537: Debug: [TPM_ORD_Startup]
tpm_startup.c:43: Info: TPM_Startup(1)
tpm_cmd_handler.c:4151: Info: TPM command failed: (0x26) The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup.
[..]

Quoted 1 line

In my opinion, we need this patch for Xen vTPM too.

Which patch is 'this patch'?
Does the above indicate that TPM_Startup(1) is sent twice to the Xen vTPM? Besides SeaBIOS, what else is sending a TPM_Startup()? If there is something else in Xen that sends a TPM_Startup() to the TPM, before SeaBIOS does, then the following code may apply as well:

This part is from src/tcgbios.c.

+ rc = build_and_send_cmd(TPM_ORD_Startup,
+ Startup_ST_CLEAR, sizeof(Startup_ST_CLEAR),
+ NULL, 10, &returnCode, TPM_DURATION_TYPE_SHORT);
+
+ dprintf(DEBUG_tcg, "Return code from TPM_Startup = 0x%08x\n",
+ returnCode);
+
+ if (CONFIG_COREBOOT) {

Here you could add a check whether you are running on Xen and ignore the error returned from TPM_Startup().

+ /* with other firmware on the system the TPM may already have been
+ * initialized
+ */
+ if (returnCode == TPM_INVALID_POSTINIT)
+ returnCode = 0;
+ }
+
+ if (rc || returnCode)
+ goto err_exit;

Regards,
Stefan

Quoted 8 lines

now Xen vTPM is working with two basic functions: TPM TCPA / SSDT and registers reset in my previous seabios patch.

Quan

Quoted 1 line

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#12 lore raw
Quoted 84 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Friday, March 27, 2015 9:45 PM
To: Xu, Quan; Kevin O'Connor
Cc: [email protected]; [email protected]; [email protected]; Daniel De Graaf; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 62 lines · Quan
Quoted 51 lines

-----Original Message-----
From: Xu, Quan
Sent: Friday, March 27, 2015 10:01 AM
To: 'Stefan Berger'; Kevin O'Connor
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 33 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:04 PM
To: Xu, Quan; Kevin O'Connor
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 25 lines · Quan
Quoted 25 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Thursday, March 26, 2015 6:18 PM
To: Kevin O'Connor; Xu, Quan
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 17 lines · Kevin O'Connor
Quoted 10 lines · Stefan Berger
Quoted 2 lines · Kevin O'Connor

Because of the mixed 16bit/32bit code in SeaBIOS, all assembler must use size suffixes - so the above should be "roll" instead of "rol".

Ok, fixed.

Quoted 3 lines

As before - both issues are minor and can be addressed after merge (as long as there is agreement that the sha1.c file can be licensed as LGPLv3).

It can have that license. I can post v11 or you can modify it, either way is fine.

Thanks. I pushed the first three patches into a test branch at:

https://github.com/KevinOConnor/seabios/tree/tcg-testing

I'd like to get confirmation that this works for the Xen requirements before merging.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I don't use Xen. I hope that Quan will provide feedback.

Stefan

Sure, I am glad to help you test it :):) Try to
https://github.com/KevinOConnor/seabios/tree/tcg-testing ??

Yes.

Stefan

Quoted 8 lines

Just for check,
I can NOT git clone
https://github.com/KevinOConnor/seabios/tree/tcg-testing
I can clone https://github.com/KevinOConnor/seabios and checkout * tcg-testing branch.
Correct?

Quan

Share the test result first. It is not working with Xen vTPM. The log from vtpm mini-os:

Quoted 11 lines

[.. ]
tpm_testing.c:229: Debug: verify plain text tpm_testing.c:261: Info: Self-Test succeeded tpm_startup.c:43: Info: TPM_Startup(1) Tpmback:Info Frontend 0/0 connected
tpm_cmd_handler.c:4217: Debug: tpm_handle_command(0) tpm_cmd_handler.c:3514: Debug: [TPM_TAG_RQU_COMMAND] tpm_cmd_handler.c:3537: Debug: [TPM_ORD_Startup] tpm_startup.c:43: Info: TPM_Startup(1) tpm_cmd_handler.c:4151: Info: TPM command failed: (0x26) The command was received in the wrong sequence relative to TPM_Init and a subsequent

Quoted 7 lines

TPM_Startup.

Quoted 4 lines

[..]

In my opinion, we need this patch for Xen vTPM too.

Which patch is 'this patch'?

This patch is '[PATCH v10 3/6] Support for BIOS interrupt handler'. Is interrupt for tGrub? Correct me if I am wrong..

Quoted 33 lines

Does the above indicate that TPM_Startup(1) is sent twice to the Xen vTPM? Besides SeaBIOS, what else is sending a TPM_Startup()? If there is something else in Xen that sends a TPM_Startup() to the TPM, before SeaBIOS does, then the following code may apply as well:

This part is from src/tcgbios.c.

(quoted diff) +3 -0
+    rc = build_and_send_cmd(TPM_ORD_Startup,
+                            Startup_ST_CLEAR, sizeof(Startup_ST_CLEAR),
+                            NULL, 10, &returnCode,

TPM_DURATION_TYPE_SHORT);

(quoted diff) +5 -0
+
+    dprintf(DEBUG_tcg, "Return code from TPM_Startup = 0x%08x\n",
+            returnCode);
+
+    if (CONFIG_COREBOOT) {

Here you could add a check whether you are running on Xen and ignore the error returned from TPM_Startup().

(quoted diff) +9 -0
+        /* with other firmware on the system the TPM may already have been
+         * initialized
+         */
+        if (returnCode == TPM_INVALID_POSTINIT)
+            returnCode = 0;
+    }
+
+    if (rc || returnCode)
+        goto err_exit;
Quoted 3 lines

Regards,
Stefan

I will go through all of these seabios patch, and try to make it compatible for Xen vTPM.

-Quan

Quoted 8 lines
Quoted 8 lines

now Xen vTPM is working with two basic functions: TPM TCPA / SSDT and registers reset in my previous seabios patch.

Quan

Quoted 1 line

A message that is not in the archive (sent off-list or not yet received): 945CA011AD5F084CBEA3E851C0AB28890E8D6B72@SHSMSX101.ccr.corp.intel.com

#14 lore raw
Quoted 30 lines · Quan
Quoted 30 lines

From: Stefan Berger [mailto:[email protected]]

Quoted 28 lines · Quan
Quoted 28 lines

From: Xu, Quan

Quoted 27 lines

From: Stefan Berger [mailto:[email protected]]

Quoted 17 lines · Quan
Quoted 17 lines

From: Stefan Berger [mailto:[email protected]]

Quoted 15 lines · Kevin O'Connor
Quoted 10 lines · Stefan Berger
Quoted 2 lines · Kevin O'Connor

Because of the mixed 16bit/32bit code in SeaBIOS, all assembler must use size suffixes - so the above should be "roll" instead of "rol".

Ok, fixed.

Quoted 3 lines

As before - both issues are minor and can be addressed after merge (as long as there is agreement that the sha1.c file can be licensed as LGPLv3).

It can have that license. I can post v11 or you can modify it, either way is fine.

Thanks. I pushed the first three patches into a test branch at:

https://github.com/KevinOConnor/seabios/tree/tcg-testing

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I'd like to get confirmation that this works for the Xen requirements before merging.

I don't use Xen. I hope that Quan will provide feedback.

Stefan

Sure, I am glad to help you test it :):) Try to
https://github.com/KevinOConnor/seabios/tree/tcg-testing ??

Yes.

[...]

Quoted 2 lines

I will go through all of these seabios patch, and try to make it compatible for Xen vTPM.

What's the status of this? Is it safe to push forward parts of Stefan's patches, or does that represent a regression for Xen?

-Kevin

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw
Quoted 7 lines · Kevin O'Connor
Quoted 1 line · Quan
Quoted 1 line

[...]

Quoted 2 lines

I will go through all of these seabios patch, and try to make it compatible for Xen vTPM.

What's the status of this? Is it safe to push forward parts of Stefan's patches, or does that represent a regression for Xen?

Xu, any news? I would like to see these patches making it into the repository.

Regards,
Stefan

author
#17 lore raw
Quoted 17 lines

-----Original Message-----
From: Stefan Berger [mailto:[email protected]]
Sent: Wednesday, April 29, 2015 7:18 PM
To: Xu, Quan
Cc: Kevin O'Connor; [email protected]; [email protected]; [email protected]; Daniel De Graaf; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 4 lines · Kevin O'Connor
Quoted 1 line · Quan
Quoted 1 line

[...]

Quoted 1 line

I will go through all of these seabios patch, and try to make it compatible for

Xen vTPM.

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 2 lines

What's the status of this? Is it safe to push forward parts of Stefan's patches, or does that represent a regression for Xen?

Xu, any news? I would like to see these patches making it into the repository.

Regards,
Stefan

Stefan,
Sorry to reply so late to you. I try to make it compatible with Xen vTPM by below patch
Against your serious of patch(https://github.com/KevinOConnor/seabios/tree/tcg-testing ). Also I have tested this patch, which is working.

### >>> patch
commit 2c556064695b0a979adb4039f13db1b29a19d3cf

Author: Quan Xu <[email protected]>
Date:   Thu Apr 30 19:43:04 2015 -0400

make SeaBios compatible with Xen vTPM.

src/tcgbios.c +3 -1
index c837ab6..4cda800 100644
@@ -23,7 +23,7 @@
 #include "std/acpi.h"  // RSDP_SIGNATURE, rsdt_descriptor
 #include "bregs.h" // struct bregs
 #include "sha1.h" // sha1
-
+#include "fw/paravirt.h" // runningOnXen
 
 static const u8 Startup_ST_CLEAR[2] = { 0x00, TPM_ST_CLEAR };
 static const u8 Startup_ST_STATE[2] = { 0x00, TPM_ST_STATE };
@@ -494,6 +494,8 @@ tpm_start(void)
         return 0;
 
     tpm_acpi_init();
+    if (runningOnXen())
+        return 0;
 
     return tpm_startup();
 }

### <<< patch

Thanks
Quan Xu

A message that is not in the archive (sent off-list or not yet received): 945CA011AD5F084CBEA3E851C0AB28890E8F394A@SHSMSX101.ccr.corp.intel.com

#19 lore raw
Quoted 5 lines · Quan

Stefan,
Sorry to reply so late to you. I try to make it compatible with Xen vTPM by below patch
Against your serious of patch(https://github.com/KevinOConnor/seabios/tree/tcg-testing ). Also I have tested this patch, which is working.

Thanks.

Quoted 34 lines

### >>> patch
commit 2c556064695b0a979adb4039f13db1b29a19d3cf

Author: Quan Xu <[email protected]>
Date:   Thu Apr 30 19:43:04 2015 -0400

make SeaBios compatible with Xen vTPM.

src/tcgbios.c +3 -1
index c837ab6..4cda800 100644
@@ -23,7 +23,7 @@
  #include "std/acpi.h"  // RSDP_SIGNATURE, rsdt_descriptor
  #include "bregs.h" // struct bregs
  #include "sha1.h" // sha1
-
+#include "fw/paravirt.h" // runningOnXen
 
  static const u8 Startup_ST_CLEAR[2] = { 0x00, TPM_ST_CLEAR };
  static const u8 Startup_ST_STATE[2] = { 0x00, TPM_ST_STATE };
@@ -494,6 +494,8 @@ tpm_start(void)
          return 0;
 
      tpm_acpi_init();
+    if (runningOnXen())
+        return 0;
 
      return tpm_startup();
  }
Quoted 2 lines

### <<< patch

Kevin, I think this should be good to add after 3/6 ?

Stefan

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw
Quoted 6 lines · Stefan Berger
Quoted 5 lines · Quan

Stefan,
Sorry to reply so late to you. I try to make it compatible with Xen vTPM by below patch
Against your serious of patch(https://github.com/KevinOConnor/seabios/tree/tcg-testing ). Also I have tested this patch, which is working.

[...]

Quoted 2 lines

Kevin, I think this should be good to add after 3/6 ?

Thanks - I applied the first three tpm patches along with this patch.

-Kevin

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#23 lore raw
Quoted 17 lines

-----Original Message-----
From: Kevin O'Connor [mailto:[email protected]]
Sent: Friday, May 22, 2015 1:20 AM
To: Stefan Berger
Cc: Xu, Quan; [email protected]; [email protected]; [email protected]; Daniel De Graaf; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 5 lines · Stefan Berger
Quoted 4 lines · Quan

Stefan,
Sorry to reply so late to you. I try to make it compatible with Xen
vTPM by below patch Against your serious of

patch(https://github.com/KevinOConnor/seabios/tree/tcg-testing ).

Quoted 8 lines
Quoted 1 line
Quoted 1 line

Also I have tested this patch, which is working.

[...]

Quoted 2 lines

Kevin, I think this should be good to add after 3/6 ?

Thanks - I applied the first three tpm patches along with this patch.

-Kevin

Thanks :))

Quan

#24 lore raw
Quoted 14 lines · Quan
Quoted 14 lines

-----Original Message-----
From: Kevin O'Connor [mailto:[email protected]]
Sent: Friday, May 22, 2015 1:20 AM
To: Stefan Berger
Cc: Xu, Quan; [email protected]; [email protected]; [email protected]; Daniel De Graaf; [email protected]
Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler

Quoted 4 lines · Stefan Berger
Quoted 3 lines · Quan

Stefan,
Sorry to reply so late to you. I try to make it compatible with Xen
vTPM by below patch Against your serious of

Quoted 8 lines
Quoted 7 lines

patch(https://github.com/KevinOConnor/seabios/tree/tcg-testing ).

Quoted 1 line
Quoted 1 line

Also I have tested this patch, which is working.

[...]

Quoted 1 line

Kevin, I think this should be good to add after 3/6 ?

Thanks - I applied the first three tpm patches along with this patch.

-Kevin

Thanks :))

Yes, thanks!

Stefan

Quoted 4 lines

Quan