From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Quan Xu <quan.xu@intel.com>,
stefano.stabellini@eu.citrix.com, eblake@redhat.com
Cc: dgdegra@tycho.nsa.gov, wei.liu2@citrix.com,
qemu-devel@nongnu.org, xen-devel@lists.xen.org
Subject: Re: [Qemu-devel] [PATCH v6 3/6] Qemu-Xen-vTPM: Xen frontend driver infrastructure
Date: Mon, 04 May 2015 11:36:07 -0400 [thread overview]
Message-ID: <554791E7.8020008@linux.vnet.ibm.com> (raw)
In-Reply-To: <1430724181-476-4-git-send-email-quan.xu@intel.com>
On 05/04/2015 03:22 AM, Quan Xu wrote:
> This patch adds infrastructure for xen front drivers living in qemu,
> so drivers don't need to implement common stuff on their own. It's
> mostly xenbus management stuff: some functions to access XenStore,
> setting up XenStore watches, callbacks on device discovery and state
> changes, and handle event channel between the virtual machines.
>
> Call xen_fe_register() function to register XenDevOps, and make sure,
> [...]
> 3 = ""
> [...]
> device = "" (frontend device, the backend is running in QEMU/.etc)
> vkbd = ""
> [...]
> vif = ""
> [...]
>
> ..
>
> (QEMU) xen_vtpmdev_ops is initialized with the following process:
> xen_hvm_init()
> [...]
> -->xen_fe_register("vtpm", ...)
> -->xenstore_fe_scan()
> -->xen_fe_try_init(ops)
> --> XenDevOps.init()
> -->xen_fe_get_xendev()
> --> XenDevOps.alloc()
> -->xen_fe_check()
> -->xen_fe_try_initialise()
> --> XenDevOps.initialise()
> -->xen_fe_try_connected()
> --> XenDevOps.connected()
> -->xs_watch()
> [...]
>
> Signed-off-by: Quan Xu <quan.xu@intel.com>
>
> --Changes in v6:
> -Replace buf_size with PAGE_SIZE and use length rather than
> shr->length.
> ---
> hw/tpm/Makefile.objs | 1 +
> hw/tpm/xen_vtpm_frontend.c | 315 +++++++++++++++++++++++++++++++++++++++++++
> hw/xen/xen_frontend.c | 20 +++
> include/hw/xen/xen_backend.h | 5 +
> include/hw/xen/xen_common.h | 6 +
> xen-hvm.c | 5 +
> 6 files changed, 352 insertions(+)
> create mode 100644 hw/tpm/xen_vtpm_frontend.c
>
> diff --git a/hw/tpm/Makefile.objs b/hw/tpm/Makefile.objs
> index 99f5983..57919fa 100644
> --- a/hw/tpm/Makefile.objs
> +++ b/hw/tpm/Makefile.objs
> @@ -1,2 +1,3 @@
> common-obj-$(CONFIG_TPM_TIS) += tpm_tis.o
> common-obj-$(CONFIG_TPM_PASSTHROUGH) += tpm_passthrough.o
> +common-obj-$(CONFIG_TPM_XENSTUBDOMS) += xen_vtpm_frontend.o
> diff --git a/hw/tpm/xen_vtpm_frontend.c b/hw/tpm/xen_vtpm_frontend.c
> new file mode 100644
> index 0000000..d6e7cc6
> --- /dev/null
> +++ b/hw/tpm/xen_vtpm_frontend.c
> @@ -0,0 +1,315 @@
> +/*
> + * Connect to Xen vTPM stubdom domain
> + *
> + * Copyright (c) 2015 Intel Corporation
> + * Authors:
> + * Quan Xu <quan.xu@intel.com>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, see <http://www.gnu.org/licenses/>
> + */
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <stdarg.h>
> +#include <string.h>
> +#include <unistd.h>
> +#include <signal.h>
> +#include <inttypes.h>
> +#include <time.h>
> +#include <fcntl.h>
> +#include <errno.h>
> +#include <sys/ioctl.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <sys/mman.h>
> +#include <sys/uio.h>
> +
> +#include "hw/hw.h"
> +#include "block/aio.h"
> +#include "hw/xen/xen_backend.h"
> +
> +#ifndef XS_STUBDOM_VTPM_ENABLE
> +#define XS_STUBDOM_VTPM_ENABLE "1"
> +#endif
> +
> +#ifndef PAGE_SIZE
> +#define PAGE_SIZE 4096
> +#endif
You should be able to use TARGET_PAGE_SIZE from exec/cpu-all.h I think.
With this change: Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Regards,
Stefan
next prev parent reply other threads:[~2015-05-04 15:36 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 7:22 [Qemu-devel] [PATCH v6 0/6] QEMU:Xen stubdom vTPM for HVM virtual machine(QEMU Part) Quan Xu
2015-05-04 7:22 ` [PATCH v6 1/6] Qemu-Xen-vTPM: Support for Xen stubdom vTPM command line options Quan Xu
2015-05-04 7:22 ` [Qemu-devel] " Quan Xu
2015-05-05 14:28 ` Eric Blake
2015-05-05 14:28 ` [Qemu-devel] " Eric Blake
2015-05-06 2:02 ` Xu, Quan
2015-05-06 2:02 ` [Qemu-devel] " Xu, Quan
2015-05-04 7:22 ` [Qemu-devel] [PATCH v6 2/6] Qemu-Xen-vTPM: Xen frontend driver infrastructure Quan Xu
2015-05-04 7:22 ` Quan Xu
2015-05-07 17:25 ` Stefano Stabellini
2015-05-07 17:25 ` [Qemu-devel] " Stefano Stabellini
2015-05-12 1:28 ` [Qemu-devel] [Xen-devel] " Xu, Quan
2015-05-12 14:12 ` Stefano Stabellini
2015-05-12 14:12 ` [Qemu-devel] [Xen-devel] " Stefano Stabellini
2015-05-12 1:28 ` Xu, Quan
2015-05-08 9:52 ` [Qemu-devel] " Stefano Stabellini
2015-05-08 9:52 ` Stefano Stabellini
2015-05-04 7:22 ` [Qemu-devel] [PATCH v6 3/6] " Quan Xu
2015-05-04 7:22 ` Quan Xu
2015-05-04 12:57 ` Xu, Quan
2015-05-04 12:57 ` [Qemu-devel] " Xu, Quan
2015-05-04 15:36 ` Stefan Berger [this message]
2015-05-05 2:41 ` Xu, Quan
2015-05-05 2:41 ` [Qemu-devel] " Xu, Quan
2015-05-05 10:23 ` Stefan Berger
2015-05-11 12:56 ` Xu, Quan
2015-05-11 12:56 ` Xu, Quan
2015-05-11 14:49 ` [Qemu-devel] " Stefan Berger
2015-05-11 14:51 ` Xu, Quan
2015-05-11 14:51 ` Xu, Quan
2015-05-11 14:49 ` Stefan Berger
2015-05-04 15:36 ` Stefan Berger
2015-05-08 9:52 ` [Qemu-devel] " Stefano Stabellini
2015-05-08 9:52 ` Stefano Stabellini
2015-05-04 7:22 ` [Qemu-devel] [PATCH v6 4/6] Qemu-Xen-vTPM: Move tpm_passthrough_is_selftest() into tpm_util.c Quan Xu
2015-05-04 15:25 ` Stefan Berger
2015-05-05 2:33 ` Xu, Quan
2015-05-05 2:33 ` Xu, Quan
2015-05-04 15:25 ` Stefan Berger
2015-05-04 7:22 ` Quan Xu
2015-05-04 7:23 ` [Qemu-devel] [PATCH v6 5/6] Qemu-Xen-vTPM: Qemu vTPM xenstubdoms backen Quan Xu
2015-05-04 15:30 ` Stefan Berger
2015-05-05 2:34 ` Xu, Quan
2015-05-05 2:34 ` [Qemu-devel] " Xu, Quan
2015-05-04 15:30 ` Stefan Berger
2015-05-04 7:23 ` Quan Xu
2015-05-04 7:23 ` [Qemu-devel] [PATCH v6 6/6] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init() Quan Xu
2015-05-04 7:23 ` Quan Xu
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=554791E7.8020008@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quan.xu@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.