Commit Graph
30261 Commits
Author SHA1 Message Date
Daniel Kiper 1663bdbe1a x86/boot/reloc: mask out MBI_BOOTDEV from mbi flags
..because it is ignored by Xen.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-02-03 11:31:27 +01:00
Boris Ostrovsky 24fdc89e48 x86/VPMU: handle APIC_LVTPC accesses
Don't have the hypervisor update APIC_LVTPC when _it_ thinks the vector
should be updated. Instead, handle guest's APIC_LVTPC accesses and write what
the guest explicitly wanted (but only when VPMU is enabled).

This is updated version of commit 8097616fbd that was reverted by
cc3404093c. Unlike the previous version, we don't update APIC_LVTPC
when VPMU is disabled to avoid interfering with NMI watchdog (which
runs only when VPMU is off).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
2015-02-03 11:30:40 +01:00
Boris Ostrovsky e5e09b5c46 x86/VPMU: disable when NMI watchdog is on
NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
overflow occurs. This may be overwritten by VPMU code later, effectively
turning off the watchdog.

We should disable VPMU when NMI watchdog is running.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-02-03 11:30:09 +01:00
Boris Ostrovsky 2c2fbca65a x86: cleanup usage of nmi_watchdog
Use NMI_NONE when testing whether NMI watchdog is off.

Remove unused NMI_INVALID macro.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-02-03 11:29:28 +01:00
Ed White 8fe99c468d x86/mm: introduce a p2m class
Use the class to differentiate between host and nested p2m's, and
potentially other classes in the future.

Fix p2m class checks that implicitly assume nested and host are
the only two classes that will ever exist.

Signed-off-by: Ed White <edmund.h.white@intel.com>
Acked-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-02-03 11:27:46 +01:00
Jan Beulich e1890c4261 time: widen wallclock seconds to 64 bits
Linux is in the process of converting their seconds representation to
64 bits, so in order to support it consistently we should follow suit
(which at some point in quite a few years we'd have to do anyway). To
represent this in struct shared_info we leverage a 32-bit hole in
x86-64's and arm's variant of the structure; for x86-32 guests the only
(reasonable) choice we have is to put the extension in struct
arch_shared_info.

A note on the conditional suppressing the xen_wc_sec_hi helper macro
definition in the ix86 case for hypervisor and tools: Neither of the
two actually need this, and its presence causes the tools to fail to
build (due to the inclusion of both the x86-64 and x86-32 variants of
the header).

As a secondary change, x86's do_platform_op() gets a pointless
initializer as well as a pointless assignment of that same variable
dropped.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-02-03 11:25:47 +01:00
Ian Jackson a1b4af1320 QEMU_TAG update 2015-02-02 17:11:56 +00:00
Andrew Cooper 1a010ca99e ocaml/xenctrl: Fix stub_xc_readconsolering()
The Ocaml stub to retrieve the hypervisor console ring had a few problems.

 * A single 32k buffer would truncate a large console ring.
 * The buffer was static and not under the protection of the Ocaml GC lock so
   could be clobbered by concurrent accesses.
 * Embedded NUL characters would cause caml_copy_string() (which is strlen()
   based) to truncate the buffer.

The function is rewritten from scratch, using the same algorithm as the python
stubs, but uses the protection of the Ocaml GC lock to maintain a static
running total of the ring size, to avoid redundant realloc()ing in future
calls.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Dave Scott <dave.scott@eu.citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-02-02 14:45:36 +00:00
Andrew Cooper c8945d5161 ocaml/xenctrl: Make failwith_xc() thread safe
The static error_str[] buffer is not thread-safe, and 1024 bytes is
unreasonably large.  Reduce to 256 bytes (which is still much larger than any
current use), and move it to being a stack variable.

Also, propagate the Noreturn attribute from caml_raise_with_string().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Dave Scott <Dave.Scott@eu.citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
2015-02-02 14:42:09 +00:00
Tiejun Chen dc9e2d7c1e tools/xenctrl: correct some function declarations
When commit 6865e52b78, "PCI multi-seg: adjust domctl interface",
is introduced, we missed to sync that head file.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2015-02-02 14:41:26 +00:00
Andrew Cooper 5b0447f647 tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory
c/s 5b5c40c0d1 "libxc: introduce a per architecture scratch pfn for temporary
grant mapping" accidentally an issue whereby there were two paths out of
xc_core_arch_get_scratch_gpfn() which returned 0, but only one of which
assigned a value to the gpfn parameter.

xc_domain_maximum_gpfn() can validly return 0, at which point gpfn 1 is a
valid scratch page to use.

In addition, widen rc before adding 1 and possibly overflowing.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Julien Grall <julien.grall@linaro.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-02-02 14:37:06 +00:00
Stefano Stabellini d8e1ee8182 libxl_set_memory_target: only remove videoram from absolute targets
If the new target is relative to the current target, do not remove
videoram again: it has already been removed from the current target.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-02-02 14:33:12 +00:00
Julien Grall d0b2caa80f xen/arm: vgic-v2: message in the emulation code should be rate-limited
printk is not rated-limited by default. Therefore a malicious guest may
be able to flood the Xen console.

If we use gdprintk, unecessary information will be printed such as the
filename and the line. Instead use XENLOG_G_ERR combine with %pv.

This is XSA-118.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-29 15:56:24 +00:00
Julien Grall c96222cc6d xen/arm: vgic-v3: message in the emulation code should be rate-limited
printk by default is not rate-limited by default. Therefore a malicious guest
may be able to flood the Xen console.

If we use gdprintk, unnecessary information will be printed such as the
filename and the line. Instead use XENLOG_G_{ERR,DEBUG} combine with %pv.

Also remove the vGICv3 prefix which is not neccessary and update some
message which were wrong.

This is XSA-118.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-29 15:56:21 +00:00
Jan Beulich 9f7798eb6e gnttab: fix a printk() format specifier
... to fix arm32 build.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2015-01-29 15:57:11 +01:00
Julien Grall 685b1dcb51 random: add missing include xen/cache.h
The commit f6c9698 " x86: allow reading MSR_IA32_TSC with XENPF_resource_op"
introduced a built regression on ARM platform.

random.c:8:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘boot_random’
 unsigned int __read_mostly boot_random;
                            ^
The define __read_mostly is defined in asm/cache.h which is included by
other headers on x86 but not on ARM. Include xen/cache.h to fix the
build.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-29 15:50:00 +01:00
Jan Beulich 7977148fee x86/shadow: use shorter constants for callback masks
private.h defining them I can't see why they couldn't be used here to
make the code easier to read.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
2015-01-29 13:46:17 +00:00
Jan Beulich 88d07de868 x86/shadow: adjust mask shadow_audit_tables() passes to hash_foreach()
It so far having been ~1 made most of the code preceding the call
pointless, but I assume this wasn't meant to be that way. Also replace
the remaining hard coded ~1 with an expression documenting the
intention a little better.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Adjust again to use SHF_page_type_mask, at Jan's suggestion.

Signed-off-by: Tim Deegan <tim@xen.org>
2015-01-29 13:44:49 +00:00
Jan Beulich b8dbddd310 x86/shadow: convert non-const statics
To make obvious that such statics are safe to use, they should be
const. In some of the cases, they wouldn't even need to be static, but
keep them so upon the maintainer's request.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
2015-01-29 13:44:28 +00:00
Jan Beulich 54057a28f2 x86: support SMBIOS v3
While presumably of primary use to ARM64 (once the code gets
generalized), we should still support this more modern variant,
allowing for the actual DMI data to reside in memory above 4Gb.

While based on draft version 3.0.0d, it is assumed that the final
version of the specification will not render this implementation
invalid (not the least because Linux 3.19 already makes the same
assumption).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-01-29 14:24:04 +01:00
David Vrabel d28f42f270 grant-table: defer releasing pages acquired in a grant copy
Acquiring a page for the source or destination of a grant copy is an
expensive operation.  A common use case is for two adjacent grant copy
ops to operate on either the same source or the same destination page.

Instead of always acquiring and releasing destination and source pages
for each operation, release the page once it is no longer valid for
the next op.

If either the source or destination domains changes both pages are
released as it is unlikely that either will still be valid.

XenServer's performance benchmarks show modest improvements in network
receive throughput (netback uses grant copy in the guest Rx path) and
no regressions in disk performance (using tapdisk3 which grant copies
as the backend).

                         Baseline   Deferred Release
Interhost receive to VM   7.2 Gb/s  ~9 Gbit/s
Interhost aggregate      24 Gb/s    28 Gb/s
Intrahost single stream  14 Gb/s    14 Gb/s
Intrahost aggregate      34 Gb/s    36 Gb/s
Aggregate disk write    900 MB/s   900 MB/s
Aggregate disk read     890 MB/s   890 MB/s

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2015-01-29 14:22:22 +01:00
David Vrabel 3c72f8c2cf grant-table: refactor grant copy to reduce duplicate code
Much of the grant copy operation is identical for the source and
destination buffers.  Refactor the code into per-buffer functions.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
2015-01-29 14:21:00 +01:00
Jan Beulich 3c2550884d x86/shadow: make some log-dirty handling functions static
Noticed while introducing the stub replacement for disabling shadow
paging support at build time.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
2015-01-29 11:55:15 +00:00
Dan Carpenter 39798e95a9 bunzip2: off by one in get_next_block()
"origPtr" is used as an offset into the bd->dbuf[] array.  That array is
allocated in start_bunzip() and has "bd->dbufSize" number of elements so
the test here should be >= instead of >.

Later we check "origPtr" again before using it as an offset so I don't
know if this bug can be triggered in real life.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Trivial adjustments to make the respective Linux commit
b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-28 16:50:08 +01:00
Jan Beulich e5f317bda1 x86: skip further initialization for idle domains
While in the end not really found necessary, early versions of the
patches to follow pointed out that we needlessly set up paging for idle
domains. Arranging for that to be skipped made me notice that we can at
once skip vMCE setup for them. Leverage to adjustment to further
re-arrange the way FPU setup gets skipped.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-01-28 16:38:20 +01:00
Chao Peng f6c9698d7f x86: allow reading MSR_IA32_TSC with XENPF_resource_op
Memory bandwidth monitoring requires system time information returned
along with the monitoring counter to verify the correctness of the
counter value and to calculate the time elapsed between two samplings.

Add MSR_IA32_TSC to the read path and it returns scaled system time(ns)
instead of raw timestamp to elimanate the needs to convert. The return
time is obfuscated with booting random to eliminate the potential abuse
of it. RESOURCE_ACCESS_MAX_ENTRIES is also increased to 3 so MSR_IA32_TSC
can be used together with an MSR write/read operation pair.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>

Fix uninitialized variable build error.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2015-01-28 16:36:36 +01:00
Jan Beulich c2ba001caf kexec: prefer __copy_to_guest() when possible
It's slightly cheaper and safe as long a copy_from_guest() for the same
guest address range was issued before.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
2015-01-28 16:32:01 +01:00
Andrew Cooper 89c381c30b docs/commandline: correct information for 'x2apic_phys' parameter
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-01-28 16:31:07 +01:00
Jan Beulich 2eb41660bf x86: also use tzcnt instead of bsf in __scanbit()
... when available, i.e. by runtime patching. This saves the
conditional move, having a back-to-back dependency on BSF's (EFLAGS)
result.

The need to include asm/cpufeatures.h from asm/bitops.h requires a
workaround for an otherwise resulting circular header file dependency:
Provide a mode by which the including site of the former header can
request to only get the X86_FEATURE_* defines (and very little more)
from it, allowing it to nevertheless be included in its entirety later
on.

While doing this I also noticed that the function's "max" parameter was
pointlessly "unsigned long" - the function only returning
"unsigned int", this can't be of any use, and hence gets converted at
once, along with the necessary adjustments to CMOVZ's output operands.

Note that while only alternative_io() is needed by this change (and
hence gets pulled over from Linux), for completeness its input-only
counterpart alternative_input() gets added as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2015-01-28 16:29:46 +01:00
Wei Liu a4a0066eb1 libxl: correct function name
spaw_ -> spawn_

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-28 14:07:28 +00:00
Andrew Cooper 755a7aaee0 tools/libxc: Disable CONFIG_MIGRATE in stubdom environments
The legacy save/restore infrastructure requires several function pointers from
the toolstack (libxl or Xend in the past) in order to work, and for HVM guests
also need to be able to play around in dom0's filesystem to move the device
model save record.

Migration v2 changes some of this, but is similarly dependent on
toolstack-provided function pointers.

Someone who wishes to re-architect the interaction of moving parts for running
a domain might be in a position to re-enabled this, but for now, explicitly
fail with ENOSYS (from xc_nomigrate.c) rather than failing with an error about
a missing function pointer (or indeed falling over a NULL pointer on certain
paths).

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-28 13:28:46 +00:00
Andrew Cooper 3380f5b627 ocaml/xenctrl: Check return values from hypercalls
rather than blindly continuing and possibly using negative values.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Dave Scott <dave.scott@eu.citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
2015-01-28 13:10:56 +00:00
Oleksandr Tyshchenko 57255adfe1 xen/arm: split the init_xen_time() in 2 parts
Create preinit_xen_time() and move to it minimum required
subset of operations needed to properly initialized
cpu_khz and boot_count vars. This is allow us to use udelay()
immediately after the call.

Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-28 13:10:26 +00:00
Quan Xu 8e906a2a18 vTPM/TPM2: Record some infomation in docs/misc/vtpmmgr.txt about
'vtpmmgr on TPM 2.0'

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu b1fee946d3 vTPM/TPM2: Unind group keys and sectors data on disk
Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu b80533f680 vTPM/TPM2: Bind group keys and sectors data on disk
Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu b8d8733f89 vTPM/TPM2: Support TPM 2.0 bind and unbind data
Bind data with TPM2_RSA_Encrypt, which performs RSA encryption using
the indicated padding scheme according to PKCS#1v2.1(PKCS#1). If the
scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme
to specify the padding scheme.
Unbind data with TPM2_RSA_Decrypt, which performs RSA decryption using
the indicated padding scheme according to PKCS#1v2.1(PKCS#1).

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu 98cbe87243 vTPM/TPM2: TPM 2.0 PCRs read
Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu 71a7c55ad0 vTPM/TPM2: Support 'tpm2' extra command line.
Make vtpm-stubdom domain compatible to launch on TPM 1.x / TPM 2.0.
Add:
..
     extra="tpm2=1"
..
to launch vtpm-stubdom domain on TPM 2.0, ignore it on TPM 1.x. for
example,
vtpm-stubdom domain configuration on TPM 2.0:

  kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
  memory=16
  disk=["file:/var/scale/vdisk/vmgr,hda,w"]
  name="vtpmmgr"
  iomem=["fed40,5"]
  extra="tpm2=1"

vtpm-stubdom domain configuration on TPM 1.x:

  kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
  memory=16
  disk=["file:/var/scale/vdisk/vmgr,hda,w"]
  name="vtpmmgr"
  iomem=["fed40,5"]

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu df75aa4aa6 vTPM/TPM2: Add main entrance vtpmmgr2_init()
Accept commands from the vtpm-stubdom domains via the mini-os TPM
backend driver. The vTPM manager communicates directly with hardware
TPM 2.0 using the mini-os tpm2_tis driver.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:50 +00:00
Quan Xu 1710fc49a0 vTPM/TPM2: TPM2.0 TIS initialization and self test.
call the TPM 2.0 various registers that allow communication between
the TPM 2.0 and platform hardware and software. TPM2_SelfTest causes
the TPM 2.0 to perform a test of its capabilities.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Quan Xu 3334d916de vTPM/TPM2: Create and load SK on TPM 2.0
TPM2_Create is used to create an object that can be loaded into a
TPM using TPM2_Load(). If the command completes successfully, the
TPM will create the new object and return the object’s creation.
data (creationData), its public area (outPublic), and its encrypted
sensitive area (outPrivate). Preservation of the returned data is
the responsibility of the caller. The object will need to be loaded
(TPM2_Load()).
TPM2_Load is used to load objects into the TPM. This command is used
when both a TPM2B_PUBLIC and TPM2B_PRIVATE are to be loaded. If only
a TPM2B_PUBLIC is to be loaded, the TPM2_LoadExternal command is used.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Quan Xu b80507775d vTPM/TPM2: TPM 2.0 takes ownership and create SRK
TPM2_CreatePrimary is used to create a Primary Object under one of
the Primary Seeds or a Temporary Object under TPM_RH_NULL. The command
uses a TPM2B_PUBLIC as a template for the object to be created. The
command will create and load a Primary Object. The sensitive area is
not returned. Any type of object and attributes combination that is
allowed by TPM2_Create() may be created by this command. The constraints
on templates and parameters are the same as TPM2_Create() except that a
Primary Storage Key and a Temporary Storage Key are not constrained to
use the algorithms of their parents.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Quan Xu de438117e0 vTPM/TPM2: Add TPM 2.0 Exposed APIs
These TPM 2.0 Exposed APIs for the Mini-os to access TPM 2.0
hardware.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Quan Xu c574452cdd vTPM/TPM2: Add global data in vtpm_globals{}
These data is for the Mini-os to access TPM 2.0 hardware.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Quan Xu 2a10a705b3 vTPM/TPM2: TPM 2.0 data structures marshal
Add TPM 2.0 data structure marshal for packing and unpacking TPM
2.0 data structures.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Quan Xu d5123397bd vTPM/TPM2: Add TPM 2.0 data structures and commands definition
Add TPM 2.0 data structures on Trusted Platform Module Library Part 2:
Structures and Trust Platform Module Library Part 3: Commands.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
2015-01-28 12:54:49 +00:00
Andrew Cooper 027af8cdb3 tools/libxl: Correct static pattern rule for pkgconfig files
Attempting to build libxl causes Make to emit the following warnings

andrewcoop@andrewcoop:xen.git$ make -C tools/libxl all
...
Makefile:253: target `xenlight.pc' doesn't match the target pattern
Makefile:253: target `xlutil.pc' doesn't match the target pattern
...

because the static pattern rule is malformed.  'Makefile' as the only
prereq-pattern does not contain a pattern.

The rule ends up working because of the use of $@.in where $< should have been
used, but lacked any dependency between a $FOO.pc and its .in source file.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-28 09:59:46 +00:00
Ian Campbell 2d61819c0b xen: arm: enable sync console in machine_reboot.
Otherwise the last thing printed is "(XE" or something.

In line with x86 also disable the watchdog and spin debugging.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
2015-01-27 16:47:02 +00:00
Sander Eikelenboom 9ba80a722b libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
At present on shutdown when using pci-passthrough with qemu-xen, qemu
closes the QMP socket before libxl is done with it causing these
errors to be logged by libxl:

    Waiting for domain test (domid 1) to die [pid 11568]
    Domain 1 has shut down, reason code 0 0x0
    Action for shutdown reason code 0 is destroy
    Domain 1 needs to be cleaned up: destroying the domain
    libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
    libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
    libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
    libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
    Done. Exiting now

Prevent this by using the qemu '-no-shutdown' parameter which is
described as doing:

    "Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
     This allows for instance switching to monitor to commit changes to the disk image."

So Qemu will stop emulating, but keeps the QMP socket open and waits
for libxl to kill the qemu process when it is done, preventing the
race and resulting in this to be logged by libxl:

    Waiting for domain test (domid 1) to die [pid 10859]
    Domain 1 has shut down, reason code 0 0x0
    Action for shutdown reason code 0 is destroy
    Domain 1 needs to be cleaned up: destroying the domain
    Done. Exiting now

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2015-01-27 16:45:29 +00:00