On 21.05.19 16:34, Ralf Ramsauer wrote:
Hi,x86 32-bit inmates are broken with recent gcc versions: they will very likely produce SSE instructions here and there for some optimisations. This lets inmates crash, as SSE needs to be discovered and enabled before it can be used. The solution is to either use -mno-sse (for the hypervisor and inmates), or to activate SSE for inmates. Let's go for enabling them, as almost all CPUs that support VT-x/SVM will very likely support SSE. Though unlikely, SSE might be unavailable. We don't stop the inmate if SSE is unavailable, we let it continue. The actual SSE patch is pretty simple, but I want to avoid duplicate code for header*.S, and I found some other spots where we can deduplicate 32/64 bit code. Ralf since v1: - don't stop the inmate if SSE is unavailable, let it continue execution - Also activate AVX, and discover some other CPU features. Report availability of features in a x86_cpu_features struct - Add a common interface for simple test cases - Add a test that runs some SSE/AVX instruction Ralf Ramsauer (6): inmates: x86: rename header.S to header-64.S inmates: x86: introduce a common assembler entry point inmates: x86: Add accessors for different system registers inmates: x86: discover and activate SSE/AVX inmates: introduce test.h and test.c inmates: x86: Add SSE/AVX test inmate inmates/lib/include/test.h | 21 +++++ inmates/lib/test.c | 28 ++++++ inmates/lib/x86/Makefile | 23 +++-- inmates/lib/x86/cpu-features.c | 103 +++++++++++++++++++++ inmates/lib/x86/header-32.S | 29 +++--- inmates/lib/x86/{header.S => header-64.S} | 29 ++---- inmates/lib/x86/header-common.S | 62 +++++++++++++ inmates/lib/x86/include/asm/regs.h | 108 ++++++++++++++++++++++ inmates/lib/x86/inmate.lds | 5 +- inmates/tests/x86/Makefile | 7 +- inmates/tests/x86/mmio-access-32.c | 52 ++++------- inmates/tests/x86/mmio-access.c | 76 +++++++-------- inmates/tests/x86/sse-demo-32.c | 1 + inmates/tests/x86/sse-demo.c | 92 ++++++++++++++++++ 14 files changed, 510 insertions(+), 126 deletions(-) create mode 100644 inmates/lib/include/test.h create mode 100644 inmates/lib/test.c create mode 100644 inmates/lib/x86/cpu-features.c rename inmates/lib/x86/{header.S => header-64.S} (91%) create mode 100644 inmates/lib/x86/header-common.S create mode 120000 inmates/tests/x86/sse-demo-32.c create mode 100644 inmates/tests/x86/sse-demo.c
Will look through this "soon". Thanks, Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/a19c3b9a-d912-0bf6-d8cf-f2eaec65bfde%40siemens.com. For more options, visit https://groups.google.com/d/optout.
