1. 12 1月, 2011 1 次提交
  2. 11 1月, 2011 1 次提交
    • J
      powerpc/pseries: Fix VPHN build errors on non-SMP systems · 39bf990e
      Jesse Larrew 提交于
      The header asm/hvcall.h was previously included indirectly via
      smp.h. On non-SMP systems, however, these declarations are excluded
      and the build breaks. This is easily fixed by including asm/hvcall.h
      directly.
      
      The VPHN feature is only meaningful on NUMA systems that implement
      the SPLPAR option, so exclude the VPHN code on systems without
      SPLPAR enabled.
      
      Also, expose unmap_cpu_from_node() on systems with SPLPAR enabled,
      even if CONFIG_HOTPLUG_CPU is disabled.
      
      Lastly, map_cpu_to_node() is now needed by VPHN to manipulate the
      node masks after boot time, so remove the __cpuinit annotation to
      fix a section mismatch.
      Signed-off-by: NJesse Larrew <jlarrew@linux.vnet.ibm.com>
      39bf990e
  3. 09 12月, 2010 5 次提交
  4. 30 11月, 2010 2 次提交
  5. 29 11月, 2010 7 次提交
  6. 30 10月, 2010 1 次提交
  7. 28 10月, 2010 1 次提交
  8. 27 10月, 2010 2 次提交
    • P
      mm: remove pte_*map_nested() · ece0e2b6
      Peter Zijlstra 提交于
      Since we no longer need to provide KM_type, the whole pte_*map_nested()
      API is now redundant, remove it.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NChris Metcalf <cmetcalf@tilera.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ece0e2b6
    • P
      mm: stack based kmap_atomic() · 3e4d3af5
      Peter Zijlstra 提交于
      Keep the current interface but ignore the KM_type and use a stack based
      approach.
      
      The advantage is that we get rid of crappy code like:
      
      	#define __KM_PTE			\
      		(in_nmi() ? KM_NMI_PTE : 	\
      		 in_irq() ? KM_IRQ_PTE :	\
      		 KM_PTE0)
      
      and in general can stop worrying about what context we're in and what kmap
      slots might be appropriate for that.
      
      The downside is that FRV kmap_atomic() gets more expensive.
      
      For now we use a CPP trick suggested by Andrew:
      
        #define kmap_atomic(page, args...) __kmap_atomic(page)
      
      to avoid having to touch all kmap_atomic() users in a single patch.
      
      [ not compiled on:
        - mn10300: the arch doesn't actually build with highmem to begin with ]
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: fix up drivers/gpu/drm/i915/intel_overlay.c]
      Acked-by: NRik van Riel <riel@redhat.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NChris Metcalf <cmetcalf@tilera.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3e4d3af5
  9. 25 10月, 2010 2 次提交
  10. 24 10月, 2010 18 次提交
    • A
      KVM: PPC: Move of include to __KERNEL__ section · 26e673c3
      Alexander Graf 提交于
      We have to protect the include for linux/of.h by __KERNEL__ so it doesn't
      accidently get referenced outside.
      
      This patch fixes this and makes the tree compile again.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      26e673c3
    • A
      KVM: PPC: Implement Level interrupts on Book3S · 17bd1580
      Alexander Graf 提交于
      The current interrupt logic is just completely broken. We get a notification
      from user space, telling us that an interrupt is there. But then user space
      expects us that we just acknowledge an interrupt once we deliver it to the
      guest.
      
      This is not how real hardware works though. On real hardware, the interrupt
      controller pulls the external interrupt line until it gets notified that the
      interrupt was received.
      
      So in reality we have two events: pulling and letting go of the interrupt line.
      
      To maintain backwards compatibility, I added a new request for the pulling
      part. The letting go part was implemented earlier already.
      
      With this in place, we can now finally start guests that do not randomly stall
      and stop to work at random times.
      
      This patch implements above logic for Book3S.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      17bd1580
    • A
      KVM: PPC: Implement correct SID mapping on Book3s_32 · 8b6db3bc
      Alexander Graf 提交于
      Up until now we were doing segment mappings wrong on Book3s_32. For Book3s_64
      we were using a trick where we know that a single mmu_context gives us 16 bits
      of context ids.
      
      The mm system on Book3s_32 instead uses a clever algorithm to distribute VSIDs
      across the available range, so a context id really only gives us 16 available
      VSIDs.
      
      To keep at least a few guest processes in the SID shadow, let's map a number of
      contexts that we can use as VSID pool. This makes the code be actually correct
      and shouldn't hurt performance too much.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8b6db3bc
    • A
      KVM: PPC: Put segment registers in shared page · df1bfa25
      Alexander Graf 提交于
      Now that the actual mtsr doesn't do anything anymore, we can move the sr
      contents over to the shared page, so a guest can directly read and write
      its sr contents from guest context.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      df1bfa25
    • A
      KVM: PPC: Interpret SR registers on demand · 8e865178
      Alexander Graf 提交于
      Right now we're examining the contents of Book3s_32's segment registers when
      the register is written and put the interpreted contents into a struct.
      
      There are two reasons this is bad. For starters, the struct has worse real-time
      performance, as it occupies more ram. But the more important part is that with
      segment registers being interpreted from their raw values, we can put them in
      the shared page, allowing guests to mess with them directly.
      
      This patch makes the internal representation of SRs be u32s.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8e865178
    • A
      KVM: PPC: Add feature bitmap for magic page · 7508e16c
      Alexander Graf 提交于
      We will soon add SR PV support to the shared page, so we need some
      infrastructure that allows the guest to query for features KVM exports.
      
      This patch adds a second return value to the magic mapping that
      indicated to the guest which features are available.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      7508e16c
    • A
      KVM: PPC: Make long relocations be ulong · 2b05d71f
      Alexander Graf 提交于
      On Book3S KVM we directly expose some asm pointers to C code as
      variables. These need to be relocated and thus break on relocatable
      kernels.
      
      To make sure we can at least build, let's mark them as long instead
      of u32 where 64bit relocations don't work.
      
      This fixes the following build error:
      
      WARNING: 2 bad relocations^M
      > c000000000008590 R_PPC64_ADDR32    .text+0x4000000000008460^M
      > c000000000008594 R_PPC64_ADDR32    .text+0x4000000000008598^M
      
      Please keep in mind that actually using KVM on a relocated kernel
      might still break. This only fixes the compile problem.
      Reported-by: NSubrata Modak <subrata@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2b05d71f
    • A
      KVM: PPC: Add book3s_32 tlbie flush acceleration · 2d27fc5e
      Alexander Graf 提交于
      On Book3s_32 the tlbie instruction flushed effective addresses by the mask
      0x0ffff000. This is pretty hard to reflect with a hash that hashes ~0xfff, so
      to speed up that target we should also keep a special hash around for it.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2d27fc5e
    • A
      KVM: PPC: RCU'ify the Book3s MMU · 2e0908af
      Alexander Graf 提交于
      So far we've been running all code without locking of any sort. This wasn't
      really an issue because I didn't see any parallel access to the shadow MMU
      code coming.
      
      But then I started to implement dirty bitmapping to MOL which has the video
      code in its own thread, so suddenly we had the dirty bitmap code run in
      parallel to the shadow mmu code. And with that came trouble.
      
      So I went ahead and made the MMU modifying functions as parallelizable as
      I could think of. I hope I didn't screw up too much RCU logic :-). If you
      know your way around RCU and locking and what needs to be done when, please
      take a look at this patch.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2e0908af
    • A
      KVM: PPC: Expose magic page support to guest · 5fc87407
      Alexander Graf 提交于
      Now that we have the shared page in place and the MMU code knows about
      the magic page, we can expose that capability to the guest!
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      5fc87407
    • A
      KVM: PPC: Magic Page Book3s support · e8508940
      Alexander Graf 提交于
      We need to override EA as well as PA lookups for the magic page. When the guest
      tells us to project it, the magic page overrides any guest mappings.
      
      In order to reflect that, we need to hook into all the MMU layers of KVM to
      force map the magic page if necessary.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      e8508940
    • A
      KVM: PPC: First magic page steps · beb03f14
      Alexander Graf 提交于
      We will be introducing a method to project the shared page in guest context.
      As soon as we're talking about this coupling, the shared page is colled magic
      page.
      
      This patch introduces simple defines, so the follow-up patches are easier to
      read.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      beb03f14
    • A
      KVM: PPC: Make PAM a define · 28e83b4f
      Alexander Graf 提交于
      On PowerPC it's very normal to not support all of the physical RAM in real mode.
      To check if we're matching on the shared page or not, we need to know the limits
      so we can restrain ourselves to that range.
      
      So let's make it a define instead of open-coding it. And while at it, let's also
      increase it.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      
      v2 -> v3:
      
        - RMO -> PAM (non-magic page)
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      28e83b4f
    • A
      KVM: PPC: Tell guest about pending interrupts · 90bba358
      Alexander Graf 提交于
      When the guest turns on interrupts again, it needs to know if we have an
      interrupt pending for it. Because if so, it should rather get out of guest
      context and get the interrupt.
      
      So we introduce a new field in the shared page that we use to tell the guest
      that there's a pending interrupt lying around.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      90bba358
    • A
      KVM: PPC: Add PV guest scratch registers · fad93fe1
      Alexander Graf 提交于
      While running in hooked code we need to store register contents out because
      we must not clobber any registers.
      
      So let's add some fields to the shared page we can just happily write to.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      fad93fe1
    • A
      KVM: PPC: Add PV guest critical sections · 5c6cedf4
      Alexander Graf 提交于
      When running in hooked code we need a way to disable interrupts without
      clobbering any interrupts or exiting out to the hypervisor.
      
      To achieve this, we have an additional critical field in the shared page. If
      that field is equal to the r1 register of the guest, it tells the hypervisor
      that we're in such a critical section and thus may not receive any interrupts.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      5c6cedf4
    • A
      KVM: PPC: Implement hypervisor interface · 2a342ed5
      Alexander Graf 提交于
      To communicate with KVM directly we need to plumb some sort of interface
      between the guest and KVM. Usually those interfaces use hypercalls.
      
      This hypercall implementation is described in the last patch of the series
      in a special documentation file. Please read that for further information.
      
      This patch implements stubs to handle KVM PPC hypercalls on the host and
      guest side alike.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2a342ed5
    • A
      KVM: PPC: Convert SPRG[0-4] to shared page · a73a9599
      Alexander Graf 提交于
      When in kernel mode there are 4 additional registers available that are
      simple data storage. Instead of exiting to the hypervisor to read and
      write those, we can just share them with the guest using the page.
      
      This patch converts all users of the current field to the shared page.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      a73a9599