aboutsummaryrefslogtreecommitdiffstats
path: root/xen
Commit message (Collapse)AuthorAgeFilesLines
* x86/HVM: fixed _hvm_hw_fix_cpu()Razvan Cojocaru2013-01-241-6/+9
| | | | | | | | | | Prevent the compiler from re-ordering the reads and writes. Suggested by Jan Beulich. Signed-off-by: Razvan Cojocaru <rzvncj@gmail.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
* xen: arm: print arm32 not x86_64 in xen info.Ian Campbell2013-01-241-1/+1
| | | | | | | Reported-by: Lars Rasmusson <Lars.Rasmusson@sics.se> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: Simplify the space of spaces supported by XENMEM_add_to_physmap(_range)Ian Campbell2013-01-242-3/+9
| | | | | | | | | | | | | | XENMAPSPACE_gmfn_foreign is not supported by XENMEM_add_to_physmap. Although in theory XENMEM_add_to_physmap_range could support XENMAPSPACE_gmfn_range this is no different to XENMAPSPACE_gmfn in the context of the ranged hypercall so disallow it to avoid any confusion. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: do not panic when failing to translate a guest addressIan Campbell2013-01-246-57/+76
| | | | | | | | | | | | | The gva_to_{par,ipa} functions currently panic if the guest address cannot be translated. Often the input comes from the guest so panicing the host is a bit harsh! Change the API of those functions to allow them to return a failure and plumb it through where it is used. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: infrastructure to have cross-platform video driversStefano Stabellini2013-01-2410-28/+48
| | | | | | | | | | | | | | - introduce a new HAS_VIDEO config variable; - build xen/drivers/video/font* if HAS_VIDEO; - rename vga_puts to video_puts; - rename vga_init to video_init; - rename vga_endboot to video_endboot. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: introduce early_ioremapStefano Stabellini2013-01-243-1/+38
| | | | | | | | | | | Introduce a function to map a range of physical memory into Xen virtual memory. It doesn't need domheap to be setup. It is going to be used to map the videoram. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: flush the entire dest_va 2MB mappingStefano Stabellini2013-01-241-1/+1
| | | | | | | | | At the beginning of setup_pagetables we modify a 2MB mapping but we only flush the first 4KB of it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: introduce flush_xen_data_tlb_range_vaStefano Stabellini2013-01-242-11/+15
| | | | | | | | | | Add flush_xen_data_tlb_range_va, that flushes a range of virtual addresses. Replace all the calls to flush_xen_data_tlb_va with calls to flush_xen_data_tlb_range_va and remove flush_xen_data_tlb_va. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: add missing FIRST, SECOND and THIRD MASK and SIZE definitionsStefano Stabellini2013-01-241-0/+6
| | | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86/mm: remove two files left over from the previous vram patches.Tim Deegan2013-01-242-1066/+0
| | | | | | | I seem to have missed these when reverting 26399:b0e618cb0233. Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/HVM: generalize IRQ raising on RTC_REG_B writesJan Beulich2013-01-231-5/+10
| | | | | | | | Raise the RTC IRQ not only when UIE gets set while UF was already set, but generalize this to cover AIE and PIE as well. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: use cached original value in RTC_REG_B writing codeJan Beulich2013-01-231-3/+3
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: fix RTC hour conversionsJan Beulich2013-01-231-8/+7
| | | | | | | | | Properly mask off bit 7 when retrieving the hour values in alarm_timer_update(), and properly use RTC_HOURS_ALARM's bit 7 when converting from 12- to 24-hour value. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: adjust rtc_timer_update()Jan Beulich2013-01-231-12/+17
| | | | | | | | | | Don't look at RTC_PIE in rtc_timer_update(), and hence don't call the function on REG_B writes at all. Also handle the two other possible clock bases. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: consolidate toggling of RTC IRQJan Beulich2013-01-231-14/+13
| | | | | | | | Note that in the RTC_UIE/RTC_UF case, this also fixes the lack of setting RTC_IRQF. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: use RTC_* names instead of literal numbersJan Beulich2013-01-231-3/+4
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: support up to 16TbJan Beulich2013-01-237-16/+98
| | | | | | | | | | | | | | This mainly involves adjusting the number of L4 entries needing copying between page tables (which is now different between PV and HVM/idle domains), and changing the cutoff point and method when more than the supported amount of memory is found in a system. Since TMEM doesn't currently cope with the full 1:1 map not always being visible, it gets forcefully disabled in that case. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* tmem: partial adjustments for x86 16Tb supportJan Beulich2013-01-231-18/+8
| | | | | | | | | | | | | | | Despite the changes below, tmem still has code assuming to be able to directly access all memory, or mapping arbitrary amounts of not directly accessible memory. I cannot see how to fix this without converting _all_ its domheap allocations to xenheap ones. And even then I wouldn't be certain about there not being other cases where the "all memory is always mapped" assumption would be broken. Therefore, tmem gets disabled by the next patch for the time being if the full 1:1 mapping isn't always visible. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: properly use map_domain_page() in miscellaneous placesJan Beulich2013-01-234-7/+36
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: properly use map_domain_page() in nested HVM codeJan Beulich2013-01-235-48/+66
| | | | | | | | | | | | | | This eliminates a couple of incorrect/inconsistent uses of map_domain_page() from VT-x code. Note that this does _not_ add error handling where none was present before, even though I think NULL returns from any of the mapping operations touched here need to properly be handled. I just don't know this code well enough to figure out what the right action in each case would be. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: properly use map_domain_page() during page table manipulationJan Beulich2013-01-237-53/+82
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: properly use map_domain_page() during domain creation/destructionJan Beulich2013-01-237-83/+105
| | | | | | | | This involves no longer storing virtual addresses of the per-domain mapping L2 and L3 page tables. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: consolidate initialization of PV guest L4 page tablesJan Beulich2013-01-234-23/+18
| | | | | | | So far this has been repeated in 3 places, requiring to remember to update all of them if a change is being made. Signed-off-by: Jan Beulich <jbeulich@suse.com>
* x86: properly use map_domain_page() when building Dom0Jan Beulich2013-01-233-26/+65
| | | | | | | | | This requires a minor hack to allow the correct page tables to be used while running on Dom0's page tables (as they can't be determined from "current" at that time). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: re-introduce map_domain_page() et alJan Beulich2013-01-237-44/+544
| | | | | | | | | | | | | | | | | | This is being done mostly in the form previously used on x86-32, utilizing the second L3 page table slot within the per-domain mapping area for those mappings. It remains to be determined whether that concept is really suitable, or whether instead re-implementing at least the non-global variant from scratch would be better. Also add the helpers {clear,copy}_domain_page() as well as initial uses of them. One question is whether, to exercise the non-trivial code paths, we shouldn't make the trivial shortcuts conditional upon NDEBUG being defined. See the debugging patch at the end of the series. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: extend frame table virtual spaceJan Beulich2013-01-234-16/+19
| | | | | | | | | | ... to allow frames for up to 16Tb. At the same time, add the super page frame table coordinates to the comment describing the address space layout. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: introduce virt_to_xen_l1e()Jan Beulich2013-01-233-4/+24
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: Do not allow guests to enable nested HVM on themselvesIan Campbell2013-01-231-0/+5
| | | | | | | | | | | There is no reason for this and doing so exposes a memory leak to guests. Only toolstacks need write access to this HVM param. This is XSA-35 / CVE-2013-0152. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Jan Beulich <JBeulich@suse.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* fix acpi_dmar_zap/reinstate() (fixes S3 regression)Tomasz Wroblewski2013-01-233-1/+63
| | | | | | | | | | | | | | | | | | | | | | | Fix S3 regression introduced by cs 23013:65d26504e843 (ACPI: large cleanup). The dmar virtual pointer returned from acpi_get_table cannot be safely stored away and used later, as the underlying acpi_os_map_memory / __acpi_map_table functions overwrite the mapping causing it to point to different tables than dmar (last fetched table is used). This subsequently causes acpi_dmar_reinstate() and acpi_dmar_zap() to write data to wrong table, causing its corruption and problems with consecutive s3 resumes. Added a new function to fetch ACPI table physical address, and establishing separate static mapping for dmar_table pointer instead of using acpi_get_table(). Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com> Added call to acpi_tb_verify_table(). Fixed page count passed to map_pages_to_xen(). Cosmetic changes. Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* xen/arch/x86: complete XSM hooks on irq/pirq mappingsDaniel De Graaf2013-01-237-38/+77
| | | | | | | | | | | | | | | | | Manipulation of a domain's pirq namespace was not fully protected by XSM hooks because the XSM hooks for IRQs needed a physical IRQ. Since this may not apply to HVM domains, a complete solution needs to split the XSM hook for this operation, using one hook for the PIRQ manipulation and one for controlling access to the hardware IRQ. This reworking has the advantage of providing the same MSI data to remove_irq that is provided to add_irq, allowing the PCI device to be determined in both functions. It also eliminates the last callers of rcu_lock_target_domain_by_id in x86 and common code in preparation for this function's removal. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* hvm: wire up domctl and xsm hypercallsDaniel De Graaf2013-01-231-0/+4
| | | | | | | | | These hypercalls are usable by HVM guests. Once connected, simple functions of the Xen toolstack can be run from an HVM domain if that domain is permitted access (which is currently only possible via XSM). Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* x86: restore (optional) forwarding of PCI SERR induced NMI to Dom0Jan Beulich2013-01-222-3/+20
| | | | | | | | | | | | | | | | c/s 22949:54fe1011f86b removed the forwarding of NMIs to Dom0 when they were caused by PCI SERR. NMI buttons as well as BMCs (like HP's iLO) may however want such events to be seen in Dom0 (e.g. to trigger a dump). Therefore restore most of the functionality which named c/s removed (adjusted for subsequent changes, and adjusting the public interface to use the modern term, retaining the old one for backwards compatibility). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* xen arm: add XSM hooks to arch_memory_opIan Campbell2013-01-215-32/+49
| | | | | | | | | | Treat XENMEM_add_to_physmap_range the same as XENMEM_add_to_physmap. Reported-by: Lars Rasmusson <Lars.Rasmusson@sics.se> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: flush dcache after memcpy'ing the kernel imageStefano Stabellini2013-01-211-0/+1
| | | | | | | | | | | | | After memcpy'ing the kernel in guest memory we need to flush the dcache to make sure that the data actually reaches the memory before we start executing guest code with caches disabled. copy_from_paddr is the function that does the copy, so add a flush_xen_dcache_va_range there. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: use module provided command line for domain 0 command lineIan Campbell2013-01-211-4/+24
| | | | | | | | | | | | | Fallback to xen,dom0-bootargs if this isn't present. Ideally this would use module1-args iff the kernel came from the modules and the existing xen,dom0-bootargs if the kernel came from flash, but this approach is simpler and has the same effect in practice. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: discard boot modules after building domain 0.Ian Campbell2013-01-213-0/+21
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: load dom0 kernel from first boot moduleIan Campbell2013-01-212-27/+75
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* device-tree: get_val cannot cope with cells > 2, add early_panicIan Campbell2013-01-211-0/+3
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: avoid allocating the heaps over modules or xen itself.Ian Campbell2013-01-211-11/+78
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: avoid placing Xen over any modules.Ian Campbell2013-01-211-7/+61
| | | | | | | | | | This will still fail if the modules are such that Xen is pushed out of the top 32M of RAM since it will then overlap with the domheap (or possibly xenheap). This will be dealt with later. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: introduce concept of modules which can be in RAM at start of dayIan Campbell2013-01-211-0/+14
| | | | | | | | | | | | | The intention is that these will eventually be filled in with information from the bootloader, perhaps via a DTB binding. Allow for 2 modules (kernel and initrd), plus a third pseudo-module which is the hypervisor itself. Currently we neither parse nor do anything with them. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86/hvm: fix RTC setting.Tim Deegan2013-01-181-3/+10
| | | | | | | | | | When the guest writes one field of the RTC time, we must bring all the other fields up to date for the current second before calculating the new RTC time. Signed-off-by: Tim Deegan <tim@xen.org> Tested-by: Phil Evans <Phil.Evans@m247.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86/AMD: Enable WC+ memory type on family 10 processorsBoris Ostrovsky2013-01-182-2/+14
| | | | | | | | | | In some cases BIOS may not enable WC+ memory type on family 10 processors, instead converting what would be WC+ memory to CD type. On guests using nested pages this could result in performance degradation. This patch enables WC+. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86: find a better location for the real-mode trampolinePaolo Bonzini2013-01-182-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | On some machines, the location at 0x40e does not point to the beginning of the EBDA. Rather, it points to the beginning of the BIOS-reserved area of the EBDA, while the option ROMs place their data below that segment. For this reason, 0x413 is actually a better source than 0x40e to get the location of the real-mode trampoline. Xen was already using it as a second source, and this patch keeps that working. However, just in case, let's also fetch the information from the multiboot structure, where the boot loader should have placed it. This way we don't necessarily trust one of the BIOS or the multiboot loader more than the other. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Retain the previous code, thus using the multiboot value only if it's sane but lower than the BDA computed one. Also use the full 32-bit mem_lower value and prefer MBI_MEMLIMITS over open coding it (requiring a slight adjustment to multiboot.h to make its constants actually usable in assembly code, which previously they were only meant to be). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
* xen: arm: fix assert in select_user_regIan Campbell2013-01-171-1/+1
| | | | | | | | The condition was inverted. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: initialize the GIC irq properties of interrupts routed to guestsStefano Stabellini2013-01-171-18/+31
| | | | | | | | | | | | We are currently initializing GIC irq properties (ITARGETSR, IPRIORITYR, and GICD_ICFGR) only in gic_route_irq, that is not called for guest interrupts at all. Move the initialization into a separate function (gic_set_irq_properties) and call it from gic_route_irq_to_guest. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: support the ARM generic virtual timerStefano Stabellini2013-01-177-45/+105
| | | | | | | | | | | | | Save and restore the virtual timer registers during the context switch. At save time initialize an internal Xen timer to make sure that Xen schedules the guest vcpu at the time of the next virtual timer interrupt. Receive the virtual timer interrupt into the hypervisor and inject it into the running guest. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: return a per-mapping error from XENMEM_add_to_physmap_range.Ian Campbell2013-01-172-1/+11
| | | | | | | | | | | | | | | | | | | | | | | Since ARM and PVH dom0 kernel use this to map foreign domain pages they could in the future hit paged out or shared pages etc and therefore need to propagate which frames are -ENOENT and which failed for some other reason. We have not yet released a version of Xen with this particular hypercall subop so we can change the interface without worrying about compatibility (I think/hope). This would be used by the privcmd driver, in particular it relates to Mats' patch "improve performance of MMAPBATCH_V2." NB I have only implemented the ARM side since the PVH side isn't in tree yet. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Mats Petersson <mats.petersson@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: Correct register values and comment in early init_uart.Lars Rasmusson2013-01-171-2/+2
| | | | | | | | | | | | | | Set register values and comment in early init_uart to match documentation of PL011 UART Reading the PL011 UART documentation on http://infocenter.arm.com/help/topic/com.arm.doc.ddi0183f/DDI0183.pdf in sec 3.2 shows the early initialisation of the UART on the Versatile Express is incorrect. This fixes it. Signed-off-by: Lars Rasmusson <Lars.Rasmusson@sics.se> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86/mm: revert 26399:b0e618cb0233 (multiple vram areas)Tim Deegan2013-01-1713-341/+391
| | | | | | | | Although this passed my smoke-tests at commit time, I'm now seeing screen corruption on 32-bit WinXP guests. Reverting for now. :( Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>