From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Fioravante Subject: Re: vTPM setup problem on the emulator Date: Thu, 10 Jan 2013 10:51:11 -0500 Message-ID: <50EEE36F.8030705@jhuapl.edu> References: <36a97c6a.ff69.13c1e887f12.Coremail.gbtux@126.com> <50EDC5EC.7050306@jhuapl.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3016483097643605126==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Bei Guan Cc: "xen-users@lists.xen.org" , xen-devel List-Id: xen-devel@lists.xenproject.org This is a cryptographically signed message in MIME format. --===============3016483097643605126== Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050109080807080406030806" This is a cryptographically signed message in MIME format. --------------ms050109080807080406030806 Content-Type: multipart/alternative; boundary="------------050004060003010007020202" This is a multi-part message in MIME format. --------------050004060003010007020202 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 01/09/2013 09:17 PM, Bei Guan wrote: > Hi Matthew, > > Thank you for your reply. > > > > 2013/1/10 Matthew Fioravante > > > On 01/09/2013 03:58 AM, gavin wrote: >> Hi, >> >> I tried to install the vTPM in Xen-4.1.0 + Dom0 kernel 2.6.18.8 + >> DomU kernel 2.6.18.8. The device is TPM emulator. >> However, I encountered several problems. >> >> 1. In DomU, I run "modprobe tpm_xenu" successfully. But it >> doesn't creates the /dev/tpm0 device as our had expected. So, the >> trousers cannot be started. An old thread in Xen mail-list can do >> this,(http://old-list-archives.xen.org/xense-devel/2006-12/msg0000= 2.html) >> but it helps little to me. >> Is there any problem with my vTPM front driver? The tpm related >> modules and other info in DomU is list here. >> *[root@gavin-pv ~]# lsmod | grep tpm* >> tpm_xenu 15752 0 [permanent] >> tpm 17952 1 tpm_xenu >> tpm_bios 10112 1 tpm >> *[root@gavin-pv ~]# tcsd -f* >> TCSD TDDL ERROR: Could not find a device to open! > Any relevant output in dmesg? Also does your domu config file have > a vtpm device specified? > > > When I run "insmod tpm_xenu.ko" at the first time in DomU, there is=20 > no special message in dmesg except for this "xen_tpm_fr: Initialising=20 > the vTPM driver." > Then, I reload the tpm_xenu module after removing it using "rmmod=20 > tpm_xenu.ko -f". I get the following message in dmesg. > ... > xen_tpm_fr: Initialising the vTPM driver. > kobject_add failed for vtpm with -EEXIST, don't try to register things = > with the same > name in the same directory. > [] kobject_add+0x11a/0x1a0 > [] kobject_register+0x21/0x50 > [] bus_add_driver+0x7d/0x140 > [] xenbus_register_driver_common+0x39/0x60 > [] xenbus_register_frontend+0x20/0x40 > [] tpmif_init+0x50/0x62 [tpm_xenu] > [] sys_init_module+0x148/0x1b40 > [] do_page_fault+0x10c/0xc6f > [] do_syscall_trace+0x1ee/0x205 > [] syscall_call+0x7/0xb > > In the DomUconfig file, I use vtpm =3D ['backend=3D0']. > But there is no vtpm device in Dom0 and DomU. See the following info. The domU is PVM correct? You can also try just compiling in tpm_xenu=20 instead of using it as a module. > > Dom0: > [root@localhost fc8_new]# ls /sys/devices/xen-backend/ > console-3-0 power uevent vbd-3-2049 vfb-3-0 vif-3-0 vkbd-3-0 > > DomU: > [root@gavin-pv tpm]# ls /sys/devices/xen > power uevent vbd-2049 vfb-0 vif-0 vkbd-0 > > >> 2. In Dom0, I run "modprobe tpmd_dev" and "modprobe tpmbk" also >> successfully and I can get the devices /dev/tpm, /dev/tpm0, and >> /dev/vtpm. However, I cannot start the tpm emulator (# ./tpmd -f >> clear pvm 1) and vtpm manager (# vtpm_managerd). The related info >> and output error from Dom0 is also list here. > So you want to use the TPM emulator on dom0 instead of a physical > TPM? > > Yes, I try to use TPM emulator right now. > In fact, there is a physical TPM chip in my laptop. But I'm not sure=20 > how to make it work in fedora8. So, when the vTPM works well on=20 > emulator, I will try to abandon the emulator and use the physical TPM. In that case you might want to make sure the TPM is disabled in the=20 BIOS if you want to use the emulator. Your dom0 kernel might have tpm=20 drivers built in which could cause a possible conflict with the emulator.= Using the tpm emulator in dom0 has its own collection of issues. You=20 might want to get the physical tpm working first and then play with=20 vtpms. We used TPM successfully on Fedora 8. Try this: Reboot your machine and get into the bios. Clear the TPM and then=20 activiate it. You might not have that option to clear if its disabled,=20 in that case just activiate it. In fedora install trousers and=20 tpm_tools. Start tcsd and try tpm_version or some other command to=20 ensure your TPM is working. If not, make sure all of the TPM drivers are = either compiled into the kernel or loaded as modules. > > > I see you listed /dev/tpm and /dev/tpm0. I believe the old manager > is hard coded to use the second one. Is tpmd creating both? > > Yes. When modprobe the tpmd_dev module, these two devices are created. > > > Thanks again. > > > >> *[root@localhost tpmd]# lsmod | grep tpm* >> tpmd_dev 10416 0 >> tpmbk 19516 0 [permanent] >> *[root@localhost tpmd]# ./tpmd -f clear pvm 1* >> VTPMD[0]: tpmd.c:766: Info: starting TPM Emulator daemon >> VTPMD[0]: tpmd.c:369: Info: parsing options >> VTPMD[1]: tpmd.c:478: Info: openening random device /dev/urandom >> VTPMD[1]: tpmd.c:621: Info: staring main loop >> Loading NVM. >> Error in read_from_file:301 >> VTPMD[1]: ../tpm/tpm_data.c:83: Info: initializing TPM data to >> default values >> VTPMD[1]: ../tpm/tpm_startup.c:30: Info: TPM_Init() >> VTPMD[1]: ../tpm/tpm_testing.c:242: Info: TPM_SelfTestFull() >> VTPMD[1]: ../tpm/tpm_testing.c:260: Info: Self-Test succeeded >> VTPMD[1]: ../tpm/tpm_startup.c:44: Info: TPM_Startup(1) >> VTPMD[1]: tpmd.c:661: Error: Failed to open devices to listen to >> guest. > > >> >> *[root@localhost vtpm]# vtpm_managerd* >> INFO[VTPM]: Starting VTPM. >> INFO[TCS]: Constructing new TCS: >> ERROR[TXDATA]: TPM open failedERROR in VTPM_Init_Manager at >> vtpm_manager.c:205 code: >> TPM_IOERROR. >> ERROR[VTPM]: Closing vtpmd due to error during startup. >> >> >> Thanks in advance for your any reply. >> >> -- >> Best Regards, >> Gavin >> >> > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel > > > Keep in mind that the old vTPM system is deprecated and I can only=20 provide limited support. If you can't get it to work I would suggest=20 pulling the latest xen-unstable and my latest patch set on here and=20 trying to use that. --------------050004060003010007020202 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 01/09/2013 09:17 PM, Bei Guan wrote= :
Hi Matthew,=C2=A0

Thank you for your reply.



2013/1/10 Matthew Fioravante <matthew.fioravante@jhuapl.edu>
On 01/09/2013 03:58 AM, gavin wrote:
Hi,

I tried to install the vTPM in Xen-4.1.0 + Dom0 kernel 2.6.18.8 + DomU kernel 2.6.18.8. The device is TPM emulator.
However, I=C2=A0 encountered several= problems.

1. In DomU, I run "modprobe tpm_xenu" successfully. But it doesn't creates the /dev/tpm0 device as our had expected. So, the trousers cannot be started. An old thread in Xen mail-list can do this,(http://old-list-archives.xen.= org/xense-devel/2006-12/msg00002.html) but it helps little to me.
Is there any problem with my vTPM front driver? The tpm related modules and other info in DomU is list here.
[root@gavin-pv ~]# lsmod | grep tpm
tpm_xenu               15752  0 [permanent]
tpm                        17952  1 tpm_xenu
tpm_bios               10112  1 tpm
[root@gavin-pv ~]# tcsd -f
TCSD TDDL ERROR: Could not find a device to open!
Any relevant output in dmesg? Also does your domu config file have a vtpm device specified?

When I run "insmod tpm_xenu.ko" at the first time in DomU, there is no=C2=A0special message in dmesg except fo= r this "xen_tpm_fr: Initialising the vTPM=C2=A0driver."
Then, I reload the tpm_xenu module after removing it using "rmmod tpm_xenu.ko -f". I=C2=A0get the following message in dmesg.
...
xen_tpm_fr: Initialising the vTPM driver.
kobject_add failed for vtpm with -EEXIST, don't try to register things with the same
name in the same directory.
=C2=A0[<c01ea4ea>] kobject_add+0x11a/0x1a0
=
=C2=A0[<c01ea691>] kobject_register+0x21/0x50
=C2=A0[<c02400fd>] bus_add_driver+0x7d/0x140
=C2=A0[<c02856f9>] xenbus_register_driver_common+0x39/0x60
=C2=A0[<c0285740>] xenbus_register_frontend+0x20/0x40
=C2=A0[<e1227050>] tpmif_init+0x50/0x62 [tpm_xen= u]
=C2=A0[<c0143b08>] sys_init_module+0x148/0x1b40<= /div>
=C2=A0[<c01187fc>] do_page_fault+0x10c/0xc6f
=C2=A0[<c010845e>] do_syscall_trace+0x1ee/0x205<= /div>
=C2=A0[<c01059bf>] syscall_call+0x7/0xb

In the DomUconfig file, I use vtpm =3D ['backend=3D0']= =2E
But there is no vtpm device in Dom0 and DomU. See the following info.
The domU is PVM correct? You can also try just compiling in tpm_xenu instead of using it as a module.

Dom0:
[root@localhost fc8_new]# ls /sys/devices/xen-backend/
console-3-0 =C2=A0power =C2=A0uevent =C2=A0vbd-3-2049 = =C2=A0vfb-3-0 =C2=A0vif-3-0 =C2=A0vkbd-3-0

DomU:
[root@gavin-pv tpm]# ls /sys/devices/xen
power =C2=A0uevent =C2=A0vbd-2049 =C2=A0vfb-0 =C2=A0vi= f-0 =C2=A0vkbd-0

=C2=A0

2. In Dom0, I run "modprobe tpmd_dev" and "modprobe tpmbk" also successfully and I can get the devices /dev/tpm, /dev/tpm0, and /dev/vtpm. However, I cannot start the tpm emulator (# ./tpmd -f clear pvm 1) and vtpm manager (# vtpm_managerd). The related info and output error from Dom0 is also list here.
So you want to use the TPM emulator on dom0 instead of a physical TPM?
Yes, I try to use TPM emulator right now.
In fact, there is a physical TPM chip in my laptop. But I'm not sure how to make it work in fedora8. So, when the vTPM works well on emulator, I will try to abandon the emulator and use the physical TPM.
In that case you might want to make sure=C2=A0 the TPM is disabled in= the BIOS if you want to use the emulator. Your dom0 kernel might have tpm drivers built in which could cause a possible conflict with the emulator.

Using the tpm emulator in dom0 has its own collection of issues. You might want to get the physical tpm working first and then play with vtpms. We used TPM successfully on Fedora 8.

Try this:
Reboot your machine and get into the bios. Clear the TPM and then activiate it. You might not have that option to clear if its disabled, in that case just activiate it. In fedora install trousers and tpm_tools. Start tcsd and try tpm_version or some other command to ensure your TPM is working. If not, make sure all of the TPM drivers are either compiled into the kernel or loaded as modules.
=

=C2=A0

I see you listed /dev/tpm and /dev/tpm0. I believe the old manager is hard coded to use the second one. Is tpmd creating both?
Yes. When modprobe the tpmd_dev module, these two devices are created.


Thanks again.

=C2=A0


[root@localhost tpmd]# lsmod | grep tpm=

tpmd_dev               10416  0=20
tpmbk                     19516  0 [permanent]
[root@localhost tpmd]# ./tpmd -f clear pvm 1
VTPMD[0]: tpmd.c:766: Info: starting TPM Emulator daemon
VTPMD[0]: tpmd.c:369: Info: parsing options
= VTPMD[1]: tpmd.c:478: Info: openening random device /dev/urandom
VTPMD[1]: tpmd.c:621: Info: staring main loop Loading NVM.
Error in read_from_= file:301
VTPMD[1]: ../tpm/tpm_data.c:83: Info: initializing TPM data to default values
VTPMD[1]: ../tpm/tpm_startup.c:30: Info: TPM_Init()
VTPMD[1]: ../tpm/tpm_testing.c:242: Info: TPM_SelfTestFull()
VTPMD[1]: ../tpm/tpm_testing.c:260: Info: Self-Test succeeded
VTPMD[1]: ../tpm/tpm_startup.c:44: Info: TPM_Startup(1)
VTPMD[1]: tpmd.c:661: Error: Failed to open devices to listen to guest.



[root@localhost vtpm]# vtpm_managerd
= INFO[VTPM]: Starting VTPM.
INFO[TCS]: Constructing new TCS:
ERROR[TXDATA]: TPM open failedERROR in VTPM_Init_Manager at vtpm_manager.c:205 code: TPM_IOERROR.
ERROR[VTPM]: Closing vtpmd due to error during startup.


Thanks in advance for your any reply.

--
Best Regards,
Gavin


=


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.x= en.org
http://lists.xen.org/xen-devel




Keep in mind that the old vTPM system is deprecated and I can only provide limited support. If you can't get it to work I would suggest pulling the latest xen-unstable and my latest patch set on here and trying to use that.
--------------050004060003010007020202-- --------------ms050109080807080406030806 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzA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OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ KoZIhvcNAQkFMQ8XDTEzMDExMDE1NTExMVowIwYJKoZIhvcNAQkEMRYEFAZB/f7f28NY4nVj Zfo3o8CBmxx5MGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYB6jqs48bsbZnm6UwY6a/YiUK1DY9/YhnPJ d422J8KMEBtAtGROiFsI6NU4PjrgHbsmyY82qRWVLTcPrscnPAempY08uG3yR0RXk9oN5vJt AZ36o0pNeZkkjmTyV+zaG0eT1zShruMvxIBOaNh7oMjakKMeVqh3NtVgOEo5HGLt9wAAAAAA AA== --------------ms050109080807080406030806-- --===============3016483097643605126== 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.xen.org http://lists.xen.org/xen-devel --===============3016483097643605126==--