On 05/11/2015 08:56 AM, Xu, Quan wrote:
-----Original Message-----
From: Stefan Berger [mailto:stef...@linux.vnet.ibm.com]
Sent: Monday, May 04, 2015 11:36 PM
To: Xu, Quan; stefano.stabell...@eu.citrix.com; ebl...@redhat.com
Cc: qemu-devel@nongnu.org; wei.l...@citrix.com; dgde...@tycho.nsa.gov;
xen-de...@lists.xen.org
Subject: Re: [PATCH v6 3/6] Qemu-Xen-vTPM: Xen frontend driver infrastructure
On 05/04/2015 03:22 AM, Quan Xu wrote:
+#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 <stef...@linux.vnet.ibm.com>
Stefan,
If I add #include "exec/cpu-all.h" in hw/tpm/xen_vtpm_frontend.c, there
are some errors as following:
++++ error ++++
In file included from hw/tpm/xen_vtpm_frontend.c:41:0:
/root/qemu2/include/exec/cpu-all.h:42:46: error: attempt to use poisoned
"TARGET_WORDS_BIGENDIAN"
/root/qemu2/include/exec/cpu-all.h:46:8: error: attempt to use poisoned
"BSWAP_NEEDED"
/root/qemu2/include/exec/cpu-all.h:109:5: error: "TARGET_LONG_SIZE" is not
defined [-Werror=undef]
/root/qemu2/include/exec/cpu-all.h:122:13: error: attempt to use poisoned
"TARGET_WORDS_BIGENDIAN"
/root/qemu2/include/exec/cpu-all.h:174:9: error: attempt to use poisoned
"TARGET_PAGE_SIZE"
/root/qemu2/include/exec/cpu-all.h:174:32: error: attempt to use poisoned
"TARGET_PAGE_BITS"
/root/qemu2/include/exec/cpu-all.h:175:9: error: attempt to use poisoned
"TARGET_PAGE_MASK"
/root/qemu2/include/exec/cpu-all.h:175:28: error: attempt to use poisoned
"TARGET_PAGE_SIZE"
/root/qemu2/include/exec/cpu-all.h:176:9: error: attempt to use poisoned
"TARGET_PAGE_ALIGN"
/root/qemu2/include/exec/cpu-all.h:176:44: error: attempt to use poisoned
"TARGET_PAGE_SIZE"
/root/qemu2/include/exec/cpu-all.h:176:68: error: attempt to use poisoned
"TARGET_PAGE_MASK"
/root/qemu2/include/exec/cpu-all.h:211:1: error: attempt to use poisoned
"CPUArchState"
/root/qemu2/include/exec/cpu-all.h:211:1: error: unknown type name
'CPUArchState'
/root/qemu2/include/exec/cpu-all.h:211:24: error: attempt to use poisoned
"CPUArchState"
/root/qemu2/include/exec/cpu-all.h:211:24: error: unknown type name
'CPUArchState'
/root/qemu2/include/exec/cpu-all.h:222:9: error: attempt to use poisoned
"CPU_INTERRUPT_HARD"
/root/qemu2/include/exec/cpu-all.h:226:9: error: attempt to use poisoned
"CPU_INTERRUPT_EXITTB"
/root/qemu2/include/exec/cpu-all.h:229:9: error: attempt to use poisoned
"CPU_INTERRUPT_HALT"
/root/qemu2/include/exec/cpu-all.h:232:9: error: attempt to use poisoned
"CPU_INTERRUPT_DEBUG"
[....]
+++ error +++
------ ---
Could I replace PAGE_SIZE with VTPM_ PAGE_SIZE, instead of TARGET_PAGE_SIZE
from exec/cpu-all.h??
+#ifndef VTPM_PAGE_SIZE
+#define VTPM_PAGE_SIZE 4096
+#endif
Fine by me.
Stefan