aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/arm
Commit message (Collapse)AuthorAgeFilesLines
* xen/arm: Add CPU ID for Broadcom Brahma-B15Marc Carino2013-10-182-0/+9
| | | | | | | | | Let Xen recognize the Broadcom Brahma-B15 CPU by adding the appropriate MIDR mask to the initialization phase. Further, ensure that the console output properly reports the CPU manufacturer as "Broadcom Corporation". Signed-off-by: Marc Carino <marc.ceeeee@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm32: Call start_xen only on the boot CPUJulien Grall2013-10-101-1/+2
| | | | | | | | The boot CPU can have a CPU ID non-equal to zero. Xen needs to check the logical CPU ID (in r12) to know if the CPU is the boot one. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Add support to load initrd in dom0Julien Grall2013-10-083-21/+102
| | | | | Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: map_domain_page: reuse slots with avail == 0Stefano Stabellini2013-10-031-7/+10
| | | | | | | | If a slot has avail == 0 but still points to the right mfn, reuse it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm32: don't export v7_initJulien Grall2013-10-031-1/+1
| | | | | Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: move smp_init_cpus to smpboot.cIan Campbell2013-09-272-125/+126
| | | | | | | Seems like a better home. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: split cpu0's domheap mapping PTs out from xen_secondIan Campbell2013-09-271-18/+17
| | | | | | | | Now that bringup has been rewritten we don't need these 4 contiguous pages for the 1:1 map. So split them out and only allocate them for 32 bit Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen: arm: configure TCR_EL2 for 40 bit physical address spaceIan Campbell2013-09-271-2/+2
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org> Acked-by: Tim Deegan <tim@xen.org>
* xen: arm: use symbolic names for MPIDR bits.Ian Campbell2013-09-272-5/+5
| | | | | | | | arm32 already uses MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP} (and bitwise equivalents) and use them. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen: arm: rewrite start of day page table and cpu bring upIan Campbell2013-09-279-643/+677
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is unfortunately a rather large monolithic patch. Rather than bringing up all CPUs in lockstep as we setup paging and relocate Xen instead create a simplified set of dedicated boot time pagetables. This allows secondary CPUs to remain powered down or in the firmware until we actually want to enable them. The bringup is now done later on in C and can be driven by DT etc. I have included code for the vexpress platform, but other platforms will need to be added. The mechanism for deciding how to bring up a CPU differs between arm32 and arm64. On arm32 it is essentially a per-platform property, with the exception of PSCI which can be implemented globally (but isn't here). On arm64 there is a per-cpu property in the device tree. Secondary CPUs are brought up directly into the relocated Xen image, instead of relying on being able to launch on the unrelocated Xen and hoping that it hasn't been clobbered. As part of this change drop support for switching from secure mode to NS HYP as well as the early CPU kick. Xen now requires that it is launched in NS HYP mode and that firmware configure things such that secondary CPUs can be woken up by a primarly CPU in HYP mode. This may require fixes to bootloaders or the use of a boot wrapper. The changes done here (re)exposed an issue with relocating Xen and the compiler spilling values to the stack between the copy and the actual switch to the relocaed copy of Xen in setup_pagetables. Therefore switch to doing the copy and switch in a single asm function where we can control precisely what gets spilled to the stack etc. Since we now have a separate set of boot pagetables it is much easier to build the real Xen pagetables inplace before relocating rather than the more complex approach of rewriting the pagetables in the relocated copy before switching. This will also enable Xen to be loaded above the 4GB boundary on 64-bit. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: implement smp initialisation callbacks for exynos5Ian Campbell2013-09-271-0/+31
| | | | | | | | These were removed in "xen: arm: rewrite start of day page table and cpu bring up". Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: implement arch/platform SMP and CPU initialisation frameworkIan Campbell2013-09-278-1/+178
| | | | | | | | | | | | Includes an implementation for vexpress using the sysflags interface and support for the ARMv8 "spin-table" method. Unused until "rewrite start of day page table and cpu bring up", split out to simplify review. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: make sure we stay within the memory bank during mm setupIan Campbell2013-09-271-3/+10
| | | | | | | | | | Otherwise if there is a module in another bank we can run off the end. Rename *n to *end to make it clearer what is happening. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: Log the raw MIDR on boot.Ian Campbell2013-09-271-2/+3
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org> Acked-by: Tim Deegan <tim@xen.org>
* xen: arm: build platform support only on the relevant archIan Campbell2013-09-271-3/+3
| | | | | | | | | | midway, omap5 and exynos are all 32-bit only platforms. This avoids needing CONFIG_ARM_32 ifdefs around the SMP callbacks on such platforms. Vexpress is both. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: Load xen under 4GB on 32-bitIan Campbell2013-09-271-0/+8
| | | | | | | | We need to be able to use a 1:1 mapping during bring up. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: print the location of the Xen heap on 32 bitIan Campbell2013-09-261-2/+4
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Julien Grall <julien.grall@linaro.org> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: rename boot misc region to boot reloc now it has a single purposeIan Campbell2013-09-261-2/+2
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: Support dtb /memreserve/ regionsIan Campbell2013-09-264-7/+72
| | | | | | | | | | | | | This requires a mapping of the DTB during setup_mm. Previously this was in the BOOT_MISC slot, which is clobbered by setup_pagetables. Split it out into its own slot which can be preserved. Also handle these regions as part of consider_modules() and when adding pages to the heaps to ensure we do not locate any part of Xen or the heaps over them. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: cope with modules outside of "visible" RAMIan Campbell2013-09-261-0/+6
| | | | | | | | | This can happen if modules are in a bank which we can't cope with e.g. due to being non-contiguous. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Julien Grall <julien.grall@linaro.org> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: do not relocate Xen outside of visible RAMIan Campbell2013-09-261-1/+9
| | | | | | | | | Since we do not handle non-contiguous banks of memory lets avoid relocating Xen into such a bank. Avoids issues such as free_init_memory releasing pages which are outside of the frametable. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: Reserve FDT via early module mechanismIan Campbell2013-09-261-1/+2
| | | | | | | | | | This will stop us putting any heaps or relocating Xen itself over the FDT. The devicetree will be copied to allocated memory in setup_mm and the original copy will be freed by discard_initial_modules. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: ensure the xenheap is 32MB alignedIan Campbell2013-09-261-1/+2
| | | | | | | | | | | | My patch 08693f5948d8 "xen: arm: reduce the size of the xen heap to max 1/8 RAM size" unintentionally violated the constraint that the xenheap must be 32MB aligned, since we only explicitly align the end of the heap and xenheap_pages was not a multiple of 32 pages. Round xenheap pages up to a 32MB boundary. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: Don't dump stack when the VCPU is offlineJulien Grall2013-09-261-0/+6
| | | | | | | | When a VCPU is not yet online, the registers contain garbagge. This will result to call randomly BUG() in show_guest_stack. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: use new 64-bit zImage magic numbers for Xen binaryIan Campbell2013-09-261-0/+8
| | | | | | | | | | | | | Upstream commit 4370eec05a88 "arm64: Expand arm64 image header" ended up changing the zImage magic (which was actually the initial branch instructio encoding!). The new header has a proper magic number at a fixed location. Switch Xen itself to using this format. Neither the bootwrapper nor the models care about this header themselves and real bootloaders are not widely used, so now is as good a time as any to switch (as upstream have proven) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen: arm: handle new 64-bit zImage magic numbersIan Campbell2013-09-261-3/+10
| | | | | | | | | Upstream commit 4370eec05a88 "arm64: Expand arm64 image header" ended up changing the zImage magic (which was actually the initial branch instruction encoding!). The new header has a proper magic number at a fixed location. Support that as well as the original magic. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen/arm: Use the hardware ID to boot correctly secondary cpusJulien Grall2013-09-261-5/+8
| | | | | | | | | Secondary CPUs will spin in head.S until their MPIDR[23:0] correspond to the smp_up_cpu. Actually Xen will set the value with the logical CPU ID which is wrong. Use the cpu_logical_map to get the correct CPU ID. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Dissociate logical and hardware CPU IDJulien Grall2013-09-262-1/+115
| | | | | | | | | | | Introduce cpu_logical_map to associate a logical CPU ID to an hardware CPU ID. This map will be filled during Xen boot via the device tree. Each CPU node contains a "reg" property which contains the hardware ID (ie MPIDR[0:23]). Also move /cpus parsing later so we can use the dt_* API. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Fix assert in send_SGI_oneJulien Grall2013-09-261-1/+1
| | | | | | | The GIC can handle maximum 8 cpus (0...7). The CPU id 7 is still valid. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: gic: Use the correct CPU IDJulien Grall2013-09-261-8/+37
| | | | | | | | | | | | | The GIC mapping of CPU interfaces does not necessarily match the logical CPU numbering. When Xen wants to send an SGI to specific CPU, it needs to use the GIC CPU ID. It can be retrieved from ITARGETSR0, in fact when this field is read, the GIC will return a value that corresponds only to the processor reading the register. So Xen can use the PPI 0 to initialize the mapping. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Initialize correctly IRQ routingJulien Grall2013-09-261-1/+2
| | | | | | | | | | | | When Xen initialize the GIC distributor, we need to route all the IRQs to the boot CPU. The CPU ID can differ between Xen and the GIC. When ITARGETSR0 is read, each field will return a value that corresponds only to the processor reading the register. So Xen can use the PPI 0 to initialize correctly the routing. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: use cpumask_t to describe cpu mask in gic_route_dt_irqJulien Grall2013-09-262-11/+15
| | | | | | | Replace by cpumask_t to take advantage of cpumask_* helpers. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Introduce init_info structureJulien Grall2013-09-265-5/+17
| | | | | | | | This structure will gather all information to boot a secondary cpus. For now it just contains the initial stack. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: replace io{read,write}{l,b} with {read,write}{l,b}Ian Campbell2013-09-214-13/+17
| | | | | | | | | | | | | | | | | | | | We appear to have invented the io versions ourselves for Xen on ARM, while x86 has the plain read/write. (and so does Linux FWIW) read/write are used in common driver code (specifically ns16550) so instead of keeping our own variant around lets replace it with the more standard ones. At the same time resync with Linux making the "based on" comment in both sets of io.h somewhat true (they don't look to have been very based on before...). Our io.h is now consistent with Linux v3.11. Note that iowrite and write take their arguments in the opposite order. Also make asm-arm/io.h useful and include it where necessary instead of picking up the include from mm.h. Remove the include from mm.h Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen/arm: Implement ioremap.Ian Campbell2013-09-211-0/+5
| | | | | | | Common code uses this, it expects an uncached mapping. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: rework placement of fdt in initial dom0 memory mapIan Campbell2013-09-212-11/+39
| | | | | | | | | | | | | | | | The 32-bit Linux kernel uses its lowmem direct mapping to access the FDT. The lowmem mapping is around 0.75GiB but varies depending on the kernel's .config. Our current scheme of loading the FDT as high as 4GB therefore fails with larger amounts of dom0 RAM. The upstream documentation has recently been update to provide more guidance <http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7824/1>. In accordance with this load the kernel just below 128MiB (aligned to 2MB) and the FDT just above, or if there is less RAM available then as high as possible. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen: arm: improve VMID allocation.Ian Campbell2013-09-212-4/+69
| | | | | | | | | | | | The VMID field is 8 bits. Rather than allowing only up to 256 VMs per host reboot before things start "acting strange" instead maintain a simple bitmap of used VMIDs and allocate them statically to guests upon creation. This limits us to 256 concurrent VMs which is a reasonable improvement. Eventually we will want a proper scheme to allocate VMIDs on context switch. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* ARM: parse separate DT properties for different commandlinesAndre Przywara2013-09-171-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we use the chosen/bootargs property as the Xen commandline and rely on xen,dom0-bootargs for Dom0. However this brings issues with bootloaders, which usually build bootargs by bootscripts for a Linux kernel - and not for the entirely different Xen hypervisor. Introduce a new possible device tree property "xen,xen-bootargs" explicitly for the Xen hypervisor and make the selection of which to use more fine grained: - If xen,xen-bootargs is present, it will be used for Xen. - If xen,dom0-bootargs is present, it will be used for Dom0. - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is, bootargs will be used for Xen. Like the current situation. - If no Xen specific properties are present, bootargs is for Dom0. - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing, bootargs will be used for Dom0. The aim is to allow common bootscripts to boot both Xen and native Linux with the same device tree blob. If needed, one could hard-code the Xen commandline into the DTB, leaving bootargs for Dom0 to be set by the (non Xen-aware) bootloader. I will send out a appropriate u-boot patch, which writes the content of the "xen_bootargs" environment variable into the xen,xen-bootargs dtb property. Signed-off-by: Andre Przywara <andre.przywara@linaro.org> Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Check if the device is available before using itJulien Grall2013-09-171-0/+3
| | | | | | | | | | | It's possible to have a device description in the DTS but the device is not wired. device_init must check if the device is available before doing anything with it. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: exynos5: Blacklist MCT deviceJulien Grall2013-09-171-0/+11
| | | | | | | | | | The Multi Core Timer (MCT) is a Samsung specific device. This device tries to route IRQ in non-boot CPU which is not yet handled by Xen. The user will see randomly dom0 hang, but I'm not sure that is the real reason. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: vexpress: Blacklist a list of board specific devicesJulien Grall2013-09-171-0/+17
| | | | | | | | | | | | On Versatile there are a bunch of devices which must not be pass-through to any guest (power management and cache coherency devices). This commit also blacklists the HDLCD device because Xen is unable to correctly map the framebuffer into dom0. Therefore, when Linux will try to access to the framebuffer, Xen will receive a non-handled data access. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Remove devices used by Xen from dom0 device treeJulien Grall2013-09-171-4/+3
| | | | | | | | | Devices used by Xen should not be pass-through to dom0. If the device is really usefull for dom0 (for instance the timer and the GIC), it will recreate the node. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Add new platform specific callback device_is_blacklistJulien Grall2013-09-172-1/+12
| | | | | | | | | | | | | | | | Each platform code will list the device that must not pass-through to a guest. Theses devices are used for: power management, timer,... When theses devices are given to DOM0, it can controls the hardware and then break the whole platform. This callback is enough until we will start to care about power performance. For this purpose, we may need to extend this interface to implement per-device MMIO filtering to allow dom0 to continue to control devices which it owns which happen to share e.g. a clock controller with Xen. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Create a fake timer node in dom0 device treeJulien Grall2013-09-171-0/+66
| | | | | | | Recreate the timer node and remove hypervisor specific interrupt. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Create a fake GIC node in dom0 device treeJulien Grall2013-09-171-0/+78
| | | | | | | | Recreate the GIC node and remove hypervisor specific ranges (vgic and hypervisor controls). Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Create a fake cpus node in dom0 device treeJulien Grall2013-09-171-0/+92
| | | | | | | | | | The number of cpus in dom0 can be different compare to the real number of physical cpus. For the moment, Xen assumes that the cpus are identical. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Create a fake PSCI node in dom0 device treeJulien Grall2013-09-171-0/+38
| | | | | | | Xen uses PSCI to bring up secondary cpus for the guest. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Don't map disabled device in DOM0Julien Grall2013-09-171-1/+5
| | | | | | | Linux should cope with 'status = "disabled"' in the Device Tree. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Build DOM0 FDT by browsing the device tree structureJulien Grall2013-09-171-165/+162
| | | | | | | | | Remove the usage of the FDT in benefit of the device tree structure. The latter is easier to use and can embedded meta-data for Xen (ie: is the device is used by Xen...). Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/dts: dt_find_interrupt_controller: accept multiple compatible stringsJulien Grall2013-09-171-1/+6
| | | | | Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>