summaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)AuthorFilesLines
2009-10-29fix kbuild for kvm_trace casesyaniv1-0/+19
2009-10-26fix older kernel buildYaniv Kamay2-3/+2
2009-10-26vdesktop: add new kernel dirIzik Eidus48-0/+6276
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-10-26vdesktop: remove kernel dirIzik Eidus42-7008/+0
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-09-24fix build on f11Yaniv Kamay2-5/+2
2009-07-22Use pci_reset_function() in RHEL5.4 so FLR done properly (v2)Don Dutile1-0/+2
Currently on RHEL5.4, libvirt's PCI device assignment code skips performing a set of PCI config cycle operations to perform a Function Level Reset (FLR) if it detects (reads PCI config hdr fields) that a PCIe device supports FLR -- libvirt assumes KVM will call the kernel's PCI support to do an FLR to a device that supports it when KVM does device assignment and deassignment to/from a FV guest. Well, as the previous BZ, 510805, just added FLR into RHEL5.4, without this patch, if a PCIe FLR device is given or taken away from a FV guest, it is not properly reset. This can cause odd system behavior.... like crashing the host... if the device is not quiesced properly by the guest OS driver on startup or shutdown. The simple fix is to conditionally compile *out* the pci_reset_function() that is stubbed to do nothing in KVM's kernel/external-module-compat-comm.h if the kernel is < 2.6.28 (when pci_reset_function() was introduced), and it's RHEL5.4 or higher. Simple backport of what Chris Wright gave me a few weeks ago, but backported to latest head of git tree (38a1e6fb3293f47698209077a8d4907d7b8e7685). Testing: Chris Wright tested his kvm modules with this patch included along with a brew-built RHEL5.4 kernel I provided with FLR support (pci_reset_function()) that also had additional trace points (printk's) to ensure the proper code flows were exec'd for FLR & non-FLR devices. [It was printk's or a really *snappy* 2.5Gbit PCIe analyzer to decode PCI config cycle writes, link reset transitions, etc. ... ah, the good ole days...] Mark McLoughlin wrote: >> #endif >> >> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) >> +#if defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,4) > > Should be > > #if !defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,4) > > Very minor issue, I know > > Cheers, > Mark. > Based on above feedback as well as Eduardo's, attached is more correct patch for upstream & RHEL5. Please review & ACK this V2 update (esp. if you ack'd the first version). - Don Message-ID: <4A5F6D27.8070701@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 510806 RH-Upstream-status: pending Obsoletes: <4A5E2CD6.8010006@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Mark McLoughlin <markmc@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Chris Wright <chrisw@redhat.com>
2009-07-13KSM suspend fixAndrea Arcangeli1-1/+2
Can somebody with a laptop with functional suspend to ram test the below? This was reported on #kvm on irc. Against kvm-userland-rhel5. ------ this add try_to_freeze() call to the ksm thread control function to allow suspend. Signed-off-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-ID: <20090623161610.GA4379@random.random> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 505440 RH-Upstream-status: pending Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com>
2009-07-10fix bug #506375Izik Eidus1-1/+3
This patch fix bug #506375 by adding cond_resched() >From a0d889214acdafe1673f3afa4985600e345b0684 Mon Sep 17 00:00:00 2001 From: Izik Eidus <ieidus@redhat.com> Date: Wed, 17 Jun 2009 01:15:55 -0400 Subject: [PATCH] ksm: fix bug #506375 - add cond_resched() This patch fix bug #506375 by adding cond_resched() Thanks. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-ID: <4A4A2CA8.1040403@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 506375 RH-Upstream-status: not-applicable Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Glauber Costa <glommer@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
2009-06-08KSM: avoid losing (but no mem leak) rmap_items inside ksm data strcturesIzik Eidus1-3/+4
The implication of this should be minor (worst case is to lose visibility on some pages in stable tree, no crash, no memleak, just no merging of pages). The tree_item->rmap_item is the head of the list and as such it must not be overwritten except in the case that the element we removed (rmap_item) was the previous head of the list, in which case it would also have rmap_item->prev set to null. This was only found by reading source while fixing the crash with slab debug enabled. For rhev/master and rhel5/master. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: not-applicable Message-Id: <1243894307-17932-5-git-send-email-ieidus@redhat.com> Message-Id: <1244142579-3405-4-git-send-email-ieidus@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Bugzilla: 504237
2009-06-08kvm doesn't build on newer RHEL-5.4 kernels because of ↵john cooper2-1/+18
get_user_pages_fast(), AKA BZ #504047, V2 [Bug fix of prior version where gupf() compat conversion was broken for !rhel5.4] This patch reverts the interim suboptimal work-around for get_user_pages_fast() and smp_send_reschedule() under RHEL5.4 kernels where both symbols are now exported to module linkage (ref: BZ #504038). Test: kernel modules should build successfully and load under a rhel5.4 kernel patched per BZ #504038. Additionally no related external-module-compat symbols should be built into modules nor referenced under a rhel5.4 host, eg: U get_user_pages_fast U smp_send_reschedule Signed-off-by: john cooper <john.cooper@redhat.com> Message-ID: <4A280149.7020807@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 504047 RH-Upstream-status: pending Obsoletes: <4A27182E.2020701@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com> Acked-by: Dor Laor <dlaor@redhat.com>
2009-06-05KSM: avoid usage of free slabed memory. (triggered with slab debugging enabled)Izik Eidus1-6/+10
This avoid crashing with slab debugging enabled by removing a window for memory corruption if freed slab entries are reused before we read the next pointer. For both rhev/master and rhel5/master. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1243894307-17932-6-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: not-applicable Obsoletes: <20090530160728.GD22104@random.random> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Bugzilla: 504237 Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Message-Id: <1244142579-3405-5-git-send-email-ieidus@redhat.com> Acked-by: john cooper <john.cooper@redhat.com>
2009-06-05ksm: remove kprobes usage for rhel 5.4 (v3)Chris Wright2-1/+10
Considering the fact that rhel 5.4 have mmu notifiers support, we dont need the kprobes to handle the notifications to kvm. Leaving the current code as it is - is not a bug, it is just matther of unneeded code that hurt the performence for rhel 5.4 when ksm is loaded (the copy on write performence) (Btw, i have faked here the signeture of Chris, hope he will forgive me :)) Thanks. Message-ID: <20090602002240.GL1494@x200.localdomain> Obsoletes: <1243894307-17932-2-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: not-applicable Acked-by: Izik Eidus <ieidus@redhat.com> Bugzilla: 504237 Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1244142579-3405-2-git-send-email-ieidus@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: john cooper <john.cooper@redhat.com>
2009-06-05KSM: sync ksm and rhel 5.4 gup-fast.Izik Eidus1-2/+13
I just noticed that rhel5.4 recived gup-fast support, so ksm is needing a small change to run safe with it. Thanks. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1243894307-17932-4-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: not-applicable Obsoletes: <4A2169FC.5010405@redhat.com> Bugzilla: 504237 Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Message-Id: <1244142579-3405-3-git-send-email-ieidus@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: john cooper <john.cooper@redhat.com>
2009-06-02ksm ?: remove full swapping support for kvm mmu pages under ovirt (rhel 5.3)Izik Eidus1-1/+1
There is problem with the anon_vma lock, as some times the kprobe run whle this lock is token (swap path) and sometimes it run while it isnt token (page fault path) There are ways to fix this issue, but they tend to be very complicated / risky, condiering the fact that in rhel 5.4 we can swap using mmu notifiers, it better to kick this code as it will reuqire alot of thinking if the fix for it is safe. note: this doesnt effect ksm, ksm pages when they are break are still swappable this code even tougth it was inside wp_notifier.c (belong to ksm) have nothing to do with ksm. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-ID: <4A11BD10.3060905@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: not-applicable Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Bugzilla: 503793
2009-05-28Adjust nr_cpu_ids checkAvi Kivity1-1/+1
nr_cpu_ids was introduced in 2.6.21, not 2.6.28. Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit kvm-kmod: 6fd661219d90ac6f4de69c1175fb9ae47ebe2b0b) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-26-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28Adjust kvm_smp_send_reschedule availabilityJan Kiszka2-4/+8
Also x86_64 before 2.6.26 requires kvm_smp_send_reschedule. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit kvm-kmod: 3d5f90d84d95fb8bbf3b95679bdede589009c1b1) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-25-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28smp_send_reschedule compatMarcelo Tosatti4-2/+60
smp_send_reschedule was exported (via smp_ops) in v2.6.24. Create a compat function which schedules the IPI to keventd context, in case interrupts are disabled, for kernels < 2.6.24. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit kvm-kmod: 629715b550be23a1ce4f921f1c7d99e35bc940a5) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-24-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28nr_cpu_ids compatMarcelo Tosatti1-0/+4
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit kvm-kmod: 72c121a11c4cbd8f5abf6741f2e09fdb2e809011) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-23-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28Fix kvm_request_irq raceChris Wright4-29/+50
Commit "32658734: Fix request_irq() for < 2.6.19" is racy between multiple guests since ioctl is only serialized per guest. Add mutex and serialize kvm_request_irq/kvm_free_irq to avoid race. Also move all this to its own C file to keep from creating per ojbect file private mutexes. Signed-off-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit kvm-kmod: 94fe7506de12dab1a8d6dc563fd5038a0b46f0a9) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498071 Message-Id: <1242950913-30143-3-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Obsoletes: <20090505180853.GI9877@x200.localdomain> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com> Acked-by: Glauber Costa <glommer@redhat.com>
2009-05-28Fix request_irq for < 2.6.19Chris Wright3-6/+28
The irq handler changes (introduced in 2.6.19, not 2.6.20) dropped struct pt_regs from the handler prototype, they are found globally now. This introduces the back compat for older kernels. The handler is just a thin layer which calls the real registered handler (all this to work around a minor little compiler warning ;-) Needed for device assignment on older kernels. Signed-off-by: Chris Wright <chrisw@redhat.com Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit kvm-kmod: 32658734cf540230d4cda11165e565794cc2bfda) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498071 Message-Id: <1242950913-30143-2-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Obsoletes: <20090428191108.GC17091@x200.localdomain> Obsoletes: <20090428191315.GE17091@x200.localdomain> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com> Acked-by: Glauber Costa <glommer@redhat.com>
2009-05-20external module: don't redefine get_user_pages_fast() on RHEL-5.4Chris Wright2-3/+2
* Eduardo Habkost (ehabkost@redhat.com) wrote: > This is needed to build kvm on newer RHEL-5.4 kernels. We need this > acked ASAP, otherwise I won't be able to build a new kvm package for > RHEL-5.4 in time before freeze. Build != insmod...did you test this? Here's what I've been using (because while it is defined, it is NOT exported to modules). Message-ID: <20090520173120.GE26525@x200.localdomain> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 501777 RH-Upstream-status: pending Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-20Revert "external module: don't redefined get_user_pages_fast() on RHEL-5.4"Eduardo Habkost1-1/+1
This reverts commit deace35dca07d923906b79df4cf265e34a49fef2. The patch was broken: it makes the module build, but the built module doesn't load. A new one was submitted by cdub. Bugzilla: 501777
2009-05-20external module: don't redefined get_user_pages_fast() on RHEL-5.4Eduardo Habkost1-1/+1
This is needed to build kvm on newer RHEL-5.4 kernels. We need this acked ASAP, otherwise I won't be able to build a new kvm package for RHEL-5.4 in time before freeze. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-ID: <20090520163202.GP4254@blackpad> Bugzilla: 501777 RH-Upstream-status: pending Acked-by: Markus Armbruster <armbru@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Acked-by: Luiz Capitulino <lcapitul@redhat.com>
2009-05-20kvm: external module: don't conflict w/ phys_addr_tChris Wright1-0/+2
Make sure not to cause duplicate definition for phys_addr_t. RH-Upstream-status: submission pending Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498071 Message-ID: <20090428191137.GD17091@x200.localdomain> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com> Acked-by: Zachary Amsden <zamsden@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
2009-05-20kvm: external module: Fix build for VT-d/AMD IOMMUSheng Yang2-4/+4
The vtd.c has renamed to iommu.c, and config option has changed to CONFIG_IOMMU_API. Notice now the host kernel before 2.6.29 can't work with VT-d due to API changed... At least this patch enabled building with host kernel before 2.6.29 with CONFIG_DMAR. Signed-off-by: Wei Huang <wei.w.huang@intel.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit f4d1fb9baa37ac54414ea21d910937a33d885e9a) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498071 Message-ID: <20090428191045.GB17091@x200.localdomain> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(commit f4d1fb9baa37ac54414ea21d910937a33d885e9a) Acked-by: Don Dutile <ddutile@redhat.com> Acked-by: Zachary Amsden <zamsden@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
2009-05-12fix effective bug - 497042Izik Eidus1-0/+8
this fix effective bug that the virtual address of the second page inside the stable tree was not saved. (this is just effective issue, nothing else) Thanks. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-ID: <49EEBA02.9010706@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> RH-Upstream-status: pending Bugzilla: 500263
2009-05-12ksm: fix Bug 496668 - stabilaty issueIzik Eidus1-5/+9
This is fixed by just running the all is_present_pte() checks under the mmap_sem lock down. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-ID: <49EC9D83.4050702@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: pending Bugzilla: 500263 Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com>
2009-05-12KSM: fix 495350 (effective bug)Izik Eidus1-5/+11
we mark the rmap_item as rmap_item that pointing into stable tree in the unstable_tree_search_insert() case. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1240106904-21687-4-git-send-email-ieidus@redhat.com> RH-Upstream-status: pending Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Bugzilla: 500263
2009-05-12KSM: fix bug 495912Izik Eidus1-3/+3
change get_user_pages() return value check. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1239808529-22398-7-git-send-email-ieidus@redhat.com> Message-Id: <1239808529-22398-7-git-send-email-ieidus@redhat.com> Message-Id: <1240106904-21687-7-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com RH-Upstream-status: pending Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Bugzilla: 500263
2009-05-12KSM: fix bug 495714Izik Eidus1-1/+1
fixing it by just calling jhash2() instead of jhash() Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1239726558-14362-6-git-send-email-ieidus@redhat.com> Message-Id: <1239808529-22398-6-git-send-email-ieidus@redhat.com> Message-Id: <1240106904-21687-6-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com Bugzilla: 500263 RH-Upstream-status: pending Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: john cooper <john.cooper@redhat.com>
2009-04-27KSM: fix bug 495351 - effective issue.Izik Eidus1-11/+19
we dont need to check for is_zapped_item in update_tree in case we have rmap_item that point into stable_tree. Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1239726558-14362-5-git-send-email-ieidus@redhat.com> Message-Id: <1239808529-22398-5-git-send-email-ieidus@redhat.com> Message-Id: <1240106904-21687-5-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com RH-Upstream-status: pending Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Bugzilla: 497886
2009-04-27KSM: fix bug 495349 (KSM correctness issue.)Izik Eidus1-79/+103
fixing by checking for anonymous pages before merging after doing get_user_pages() Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1239726558-14362-3-git-send-email-ieidus@redhat.com> Message-Id: <1239808529-22398-3-git-send-email-ieidus@redhat.com> Message-Id: <1240106904-21687-3-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com RH-Upstream-status: pending Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Bugzilla: 497886
2009-04-27KSM: fix bug 495348Izik Eidus1-2/+8
we add a check for the !vm_file to be sure we are not dealing with file backed pages! Signed-off-by: Izik Eidus <ieidus@redhat.com> Message-Id: <1239726558-14362-2-git-send-email-ieidus@redhat.com> Message-Id: <1239808529-22398-2-git-send-email-ieidus@redhat.com> Message-Id: <1240106904-21687-2-git-send-email-ieidus@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com RH-Upstream-status: pending Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Bugzilla: 497886
2009-04-08kvm: external module: hrtimer_expires_remaining was introduced in 2.6.28Avi Kivity1-12/+4
Noted by Alexander Graf. (cherry picked from commit 034e9938f4336f69d643a23ae4b18fa0e6524c9b) Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(kvm/master) Bugzilla: 493112 Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com>
2009-03-30kvm: external module: do not hardcode tsc_khzMarcelo Tosatti1-6/+2
external module compat hard codes tsc_khz as 2000000 if KERNEL_VERSION < (2,6,23). This breaks kvmclock on hosts with different frequency. While tsc_khz was only exported on 2.6.23, the majority of relevant older v2.6 based distros seem to have it exported. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(kvm/master) Bugzilla: 488543 Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Donald Dutile <ddutile@redhat.com> Acked-by: Glauber Costa <glommer@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Avi Kivity <avi@redhat.com>
2009-03-05kvm: external module: handle compound_head() on RHEL 5.2+Avi Kivity1-0/+9
RHEL 5.2 introduced compound_head(), so we need additional hackery to avoid redefining it. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(kvm/master) Bugzilla: 488727 Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com>
2009-03-05kvm: external module: backward compatibility for compound_head()Eduardo Habkost1-0/+13
(cherry picked from commit 5ccf827b6347c04db6b779365b249a17fef62675) [ehabkost: solved conflicts manually on cherry-picking] Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(kvm/master) Bugzilla: 488727 Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Andrea Arcangeli <aarcange@redhat.com>
2009-02-20kvm: external module: compatibility for hrtimer_expires_remaining()Avi Kivity3-0/+16
(cherry picked from commit 3f7cba35281a5b2dba008179a4979d737105574d) Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 485482
2009-02-06Avoid confusion given future mainline kernel module name.Andrea Arcangeli3-3/+2
[ehabkost: rename ksm.c to ksm_main.c] Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2009-02-06kvm swapping with kprobesAndrea Arcangeli1-7/+127
This simulates a single mmu notifier hook in the try_to_unmap path of the VM to provide some swapping behavior to KVM, similar to when mmu notifier is available in the host (but mmu notifier does a lot more including covering the secondary-tlb flushing issues). Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Izik Eidus <ieidus@redhat.com> RH-Upstream-status: pending
2009-02-06[PATCH 40/54] ksmAndrea Arcangeli7-0/+1903
KSM tree implementation with kprobes wp_notifier. Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: pending
2009-02-06kmem-cacheAndrea Arcangeli1-0/+14
Add kmem-cache compat code for ksm.c. Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> RH-Upstream-status: pending
2009-02-06ksm buildsystemAndrea Arcangeli1-0/+14
Build ksm along with kvm sharing the same kvm compat code. Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> RH-Upstream-status: pending
2009-02-06include <asm/svm.h> on external-module-compat.hEduardo Habkost1-0/+3
Make sure we get the MSR_* defines from there if needed. This fixes some "already defined" warnings when compiling. This fix applies only to the maint/2.6.29 branch, as on the master branch the MSR_* defines went to a different header file. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Type: bugfix(build) RH-Upstream-status: not_applicable(kvm/master), submitted(maint/2.6.29)
2009-02-06compat code fixes for RHEL 5.3Andrea Arcangeli1-0/+6
Compat code for rhel 5.3 (and some RHEL 5.2 kernel versions). [ehabkost: changed pagefault_* to check for RHEL < 5.2 instead of RHEL <= 5.2] [ehabkost: changed __aligned to check for RHEL <= 5.2 && !defined(__aligned)] [ehabkost: changed patch description to mention that some RHEL 5.2 kernels need this also] Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Type: bugfix(build) RH-Upstream-status: submitted(kvm-devel)
2009-02-06Use native anon_inodes on RHEL5 if availableEduardo Habkost1-3/+10
RHEL5 now includes anon_inodes on newer kernel versions. Detect this case and use the native anon_inodes implementation when available. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Type: improvement RH-Upstream-status: submitted(kvm-devel)
2009-02-06export anon_inode_getfdAndrea Arcangeli1-0/+4
Allow ksm to share the same anon_inodes compat code of kvm. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> RH-Upstream-status: pending
2009-01-14Revert "kvm: external module: Remove obsolete special_reload_dr7 hack"Avi Kivity3-0/+15
This reverts commit 143a954b551ad89a828502447be37a3406116187, but adds a check that disables the hack on new-enough modules. This allow using both older and newer sources with the same compat kit. Signed-off-by: Avi Kivity <avi@redhat.com>
2009-01-07kvm: external module: define marker_synchronize_unregister on older kernelsEduardo Habkost1-0/+5
marker_synchronize_unregister() is available only on 2.6.28. However, its definition is very simple, so we can define it if it is missing. This fixes compilation of kvm_trace.c against older kernels. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2009-01-04kvm: external module: backward compatibility for CONFIG_HAVE_KVM_IRQCHIPAvi Kivity2-0/+8
Signed-off-by: Avi Kivity <avi@redhat.com>