- 01 Jun, 2017 3 commits
-
-
Andrew Jones authored
Also base on on_cpu_async() to allow it to be called more than once. Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170601135002.26704-4-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
x86 has two smp functions on_cpu() and on_cpu_async(). These are nice because we can run them more than once on cpus. This patch adds the same API to ARM, but the target cpu requirements are not the same. While on x86 the interrupt controller must be enabled enough to send/receive IPIs and the target cpu must have interrupts enabled (or be expected to enable them), on ARM we do not use IPIs, so the GIC does not need to be enabled and cpus do not need to register irq handlers nor enable interrupts. Instead, target cpus are expected to be powered off or idle. The advantage of the ARM approach is the lack of interrupt handling dependencies. The disadvantage is the lack of preemption - even on_cpu_async() must wait for the target cpu to be idle first. Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170601135002.26704-3-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Also prepare the newly renamed function to come out of idle and use sev/wfe rather than a busy wait in smp_run(). Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170601135002.26704-2-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 31 May, 2017 3 commits
-
-
David Hildenbrand authored
The program interrupt handler will detect unexpected program interrupts and allow to expect + verify program interrupts for testing purposes. We need "-fno-delete-null-pointer-checks", otherwise trying to access the lowcore at address 0 makes GCC generate very weird code. Add two tests to test for simple operation and addressing exceptions. Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170531123925.4547-3-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
Add the s390x psw and lowcore structs and generate asm offsets for lowcore fields. Add all lowcore fields defined in the current PoP (z13). Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170531123925.4547-2-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
RTAS tokens can have any value, also 0xffffffff is theoretically allowed (which is currently used for the RTAS_UNKNOWN_SERVICE error code). Thus we should not mix error codes and tokens in the return value here and return the token value via a pointer parameter instead. This patch also adds a check to rtas_token() to test whether the device tree is available at all. This fixes a possible endless loop that happens without device tree, spamming the console with "rtas_node: /rtas: FDT_ERR_BADMAGIC" messages: Somewhere the code calls abort() due to the missing device tree, and abort() calls exit() which in turn tries to shut down the VM with rtas_power_off(). rtas_power_off() needs the device tree again to look up the right RTAS token, where we then end up in the next iteration. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <1496229338-7113-1-git-send-email-thuth@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 30 May, 2017 3 commits
-
-
Andrew Jones authored
Eventually we'll allow calling functions on cpus more than once, to allow multiple subtests to run in a single execution. But that'll only work if the subtests don't halt the cpus... Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170529135804.22891-4-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170529135804.22891-3-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
It's tempting to try running smp_run() more than once, but that won't currently work. In the meantime, let's fail better. Also, there's no reason to expose the structure in smp.h Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170529135804.22891-2-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 26 May, 2017 7 commits
-
-
David Hildenbrand authored
Add Thomas and myself as maintainers for now. Acked-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-8-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
Let's also add the brand new s390x version. Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-7-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
Now the basics should be working and therefore the self test should pass. Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-6-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
We can reuse strlen and memcpy. __pa(x) is already defined in page.h We don't have (and need) defines for error values and consuming sclp irqs is not required, as we won't be passing control to some other OS. Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-5-david@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
The s390x-ccw pcbios already has what we need to print to the sclp console. Let's copy the files and adjust them to our needs later. Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-4-david@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
Test if the general infrastructure is working. The test will fail until we have proper sclp console output. Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-3-david@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
David Hildenbrand authored
This adds the very basic infrastructure for s390x. As we compile for z900, also QEMU tcg can be used. To cross compile: $./configure --arch=s390x --cross-prefix=/usr/bin/s390x-linux-gnu- $ make Please note that for now, nothing will be compiled, as there is no test to compile. A basic self test will be added in the following patches. smp and stack unwinding is not supported yet. sclp console output will be added in the following patches. Parts based on a prototype by Thomas Huth. Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20170522085702.17856-2-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 25 May, 2017 11 commits
-
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170522181821.29482-3-drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170522181821.29482-2-drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Bennée authored
The configure script will happily default to cortex-a15 even when running on a cortex-a7. This runs into problems when running KVM on common dev boards as we should be using the "host" processor. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <20170518160208.9674-3-alex.bennee@linaro.org> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Bennée authored
Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <20170518160208.9674-2-alex.bennee@linaro.org> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525102849.22754-7-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525102849.22754-6-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525102849.22754-5-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
A common pattern is - run a function on all cpus - signal each cpu's completion with a cpumask - halt the secondaries when they're complete - have the primary wait on the cpumask for all to complete smp_run is a wrapper for that pattern. Also, we were allowing secondaries to go off in the weeds if they returned from their secondary entry function, which can be difficult to debug. A nice side-effect of adding this wrapper is we don't do that anymore, and can even know when a secondary has halted with the new cpu_halted_mask. Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525102849.22754-4-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525102849.22754-3-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Remove version from ops as it's not an op, nor necessary. Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525102849.22754-2-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20170525103936.23063-1-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 22 May, 2017 2 commits
-
-
Radim Krčmář authored
We weren't cleaning api/, rules were needlessly repetitive, and c++ specific flags weren't in CXXFLAGS. Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Radim Krčmář authored
API was never selected by default, because <stdc++> should have been <bits/stdc++> and in any case needs g++. Boost dependency has recently been lifted, but we added gnu++11 dependency. Only x86 currently uses compiles api, so make the room for errors a bit smaller by checking for it. Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
- 20 May, 2017 6 commits
-
-
Radim Krčmář authored
It's one character shorter, properly prefixed, and also provides error detection: %#d triggers a warning. Done with `sed -i 's/0x%/%#/g' **/*.[ch]` to motivate the use of %#, existing padding was raised by 2 to account for the counted "0x" (output should be the same). Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Radim Krčmář authored
The only use is with %#x, where we'll automatically get 0x prefix. Advantage over 0x%x can be seen with padding. A simple test: printf(".%#08x.\n", 0); printf(".%#8x.\n", 0); printf(".%#-8x.\n", 0); printf(".%#08x.\n", 1); printf(".%#8x.\n", 1); printf(".%#-8x.\n", 1); printf(".%#08x.\n", 0x123456); printf(".%#8x.\n", 0x123456); printf(".%#-8x.\n", 0x123456); printf(".%#02x.\n", 0); printf(".%#2x.\n", 0); printf(".%#-2x.\n", 0); printf(".%#02x.\n", 1); printf(".%#2x.\n", 1); printf(".%#-2x.\n", 1); looks just like glibc: .00000000. . 0. .0 . .0x000001. . 0x1. .0x1 . .0x123456. .0x123456. .0x123456. .00. . 0. .0 . .0x1. .0x1. .0x1. Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Radim Krčmář authored
Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Radim Krčmář authored
A simple test: printf(".%8p.\n", (void *)0); printf(".%-8p.\n", (void *)0); printf(".%8p.\n", (void *)1); printf(".%-8p.\n", (void *)1); printf(".%8p.\n", (void *)0x123456); printf(".%-8p.\n", (void *)0x123456); printf(".%2p.\n", (void *)0); printf(".%-2p.\n", (void *)0); printf(".%2p.\n", (void *)1); printf(".%-2p.\n", (void *)1); glibc: . (nil). .(nil) . . 0x1. .0x1 . .0x123456. .0x123456. .(nil). .(nil). .0x1. .0x1. before patch: . 0x 0. .0x 0 . . 0x 1. .0x 1 . . 0x 123456. .0x 123456 . .0x 0. .0x0 . .0x 1. .0x1 . after patch: . 0. .0 . . 0x1. .0x1 . .0x123456. .0x123456. . 0. .0 . .0x1. .0x1. (nil) would be possible with a small change, but the standard leaves it to the implementation and 0 is acceptable, IMO. Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Radim Krčmář authored
report() is a wrapper for printf(), but the compiler was not aware. Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Radim Krčmář authored
Fix conversions that would trigger a warning if the format was checked by a compiler. Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
- 19 May, 2017 5 commits
-
-
Alex Bennée authored
This adds a TravisCI build matrix to test all the various build combinations of architecture and with/without out-of-tree builds. It currently fails because the Trusty compilers have some issues with various format strings and unsigned/signed comparisions but these can be fixed up later. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Thomas Huth authored
The changes for out-of-tree builds are here pretty much the same as for the ARM Makefile.common. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Alex Bennée authored
We still need to tell the compiler the correct search path for finding headers and the like. This is slightly complicated by the "dynamic" asm search path which is in our build tree but (may be) symlinked to the right architectures headers. Also we explicitly include SRCDIR for the linking scripts as VPATH doesn't seem to find them well enough. Also we set OBJDIRS for the lib/arm, lib/arm64 and generated asm-offset files. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Alex Bennée authored
We still need to tell the compiler the correct search path for finding headers and the like. This is slightly complicated by the "dynamic" asm search path which is in our build tree but (may be) symlinked to the right architectures headers. Also we explicitly include SRCDIR for the linking scripts as VPATH doesn't seem to find them well enough. Also update OBJDIRS to include lib/x86. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Alex Bennée authored
This is slightly clumsy way to ensure the directory structure for the out-of-tree build is made first. The PHONY target is depended on by make all first which runs mkdir for all OBJDIRS. If an architecture target needs deeper nesting it needs to add directories to OBJDIRS so it can be picked up by the directories rule. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-