[siemens/jailhouse] 5fbd3e: x86: Stop printing PCI address port in vcpu_handle...

2 views
Skip to first unread message

GitHub

unread,
Apr 10, 2015, 6:30:57 AM4/10/15
to jailho...@googlegroups.com
Branch: refs/heads/next
Home: https://github.com/siemens/jailhouse
Commit: 5fbd3e16cedd321d6183b1efb8b3ad045461bcc8
https://github.com/siemens/jailhouse/commit/5fbd3e16cedd321d6183b1efb8b3ad045461bcc8
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Stop printing PCI address port in vcpu_handle_io_access

This information is provided by x86_pci_config_handler since b1be672359.

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


Commit: a9cf03589778b2f0ccf634e3faf6462efe5b133e
https://github.com/siemens/jailhouse/commit/a9cf03589778b2f0ccf634e3faf6462efe5b133e
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Adjust output of SVM's dump_guest_regs

Aligns us with VMX.

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


Commit: 25226b50279cb6a99c67a8a2813488dbcbef51bb
https://github.com/siemens/jailhouse/commit/25226b50279cb6a99c67a8a2813488dbcbef51bb
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Prevent interference by Intel perf counters

Make it simple but safe: Disable perf counters during setup and prevent
that cells can modify the corresponding MSR. This avoids that we have
to switch the MSR during vmentry/exit, but it also blocks perf & friends
while Jailhouse is active.

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


Commit: e0623d3134b80e93a8f18e13a32754b51c6a4cb5
https://github.com/siemens/jailhouse/commit/e0623d3134b80e93a8f18e13a32754b51c6a4cb5
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Improve readability of VMX constants

Convert from magic number to shifted value to improve readability.

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


Commit: 355118aac51e4f39338049a349debc0dfa44f5af
https://github.com/siemens/jailhouse/commit/355118aac51e4f39338049a349debc0dfa44f5af
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Validate EFER save/restore feature on Intel

This feature practically comes with unrestricted guest mode, but the
spec does not guarantee this.

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


Commit: f4cdab01af711f5628bf5f8d734d72255f70a263
https://github.com/siemens/jailhouse/commit/f4cdab01af711f5628bf5f8d734d72255f70a263
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Switch between host and guest PAT

Do not allow the guest to mess with the PAT MSR in a was that also
affects the host. This may cause the host to run in uncached mode,
slowing it down, or - even worse- access MMIO with caches enabled which
will cause inconsistencies.

On Intel, we have to require and enable the related save/restore
feature. On AMD, we need to intercept the MSR accesses and map them on
the g_pat field of the VMCB.

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


Commit: 176c4db2176c863ab47e7e23b99070f002e26e41
https://github.com/siemens/jailhouse/commit/176c4db2176c863ab47e7e23b99070f002e26e41
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Refactor svm_handle_msr_read/write

Convert to switch-case and simplify the exit path of the write handler.

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


Commit: dac2a01ed68c3180306ed952c95d02dd10899e56
https://github.com/siemens/jailhouse/commit/dac2a01ed68c3180306ed952c95d02dd10899e56
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Factor out vcpu_handle_msr_read/write

This will simplify the emulation of MTRR_DEF_TYPE. It already allows to
consolidate filtering for x2APIC MSRs and error reporting.

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


Commit: 30927c3a2bfeb04171361b9ba761e6ae01e33872
https://github.com/siemens/jailhouse/commit/30927c3a2bfeb04171361b9ba761e6ae01e33872
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Factor out set_rdmsr_value and get_wrmsr_value

This improves readability of the code and scales better with more MSRs
being intercepted.

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


Commit: 6dcdf86a1fb228cbdf37d2ac7ae45e3ad4231160
https://github.com/siemens/jailhouse/commit/6dcdf86a1fb228cbdf37d2ac7ae45e3ad4231160
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Introduce vcpu_reset

So far this just encapsulates the general purpose register reset, but
more will follow.

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


Commit: dd6a4d8d185e5b45dc94d0fbf4c233e6b1dc9f50
https://github.com/siemens/jailhouse/commit/dd6a4d8d185e5b45dc94d0fbf4c233e6b1dc9f50
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 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/vcpu.c
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Maintain PAT shadow

For emulating the MTRR-disabled state, we will have to modify the
effective guest PAT state soon. This prepares for it by keeping PAT in
a shadow per-cpu field and intercept access to the MSR.

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


Commit: fe8fac80d74cd592f9ad3a99be521dc8b7771d80
https://github.com/siemens/jailhouse/commit/fe8fac80d74cd592f9ad3a99be521dc8b7771d80
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Emulate MTRR enable/disable

We assume that cells will only flip the enabled flag of
IA32_MTRR_DEF_TYPE, leaving the rest of the register in default state
(the one found during handover). SVM already implemented this but
emulated the disabled state by modifying the host PAT.

This approach works less invasively by only changing the effective guest
PAT to 0 in case MTRRs are off. And it provides this for Intel as well.

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


Commit: e8c40f62906b5b2f1ff1cc2f2c0ec8a0790a0ca3
https://github.com/siemens/jailhouse/commit/e8c40f62906b5b2f1ff1cc2f2c0ec8a0790a0ca3
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Block write access to MTRR registers

Linux does not try to rewrite them on CPU hotplug if they are identical
to other CPUs' registers, and our non-root cells have no business in
touching them as well. This effectively freezes MTRRs after handover
ensures consistent states for both the hypervisor and all cells across
all CPUs.

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


Commit: 12414a41a75baf0f66a78a908a89bbcdc249657c
https://github.com/siemens/jailhouse/commit/12414a41a75baf0f66a78a908a89bbcdc249657c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove local cpu_data variable from vcpu_handle_io_access

Only used once.

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


Commit: 3633188f6d924d3c43965a71ac6d4a58493cb5d4
https://github.com/siemens/jailhouse/commit/3633188f6d924d3c43965a71ac6d4a58493cb5d4
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove local cpu_data variable from vcpu_handle_hypercall

Only used once.

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


Commit: 28f936a66cdabf238647f70eea79f4b5e83641d6
https://github.com/siemens/jailhouse/commit/28f936a66cdabf238647f70eea79f4b5e83641d6
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/apic.c
M hypervisor/arch/x86/control.c
M hypervisor/arch/x86/include/asm/apic.h

Log Message:
-----------
x86: Remove cpu_data parameter from apic_clear

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
inline.

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


Commit: ca1a5c21dcac6e5cdef2ce702c43c128b83d36ce
https://github.com/siemens/jailhouse/commit/ca1a5c21dcac6e5cdef2ce702c43c128b83d36ce
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove unused parameter from apic_valid_ipi_mode

No use case in sight.

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


Commit: a631fea5db1991dbebd35783e7cf75020f3e763c
https://github.com/siemens/jailhouse/commit/a631fea5db1991dbebd35783e7cf75020f3e763c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove cpu_data parameter from apic_send_[logical_dest_]ipi

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
inline.

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


Commit: ba7e3c32371d2408c584a4554a06af6b9490fa21
https://github.com/siemens/jailhouse/commit/ba7e3c32371d2408c584a4554a06af6b9490fa21
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Update apic_handle_icr_write signature

apic_handle_icr_write became locally used only by 3da0bd91d9, and we
also no longer use the cpu_data parameter.

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


Commit: 5035f578da65ef7f3eb5aa73f75fd52d1ea2b473
https://github.com/siemens/jailhouse/commit/5035f578da65ef7f3eb5aa73f75fd52d1ea2b473
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove cpu_data parameter from vcpu_park

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The implementations can obtain the
reference inline as needed.

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


Commit: 35af38ebdfefd31e43e3b8644bc10b16b990e452
https://github.com/siemens/jailhouse/commit/35af38ebdfefd31e43e3b8644bc10b16b990e452
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Obtain execution state inside vcpu_handle_hypercall

This simplifies the invocation of the handler and aligns it with
vcpu_handle_pt_violation.

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


Commit: f67a94e567cb274a98895459c9242cc224606040
https://github.com/siemens/jailhouse/commit/f67a94e567cb274a98895459c9242cc224606040
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Retrieve vcpu_io_intercept from vcpu_handle_io_access

Convert the vendor-specific functions into vcpu_vendor_get_io_intercept
and invoke that one from vcpu_handle_io_access. That offloads this
burden from the callers of vcpu_handle_io_access and takes us further
towards consistent vendor callbacks for such purposes.

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


Commit: cdb7417b71e03f876ef4ec0b782d0ce55766d59e
https://github.com/siemens/jailhouse/commit/cdb7417b71e03f876ef4ec0b782d0ce55766d59e
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Rename parameter of vcpu_vendor_get_io_intercept

This aligns the internal names with those used externally. No functional
changes.

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


Commit: 77f7ca835b53b2f4088e41279123c706bbfcc0ef
https://github.com/siemens/jailhouse/commit/77f7ca835b53b2f4088e41279123c706bbfcc0ef
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Rename vcpu_handle_pt_violation to vcpu_handle_mmio_access

This describes more accurately what the handler does and aligns us with
vcpu_handle_io_access.

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


Commit: e9e346780e98c49f0a799abdc3463be4e726ab34
https://github.com/siemens/jailhouse/commit/e9e346780e98c49f0a799abdc3463be4e726ab34
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Retrieve vcpu_mmio_intercept from vcpu_handle_mmio_access

Analogously to vcpu_handle_io_access, define the vendor callback
vcpu_vendor_get_mmio_intercept and call it from vcpu_handle_mmio_access
instead of passing it to the handler. For consistency reasons, rename
vcpu_pf_intercept to vcpu_mmio_intercept.

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


Commit: 698dcf0a5f559f00dcf6587f170ecda7ee3dc218
https://github.com/siemens/jailhouse/commit/698dcf0a5f559f00dcf6587f170ecda7ee3dc218
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Factor out vcpu_handle_xsetbv

The handling logic is fully shared between AMD and Intel CPUs.
Consolidate it.

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


Commit: 37b9874733fe5bd8422f8eef3ca1674f199f7da1
https://github.com/siemens/jailhouse/commit/37b9874733fe5bd8422f8eef3ca1674f199f7da1
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/apic.c
M hypervisor/arch/x86/i8042.c
M hypervisor/arch/x86/include/asm/apic.h
M hypervisor/arch/x86/include/asm/i8042.h
M hypervisor/arch/x86/include/asm/pci.h
M hypervisor/arch/x86/include/asm/processor.h
M hypervisor/arch/x86/include/asm/vcpu.h
M hypervisor/arch/x86/pci.c
M hypervisor/arch/x86/svm.c
M hypervisor/arch/x86/vcpu.c
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Allow index-based guest register access without type casts

Convert struct registers into a union and provide a by_index array for
index-based access. This is used by various handlers that parse guest
instructions and so far use a blunt type case on the structure.

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


Commit: 4ef415deb2c94711ab56f277179c1cfad60ec8d9
https://github.com/siemens/jailhouse/commit/4ef415deb2c94711ab56f277179c1cfad60ec8d9
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/svm-vmexit.S

Log Message:
-----------
x86: Reorder stack layout in svm_vmexit

Push the guest registers first so that they end up at the same location
on the stack as on Intel. This will allow to address them generically
via the per_cpu structure.

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


Commit: e6b0322e3037f5e4c7e8a4bf24d6e3d1965b15c5
https://github.com/siemens/jailhouse/commit/e6b0322e3037f5e4c7e8a4bf24d6e3d1965b15c5
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Enable direct access to per-cpu guest registers

Now that the guest registers are saved at the same location on the
per-cpu stack for both Intel and AMD, we can enable direct access via
the per-cpu data structure. This will allow to drop the guest registers
parameter from most functions.

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


Commit: f23b2df3feb047acd45133e10881bd4044ebcfd6
https://github.com/siemens/jailhouse/commit/f23b2df3feb047acd45133e10881bd4044ebcfd6
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/vcpu.h
M hypervisor/arch/x86/svm-vmexit.S
M hypervisor/arch/x86/svm.c
M hypervisor/arch/x86/vmx-vmexit.S
M hypervisor/arch/x86/vmx.c

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_handle_exit

We can retrieve them from the per-cpu data structure now.

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


Commit: 4b7e0bef9ddb4585c242469c51010d1cc1a96105
https://github.com/siemens/jailhouse/commit/4b7e0bef9ddb4585c242469c51010d1cc1a96105
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_reset

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: 963d1b2ffc889cff255931d8581f67b439104917
https://github.com/siemens/jailhouse/commit/963d1b2ffc889cff255931d8581f67b439104917
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_deactivate_vmm

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: 0b82e37052971d00fcdb4e39cc8bc7a40f727c8b
https://github.com/siemens/jailhouse/commit/0b82e37052971d00fcdb4e39cc8bc7a40f727c8b
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_handle_hypercall

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: 5233c243dbd19ceb059fbd6ef311bd06b7bac009
https://github.com/siemens/jailhouse/commit/5233c243dbd19ceb059fbd6ef311bd06b7bac009
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_handle_xsetbv

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: bb784c93249386d40971ec0da1bac0c28fb05677
https://github.com/siemens/jailhouse/commit/bb784c93249386d40971ec0da1bac0c28fb05677
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/apic.c
M hypervisor/arch/x86/include/asm/apic.h
M hypervisor/arch/x86/vcpu.c

Log Message:
-----------
x86: Remove parameters from x2apic_handle_read/write

The function only works against the current CPU, thus should avoid to
take the misleading parameters. We can retrieve the per-cpu data
structure and the guest registers in the function now.

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


Commit: 015f5e58d9960c26b013cb6db37aa22cf5a3e79b
https://github.com/siemens/jailhouse/commit/015f5e58d9960c26b013cb6db37aa22cf5a3e79b
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers and cpu_data parameters from apic_mmio_access

The function only works on the current CPU, thus should avoid to take
misleading parameters. The necessary references can be obtained inline.

With the parameters no longer needed, the callers
svm/vmx_handle_apic_access can drop some of them as well.

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


Commit: f691199ac38f1706ce108fd6b5548a882cbcf8bc
https://github.com/siemens/jailhouse/commit/f691199ac38f1706ce108fd6b5548a882cbcf8bc
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/i8042.c
M hypervisor/arch/x86/include/asm/i8042.h
M hypervisor/arch/x86/vcpu.c

Log Message:
-----------
x86: Remove guest registers parameter from i8042_access_handler

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: 816b34becc0a8c08965d623e16e7ef88539f2e6d
https://github.com/siemens/jailhouse/commit/816b34becc0a8c08965d623e16e7ef88539f2e6d
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Rework RAX register accessors of PCI layer

Stop requiring that the guest registers are passed down to the
accessors. Access handlers always work over the issuing CPU, thus can
obtain the register state themselves. Rename the accessors to make it
clear that they work against guest registers.

This allows to drop the guest_regs parameters from
data_port_in/out_handler.

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


Commit: 13e6affd7cf63411c1e6ae0cf3f16d94ab81fba4
https://github.com/siemens/jailhouse/commit/13e6affd7cf63411c1e6ae0cf3f16d94ab81fba4
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/pci.h
M hypervisor/arch/x86/pci.c
M hypervisor/arch/x86/vcpu.c

Log Message:
-----------
x86: Remove guest registers and cell parameters from x86_pci_config_handler

The function only works against the current CPU, thus should avoid to
take the misleading parameters. Guest registers are no long er required,
and the cell reference can be obtained inline.

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


Commit: 42bcdde82ca5b17d2194b7edd16b7391c4481b8c
https://github.com/siemens/jailhouse/commit/42bcdde82ca5b17d2194b7edd16b7391c4481b8c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove unused guest registers parameter from vcpu_handle_io_access

All filter functions obtain the reference themselves now.

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


Commit: 5c9a283ab7f5a0bbe5702dbb0f2827f6bf94fdbf
https://github.com/siemens/jailhouse/commit/5c9a283ab7f5a0bbe5702dbb0f2827f6bf94fdbf
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_handle_mmio_access

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: c51ad30ee60768343a02c97c8e4d2cde62d87a8c
https://github.com/siemens/jailhouse/commit/c51ad30ee60768343a02c97c8e4d2cde62d87a8c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from vcpu_handle_msr_read/write

The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

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


Commit: 511fcdb207a9bbb2f2229b7f4a75b5ae0a333a5d
https://github.com/siemens/jailhouse/commit/511fcdb207a9bbb2f2229b7f4a75b5ae0a333a5d
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove parameters from vmx_handle_cr

Guest registers can be retrieved inline.

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


Commit: f5132aa90500b2b0913894264e96ca7bb73c1a1f
https://github.com/siemens/jailhouse/commit/f5132aa90500b2b0913894264e96ca7bb73c1a1f
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Factor out vmx_handle_cpuid

Shortens vcpu_handle_exit and improves readability.

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


Commit: af2dc04444602ec8519d1e9a076b7c58c4b71fa8
https://github.com/siemens/jailhouse/commit/af2dc04444602ec8519d1e9a076b7c58c4b71fa8
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Drop local guest_regs variable from VMX version of vcpu_handle_exit

No need to cache it. It can be derived from cpu_data now.

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


Commit: 5a86406f7def26fac64c658de94c2aa8b6d8a7bd
https://github.com/siemens/jailhouse/commit/5a86406f7def26fac64c658de94c2aa8b6d8a7bd
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Drop some unneeded local variables from SVM functions

No need to maintain cpu_data or even vmcb as local variable if they are
only used once.

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


Commit: 1c13828225d708cc171e46c6730c86c9a165b3c5
https://github.com/siemens/jailhouse/commit/1c13828225d708cc171e46c6730c86c9a165b3c5
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove traces of cpuid interception from SVM

There is no foreseeable need to intercept cpuid on AMD. On Intel, we
are not asked if we want to, so we have to execute it on behalf of the
cell.But here we can simple let it happen.

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


Commit: cfc8cd05ed77f53a3d331ef3a032838986287bb2
https://github.com/siemens/jailhouse/commit/cfc8cd05ed77f53a3d331ef3a032838986287bb2
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from svm_handle_cr

We can retrieve them from the per-cpu data structure now.

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


Commit: d3efb0a6832b924a16a8e021f91572e5a8c86b9c
https://github.com/siemens/jailhouse/commit/d3efb0a6832b924a16a8e021f91572e5a8c86b9c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Cache vmcb instead of cpu_data in SVM's vcpu_vendor_get_execution_state

Easier to read.

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


Commit: 3f978b1d17bd8b30a4a5bdec07752cea25acc834
https://github.com/siemens/jailhouse/commit/3f978b1d17bd8b30a4a5bdec07752cea25acc834
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Rename x86_parse_mov_to_cr to svm_parse_mov_to_cr

This functions is SVM-specific.

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


Commit: 95fef422d49853e29a45a815a40d4430a4fe6ca8
https://github.com/siemens/jailhouse/commit/95fef422d49853e29a45a815a40d4430a4fe6ca8
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Pass vmcb instead of cpu_data to some internal SVM functions

update_efer, svm_parse_mov_to_cr and svm_handle_apic_access have no use
for cpu_data and rather convert it into a vmcb reference directly. So
pass that one instead to save some statements.

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


Commit: 7dccd97c75b4649931f5f6c79426952e20f2b868
https://github.com/siemens/jailhouse/commit/7dccd97c75b4649931f5f6c79426952e20f2b868
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove guest registers parameter from svm_handle_msr_write

We can retrieve them from the per-cpu data structure now.

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


Commit: 5af628795264c6a1af9c34e33ecfc2ddb3b77fe8
https://github.com/siemens/jailhouse/commit/5af628795264c6a1af9c34e33ecfc2ddb3b77fe8
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Drop local guest_regs variable from SVM version of vcpu_handle_exit

No need to cache it. It can be derived from cpu_data now.

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


Commit: 5d0a4f1881790b0dea3a396aabd2d5dc1ca7db3a
https://github.com/siemens/jailhouse/commit/5d0a4f1881790b0dea3a396aabd2d5dc1ca7db3a
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/asm-defines.c
M hypervisor/arch/x86/svm-vmexit.S

Log Message:
-----------
x86: Drop PERCPU_VMCB and VMCB_RAX

We can calculate PERCPU_VMCB_RAX directly and save the two intermediate
steps.

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


Commit: 63e58fd275838cca0ab97e06f5ad57fece076ced
https://github.com/siemens/jailhouse/commit/63e58fd275838cca0ab97e06f5ad57fece076ced
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Simplify set_svm_segment_from_segment

No need to complain: segment.access_rights is generic as it simply holds
bits 8..23 of the second descriptor dword. The additional invalid bit
used by VMX only can be ignored by SVM - and it is already, even when
leaving out the explicit test.

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


Commit: 58a222041d29bc08cc68e605bc1b3e1db8c267d2
https://github.com/siemens/jailhouse/commit/58a222041d29bc08cc68e605bc1b3e1db8c267d2
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Simplify set_svm_segment_from_dtr

By using set_svm_segment_from_segment for ldtr, we can remove the
condition from set_svm_segment_from_dtr.

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


Commit: e50bdee8b383b63c7df4ff7e125724c6401d0691
https://github.com/siemens/jailhouse/commit/e50bdee8b383b63c7df4ff7e125724c6401d0691
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Simplify descriptor reset in svm_vcpu_reset

Reduce boilerplate code by using constants for common reset states.

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


Commit: 7e78a6e3aa4b50e31fbe8e6ad9c6bfc83e64fedb
https://github.com/siemens/jailhouse/commit/7e78a6e3aa4b50e31fbe8e6ad9c6bfc83e64fedb
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Drop constant return values from SVM functions

vmcb writing cannot fail on AMD, thus neither vmcb_setup nor
svm_set_cell_config can. Simply remove the error codes and related
handling.

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


Commit: 1e07d2fac005280c8dc86b05b44a86ab9896e09d
https://github.com/siemens/jailhouse/commit/1e07d2fac005280c8dc86b05b44a86ab9896e09d
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Simplify error exit of svm_parse_mov_to_cr and svm_handle_cr

No need to maintain a return code variable when we can simply return
false directly.

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


Commit: 9d146dd85ea2be81e27a972d7a6150da209a184b
https://github.com/siemens/jailhouse/commit/9d146dd85ea2be81e27a972d7a6150da209a184b
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/include/asm/svm.h
M hypervisor/arch/x86/svm-vmexit.S
M hypervisor/arch/x86/svm.c

Log Message:
-----------
x86: Refactor SVM version of vcpu_activate_vmm

We can reduce the assembly required in vcpu_activate_vmm by reordering
svm_vmexit to svm_vmentry, i.e. pulling the VM entry logic to the front.
Moreover, RAX can be loaded directly. There is furthermore no need to
declare clobbered variables as we won't return from the assembly block,
which is already declared via __builtin_unreachable.

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


Commit: ba3e46c002521033b616c31a496b0dce79912be1
https://github.com/siemens/jailhouse/commit/ba3e46c002521033b616c31a496b0dce79912be1
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove unneeded MSR restoring from SVM's vcpu_deactivate_vmm

None of these MSRs is modified by Jailhouse after VM exit, thus they
still contain the state the Linux guest left behind.

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


Commit: 60eade7bb25676bf386d392907428f159d1101f2
https://github.com/siemens/jailhouse/commit/60eade7bb25676bf386d392907428f159d1101f2
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Make SYSENTER MSR restoration VMX-specific

SVM does not overwrite these MSRs on VM exit, thus does not require the
restoration done in arch_cpu_restore so far. Make them VMX-specific so
that we can drop a few lines of code.

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


Commit: 3ebc81ac17fa143d0d4794740f08117906b91055
https://github.com/siemens/jailhouse/commit/3ebc81ac17fa143d0d4794740f08117906b91055
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Remove write-only linux_sysenter_* fields

The vendor code reads the state directly from the MSRs during setup.

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


Commit: ee283bcf1818076662d897d489260f09d2b46c6c
https://github.com/siemens/jailhouse/commit/ee283bcf1818076662d897d489260f09d2b46c6c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

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

Log Message:
-----------
x86: Make FS_BASE MSR restoration VMX-specific

SVM does not touch this MSR on VM exit, thus does not require the
restoration done in arch_cpu_restore so far. Make it VMX-specific so
that we can drop a few lines of code.

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


Commit: 68387fab885c403d7d288af71d43d56cc35d3229
https://github.com/siemens/jailhouse/commit/68387fab885c403d7d288af71d43d56cc35d3229
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2015-04-10 (Fri, 10 Apr 2015)

Changed paths:
M hypervisor/arch/x86/svm-vmexit.S
M hypervisor/arch/x86/svm.c

Log Message:
-----------
x86: Do not call vmload/vmsave on every VM exit

Benchmarks indicate that we can gain about 160 cycles per VM exit &
reentry by only saving/restoring MSR_GS_BASE. We don't touch the other
states that vmload/vmsave deals with.

We still need to perform vmload on handover (actually, we only need to
load MSR_GS_BASE, but vmload is simpler) and after VCPU reset. And as we
no longer save the full state, also for shutdown, we need to pull the
missing information for arch_cpu_restore directly from the registers.


Compare: https://github.com/siemens/jailhouse/compare/600e0ab631ee...68387fab885c
Reply all
Reply to author
Forward
0 new messages