aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* docs: fix syntax error in xl.cfg.podOlaf Hering2013-09-261-2/+0
| | | | | | | | man/xl.cfg.pod.5 around line 1193: '=item' outside of any '=over' POD document had syntax errors at /usr/bin/pod2man line 71. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Use the hardware ID to boot correctly secondary cpusJulien Grall2013-09-262-5/+10
| | | | | | | | | 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-264-49/+119
| | | | | | | | | | | 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-263-12/+17
| | | | | | | 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-266-5/+23
| | | | | | | | 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>
* x86: fix compat guest handling of XENPF_enter_acpi_sleepJan Beulich2013-09-262-11/+8
| | | | | | | | | | | | | Rather than blindly defining the native name to the compat one, when we want to pass the compat structure to a native function we ought to verify that their layouts match. With a respective xlat.lst entry there's then also no need anymore to do such aliasing. While cleaaning up that file I also noticed that the Cx and Px interface handling here has quite a few unnecessary #define-s - delete them. Signed-off-by: Jan Beulich <jbeulich@suse.com>
* fix DOMID_IO mapping permission checks (try 2)Daniel De Graaf2013-09-261-2/+3
| | | | | | | | | | | | | | When the permission checks for memory mapping were moved from get_pg_owner to xsm_mmu_update in aaba7a677, the exception for DOMID_IO was not taken into account. This will cause IO memory mappings by PV domains (mini-os in particular) to fail when XSM/FLASK is not being used. This patch reintroduces the exception for DOMID_IO; the actual restrictions on IO memory mappings have always been checked separately using iomem_access_permitted, so this change should not break existing access control. Reported-by: Eduardo Peixoto Macedo <epm@cin.ufpe.br> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* x86/crash: Indicate how well nmi_shootdown_cpus() managed to doAndrew Cooper2013-09-261-4/+15
| | | | | | | | | | | | | | Having nmi_shootdown_cpus() report which pcpus failed to be shot down is a useful debugging hint as to what possibly went wrong (especially when the crash logs seem to indicate that an NMI timeout occurred while waiting for one of the problematic pcpus to perform an action). This is achieved by swapping an atomic_t count of unreported pcpus with a cpumask. In the case that the 1 second timeout occurs, use the cpumask to identify the problematic pcpus. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: fix rdrand asm()Jan Beulich2013-09-261-1/+1
| | | | | | | | | | | | Just learned the hard way that at least for non-volatile asm()s gcc indeed does what the documentation says: It may move it across jumps (i.e. ahead of the cpu_has() check). While the documentation claims that this can also happen for volatile asm()s, if that was the case we'd have many more problems in our code (and e,g, Linux would too). Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* Revert "fix DOMID_IO mapping permission checks"Jan Beulich2013-09-251-2/+0
| | | | This reverts commit 145ae98bfab8280744ad5e800cc036e1c84c0486.
* xm-test: add a missing %sZhu Yanhai2013-09-251-1/+1
| | | | | | | Obviously we need a %s here. Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xenstore: check socket path length before copying itMatthew Daley2013-09-251-0/+4
| | | | | | Coverity-ID: 1055997 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xenstored: fix faulty check for bad handle in domain_initMatthew Daley2013-09-251-1/+1
| | | | | | | Coverity-ID: 1054975 Coverity-ID: 1055196 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xenstored: handle unlikely failure better in ask_parentsMatthew Daley2013-09-251-1/+3
| | | | | | Coverity-ID: 1055277 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix file open failure check in libxl__file_reference_mapMatthew Daley2013-09-251-1/+1
| | | | | | Coverity-ID: 1055567 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix typo in libxl__hotplug_nic error checkingMatthew Daley2013-09-251-1/+1
| | | | | | Coverity-ID: 1055945 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: only free console reader if it was allocated in main_dmesgMatthew Daley2013-09-251-1/+2
| | | | | | Coverity-ID: 1055304 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix out-of-memory check in parse_global_configMatthew Daley2013-09-251-2/+2
| | | | | | Coverity-ID: 1055174 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix leak of rune in main_remusMatthew Daley2013-09-251-0/+3
| | | | | | Coverity-ID: 1087194 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix leak of config_data in main_cpupoolcreateMatthew Daley2013-09-251-0/+1
| | | | | | Coverity-ID: 1087193 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix leak of corename in handle_domain_deathMatthew Daley2013-09-251-0/+1
| | | | | | Coverity-ID: 1087192 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix dispose without init of disk in cd_insertMatthew Daley2013-09-251-4/+2
| | | | | | Coverity-ID: 1056078 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix libxl_string_list_length and its only callerMatthew Daley2013-09-252-2/+2
| | | | | | | | | | | | | | | | The wrong amount of indirections were being taken in libxl_string_list_length, and its only caller was miscounting the amount of initial non-list arguments, seemingly since the initial commit (599c784). This has been seen and reported in the wild (##xen): < Trixboxer> Hi, any idea why would I get < Trixboxer> xl: libxl_bootloader.c:42: bootloader_arg: Assertion `bl->nargs < bl->argsspace' failed. < Trixboxer> 4.2.2-23.el6 Coverity-ID: 1054954 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: fix memory leak in load_p2m_frame_list error handlingMatthew Daley2013-09-251-0/+1
| | | | | | Coverity-ID: 1055885 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* fix DOMID_IO mapping permission checksDaniel De Graaf2013-09-251-0/+2
| | | | | | | | | | | | | | When the permission checks for memory mapping were moved from get_pg_owner to xsm_mmu_update in aaba7a677, the exception for DOMID_IO was not taken into account. This will cause IO memory mappings by PV domains (mini-os in particular) to fail when XSM/FLASK is not being used. This patch reintroduces the exception for DOMID_IO; the actual restrictions on IO memory mappings have always been checked separately using iomem_access_permitted, so this change should not break existing access control. Reported-by: Eduardo Peixoto Macedo <epm@cin.ufpe.br> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* x86/hap: Remove bogus assertion in hap_free_p2m_page()Andrew Cooper2013-09-251-1/+0
| | | | | | | | | | | | | Coverity ID: 1055622 Coverity correctly points out that this ASSERT() is unconditionally true as an unsigned integer is always >= 0. Judging from the shadow counterpart and p2m callsites, there is nothing invalid about freeing the final p2m page. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* ns16550: Use correct #define symbol for HAS_IOPORTSAndrew Cooper2013-09-251-1/+1
| | | | | | | | | | CID 1091471, Regression caused by 7c1de0038895cbc75ebd0caffc5b0f3f03c5ad51 This appears to be a typo which causes check_existence() to unconditionally return 1 in all cases. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* x86/xsave: initialize extended register state when guests enable itJan Beulich2013-09-251-0/+15
| | | | | | | | | | | | Till now, when setting previously unset bits in XCR0 we wouldn't touch the active register state, thus leaving in the newly enabled registers whatever a prior user of it left there, i.e. potentially leaking information between guests. This is CVE-2013-1442 / XSA-62. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
* VMX: drop memory clobbers from vmread/vmwrite wrappersJan Beulich2013-09-231-9/+6
| | | | | | | | All effects are properly being described by the asm() constraints. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jun Nakajima <jun.nakajima@intel.com>
* VMX: also use proper instruction mnemonic for VMREADJan Beulich2013-09-237-156/+246
| | | | | | | | | | | ... when assembler supports it, following commit cfd54835 ("VMX: use proper instruction mnemonics if assembler supports them"). This merely got split off from the earlier change becase of the significant number of call sites needing to be changed. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jun Nakajima <jun.nakajima@intel.com>
* x86/HVM: refuse doing string operations in certain situationsJan Beulich2013-09-231-0/+14
| | | | | | | | | | We shouldn't do any acceleration for - "rep movs" when either side is passed through MMIO or when both sides are handled by qemu - "rep ins" and "rep outs" when the memory operand is any kind of MMIO Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: linear address must be canonical for the whole accessed rangeJan Beulich2013-09-231-12/+13
| | | | | | | | | | | | ... rather than just for the first byte. While at it, also - make the real mode case at least dpo a wrap around check - drop the mis-named "gpf" label (we're not generating faults here) and use in-place returns instead Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86_emulate: fix wrap around handling for repeated string instructionsJan Beulich2013-09-231-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | For one, repeat count clipping for MOVS must be done taking into consideration both source and destination addresses. And then we should allow a wrap on the final iteration only if either the wrap is a precise one (i.e. the access itself doesn't wrap, just the resulting index register value would) or if there is just one iteration. In all other cases we should do a bulk operation first without hitting the wrap, and then issue an individual iteration. If we don't do it that way, - the last iteration not completing successfully will cause the whole operation to fail (i.e. registers not get updated to the failure point) - hvmemul_virtual_to_linear() may needlessly enforce non-repeated operation Additionally with the prior implementation there was a case (df=1, ea=~0, reps=~0, bytes_per_rep=1) where we'd end up passing zero reps back to the caller, yet various places assume that there's at least on iteration. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* gdbsx: clear sockaddr before using itMatthew Daley2013-09-211-0/+1
| | | | | | | | ...so that sin_zero is actually zero. Coverity-ID: 1056070 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* mini-os: fix various memory leaks in various locationsMatthew Daley2013-09-212-2/+7
| | | | | | | | | | Coverity-ID: 1055827 Coverity-ID: 1055828 Coverity-ID: 1055829 Coverity-ID: 1055830 Coverity-ID: 1055831 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix various memory leaks in consfrontMatthew Daley2013-09-211-4/+5
| | | | | | | | Coverity-ID: 1055816 Coverity-ID: 1055817 Coverity-ID: 1055818 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix various memory leaks in pcifrontMatthew Daley2013-09-211-10/+19
| | | | | | Coverity-ID: 1055834-1055840 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix various memory leaks in netfrontMatthew Daley2013-09-211-6/+11
| | | | | | | Coverity-ID: 1055832 Coverity-ID: 1055833 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix various memory leaks in {fb, kbd}frontMatthew Daley2013-09-211-17/+31
| | | | | | Coverity-ID: 1055819-1055826 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix various memory leaks in blkfrontMatthew Daley2013-09-211-4/+7
| | | | | | | Coverity-ID: 1055814 Coverity-ID: 1055815 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* mini-os: fix nodename generation in init_netfrontMatthew Daley2013-09-211-2/+4
| | | | | | | | Using strlen here makes no sense. Coverity-ID: 1056053 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* xen/arm: Support Cortex-A7 GICIan Campbell2013-09-211-1/+2
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* ns16550: support DesignWare 8250Ian Campbell2013-09-212-0/+16
| | | | | | | | | | | | This hardware has an additional feature which signals an error if you try to write LCR while the UART is busy. We need to clear this error during setup, otherwise LCR.DLAB doesn't get set and we cannot read/write the divisor. This has been tested on the cubieboard2 Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Cc: jbeulich@suse.com
* ns16550: make usable on ARMIan Campbell2013-09-214-12/+186
| | | | | | | | | | | | | | There are several aspects to this: - Correctly conditionalise use of PCI - Correctly conditionalise use of IO ports - Add discovery via device tree - Support different registers shift/stride and widths - Add vuart hooks. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Frser <keir@xen.org> Reviewed-by: Jan Beulich <jbeulich@suse.com> Cc: PranavkumarSawargaonkar<pranavkumar@linaro.org>