Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf39c8e5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'stable/for-linus-3.12-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull Xen updates from Konrad Rzeszutek Wilk:
 "A couple of features and a ton of bug-fixes.  There is also some
  maintership changes.  Jeremy is enjoying the full-time work at the
  startup and as much as he would love to help - he can't find the time.
  I have a bunch of other things that I promised to work on - paravirt
  diet, get SWIOTLB working everywhere, etc, but haven't been able to
  find the time.

  As such both David Vrabel and Boris Ostrovsky have graciously
  volunteered to help with the maintership role.  They will keep the lid
  on regressions, bug-fixes, etc.  I will be in the background to help -
  but eventually there will be less of me doing the Xen GIT pulls and
  more of them.  Stefano is still doing the ARM/ARM64 and will continue
  on doing so.

  Features:
   - Xen Trusted Platform Module (TPM) frontend driver - with the
     backend in MiniOS.
   - Scalability improvements in event channel.
   - Two extra Xen co-maintainers (David, Boris) and one going away (Jeremy)

  Bug-fixes:
   - Make the 1:1 mapping work during early bootup on selective regions.
   - Add scratch page to balloon driver to deal with unexpected code
     still holding on stale pages.
   - Allow NMIs on PV guests (64-bit only)
   - Remove unnecessary TLB flush in M2P code.
   - Fixes duplicate callbacks in Xen granttable code.
   - Fixes in PRIVCMD_MMAPBATCH ioctls to allow retries
   - Fix for events being lost due to rescheduling on different VCPUs.
   - More documentation"

* tag 'stable/for-linus-3.12-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (23 commits)
  hvc_xen: Remove unnecessary __GFP_ZERO from kzalloc
  drivers/xen-tpmfront: Fix compile issue with missing option.
  xen/balloon: don't set P2M entry for auto translated guest
  xen/evtchn: double free on error
  Xen: Fix retry calls into PRIVCMD_MMAPBATCH*.
  xen/pvhvm: Initialize xen panic handler for PVHVM guests
  xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping
  xen: fix ARM build after 6efa20e4
  MAINTAINERS: Remove Jeremy from the Xen subsystem.
  xen/events: document behaviour when scanning the start word for events
  x86/xen: during early setup, only 1:1 map the ISA region
  x86/xen: disable premption when enabling local irqs
  swiotlb-xen: replace dma_length with sg_dma_len() macro
  swiotlb: replace dma_length with sg_dma_len() macro
  xen/balloon: set a mapping for ballooned out pages
  xen/evtchn: improve scalability by using per-user locks
  xen/p2m: avoid unneccesary TLB flush in m2p_remove_override()
  MAINTAINERS: Add in two extra co-maintainers of the Xen tree.
  MAINTAINERS: Update the Xen subsystem's with proper mailing list.
  xen: replace strict_strtoul() with kstrtoul()
  ...
parents 3398d252 23b7eaf8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1120,6 +1120,7 @@ D: author of userfs filesystem
D: Improved mmap and munmap handling
D: Improved mmap and munmap handling
D: General mm minor tidyups
D: General mm minor tidyups
D: autofs v4 maintainer
D: autofs v4 maintainer
D: Xen subsystem
S: 987 Alabama St
S: 987 Alabama St
S: San Francisco
S: San Francisco
S: CA, 94110
S: CA, 94110
+113 −0
Original line number Original line Diff line number Diff line
Virtual TPM interface for Xen

Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)

This document describes the virtual Trusted Platform Module (vTPM) subsystem for
Xen. The reader is assumed to have familiarity with building and installing Xen,
Linux, and a basic understanding of the TPM and vTPM concepts.

INTRODUCTION

The goal of this work is to provide a TPM functionality to a virtual guest
operating system (in Xen terms, a DomU).  This allows programs to interact with
a TPM in a virtual system the same way they interact with a TPM on the physical
system.  Each guest gets its own unique, emulated, software TPM.  However, each
of the vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain,
which seals the secrets to the Physical TPM.  If the process of creating each of
these domains (manager, vTPM, and guest) is trusted, the vTPM subsystem extends
the chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
major component of vTPM is implemented as a separate domain, providing secure
separation guaranteed by the hypervisor. The vTPM domains are implemented in
mini-os to reduce memory and processor overhead.

This mini-os vTPM subsystem was built on top of the previous vTPM work done by
IBM and Intel corporation.


DESIGN OVERVIEW
---------------

The architecture of vTPM is described below:

+------------------+
|    Linux DomU    | ...
|       |  ^       |
|       v  |       |
|   xen-tpmfront   |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
|  vtpm-stubdom    | ...
|       |  ^       |
|       v  |       |
| mini-os/tpmfront |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
| vtpmmgr-stubdom  |
|       |  ^       |
|       v  |       |
| mini-os/tpm_tis  |
+------------------+
        |  ^
        v  |
+------------------+
|   Hardware TPM   |
+------------------+

 * Linux DomU: The Linux based guest that wants to use a vTPM. There may be
	       more than one of these.

 * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
                    provides vTPM access to a Linux-based DomU.

 * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
		    connects to this backend driver to facilitate communications
		    between the Linux DomU and its vTPM. This driver is also
		    used by vtpmmgr-stubdom to communicate with vtpm-stubdom.

 * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
		 one to one mapping between running vtpm-stubdom instances and
                 logical vtpms on the system. The vTPM Platform Configuration
                 Registers (PCRs) are normally all initialized to zero.

 * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
		     vtpm-stubdom uses this driver to communicate with
		     vtpmmgr-stubdom. This driver is also used in mini-os
		     domains such as pv-grub that talk to the vTPM domain.

 * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager. There is
		    only one vTPM manager and it should be running during the
		    entire lifetime of the machine.  This domain regulates
		    access to the physical TPM on the system and secures the
		    persistent state of each vTPM.

 * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS)
                    driver. This driver used by vtpmmgr-stubdom to talk directly to
                    the hardware TPM. Communication is facilitated by mapping
                    hardware memory pages into vtpmmgr-stubdom.

 * Hardware TPM: The physical TPM that is soldered onto the motherboard.


INTEGRATION WITH XEN
--------------------

Support for the vTPM driver was added in Xen using the libxl toolstack in Xen
4.3.  See the Xen documentation (docs/misc/vtpm.txt) for details on setting up
the vTPM and vTPM Manager stub domains.  Once the stub domains are running, a
vTPM device is set up in the same manner as a disk or network device in the
domain's configuration file.

In order to use features such as IMA that require a TPM to be loaded prior to
the initrd, the xen-tpmfront driver must be compiled in to the kernel.  If not
using such features, the driver can be compiled as a module and will be loaded
as usual.
+8 −8
Original line number Original line Diff line number Diff line
@@ -9278,9 +9278,9 @@ F: drivers/media/tuners/tuner-xc2028.*


XEN HYPERVISOR INTERFACE
XEN HYPERVISOR INTERFACE
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
M:	Jeremy Fitzhardinge <jeremy@goop.org>
M:	Boris Ostrovsky <boris.ostrovsky@oracle.com>
L:	xen-devel@lists.xensource.com (moderated for non-subscribers)
M:	David Vrabel <david.vrabel@citrix.com>
L:	virtualization@lists.linux-foundation.org
L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
S:	Supported
S:	Supported
F:	arch/x86/xen/
F:	arch/x86/xen/
F:	drivers/*/xen-*front.c
F:	drivers/*/xen-*front.c
@@ -9291,35 +9291,35 @@ F: include/uapi/xen/


XEN HYPERVISOR ARM
XEN HYPERVISOR ARM
M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
L:	xen-devel@lists.xensource.com (moderated for non-subscribers)
L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
S:	Supported
S:	Supported
F:	arch/arm/xen/
F:	arch/arm/xen/
F:	arch/arm/include/asm/xen/
F:	arch/arm/include/asm/xen/


XEN HYPERVISOR ARM64
XEN HYPERVISOR ARM64
M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
L:	xen-devel@lists.xensource.com (moderated for non-subscribers)
L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
S:	Supported
S:	Supported
F:	arch/arm64/xen/
F:	arch/arm64/xen/
F:	arch/arm64/include/asm/xen/
F:	arch/arm64/include/asm/xen/


XEN NETWORK BACKEND DRIVER
XEN NETWORK BACKEND DRIVER
M:	Ian Campbell <ian.campbell@citrix.com>
M:	Ian Campbell <ian.campbell@citrix.com>
L:	xen-devel@lists.xensource.com (moderated for non-subscribers)
L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
L:	netdev@vger.kernel.org
L:	netdev@vger.kernel.org
S:	Supported
S:	Supported
F:	drivers/net/xen-netback/*
F:	drivers/net/xen-netback/*


XEN PCI SUBSYSTEM
XEN PCI SUBSYSTEM
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
L:	xen-devel@lists.xensource.com (moderated for non-subscribers)
L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
S:	Supported
S:	Supported
F:	arch/x86/pci/*xen*
F:	arch/x86/pci/*xen*
F:	drivers/pci/*xen*
F:	drivers/pci/*xen*


XEN SWIOTLB SUBSYSTEM
XEN SWIOTLB SUBSYSTEM
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
L:	xen-devel@lists.xensource.com (moderated for non-subscribers)
L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
S:	Supported
S:	Supported
F:	arch/x86/xen/*swiotlb*
F:	arch/x86/xen/*swiotlb*
F:	drivers/xen/*swiotlb*
F:	drivers/xen/*swiotlb*
+1 −0
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@ enum ipi_vector {
	XEN_CALL_FUNCTION_SINGLE_VECTOR,
	XEN_CALL_FUNCTION_SINGLE_VECTOR,
	XEN_SPIN_UNLOCK_VECTOR,
	XEN_SPIN_UNLOCK_VECTOR,
	XEN_IRQ_WORK_VECTOR,
	XEN_IRQ_WORK_VECTOR,
	XEN_NMI_VECTOR,


	XEN_NR_IPIS,
	XEN_NR_IPIS,
};
};
+10 −5
Original line number Original line Diff line number Diff line
@@ -427,8 +427,7 @@ static void __init xen_init_cpuid_mask(void)


	if (!xen_initial_domain())
	if (!xen_initial_domain())
		cpuid_leaf1_edx_mask &=
		cpuid_leaf1_edx_mask &=
			~((1 << X86_FEATURE_APIC) |  /* disable local APIC */
			~((1 << X86_FEATURE_ACPI));  /* disable ACPI */
			  (1 << X86_FEATURE_ACPI));  /* disable ACPI */


	cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_X2APIC % 32));
	cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_X2APIC % 32));


@@ -735,8 +734,7 @@ static int cvt_gate_to_trap(int vector, const gate_desc *val,
		addr = (unsigned long)xen_int3;
		addr = (unsigned long)xen_int3;
	else if (addr == (unsigned long)stack_segment)
	else if (addr == (unsigned long)stack_segment)
		addr = (unsigned long)xen_stack_segment;
		addr = (unsigned long)xen_stack_segment;
	else if (addr == (unsigned long)double_fault ||
	else if (addr == (unsigned long)double_fault) {
		 addr == (unsigned long)nmi) {
		/* Don't need to handle these */
		/* Don't need to handle these */
		return 0;
		return 0;
#ifdef CONFIG_X86_MCE
#ifdef CONFIG_X86_MCE
@@ -747,7 +745,12 @@ static int cvt_gate_to_trap(int vector, const gate_desc *val,
		 */
		 */
		;
		;
#endif
#endif
	} else {
	} else if (addr == (unsigned long)nmi)
		/*
		 * Use the native version as well.
		 */
		;
	else {
		/* Some other trap using IST? */
		/* Some other trap using IST? */
		if (WARN_ON(val->ist != 0))
		if (WARN_ON(val->ist != 0))
			return 0;
			return 0;
@@ -1710,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)


	xen_hvm_init_shared_info();
	xen_hvm_init_shared_info();


	xen_panic_handler_init();

	if (xen_feature(XENFEAT_hvm_callback_vector))
	if (xen_feature(XENFEAT_hvm_callback_vector))
		xen_have_vector_callback = 1;
		xen_have_vector_callback = 1;
	xen_hvm_smp_init();
	xen_hvm_smp_init();
Loading