Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line options
PATCH v2 1/4 Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line options
--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)
configure +14 -0
@@ -2942,6 +2942,16 @@ else fi ########################################## +# TPM xenstubdoms is only on x86 Linux + +if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64 && \ + test "$xen" = "yes"; then + tpm_xenstubdoms=$tpm +else + tpm_xenstubdoms=no +fi + +########################################## # attr probe if test "$attr" != "no" ; then
@@ -4333,6 +4343,7 @@ echo "gcov $gcov_tool" echo "gcov enabled $gcov" echo "TPM support $tpm" echo "libssh2 support $libssh2" +echo "TPM xenstubdoms $tpm_xenstubdoms" echo "TPM passthrough $tpm_passthrough" echo "QOM debugging $qom_cast_debug" echo "vhdx $vhdx"
@@ -4810,6 +4821,9 @@ if test "$tpm" = "yes"; then if test "$tpm_passthrough" = "yes"; then echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak fi + if test "$tpm_xenstubdoms" = "yes"; then + echo "CONFIG_TPM_XENSTUBDOMS=y" >> $config_host_mak + fi fi echo "TRACE_BACKENDS=$trace_backends" >> $config_host_mak
hmp.c +7 -0
@@ -689,6 +689,7 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)Error *err =NULL ;unsigned int c =0 ;TPMPassthroughOptions *tpo; +TPMXenstubdomsOptions *txo; info_list =qmp_query_tpm (&err);if (err) {
@@ -718,6 +719,12 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict) tpo->has_cancel_path ?",cancel-path=" :"" , tpo->has_cancel_path ? tpo->cancel_path : "");break ; +case TPM_TYPE_OPTIONS_KIND_XENSTUBDOMS : + txo = ti->options->xenstubdoms; +if (!txo) { +monitor_printf (mon,"null TPMXenstubdomsOptions error!\n" ); + } +break ;case TPM_TYPE_OPTIONS_KIND_MAX :break ; }
qapi-schema.json +18 -2
@@ -2855,8 +2855,12 @@ # @passthrough: TPM passthrough type # # Since: 1.5 +# +# @xenstubdoms: TPM xenstubdoms type +# +# Since: 2.3 ## -{ 'enum': 'TpmType', 'data': [ 'passthrough' ] } +{ 'enum': 'TpmType', 'data': [ 'passthrough', 'xenstubdoms' ] } ## # @query-tpm-types:
@@ -2884,6 +2888,16 @@ { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str', '*cancel-path' : 'str'} } +# @TPMXenstubdomsOptions: +# +# Information about the TPM xenstubdoms type +# +# Since: 2.3 +## +{ 'type': 'TPMXenstubdomsOptions', 'data': { } } +# +## + ## # @TpmTypeOptions: #
@@ -2894,7 +2908,9 @@ # Since: 1.5 ## { 'union': 'TpmTypeOptions', - 'data': { 'passthrough' : 'TPMPassthroughOptions' } } + 'data': { 'passthrough' : 'TPMPassthroughOptions', + 'xenstubdoms' : 'TPMXenstubdomsOptions' } } +## ## # @TpmInfo:
qemu-options.hx +11 -2
@@ -2485,7 +2485,8 @@ DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \ "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n" " use path to provide path to a character device; default is /dev/tpm0\n" " use cancel-path to provide path to TPM's cancel sysfs entry; if\n" - " not provided it will be searched for in /sys/class/misc/tpm?/device\n", + " not provided it will be searched for in /sys/class/misc/tpm?/device\n" + "-tpmdev xenstubdoms,id=id\n", QEMU_ARCH_ALL) STEXI
@@ -2495,7 +2496,8 @@ The general form of a TPM device option is: @item -tpmdev @var{backend} ,id=@var{id} [,@var{options}] @findex -tpmdev Backend type must be: -@option{passthrough}. +@option{passthrough}, or +@option{xenstubdoms}. The specific backend type will determine the applicable options. The @code{-tpmdev} option creates the TPM backend and requires a
@@ -2545,6 +2547,13 @@ To create a passthrough TPM use the following two options: Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by @code{tpmdev=tpm0} in the device option. +To create a xenstubdoms TPM use the following two options: +@example +-tpmdev xenstubdoms,id=tpm0 -device tpm-tis,tpmdev=tpm0 +@end example +Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by +@code{tpmdev=tpm0} in the device option. + @end table ETEXI
tpm.c +6 -1
@@ -25,7 +25,7 @@ static QLIST_HEAD(, TPMBackend) tpm_backends =#define TPM_MAX_MODELS 1 -#define TPM_MAX_DRIVERS 1 +#define TPM_MAX_DRIVERS 2static TPMDriverOps const *be_drivers[TPM_MAX_DRIVERS ] = {NULL ,
@@ -256,6 +256,7 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv) {TPMInfo *res =g_new0 (TPMInfo,1 );TPMPassthroughOptions *tpo; +TPMXenstubdomsOptions *txo; res->id =g_strdup (drv->id); res->model = drv->fe_model;
@@ -275,6 +276,10 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv) tpo->has_cancel_path = true; }break ; +case TPM_TYPE_XENSTUBDOMS : + res->options->kind =TPM_TYPE_OPTIONS_KIND_XENSTUBDOMS ; + txo =g_new0 (TPMXenstubdomsOptions,1 ); + res->options->xenstubdoms = txo;case TPM_TYPE_MAX :break ; }
Signature · 1 line
1.8.3.2
Quoted 12 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)+++
b/qapi-schema.json
qapi-schema.json line 2861
Quoted 7 lines
qapi-schema.json +4
-0@@ -2855,8 +2855,12 @@ # @passthrough: TPM passthrough type # # Since: 1.5 +# +# @xenstubdoms: TPM xenstubdoms type +# +# Since: 2.3
Typically, this would be done as:
# @passthrough: TPM passthrough type
#
# @xenstubdoms: TPM xenstubdoms type (since 2.3)
#
# Since: 1.5
as the enum itself was added in 1.5, not 2.3.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 12 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)+++
b/qapi-schema.json
qapi-schema.json line 2861
Quoted 7 lines
qapi-schema.json +4
-0@@ -2855,8 +2855,12 @@ # @passthrough: TPM passthrough type # # Since: 1.5 +# +# @xenstubdoms: TPM xenstubdoms type +# +# Since: 2.3
Typically, this would be done as:
# @passthrough: TPM passthrough type
#
# @xenstubdoms: TPM xenstubdoms type (since 2.3)
#
# Since: 1.5
as the enum itself was added in 1.5, not 2.3.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 9 lines · Eric Blake
Quoted 8 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)
Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 9 lines · Eric Blake
Quoted 8 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)
Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 18 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Eric Blake
Sent: Tuesday, November 25, 2014 1:31 AM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [Xen-devel] [Qemu-devel] [v2 1/4] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line optionsQuoted 6 lines · Eric Blake
Quoted 5 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx |
Quoted 9 lines
13
Quoted 3 lines
Quoted 3 lines
+++++++++++--
tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Thanks Eric.
Should I:
V2 is version number,
1. $git format-patch --subject-prefix=v2 -ns --cover-letter master Then, edit 0000-cover-letter.patch
2. $git format-patch --subject-prefix=v2 -4 Then, commit these 4 patch and 0000-cover-letter.patch
right?
Thanks
Quan Xu
Quoted 3 lines
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Quoted 18 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Eric Blake
Sent: Tuesday, November 25, 2014 1:31 AM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [Xen-devel] [Qemu-devel] [v2 1/4] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line optionsQuoted 6 lines · Eric Blake
Quoted 5 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx |
Quoted 9 lines
13
Quoted 3 lines
Quoted 3 lines
+++++++++++--
tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Thanks Eric.
Should I:
V2 is version number,
1. $git format-patch --subject-prefix=v2 -ns --cover-letter master Then, edit 0000-cover-letter.patch
2. $git format-patch --subject-prefix=v2 -4 Then, commit these 4 patch and 0000-cover-letter.patch
right?
Thanks
Quan Xu
Quoted 3 lines
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Quoted 5 lines · Quan
Quoted 5 lines
Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Quoted 7 lines
Thanks Eric.
Should I:
V2 is version number,
1. $git format-patch --subject-prefix=v2 -ns --cover-letter master Then, edit 0000-cover-letter.patch
Rather than '--subject-prefix=v2', I prefer using '-v2'. The important part is that you send the mails with 'git send-email' instead of doing it by hand. In fact, you can do 'git send-email --annotate -v2 --cover-letter master' and skip the format-patch altogether, if you are okay saving your cover letter edits to the point where you are sending the mails.
Quoted 3 lines
2. $git format-patch --subject-prefix=v2 -4 Then, commit these 4 patch and 0000-cover-letter.patch
I'm not sure what you meant by commit. You aren't adding the *.patch files to a repository, but sending them as email.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 5 lines · Quan
Quoted 5 lines
Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Quoted 7 lines
Thanks Eric.
Should I:
V2 is version number,
1. $git format-patch --subject-prefix=v2 -ns --cover-letter master Then, edit 0000-cover-letter.patch
Rather than '--subject-prefix=v2', I prefer using '-v2'. The important part is that you send the mails with 'git send-email' instead of doing it by hand. In fact, you can do 'git send-email --annotate -v2 --cover-letter master' and skip the format-patch altogether, if you are okay saving your cover letter edits to the point where you are sending the mails.
Quoted 3 lines
2. $git format-patch --subject-prefix=v2 -4 Then, commit these 4 patch and 0000-cover-letter.patch
I'm not sure what you meant by commit. You aren't adding the *.patch files to a repository, but sending them as email.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 24 lines
-----Original Message-----
From: Eric Blake [mailto:[email protected]]
Sent: Wednesday, November 26, 2014 12:31 AM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [Xen-devel] [Qemu-devel] [v2 1/4] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line optionsQuoted 5 lines · Quan
Quoted 5 lines
Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Quoted 7 lines
Thanks Eric.
Should I:
V2 is version number,
1. $git format-patch --subject-prefix=v2 -ns --cover-letter master Then, edit 0000-cover-letter.patch
Quoted 6 lines
Rather than '--subject-prefix=v2', I prefer using '-v2'. The important part is that you send the mails with 'git send-email' instead of doing it by hand. In fact, you can do 'git send-email --annotate -v2 --cover-letter master' and skip the format-patch altogether, if you are okay saving your cover letter edits to the point where you are sending the mails.
Thanks Eric.
Quoted 7 lines
Quoted 3 lines
2. $git format-patch --subject-prefix=v2 -4 Then, commit these 4 patch and 0000-cover-letter.patch
I'm not sure what you meant by commit. You aren't adding the *.patch files to a repository, but sending them as email.
Yes, just but sending them as email.
Quoted 3 lines
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Quoted 24 lines
-----Original Message-----
From: Eric Blake [mailto:[email protected]]
Sent: Wednesday, November 26, 2014 12:31 AM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [Xen-devel] [Qemu-devel] [v2 1/4] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line optionsQuoted 5 lines · Quan
Quoted 5 lines
Also, this message was not threaded properly; it appeared as a top-level thread along with three other threads for its siblings, instead of all four patches being in-reply-to the 0/4 cover letter.
Quoted 7 lines
Thanks Eric.
Should I:
V2 is version number,
1. $git format-patch --subject-prefix=v2 -ns --cover-letter master Then, edit 0000-cover-letter.patch
Quoted 6 lines
Rather than '--subject-prefix=v2', I prefer using '-v2'. The important part is that you send the mails with 'git send-email' instead of doing it by hand. In fact, you can do 'git send-email --annotate -v2 --cover-letter master' and skip the format-patch altogether, if you are okay saving your cover letter edits to the point where you are sending the mails.
Thanks Eric.
Quoted 7 lines
Quoted 3 lines
2. $git format-patch --subject-prefix=v2 -4 Then, commit these 4 patch and 0000-cover-letter.patch
I'm not sure what you meant by commit. You aren't adding the *.patch files to a repository, but sending them as email.
Yes, just but sending them as email.
Quoted 3 lines
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Quoted 33 lines
-----Original Message-----
From: Eric Blake [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 1:19 AM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [v2 1/4] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line optionsQuoted 12 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)+++
b/qapi-schema.jsonqapi-schema.json line 2861
Quoted 7 lines
qapi-schema.json +4
-0@@ -2855,8 +2855,12 @@ # @passthrough: TPM passthrough type # # Since: 1.5 +# +# @xenstubdoms: TPM xenstubdoms type +# +# Since: 2.3Typically, this would be done as:
Quoted 4 lines
# @passthrough: TPM passthrough type
#
# @xenstubdoms: TPM xenstubdoms type (since 2.3) # # Since: 1.5
Thanks Eric.
I will modify it as your suggestion in v3.
Quoted 5 lines
as the enum itself was added in 1.5, not 2.3.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Quoted 33 lines
-----Original Message-----
From: Eric Blake [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 1:19 AM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [v2 1/4] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line optionsQuoted 12 lines · Quan Xu
Signed-off-by Quan Xu <[email protected]>--- configure | 14 ++++++++++++++ hmp.c | 7 +++++++ qapi-schema.json | 20 ++++++++++++++++++-- qemu-options.hx | 13 +++++++++++-- tpm.c | 7 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-)+++
b/qapi-schema.jsonqapi-schema.json line 2861
Quoted 7 lines
qapi-schema.json +4
-0@@ -2855,8 +2855,12 @@ # @passthrough: TPM passthrough type # # Since: 1.5 +# +# @xenstubdoms: TPM xenstubdoms type +# +# Since: 2.3Typically, this would be done as:
Quoted 4 lines
# @passthrough: TPM passthrough type
#
# @xenstubdoms: TPM xenstubdoms type (since 2.3) # # Since: 1.5
Thanks Eric.
I will modify it as your suggestion in v3.
Quoted 5 lines
as the enum itself was added in 1.5, not 2.3.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org