1. 20 10月, 2012 12 次提交
  2. 12 10月, 2012 3 次提交
    • K
      xen/pv-on-hvm kexec: add quirk for Xen 3.4 and shutdown watches. · cb6b6df1
      Konrad Rzeszutek Wilk 提交于
      The commit 254d1a3f, titled
      "xen/pv-on-hvm kexec: shutdown watches from old kernel" assumes that the
      XenBus backend can deal with reading of values from:
       "control/platform-feature-xs_reset_watches":
      
          ... a patch for xenstored is required so that it
          accepts the XS_RESET_WATCHES request from a client (see changeset
          23839:42a45baf037d in xen-unstable.hg). Without the patch for xenstored
          the registration of watches will fail and some features of a PVonHVM
          guest are not available. The guest is still able to boot, but repeated
          kexec boots will fail."
      
      Sadly this is not true when using a Xen 3.4 hypervisor and booting a PVHVM
      guest. We end up hanging at:
      
        err = xenbus_scanf(XBT_NIL, "control",
                              "platform-feature-xs_reset_watches", "%d", &supported);
      
      This can easily be seen with guests hanging at xenbus_init:
      
      NX (Execute Disable) protection: active
      SMBIOS 2.4 present.
      DMI: Xen HVM domU, BIOS 3.4.0 05/13/2011
      Hypervisor detected: Xen HVM
      Xen version 3.4.
      Xen Platform PCI: I/O protocol version 1
      ... snip ..
      calling  xenbus_init+0x0/0x27e @ 1
      
      Reverting the commit or using the attached patch fixes the issue. This fix
      checks whether the hypervisor is older than 4.0 and if so does not try to
      perform the read.
      
      Fixes-Oracle-Bug: 14708233
      CC: stable@vger.kernel.org
      Acked-by: NOlaf Hering <olaf@aepfle.de>
      [v2: Added a comment in the source code]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cb6b6df1
    • K
      xen/bootup: allow {read|write}_cr8 pvops call. · 1a7bbda5
      Konrad Rzeszutek Wilk 提交于
      We actually do not do anything about it. Just return a default
      value of zero and if the kernel tries to write anything but 0
      we BUG_ON.
      
      This fixes the case when an user tries to suspend the machine
      and it blows up in save_processor_state b/c 'read_cr8' is set
      to NULL and we get:
      
      kernel BUG at /home/konrad/ssd/linux/arch/x86/include/asm/paravirt.h:100!
      invalid opcode: 0000 [#1] SMP
      Pid: 2687, comm: init.late Tainted: G           O 3.6.0upstream-00002-gac264ac-dirty #4 Bochs Bochs
      RIP: e030:[<ffffffff814d5f42>]  [<ffffffff814d5f42>] save_processor_state+0x212/0x270
      
      .. snip..
      Call Trace:
       [<ffffffff810733bf>] do_suspend_lowlevel+0xf/0xac
       [<ffffffff8107330c>] ? x86_acpi_suspend_lowlevel+0x10c/0x150
       [<ffffffff81342ee2>] acpi_suspend_enter+0x57/0xd5
      
      CC: stable@vger.kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      1a7bbda5
    • K
      xen/bootup: allow read_tscp call for Xen PV guests. · cd0608e7
      Konrad Rzeszutek Wilk 提交于
      The hypervisor will trap it. However without this patch,
      we would crash as the .read_tscp is set to NULL. This patch
      fixes it and sets it to the native_read_tscp call.
      
      CC: stable@vger.kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cd0608e7
  3. 04 10月, 2012 3 次提交
  4. 03 10月, 2012 2 次提交
  5. 27 9月, 2012 1 次提交
    • K
      Merge branch 'xenarm-for-linus' of... · ae1659ee
      Konrad Rzeszutek Wilk 提交于
      Merge branch 'xenarm-for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm into stable/for-linus-3.7
      
      * 'xenarm-for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm:
        arm: introduce a DTS for Xen unprivileged virtual machines
        MAINTAINERS: add myself as Xen ARM maintainer
        xen/arm: compile netback
        xen/arm: compile blkfront and blkback
        xen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree
        xen/arm: receive Xen events on ARM
        xen/arm: initialize grant_table on ARM
        xen/arm: get privilege status
        xen/arm: introduce CONFIG_XEN on ARM
        xen: do not compile manage, balloon, pci, acpi, pcpu and cpu_hotplug on ARM
        xen/arm: Introduce xen_ulong_t for unsigned long
        xen/arm: Xen detection and shared_info page mapping
        docs: Xen ARM DT bindings
        xen/arm: empty implementation of grant_table arch specific functions
        xen/arm: sync_bitops
        xen/arm: page.h definitions
        xen/arm: hypercalls
        arm: initial Xen support
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      ae1659ee
  6. 26 9月, 2012 1 次提交
    • K
      xen/pciback: Restore the PCI config space after an FLR. · c341ca45
      Konrad Rzeszutek Wilk 提交于
      When we do an FLR, or D0->D3_hot we may lose the BARs as the
      device has turned itself off (and on). This means the device cannot
      function unless the pci_restore_state is called - which it is
      when the PCI device is unbound from the Xen PCI backend driver.
      For PV guests it ends up calling pci_enable_device / pci_enable_msi[x]
      which does the proper steps
      
      That however is not happening if a HVM guest is run as QEMU
      deals with PCI configuration space. QEMU also requires that the
      device be "parked"  under the ownership of a pci-stub driver to
      guarantee that the PCI device is not being used. Hence we
      follow the same incantation as pci_reset_function does - by
      doing an FLR, then restoring the PCI configuration space.
      
      The result of this patch is that when you run lspci, you get
      now this:
      
      -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
      -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
      +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
      +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
              Region 2: I/O ports at c000 [size=32]
      -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
      +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
      
      The [virtual] means that lspci read those entries from SysFS but when
      it read them from the device it got a different value (0xfffffff).
      
      CC: stable@vger.kernel.org #only for 3.5, 3.6
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c341ca45
  7. 25 9月, 2012 2 次提交
    • J
      xen-pciback: properly clean up after calling pcistub_device_find() · e6aa70a0
      Jan Beulich 提交于
      As the function calls pcistub_device_get() before returning non-NULL,
      its callers need to take care of calling pcistub_device_put() on
      (mostly, but not exclusively) error paths.
      
      Otoh, the function already guarantees that the 'dev' member is non-NULL
      upon successful return, so callers do not need to check for this a
      second time.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      e6aa70a0
    • S
      arm: introduce a DTS for Xen unprivileged virtual machines · bbd6eb29
      Stefano Stabellini 提交于
      Given that the xenvm machine is based on vexpress but with an extremely
      limited selection of peripherals (the guest is supposed to use virtual
      devices instead), add "xen,xenvm" to the list of compatible machines in
      mach-vexpress.
      
      
      Changes in v3:
      
      - add comments to mark fields that are likely to be changed by the
      hypervisor.
      
      
      Changes in v2:
      
      - remove include skeleton;
      - use #address-cells = <2> and #size-cells = <2>;
      - remove the debug bootargs;
      - use memory@80000000 instead of memory;
      - remove the ranges and interrupt-map from the motherboard node;
      - set the machine compatible to "xen,xenvm-4.2", "xen,xenvm";
      - rename the dts file to xenvm-4.2.dts;
      - add "xen,xenvm" to the list of compatible DT strings to mach-vexpress.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: Pawel Moll <pawel.moll@arm.com> (v2m changes)
      bbd6eb29
  8. 24 9月, 2012 2 次提交
  9. 23 9月, 2012 1 次提交
    • K
      Merge branch 'stable/late-swiotlb.v3.3' into stable/for-linus-3.7 · a5f95155
      Konrad Rzeszutek Wilk 提交于
      * stable/late-swiotlb.v3.3:
        xen/swiotlb: Fix compile warnings when using plain integer instead of NULL pointer.
        xen/swiotlb: Remove functions not needed anymore.
        xen/pcifront: Use Xen-SWIOTLB when initting if required.
        xen/swiotlb: For early initialization, return zero on success.
        xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used.
        xen/swiotlb: Move the error strings to its own function.
        xen/swiotlb: Move the nr_tbl determination in its own function.
        swiotlb: add the late swiotlb initialization function with iotlb memory
        xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.
        xen/swiotlb: Simplify the logic.
      
      Conflicts:
      	arch/x86/xen/pci-swiotlb-xen.c
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a5f95155
  10. 21 9月, 2012 1 次提交
    • A
      xen/gndev: Xen backend support for paged out grant targets V4. · c571898f
      Andres Lagar-Cavilla 提交于
      Since Xen-4.2, hvm domains may have portions of their memory paged out. When a
      foreign domain (such as dom0) attempts to map these frames, the map will
      initially fail. The hypervisor returns a suitable errno, and kicks an
      asynchronous page-in operation carried out by a helper. The foreign domain is
      expected to retry the mapping operation until it eventually succeeds. The
      foreign domain is not put to sleep because itself could be the one running the
      pager assist (typical scenario for dom0).
      
      This patch adds support for this mechanism for backend drivers using grant
      mapping and copying operations. Specifically, this covers the blkback and
      gntdev drivers (which map foreign grants), and the netback driver (which copies
      foreign grants).
      
      * Add a retry method for grants that fail with GNTST_eagain (i.e. because the
        target foreign frame is paged out).
      * Insert hooks with appropriate wrappers in the aforementioned drivers.
      
      The retry loop is only invoked if the grant operation status is GNTST_eagain.
      It guarantees to leave a new status code different from GNTST_eagain. Any other
      status code results in identical code execution as before.
      
      The retry loop performs 256 attempts with increasing time intervals through a
      32 second period. It uses msleep to yield while waiting for the next retry.
      
      V2 after feedback from David Vrabel:
      * Explicit MAX_DELAY instead of wrap-around delay into zero
      * Abstract GNTST_eagain check into core grant table code for netback module.
      
      V3 after feedback from Ian Campbell:
      * Add placeholder in array of grant table error descriptions for unrelated
        error code we jump over.
      * Eliminate single map and retry macro in favor of a generic batch flavor.
      * Some renaming.
      * Bury most implementation in grant_table.c, cleaner interface.
      
      V4 rebased on top of sync of Xen grant table interface headers.
      Signed-off-by: NAndres Lagar-Cavilla <andres@lagarcavilla.org>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      [v5: Fixed whitespace issues]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c571898f
  11. 18 9月, 2012 6 次提交
    • J
      xen-pciback: support wild cards in slot specifications · c3cb4709
      Jan Beulich 提交于
      Particularly for hiding sets of SR-IOV devices, specifying them all
      individually is rather cumbersome. Therefore, allow function and slot
      numbers to be replaced by a wildcard character ('*').
      
      Unfortunately this gets complicated by the in-kernel sscanf()
      implementation not being really standard conformant - matching of
      plain text tails cannot be checked by the caller (a patch to overcome
      this will be sent shortly, and a follow-up patch for simplifying the
      code is planned to be sent when that fixed went upstream).
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c3cb4709
    • K
      xen/swiotlb: Fix compile warnings when using plain integer instead of NULL pointer. · 2a3bce8f
      Konrad Rzeszutek Wilk 提交于
      arch/x86/xen/pci-swiotlb-xen.c:96:1: warning: Using plain integer as NULL pointer
      arch/x86/xen/pci-swiotlb-xen.c:96:1: warning: Using plain integer as NULL pointer
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      2a3bce8f
    • K
      xen/swiotlb: Remove functions not needed anymore. · e815f45e
      Konrad Rzeszutek Wilk 提交于
      Sparse warns us off:
      drivers/xen/swiotlb-xen.c:506:1: warning: symbol 'xen_swiotlb_map_sg' was not declared. Should it be static?
      drivers/xen/swiotlb-xen.c:534:1: warning: symbol 'xen_swiotlb_unmap_sg' was not declared. Should it be static?
      
      and it looks like we do not need this function at all.
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      e815f45e
    • K
      xen/pcifront: Use Xen-SWIOTLB when initting if required. · 3d925320
      Konrad Rzeszutek Wilk 提交于
      We piggyback on "xen/swiotlb: Use the swiotlb_late_init_with_tbl to init
      Xen-SWIOTLB late when PV PCI is used." functionality to start up
      the Xen-SWIOTLB if we are hot-plugged. This allows us to bypass
      the need to supply 'iommu=soft' on the Linux command line (mostly).
      With this patch, if a user forgot 'iommu=soft' on the command line,
      and hotplug a PCI device they will get:
      
      pcifront pci-0: Installing PCI frontend
      Warning: only able to allocate 4 MB for software IO TLB
      software IO TLB [mem 0x2a000000-0x2a3fffff] (4MB) mapped at [ffff88002a000000-ffff88002a3fffff]
      pcifront pci-0: Creating PCI Frontend Bus 0000:00
      pcifront pci-0: PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
      pci_bus 0000:00: root bus resource [mem 0x00000000-0xfffffffff]
      pci 0000:00:00.0: [8086:10d3] type 00 class 0x020000
      pci 0000:00:00.0: reg 10: [mem 0xfe5c0000-0xfe5dffff]
      pci 0000:00:00.0: reg 14: [mem 0xfe500000-0xfe57ffff]
      pci 0000:00:00.0: reg 18: [io  0xe000-0xe01f]
      pci 0000:00:00.0: reg 1c: [mem 0xfe5e0000-0xfe5e3fff]
      pcifront pci-0: claiming resource 0000:00:00.0/0
      pcifront pci-0: claiming resource 0000:00:00.0/1
      pcifront pci-0: claiming resource 0000:00:00.0/2
      pcifront pci-0: claiming resource 0000:00:00.0/3
      e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
      e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
      e1000e 0000:00:00.0: Disabling ASPM L0s L1
      e1000e 0000:00:00.0: enabling device (0000 -> 0002)
      e1000e 0000:00:00.0: Xen PCI mapped GSI16 to IRQ34
      e1000e 0000:00:00.0: (unregistered net_device): Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
      e1000e 0000:00:00.0: eth0: (PCI Express:2.5GT/s:Width x1) 00:1b:21:ab:c6:13
      e1000e 0000:00:00.0: eth0: Intel(R) PRO/1000 Network Connection
      e1000e 0000:00:00.0: eth0: MAC: 3, PHY: 8, PBA No: E46981-005
      
      The "Warning only" will go away if one supplies 'iommu=soft' instead
      as we have a higher chance of being able to allocate large swaths of
      memory.
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      3d925320
    • K
      xen/swiotlb: For early initialization, return zero on success. · c468bdee
      Konrad Rzeszutek Wilk 提交于
      If everything is setup properly we would return -ENOMEM since
      rc by default is set to that value. Lets not do that and return
      a proper return code.
      
      Note: The reason the early code needs this special treatment
      is that it SWIOTLB library call does not return anything (and
      had it failed it would call panic()) - but our function does.
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c468bdee
    • K
      xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used. · b8277600
      Konrad Rzeszutek Wilk 提交于
      With this patch we provide the functionality to initialize the
      Xen-SWIOTLB late in the bootup cycle - specifically for
      Xen PCI-frontend. We still will work if the user had
      supplied 'iommu=soft' on the Linux command line.
      
      Note: We cannot depend on after_bootmem to automatically
      determine whether this is early or not. This is because
      when PCI IOMMUs are initialized it is after after_bootmem but
      before a lot of "other" subsystems are initialized.
      
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      [v1: Fix smatch warnings]
      [v2: Added check for xen_swiotlb]
      [v3: Rebased with new xen-swiotlb changes]
      [v4: squashed xen/swiotlb: Depending on after_bootmem is not correct in]
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b8277600
  12. 17 9月, 2012 3 次提交
  13. 14 9月, 2012 2 次提交
  14. 12 9月, 2012 1 次提交
    • K
      Merge branch 'stable/128gb.v5.1' into stable/for-linus-3.7 · 98104c34
      Konrad Rzeszutek Wilk 提交于
      * stable/128gb.v5.1:
        xen/mmu: If the revector fails, don't attempt to revector anything else.
        xen/p2m: When revectoring deal with holes in the P2M array.
        xen/mmu: Release just the MFN list, not MFN list and part of pagetables.
        xen/mmu: Remove from __ka space PMD entries for pagetables.
        xen/mmu: Copy and revector the P2M tree.
        xen/p2m: Add logic to revector a P2M tree to use __va leafs.
        xen/mmu: Recycle the Xen provided L4, L3, and L2 pages
        xen/mmu: For 64-bit do not call xen_map_identity_early
        xen/mmu: use copy_page instead of memcpy.
        xen/mmu: Provide comments describing the _ka and _va aliasing issue
        xen/mmu: The xen_setup_kernel_pagetable doesn't need to return anything.
        Revert "xen/x86: Workaround 64-bit hypervisor and 32-bit initial domain." and "xen/x86: Use memblock_reserve for sensitive areas."
        xen/x86: Workaround 64-bit hypervisor and 32-bit initial domain.
        xen/x86: Use memblock_reserve for sensitive areas.
        xen/p2m: Fix the comment describing the P2M tree.
      
      Conflicts:
      	arch/x86/xen/mmu.c
      
      The pagetable_init is the old xen_pagetable_setup_done and xen_pagetable_setup_start
      rolled in one.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      98104c34