aboutsummaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2009-01-03AMD IOMMU: allocate a new protection for hotplugged devicesJoerg Roedel
Impact: also hotplug devices benefit from device isolation Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add a domain flag for default domainsJoerg Roedel
Impact: adds a new protection domain flag Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: register functions for the IOMMU APIJoerg Roedel
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain address lookup function for IOMMU APIJoerg Roedel
Impact: add a generic function to lockup addresses in protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain unmap function for IOMMU APIJoerg Roedel
Impact: add a generic function to unmap pages into protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain map function for IOMMU APIJoerg Roedel
Impact: add a generic function to map pages into protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add device attach function for IOMMU APIJoerg Roedel
Impact: add a generic function to attach devices to protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add device detach function for IOMMU APIJoerg Roedel
Impact: add a generic function to detach devices from protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain destroy function for IOMMU APIJoerg Roedel
Impact: add a generic function for releasing protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain init function for IOMMU APIJoerg Roedel
Impact: add a generic function for allocation protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain cleanup helper functionJoerg Roedel
Impact: add a function to remove all devices from a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add device notifier callbackJoerg Roedel
Impact: inform IOMMU about state change of a device in the driver core Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add device detach helper functionsJoerg Roedel
Impact: add helper functions to detach a device from a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: rename set_device_domain functionJoerg Roedel
Impact: rename set_device_domain() to attach_device() Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add device reference counting for protection domainsJoerg Roedel
Impact: know how many devices are assigned to a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add checks for dma_ops domain to dma_ops functionsJoerg Roedel
Impact: detect when a driver uses a device assigned otherwise Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add protection domain flagsJoerg Roedel
Imapct: add a new struct member to 'struct protection_domain' When using protection domains for dma_ops and KVM its better to know for which subsystem it was allocated. Add a flags member to struct protection domain for that purpose. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add iommu_flush_domain functionJoerg Roedel
Impact: add a function to flush a domain id on every IOMMU Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: don't remove protection domain from iommu_pd_listJoerg Roedel
Impact: save unneeded logic to add and remove domains to the list The removal of a protection domain from the iommu_pd_list is not necessary. Another benefit is that we save complexity because we don't have to readd it later when the device no longer uses the domain. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: move invalidation command building to a separate functionJoerg Roedel
Impact: refactoring of iommu_queue_inv_iommu_pages Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: refactor completion wait handling into separate functionsJoerg Roedel
Impact: split one function into three The separate functions are required synchronize commands across all hardware IOMMUs in the system. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: add domain id free functionJoerg Roedel
Impact: add code to release a domain id Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: make dma_ops_free_pagetable genericJoerg Roedel
Impact: change code to free pagetables from protection domains The dma_ops_free_pagetable function can only free pagetables from dma_ops domains. Change that to free pagetables of pure protection domains. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-03AMD IOMMU: rename iommu_map to iommu_map_pageJoerg Roedel
Impact: function rename The iommu_map function maps only one page. Make this clear in the function name. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2009-01-02Merge branch 'cpus4096-for-linus-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits) x86: export vector_used_by_percpu_irq x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and() sched: nominate preferred wakeup cpu, fix x86: fix lguest used_vectors breakage, -v2 x86: fix warning in arch/x86/kernel/io_apic.c sched: fix warning in kernel/sched.c sched: move test_sd_parent() to an SMP section of sched.h sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0 sched: activate active load balancing in new idle cpus sched: bias task wakeups to preferred semi-idle packages sched: nominate preferred wakeup cpu sched: favour lower logical cpu number for sched_mc balance sched: framework for sched_mc/smt_power_savings=N sched: convert BALANCE_FOR_xx_POWER to inline functions x86: use possible_cpus=NUM to extend the possible cpus allowed x86: fix cpu_mask_to_apicid_and to include cpu_online_mask x86: update io_apic.c to the new cpumask code x86: Introduce topology_core_cpumask()/topology_thread_cpumask() x86: xen: use smp_call_function_many() x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c ... Fixed up trivial conflict in kernel/time/tick-sched.c manually
2009-01-02Merge branch 'kvm-updates/2.6.29' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm * 'kvm-updates/2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (140 commits) KVM: MMU: handle large host sptes on invlpg/resync KVM: Add locking to virtual i8259 interrupt controller KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared MAINTAINERS: Maintainership changes for kvm/ia64 KVM: ia64: Fix kvm_arch_vcpu_ioctl_[gs]et_regs() KVM: x86: Rework user space NMI injection as KVM_CAP_USER_NMI KVM: VMX: Fix pending NMI-vs.-IRQ race for user space irqchip KVM: fix handling of ACK from shared guest IRQ KVM: MMU: check for present pdptr shadow page in walk_shadow KVM: Consolidate userspace memory capability reporting into common code KVM: Advertise the bug in memory region destruction as fixed KVM: use cpumask_var_t for cpus_hardware_enabled KVM: use modern cpumask primitives, no cpumask_t on stack KVM: Extract core of kvm_flush_remote_tlbs/kvm_reload_remote_mmus KVM: set owner of cpu and vm file operations anon_inodes: use fops->owner for module refcount x86: KVM guest: kvm_get_tsc_khz: return khz, not lpj KVM: MMU: prepopulate the shadow on invlpg KVM: MMU: skip global pgtables on sync due to cr3 switch KVM: MMU: collapse remote TLB flushes on root sync ...
2009-01-02Fix compiler warning in arch/x86/mm/init_32.cIngo Brueckl
Signed-off-by: Ingo Brueckl <ib@wupperonline.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-31Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (34 commits) nfsd race fixes: jfs nfsd race fixes: reiserfs nfsd race fixes: ext4 nfsd race fixes: ext3 nfsd race fixes: ext2 nfsd/create race fixes, infrastructure filesystem notification: create fs/notify to contain all fs notification fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization kill ->dir_notify() filp_cachep can be static in fs/file_table.c fix f_count description in Documentation/filesystems/files.txt make INIT_FS use the __RW_LOCK_UNLOCKED initialization take init_fs to saner place kill vfs_permission pass a struct path * to may_open kill walk_init_root remove incorrect comment in inode_permission expand some comments (d_path / seq_path) correct wrong function name of d_put in kernel document and source comment fix switch_names() breakage in short-to-short case ...
2008-12-31take init_fs to saner placeAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-12-31shrink struct dentryNick Piggin
struct dentry is one of the most critical structures in the kernel. So it's sad to see it going neglected. With CONFIG_PROFILING turned on (which is probably the common case at least for distros and kernel developers), sizeof(struct dcache) == 208 here (64-bit). This gives 19 objects per slab. I packed d_mounted into a hole, and took another 4 bytes off the inline name length to take the padding out from the end of the structure. This shinks it to 200 bytes. I could have gone the other way and increased the length to 40, but I'm aiming for a magic number, read on... I then got rid of the d_cookie pointer. This shrinks it to 192 bytes. Rant: why was this ever a good idea? The cookie system should increase its hash size or use a tree or something if lookups are a problem. Also the "fast dcookie lookups" in oprofile should be moved into the dcookie code -- how can oprofile possibly care about the dcookie_mutex? It gets dropped after get_dcookie() returns so it can't be providing any sort of protection. At 192 bytes, 21 objects fit into a 4K page, saving about 3MB on my system with ~140 000 entries allocated. 192 is also a multiple of 64, so we get nice cacheline alignment on 64 and 32 byte line systems -- any given dentry will now require 3 cachelines to touch all fields wheras previously it would require 4. I know the inline name size was chosen quite carefully, however with the reduction in cacheline footprint, it should actually be just about as fast to do a name lookup for a 36 character name as it was before the patch (and faster for other sizes). The memory footprint savings for names which are <= 32 or > 36 bytes long should more than make up for the memory cost for 33-36 byte names. Performance is a feature... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-12-31Merge branch 'irq-fixes-for-linus-4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sparseirq: move __weak symbols into separate compilation unit sparseirq: work around __weak alias bug sparseirq: fix hang with !SPARSE_IRQ sparseirq: set lock_class for legacy irq when sparse_irq is selected sparseirq: work around compiler optimizing away __weak functions sparseirq: fix desc->lock init sparseirq: do not printk when migrating IRQ descriptors sparseirq: remove duplicated arch_early_irq_init() irq: simplify for_each_irq_desc() usage proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c irq: for_each_irq_desc() move to irqnr.h hrtimer: remove #include <linux/irq.h>
2008-12-31KVM: MMU: handle large host sptes on invlpg/resyncMarcelo Tosatti
The invlpg and sync walkers lack knowledge of large host sptes, descending to non-existant pagetable level. Stop at directory level in such case. Fixes SMP Windows XP with hugepages. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Add locking to virtual i8259 interrupt controllerAvi Kivity
While most accesses to the i8259 are with the kvm mutex taken, the call to kvm_pic_read_irq() is not. We can't easily take the kvm mutex there since the function is called with interrupts disabled. Fix by adding a spinlock to the virtual interrupt controller. Since we can't send an IPI under the spinlock (we also take the same spinlock in an irq disabled context), we defer the IPI until the spinlock is released. Similarly, we defer irq ack notifications until after spinlock release to avoid lock recursion. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: Don't treat a global pte as such if cr4.pge is clearedAvi Kivity
The pte.g bit is meaningless if global pages are disabled; deferring mmu page synchronization on these ptes will lead to the guest using stale shadow ptes. Fixes Vista x86 smp bootloader failure. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: ia64: Fix kvm_arch_vcpu_ioctl_[gs]et_regs()Jes Sorensen
Fix kvm_arch_vcpu_ioctl_[gs]et_regs() to do something meaningful on ia64. Old versions could never have worked since they required pointers to be set in the ioctl payload which were never being set by the ioctl handler for get_regs. In addition reserve extra space for future extensions. The change of layout of struct kvm_regs doesn't require adding a new CAP since get/set regs never worked on ia64 until now. This version doesn't support copying the KVM kernel stack in/out of the kernel. This should be implemented in a seperate ioctl call if ever needed. Signed-off-by: Jes Sorensen <jes@sgi.com> Acked-by : Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86: Rework user space NMI injection as KVM_CAP_USER_NMIJan Kiszka
There is no point in doing the ready_for_nmi_injection/ request_nmi_window dance with user space. First, we don't do this for in-kernel irqchip anyway, while the code path is the same as for user space irqchip mode. And second, there is nothing to loose if a pending NMI is overwritten by another one (in contrast to IRQs where we have to save the number). Actually, there is even the risk of raising spurious NMIs this way because the reason for the held-back NMI might already be handled while processing the first one. Therefore this patch creates a simplified user space NMI injection interface, exporting it under KVM_CAP_USER_NMI and dropping the old KVM_CAP_NMI capability. And this time we also take care to provide the interface only on archs supporting NMIs via KVM (right now only x86). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: VMX: Fix pending NMI-vs.-IRQ race for user space irqchipJan Kiszka
As with the kernel irqchip, don't allow an NMI to stomp over an already injected IRQ; instead wait for the IRQ injection to be completed. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: check for present pdptr shadow page in walk_shadowMarcelo Tosatti
walk_shadow assumes the caller verified validity of the pdptr pointer in question, which is not the case for the invlpg handler. Fixes oops during Solaris 10 install. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: Consolidate userspace memory capability reporting into common codeAvi Kivity
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31x86: KVM guest: kvm_get_tsc_khz: return khz, not lpjEduardo Habkost
kvm_get_tsc_khz() currently returns the previously-calculated preset_lpj value, but it is in loops-per-jiffy, not kHz. The current code works correctly only when HZ=1000. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: prepopulate the shadow on invlpgMarcelo Tosatti
If the guest executes invlpg, peek into the pagetable and attempt to prepopulate the shadow entry. Also stop dirty fault updates from interfering with the fork detector. 2% improvement on RHEL3/AIM7. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: skip global pgtables on sync due to cr3 switchMarcelo Tosatti
Skip syncing global pages on cr3 switch (but not on cr4/cr0). This is important for Linux 32-bit guests with PAE, where the kmap page is marked as global. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: collapse remote TLB flushes on root syncMarcelo Tosatti
Collapse remote TLB flushes on root sync. kernbench is 2.7% faster on 4-way guest. Improvements have been seen with other loads such as AIM7. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: MMU: use page array in unsync walkMarcelo Tosatti
Instead of invoking the handler directly collect pages into an array so the caller can work with it. Simplifies TLB flush collapsing. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: Fix handling of VMMCALL instructionAmit Shah
The VMMCALL instruction doesn't get recognised and isn't processed by the emulator. This is seen on an Intel host that tries to execute the VMMCALL instruction after a guest live migrates from an AMD host. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: add the emulation of shld and shrd instructionsGuillaume Thouvenin
Add emulation of shld and shrd instructions Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: add the assembler code for three operandsGuillaume Thouvenin
Add the assembler code for instruction with three operands and one operand is stored in ECX register Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: add a new "implied 1" Src decode typeGuillaume Thouvenin
Add SrcOne operand type when we need to decode an implied '1' like with regular shift instruction Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: add Src2 decode setGuillaume Thouvenin
Instruction like shld has three operands, so we need to add a Src2 decode set. We start with Src2None, Src2CL, and Src2ImmByte, Src2One to support shld/shrd and we will expand it later. Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31KVM: x86 emulator: Extend the opcode descriptorGuillaume Thouvenin
Extend the opcode descriptor to 32 bits. This is needed by the introduction of a new Src2 operand type. Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@redhat.com>