[siemens/jailhouse] af8a85: x86: Add MSR whitelisting to to-do list

2 views
Skip to first unread message

GitHub

unread,
Mar 30, 2015, 5:49:59 AM3/30/15
to jailho...@googlegroups.com
Branch: refs/heads/master
Home: https://github.com/siemens/jailhouse
Commit: af8a8530a2e15e5feb3d831bf821e4e8cdd02a64
https://github.com/siemens/jailhouse/commit/af8a8530a2e15e5feb3d831bf821e4e8cdd02a64
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M TODO.md
M hypervisor/arch/x86/svm.c
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Add MSR whitelisting to to-do list

We currently allow access to almost all MSRs (except for APIC-related
ones). This has to be changed into a whitelist approach to avoid that
the cell manipulates a CPU state in a way we didn't validate as safe.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 40eb3071b7619ad73e85f16ac1b0b3d7bc457e64
https://github.com/siemens/jailhouse/commit/40eb3071b7619ad73e85f16ac1b0b3d7bc457e64
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/vcpu.c

Log Message:
-----------
x86: Fix comment wording

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 6fd21603925c0f8509849214e5cff25f5d474fa7
https://github.com/siemens/jailhouse/commit/6fd21603925c0f8509849214e5cff25f5d474fa7
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/svm.c

Log Message:
-----------
x86: Drop redundant stgi from SVM's vcpu_deactivate_vmm

Already done via arch_cpu_restore -> vcpu_exit.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: e861c20c2b9db80b41a7b76212206b3fc807c389
https://github.com/siemens/jailhouse/commit/e861c20c2b9db80b41a7b76212206b3fc807c389
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/processor.h

Log Message:
-----------
x86: Reformat and extend CR0 constants

Encode CR0 constants in an easier readable form and add some bits we
will need soon. Also add a mask of the reserved bits that need to be
left as-is on modifications.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 47a1f4a8d815556453f6c987b3f5c9f5fa8fc1be
https://github.com/siemens/jailhouse/commit/47a1f4a8d815556453f6c987b3f5c9f5fa8fc1be
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Rework CR0/CR4 restriction handling for VMX

First of all, we want to reuse the restrictions also for setting the
host CRx values. And then the current implementation would benefit from
more documentation, caching of those static values and checking their
consistency across all CPUs.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 9f20699e6808379a2b472273ee3f4174f9c994dd
https://github.com/siemens/jailhouse/commit/9f20699e6808379a2b472273ee3f4174f9c994dd
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/svm.c

Log Message:
-----------
x86: Rename SVM_CR0_CLEARED_BITS to SVM_CR0_ALLOWED_BITS

Clarifies the semantic.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 7e24ac197d19b00316a1ee9adee252493c4cdef8
https://github.com/siemens/jailhouse/commit/7e24ac197d19b00316a1ee9adee252493c4cdef8
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/percpu.h
M hypervisor/arch/x86/include/asm/vcpu.h
M hypervisor/arch/x86/setup.c
M hypervisor/arch/x86/svm.c
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Bring host CR0 into well-defined state during setup

Avoid any uncertainty about the state of CR0 left behind by Linux: check
for unexpectedly set reserved bits or required-1 bits, and otherwise set
our own state.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 3900f0bd40490aed3aa31a537361e29aafb004f9
https://github.com/siemens/jailhouse/commit/3900f0bd40490aed3aa31a537361e29aafb004f9
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/processor.h

Log Message:
-----------
x86: Reformat and cleanup CR4 constants

Encode CR0 constants in an easier readable form, add soon required XSAVE
feature bit and remove unused PGE. Also add a mask of the reserved bits
that need to be left as-is on modifications.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 900099040da4d33eed033a38b57c1a13b3596068
https://github.com/siemens/jailhouse/commit/900099040da4d33eed033a38b57c1a13b3596068
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/processor.h

Log Message:
-----------
x86: Sort and document feature bits

Sort feature bit constants according to their leafs and document their
locations.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 427ff407c1ae4d8c2acfe657974f54b240c4af1b
https://github.com/siemens/jailhouse/commit/427ff407c1ae4d8c2acfe657974f54b240c4af1b
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/processor.h
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Check for availability of xsetbv before executing it for the guest

Practically, this feature is also available on VMX-capable CPUs, but we
should not rely on it.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 0254c6cec7a8f6212848b118a6aeb60d8d4eccb4
https://github.com/siemens/jailhouse/commit/0254c6cec7a8f6212848b118a6aeb60d8d4eccb4
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/percpu.h
M hypervisor/arch/x86/include/asm/vcpu.h
M hypervisor/arch/x86/setup.c
M hypervisor/arch/x86/svm.c
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Bring host CR4 into well-defined state during setup

Analogously to CR0: Avoid any uncertainty about the state of CR4 left
behind by Linux: check for unexpectedly set reserved bits or required-1
bits, and otherwise set our own state.

A side effect of this change is the VMX's vcpu_exit will no longer clear
VMXE in CR4 but only in the cached Linux state that arch_cpu_restore
will write back.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: a89ecf17df8b0bb9281c47bc1a40a3030dee5835
https://github.com/siemens/jailhouse/commit/a89ecf17df8b0bb9281c47bc1a40a3030dee5835
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M hypervisor/include/jailhouse/printk.h

Log Message:
-----------
core: Introduce error return code tracing

A number of errors that can be reported during setup or while
reconfiguring cells are hard to trace down to their detailed reasons
because of the limited number of error codes available through POSIX.
This Introduces a non-invasive mechanism to instrument error return
paths in the hypervisor and report the origin of a specific error code
in the form

hypervisor/arch/x86/vmx.c:592: returning error -ENODEV

This can then be matched against the source code to find out which check
on the hardware, the system state or the configuration data failed
precisely.

The feature is off by default, requiring CONFIG_TRACE_ERROR to be set in
config.h.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 55400dafb2753bc7a1829c795cdb7a4c07136bdd
https://github.com/siemens/jailhouse/commit/55400dafb2753bc7a1829c795cdb7a4c07136bdd
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M hypervisor/control.c
M hypervisor/paging.c
M hypervisor/pci.c
M hypervisor/pci_ivshmem.c

Log Message:
-----------
core: Instrument relevant return paths for error tracing

This instruments return paths so that the origin of important errors can
be tracked down. Two so far explicit error outputs are replaced with
trace_error.

We do not instrument -ENOMEM cases unless they relate to allocations
from the remapping pool. All other -ENOMEM cases boil down to a too
small hypervisor region.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 2029c09ee7f21937986f3a05725a1341bfb7c27c
https://github.com/siemens/jailhouse/commit/2029c09ee7f21937986f3a05725a1341bfb7c27c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M hypervisor/arch/x86/apic.c
M hypervisor/arch/x86/ioapic.c
M hypervisor/arch/x86/svm.c
M hypervisor/arch/x86/vcpu.c
M hypervisor/arch/x86/vmx.c
M hypervisor/arch/x86/vtd.c

Log Message:
-----------
x86: Instrument relevant return paths for error tracing

Add trace_error to return paths so that the origin of important errors
can be tracked down.

CC: Valentine Sinitsyn <valentine...@gmail.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: e61898c87f0b275c1e617856805bd96d2c0aa994
https://github.com/siemens/jailhouse/commit/e61898c87f0b275c1e617856805bd96d2c0aa994
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M hypervisor/paging.c

Log Message:
-----------
core: Simplify error reporting of paging_init

If -ENOMEM shows up at the user, this always means we ran out of pages.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 68657bf459d72e944eb9a5bbd5c3b71736d21178
https://github.com/siemens/jailhouse/commit/68657bf459d72e944eb9a5bbd5c3b71736d21178
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M ci/jailhouse-config-vexpress.h
M ci/jailhouse-config-x86.h

Log Message:
-----------
ci: Test CONFIG_TRACE_ERROR in specific targets

Make sure we test both CONFIG_TRACE_ERROR enabled and disabled by
leaving it off for the Banana Pi, and also test it on both
architectures.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: db73a985e5102ccef3326a138d117c8aa794128c
https://github.com/siemens/jailhouse/commit/db73a985e5102ccef3326a138d117c8aa794128c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M configs/qemu-vm.c

Log Message:
-----------
configs: Tune qemu config for X mode changes

X triggers accesses to the QEMU VBE ports and some non-existent port
402. Allow both to (re-)enable graphic mode changes.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 8918cd931be78e78aa7a83c93ad7222163b03e2b
https://github.com/siemens/jailhouse/commit/8918cd931be78e78aa7a83c93ad7222163b03e2b
Author: Henning Schild <henning...@siemens.com>
Date: 2015-03-21 (Sat, 21 Mar 2015)

Changed paths:
M tools/jailhouse-config-create

Log Message:
-----------
tools: config create: do not break up ROM memory region

Just take the ROM memory region as one, that avoids creating unalligned
memory regions on some systems.

Signed-off-by: Henning Schild <henning...@siemens.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Compare: https://github.com/siemens/jailhouse/compare/07a57f3e7a10...8918cd931be7
Reply all
Reply to author
Forward
0 new messages