1. 23 Nov, 2010 1 commit
  2. 22 Nov, 2010 2 commits
    • Konrad Rzeszutek Wilk's avatar
      xen/events: Use PIRQ instead of GSI value when unmapping MSI/MSI-X irqs. · 12334715
      Konrad Rzeszutek Wilk authored
      When we allocate a vector for MSI/MSI-X we save away the PIRQ, and the
      vector value. When we unmap (de-allocate) the MSI/MSI-X vector(s) we
      need to provide the PIRQ and the vector value. What we did instead
      was to provide the GSI (which was zero) and the vector value, and we
      got these unhappy error messages:
      
      (XEN) irq.c:1575: dom0: pirq 0 not mapped
      [    7.733415] unmap irq failed -22
      
      This patches fixes this and we use the PIRQ value instead of the GSI
      value.
      
      CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      12334715
    • Konrad Rzeszutek Wilk's avatar
      xen: set IO permission early (before early_cpu_init()) · ec35a69c
      Konrad Rzeszutek Wilk authored
      This patch is based off "xen dom0: Set up basic IO permissions for dom0."
      by Juan Quintela <quintela@redhat.com>.
      
      On AMD machines when we boot the kernel as Domain 0 we get this nasty:
      
      mapping kernel into physical memory
      Xen: setup ISA identity maps
      about to get started...
      (XEN) traps.c:475:d0 Unhandled general protection fault fault/trap [#13] on VCPU 0 [ec=0000]
      (XEN) domain_crash_sync called from entry.S
      (XEN) Domain 0 (vcpu#0) crashed on cpu#0:
      (XEN) ----[ Xen-4.1-101116  x86_64  debug=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e033:[<ffffffff8130271b>]
      (XEN) RFLAGS: 0000000000000282   EM: 1   CONTEXT: pv guest
      (XEN) rax: 000000008000c068   rbx: ffffffff8186c680   rcx: 0000000000000068
      (XEN) rdx: 0000000000000cf8   rsi: 000000000000c000   rdi: 0000000000000000
      (XEN) rbp: ffffffff81801e98   rsp: ffffffff81801e50   r8:  ffffffff81801eac
      (XEN) r9:  ffffffff81801ea8   r10: ffffffff81801eb4   r11: 00000000ffffffff
      (XEN) r12: ffffffff8186c694   r13: ffffffff81801f90   r14: ffffffffffffffff
      (XEN) r15: 0000000000000000   cr0: 000000008005003b   cr4: 00000000000006f0
      (XEN) cr3: 0000000221803000   cr2: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: e02b   cs: e033
      (XEN) Guest stack trace from rsp=ffffffff81801e50:
      
      RIP points to read_pci_config() function.
      
      The issue is that we don't set IO permissions for the Linux kernel early enough.
      
      The call sequence used to be:
      
          xen_start_kernel()
      	x86_init.oem.arch_setup = xen_setup_arch;
              setup_arch:
                 - early_cpu_init
                     - early_init_amd
                        - read_pci_config
                 - x86_init.oem.arch_setup [ xen_arch_setup ]
                     - set IO permissions.
      
      We need to set the IO permissions earlier on, which this patch does.
      Acked-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      ec35a69c
  3. 20 Nov, 2010 4 commits
  4. 16 Nov, 2010 2 commits
  5. 12 Nov, 2010 1 commit
  6. 11 Nov, 2010 2 commits
    • Ian Campbell's avatar
      xen: do not release any memory under 1M in domain 0 · 9ec23a7f
      Ian Campbell authored
      We already deliberately setup a 1-1 P2M for the region up to 1M in
      order to allow code which assumes this region is already mapped to
      work without having to convert everything to ioremap.
      
      Domain 0 should not return any apparently unused memory regions
      (reserved or otherwise) in this region to Xen since the e820 may not
      accurately reflect what the BIOS has stashed in this region.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      9ec23a7f
    • Ian Campbell's avatar
      xen: events: do not unmask event channels on resume · 6903591f
      Ian Campbell authored
      The IRQ core code will take care of disabling and reenabling
      interrupts over suspend resume automatically, therefore we do not need
      to do this in the Xen event channel code.
      
      The only exception is those event channels marked IRQF_NO_SUSPEND
      which the IRQ core ignores. We must unmask these ourselves, taking
      care to obey the current IRQ_DISABLED status. Failure check for
      IRQ_DISABLED leads to enabling polled only event channels, such as
      that associated with the pv spinlocks, which must never be enabled:
      
      [   21.970432] ------------[ cut here ]------------
      [   21.970432] kernel BUG at arch/x86/xen/spinlock.c:343!
      [   21.970432] invalid opcode: 0000 [#1] SMP
      [   21.970432] last sysfs file: /sys/devices/virtual/net/lo/operstate
      [   21.970432] Modules linked in:
      [   21.970432]
      [   21.970432] Pid: 0, comm: swapper Not tainted (2.6.32.24-x86_32p-xen-01034-g787c727 #34)
      [   21.970432] EIP: 0061:[<c102e209>] EFLAGS: 00010046 CPU: 3
      [   21.970432] EIP is at dummy_handler+0x3/0x7
      [   21.970432] EAX: 0000021c EBX: dfc16880 ECX: 0000001a EDX: 00000000
      [   21.970432] ESI: dfc02c00 EDI: 00000001 EBP: dfc47e10 ESP: dfc47e10
      [   21.970432]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
      [   21.970432] Process swapper (pid: 0, ti=dfc46000 task=dfc39440 task.ti=dfc46000)
      [   21.970432] Stack:
      [   21.970432]  dfc47e30 c10a39f0 0000021c 00000000 00000000 dfc16880 0000021c 00000001
      [   21.970432] <0> dfc47e40 c10a4f08 0000021c 00000000 dfc47e78 c12240a7 c1839284 c1839284
      [   21.970432] <0> 00000200 00000000 00000000 f5720000 c1f3d028 c1f3d02c 00000180 dfc47e90
      [   21.970432] Call Trace:
      [   21.970432]  [<c10a39f0>] ? handle_IRQ_event+0x5f/0x122
      [   21.970432]  [<c10a4f08>] ? handle_percpu_irq+0x2f/0x55
      [   21.970432]  [<c12240a7>] ? __xen_evtchn_do_upcall+0xdb/0x15f
      [   21.970432]  [<c122481e>] ? xen_evtchn_do_upcall+0x20/0x30
      [   21.970432]  [<c1030d47>] ? xen_do_upcall+0x7/0xc
      [   21.970432]  [<c102007b>] ? apic_reg_read+0xd3/0x22d
      [   21.970432]  [<c1002227>] ? hypercall_page+0x227/0x1005
      [   21.970432]  [<c102d30b>] ? xen_force_evtchn_callback+0xf/0x14
      [   21.970432]  [<c102da7c>] ? check_events+0x8/0xc
      [   21.970432]  [<c102da3b>] ? xen_irq_enable_direct_end+0x0/0x1
      [   21.970432]  [<c105e485>] ? finish_task_switch+0x62/0xba
      [   21.970432]  [<c14e3f84>] ? schedule+0x808/0x89d
      [   21.970432]  [<c1084dc5>] ? hrtimer_start_expires+0x1a/0x22
      [   21.970432]  [<c1085154>] ? tick_nohz_restart_sched_tick+0x15a/0x162
      [   21.970432]  [<c102f43a>] ? cpu_idle+0x6d/0x6f
      [   21.970432]  [<c14db29e>] ? cpu_bringup_and_idle+0xd/0xf
      [   21.970432] Code: 5d 0f 95 c0 0f b6 c0 c3 55 66 83 78 02 00 89 e5 5d 0f 95 \
      c0 0f b6 c0 c3 55 b2 01 86 10 31 c0 84 d2 89 e5 0f 94 c0 5d c3 55 89 e5 <0f> 0b \
      eb fe 55 80 3d 4c ce 84 c1 00 89 e5 57 56 89 c6 53 74 15
      [   21.970432] EIP: [<c102e209>] dummy_handler+0x3/0x7 SS:ESP 0069:dfc47e10
      [   21.970432] ---[ end trace c0b71f7e12cf3011 ]---
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      6903591f
  7. 29 Oct, 2010 2 commits
    • Ian Campbell's avatar
      xen: correct size of level2_kernel_pgt · a2d771c0
      Ian Campbell authored
      sizeof(pmd_t *) is 4 bytes on 32-bit PAE leading to an allocation of
      only 2048 bytes. The correct size is sizeof(pmd_t) giving us a full
      page allocation.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      a2d771c0
    • Linus Torvalds's avatar
      Merge branch 'stable/xen-pcifront-0.8.2' of... · 18cb657c
      Linus Torvalds authored
      Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
        and branch 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm
      
      * 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm:
        xen: register xen pci notifier
        xen: initialize cpu masks for pv guests in xen_smp_init
        xen: add a missing #include to arch/x86/pci/xen.c
        xen: mask the MTRR feature from the cpuid
        xen: make hvc_xen console work for dom0.
        xen: add the direct mapping area for ISA bus access
        xen: Initialize xenbus for dom0.
        xen: use vcpu_ops to setup cpu masks
        xen: map a dummy page for local apic and ioapic in xen_set_fixmap
        xen: remap MSIs into pirqs when running as initial domain
        xen: remap GSIs as pirqs when running as initial domain
        xen: introduce XEN_DOM0 as a silent option
        xen: map MSIs into pirqs
        xen: support GSI -> pirq remapping in PV on HVM guests
        xen: add xen hvm acpi_register_gsi variant
        acpi: use indirect call to register gsi in different modes
        xen: implement xen_hvm_register_pirq
        xen: get the maximum number of pirqs from xen
        xen: support pirq != irq
      
      * 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (27 commits)
        X86/PCI: Remove the dependency on isapnp_disable.
        xen: Update Makefile with CONFIG_BLOCK dependency for biomerge.c
        MAINTAINERS: Add myself to the Xen Hypervisor Interface and remove Chris Wright.
        x86: xen: Sanitse irq handling (part two)
        swiotlb-xen: On x86-32 builts, select SWIOTLB instead of depending on it.
        MAINTAINERS: Add myself for Xen PCI and Xen SWIOTLB maintainer.
        xen/pci: Request ACS when Xen-SWIOTLB is activated.
        xen-pcifront: Xen PCI frontend driver.
        xenbus: prevent warnings on unhandled enumeration values
        xenbus: Xen paravirtualised PCI hotplug support.
        xen/x86/PCI: Add support for the Xen PCI subsystem
        x86: Introduce x86_msi_ops
        msi: Introduce default_[teardown|setup]_msi_irqs with fallback.
        x86/PCI: Export pci_walk_bus function.
        x86/PCI: make sure _PAGE_IOMAP it set on pci mappings
        x86/PCI: Clean up pci_cache_line_size
        xen: fix shared irq device passthrough
        xen: Provide a variant of xen_poll_irq with timeout.
        xen: Find an unbound irq number in reverse order (high to low).
        xen: statically initialize cpu_evtchn_mask_p
        ...
      
      Fix up trivial conflicts in drivers/pci/Makefile
      18cb657c
  8. 28 Oct, 2010 26 commits