1. 15 1月, 2009 1 次提交
  2. 08 1月, 2009 6 次提交
  3. 07 1月, 2009 3 次提交
  4. 01 1月, 2009 1 次提交
  5. 31 12月, 2008 18 次提交
    • H
      KVM: ppc: mostly cosmetic updates to the exit timing accounting code · 7b701591
      Hollis Blanchard 提交于
      The only significant changes were to kvmppc_exit_timing_write() and
      kvmppc_exit_timing_show(), both of which were dramatically simplified.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      7b701591
    • H
      KVM: ppc: Implement in-kernel exit timing statistics · 73e75b41
      Hollis Blanchard 提交于
      Existing KVM statistics are either just counters (kvm_stat) reported for
      KVM generally or trace based aproaches like kvm_trace.
      For KVM on powerpc we had the need to track the timings of the different exit
      types. While this could be achieved parsing data created with a kvm_trace
      extension this adds too much overhead (at least on embedded PowerPC) slowing
      down the workloads we wanted to measure.
      
      Therefore this patch adds a in-kernel exit timing statistic to the powerpc kvm
      code. These statistic is available per vm&vcpu under the kvm debugfs directory.
      As this statistic is low, but still some overhead it can be enabled via a
      .config entry and should be off by default.
      
      Since this patch touched all powerpc kvm_stat code anyway this code is now
      merged and simplified together with the exit timing statistic code (still
      working with exit timing disabled in .config).
      Signed-off-by: NChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      73e75b41
    • H
      KVM: ppc: save and restore guest mappings on context switch · c5fbdffb
      Hollis Blanchard 提交于
      Store shadow TLB entries in memory, but only use it on host context switch
      (instead of every guest entry). This improves performance for most workloads on
      440 by reducing the guest TLB miss rate.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      c5fbdffb
    • H
      KVM: ppc: directly insert shadow mappings into the hardware TLB · 7924bd41
      Hollis Blanchard 提交于
      Formerly, we used to maintain a per-vcpu shadow TLB and on every entry to the
      guest would load this array into the hardware TLB. This consumed 1280 bytes of
      memory (64 entries of 16 bytes plus a struct page pointer each), and also
      required some assembly to loop over the array on every entry.
      
      Instead of saving a copy in memory, we can just store shadow mappings directly
      into the hardware TLB, accepting that the host kernel will clobber these as
      part of the normal 440 TLB round robin. When we do that we need less than half
      the memory, and we have decreased the exit handling time for all guest exits,
      at the cost of increased number of TLB misses because the host overwrites some
      guest entries.
      
      These savings will be increased on processors with larger TLBs or which
      implement intelligent flush instructions like tlbivax (which will avoid the
      need to walk arrays in software).
      
      In addition to that and to the code simplification, we have a greater chance of
      leaving other host userspace mappings in the TLB, instead of forcing all
      subsequent tasks to re-fault all their mappings.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      7924bd41
    • H
      powerpc/44x: declare tlb_44x_index for use in C code · c0ca609c
      Hollis Blanchard 提交于
      KVM currently ignores the host's round robin TLB eviction selection, instead
      maintaining its own TLB state and its own round robin index. However, by
      participating in the normal 44x TLB selection, we can drop the alternate TLB
      processing in KVM. This results in a significant performance improvement,
      since that processing currently must be done on *every* guest exit.
      
      Accordingly, KVM needs to be able to access and increment tlb_44x_index.
      (KVM on 440 cannot be a module, so there is no need to export this symbol.)
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Acked-by: NJosh Boyer <jwboyer@linux.vnet.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      c0ca609c
    • H
      KVM: ppc: support large host pages · 89168618
      Hollis Blanchard 提交于
      KVM on 440 has always been able to handle large guest mappings with 4K host
      pages -- we must, since the guest kernel uses 256MB mappings.
      
      This patch makes KVM work when the host has large pages too (tested with 64K).
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      89168618
    • H
      KVM: ppc: fix userspace mapping invalidation on context switch · fe4e771d
      Hollis Blanchard 提交于
      We used to defer invalidating userspace TLB entries until jumping out of the
      kernel. This was causing MMU weirdness most easily triggered by using a pipe in
      the guest, e.g. "dmesg | tail". I believe the problem was that after the guest
      kernel changed the PID (part of context switch), the old process's mappings
      were still present, and so copy_to_user() on the "return to new process" path
      ended up using stale mappings.
      
      Testing with large pages (64K) exposed the problem, probably because with 4K
      pages, pressure on the TLB faulted all process A's mappings out before the
      guest kernel could insert any for process B.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      fe4e771d
    • H
      KVM: ppc: optimize irq delivery path · d4cf3892
      Hollis Blanchard 提交于
      In kvmppc_deliver_interrupt is just one case left in the switch and it is a
      rare one (less than 8%) when looking at the exit numbers. Therefore we can
      at least drop the switch/case and if an if. I inserted an unlikely too, but
      that's open for discussion.
      
      In kvmppc_can_deliver_interrupt all frequent cases are in the default case.
      I know compilers are smart but we can make it easier for them. By writing
      down all options and removing the default case combined with the fact that
      ithe values are constants 0..15 should allow the compiler to write an easy
      jump table.
      Modifying kvmppc_can_deliver_interrupt pointed me to the fact that gcc seems
      to be unable to reduce priority_exception[x] to a build time constant.
      Therefore I changed the usage of the translation arrays in the interrupt
      delivery path completely. It is now using priority without translation to irq
      on the full irq delivery path.
      To be able to do that ivpr regs are stored by their priority now.
      
      Additionally the decision made in kvmppc_can_deliver_interrupt is already
      sufficient to get the value of interrupt_msr_mask[x]. Therefore we can replace
      the 16x4byte array used here with a single 4byte variable (might still be one
      miss, but the chance to find this in cache should be better than the right
      entry of the whole array).
      Signed-off-by: NChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d4cf3892
    • H
      KVM: ppc: adjust vcpu types to support 64-bit cores · 5cf8ca22
      Hollis Blanchard 提交于
      However, some of these fields could be split into separate per-core structures
      in the future.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      5cf8ca22
    • H
      KVM: ppc: create struct kvm_vcpu_44x and introduce container_of() accessor · db93f574
      Hollis Blanchard 提交于
      This patch doesn't yet move all 44x-specific data into the new structure, but
      is the first step down that path. In the future we may also want to create a
      struct kvm_vcpu_booke.
      
      Based on patch from Liu Yu <yu.liu@freescale.com>.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      db93f574
    • H
      KVM: ppc: Move the last bits of 44x code out of booke.c · 5cbb5106
      Hollis Blanchard 提交于
      Needed to port to other Book E processors.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      5cbb5106
    • H
      KVM: ppc: refactor instruction emulation into generic and core-specific pieces · 75f74f0d
      Hollis Blanchard 提交于
      Cores provide 3 emulation hooks, implemented for example in the new
      4xx_emulate.c:
      kvmppc_core_emulate_op
      kvmppc_core_emulate_mtspr
      kvmppc_core_emulate_mfspr
      
      Strictly speaking the last two aren't necessary, but provide for more
      informative error reporting ("unknown SPR").
      
      Long term I'd like to have instruction decoding autogenerated from tables of
      opcodes, and that way we could aggregate universal, Book E, and core-specific
      instructions more easily and without redundant switch statements.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      75f74f0d
    • H
      ppc: Create disassemble.h to extract instruction fields · c381a043
      Hollis Blanchard 提交于
      This is used in a couple places in KVM, but isn't KVM-specific.
      
      However, this patch doesn't modify other in-kernel emulation code:
      - xmon uses a direct copy of ppc_opc.c from binutils
      - emulate_instruction() doesn't need it because it can use a series
        of mask tests.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      c381a043
    • H
      KVM: ppc: Refactor powerpc.c to relocate 440-specific code · 9dd921cf
      Hollis Blanchard 提交于
      This introduces a set of core-provided hooks. For 440, some of these are
      implemented by booke.c, with the rest in (the new) 44x.c.
      
      Note that these hooks are link-time, not run-time. Since it is not possible to
      build a single kernel for both e500 and 440 (for example), using function
      pointers would only add overhead.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      9dd921cf
    • H
      KVM: ppc: Rename "struct tlbe" to "struct kvmppc_44x_tlbe" · 0f55dc48
      Hollis Blanchard 提交于
      This will ease ports to other cores.
      
      Also remove unused "struct kvm_tlb" while we're at it.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      0f55dc48
    • H
      KVM: ppc: Move 440-specific TLB code into 44x_tlb.c · a0d7b9f2
      Hollis Blanchard 提交于
      This will make it easier to provide implementations for other cores.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      a0d7b9f2
    • A
      powerpc/qe: Fix few build errors with CONFIG_QUICC_ENGINE=n · be11d3b3
      Anton Vorontsov 提交于
      Some 83xx boards were not ready for the optional QUICC Engine support.
      
      This patch fixes following build errors:
      
      arch/powerpc/platforms/built-in.o: In function `flush_disable_caches':
      (.text+0xb308): undefined reference to `par_io_data_set'
      arch/powerpc/platforms/built-in.o: In function `flush_disable_caches':
      (.text+0xb334): undefined reference to `par_io_data_set'
      arch/powerpc/platforms/built-in.o: In function `flush_disable_caches':
      (.text+0xb408): undefined reference to `qe_ic_get_high_irq'
      arch/powerpc/platforms/built-in.o: In function `flush_disable_caches':
      (.text+0xb478): undefined reference to `qe_ic_get_low_irq'
      arch/powerpc/platforms/built-in.o: In function `mpc832x_spi_init':
      mpc832x_rdb.c:(.init.text+0x574c): undefined reference to `par_io_config_pin'
      mpc832x_rdb.c:(.init.text+0x5768): undefined reference to `par_io_config_pin'
      mpc832x_rdb.c:(.init.text+0x5784): undefined reference to `par_io_config_pin'
      mpc832x_rdb.c:(.init.text+0x57a0): undefined reference to `par_io_config_pin'
      mpc832x_rdb.c:(.init.text+0x57bc): undefined reference to `par_io_config_pin'
      arch/powerpc/platforms/built-in.o:mpc832x_rdb.c:(.init.text+0x57d8): more undefined references to `par_io_config_pin' follow
      arch/powerpc/platforms/built-in.o: In function `mpc836x_rdk_init_IRQ':
      mpc836x_rdk.c:(.init.text+0x5e84): undefined reference to `qe_ic_init'
      arch/powerpc/platforms/built-in.o: In function `mpc836x_rdk_setup_arch':
      mpc836x_rdk.c:(.init.text+0x5f10): undefined reference to `qe_reset'
      make: *** [.tmp_vmlinux1] Error 1
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      be11d3b3
    • A
      powerpc/qe: Implement QE Pin Multiplexing API · 1b9e8904
      Anton Vorontsov 提交于
      With this API we're able to set a QE pin to the GPIO mode or a dedicated
      peripheral function.
      
      The API relies on the fact that QE gpio controllers are registered. If
      they aren't, the API won't work (gracefully though).
      
      There is one caveat though: if anybody occupied the node->data before us,
      or overwrote it, then bad things will happen. Luckily this is all in the
      platform code that we fully control, so this should never happen.
      
      I could implement more checks (for example we could create a list of
      successfully registered QE controllers, and compare the node->data in the
      qe_pin_request()), but this is unneeded if nobody is going to do silly
      things behind our back.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      1b9e8904
  6. 29 12月, 2008 1 次提交
  7. 26 12月, 2008 1 次提交
  8. 25 12月, 2008 1 次提交
    • M
      [S390] arch_setup_additional_pages arguments · fc5243d9
      Martin Schwidefsky 提交于
      arch_setup_additional_pages currently gets two arguments, the binary
      format descripton and an indication if the process uses an executable
      stack or not. The second argument is not used by anybody, it could
      be removed without replacement.
      
      What actually does make sense is to pass an indication if the process
      uses the elf interpreter or not. The glibc code will not use anything
      from the vdso if the process does not use the dynamic linker, so for
      statically linked binaries the architecture backend can choose not
      to map the vdso.
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      fc5243d9
  9. 23 12月, 2008 4 次提交
  10. 21 12月, 2008 4 次提交