]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years agoKVM: SVM: disable CR8 intercept when tpr is not masking interrupts
Joerg Roedel [Wed, 16 Apr 2008 14:51:18 +0000 (16:51 +0200)]
KVM: SVM: disable CR8 intercept when tpr is not masking interrupts

This patch disables the intercept of CR8 writes if the TPR is not masking
interrupts. This reduces the total number CR8 intercepts to below 1 percent of
what we have without this patch using Windows 64 bit guests.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: sync V_TPR with LAPIC.TPR if CR8 write intercept is disabled
Joerg Roedel [Wed, 16 Apr 2008 14:51:17 +0000 (16:51 +0200)]
KVM: SVM: sync V_TPR with LAPIC.TPR if CR8 write intercept is disabled

If the CR8 write intercept is disabled the V_TPR field of the VMCB needs to be
synced with the TPR field in the local apic.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: export kvm_lapic_set_tpr() to modules
Joerg Roedel [Wed, 16 Apr 2008 14:51:16 +0000 (16:51 +0200)]
KVM: export kvm_lapic_set_tpr() to modules

This patch exports the kvm_lapic_set_tpr() function from the lapic code to
modules. It is required in the kvm-amd module to optimize CR8 intercepts.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: sync TPR value to V_TPR field in the VMCB
Joerg Roedel [Wed, 16 Apr 2008 14:51:15 +0000 (16:51 +0200)]
KVM: SVM: sync TPR value to V_TPR field in the VMCB

This patch adds syncing of the lapic.tpr field to the V_TPR field of the VMCB.
With this change we can safely remove the CR8 read intercept.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ppc: PowerPC 440 KVM implementation
Hollis Blanchard [Thu, 17 Apr 2008 04:28:09 +0000 (23:28 -0500)]
KVM: ppc: PowerPC 440 KVM implementation

This functionality is definitely experimental, but is capable of running
unmodified PowerPC 440 Linux kernels as guests on a PowerPC 440 host. (Only
tested with 440EP "Bamboo" guests so far, but with appropriate userspace
support other SoC/board combinations should work.)

See Documentation/powerpc/kvm_440.txt for technical details.

[stephen: build fix]

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Add MAINTAINERS entry for PowerPC KVM
Hollis Blanchard [Thu, 17 Apr 2008 04:28:08 +0000 (23:28 -0500)]
KVM: Add MAINTAINERS entry for PowerPC KVM

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ppc: Add DCR access information to struct kvm_run
Hollis Blanchard [Thu, 17 Apr 2008 04:28:07 +0000 (23:28 -0500)]
KVM: ppc: Add DCR access information to struct kvm_run

Device Control Registers are essentially another address space found on PowerPC
4xx processors, analogous to PIO on x86. DCRs are always 32 bits, and can be
identified by a 32-bit number. We forward most DCR accesses to userspace for
emulation (with the exception of CPR0 registers, which can be read directly
for simplicity in timebase frequency determination).

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoppc: Export tlb_44x_hwater for KVM
Hollis Blanchard [Thu, 17 Apr 2008 04:28:06 +0000 (23:28 -0500)]
ppc: Export tlb_44x_hwater for KVM

PowerPC 440 KVM needs to know how many TLB entries are used for the host kernel
linear mapping (it does not modify these mappings when switching between guest
and host execution).

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Rename debugfs_dir to kvm_debugfs_dir
Hollis Blanchard [Tue, 15 Apr 2008 21:05:42 +0000 (16:05 -0500)]
KVM: Rename debugfs_dir to kvm_debugfs_dir

It's a globally exported symbol now.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: x86 emulator: fix lea to really get the effective address
Avi Kivity [Mon, 14 Apr 2008 20:46:37 +0000 (23:46 +0300)]
KVM: x86 emulator: fix lea to really get the effective address

We never hit this, since there is currently no reason to emulate lea.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: x86 emulator: fix smsw and lmsw with a memory operand
Avi Kivity [Mon, 14 Apr 2008 11:40:50 +0000 (14:40 +0300)]
KVM: x86 emulator: fix smsw and lmsw with a memory operand

lmsw and smsw were implemented only with a register operand.  Extend them
to support a memory operand as well.  Fixes Windows running some display
compatibility test on AMD hosts.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: x86 emulator: initialize src.val and dst.val for register operands
Avi Kivity [Mon, 14 Apr 2008 20:27:07 +0000 (23:27 +0300)]
KVM: x86 emulator: initialize src.val and dst.val for register operands

This lets us treat the case where mod == 3 in the same manner as other cases.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: force a new asid when initializing the vmcb
Avi Kivity [Mon, 14 Apr 2008 10:10:21 +0000 (13:10 +0300)]
KVM: SVM: force a new asid when initializing the vmcb

Shutdown interception clears the vmcb, leaving the asid at zero (which is
illegal.  so force a new asid on vmcb initialization.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: fix kvm_vcpu_kick vs __vcpu_run race
Marcelo Tosatti [Fri, 11 Apr 2008 18:01:22 +0000 (15:01 -0300)]
KVM: fix kvm_vcpu_kick vs __vcpu_run race

There is a window open between testing of pending IRQ's
and assignment of guest_mode in __vcpu_run.

Injection of IRQ's can race with __vcpu_run as follows:

CPU0                                CPU1
kvm_x86_ops->run()
vcpu->guest_mode = 0                SET_IRQ_LINE ioctl
..
kvm_x86_ops->inject_pending_irq
kvm_cpu_has_interrupt()

                                    apic_test_and_set_irr()
                                    kvm_vcpu_kick
                                    if (vcpu->guest_mode)
                                        send_ipi()

vcpu->guest_mode = 1

So move guest_mode=1 assignment before ->inject_pending_irq, and make
sure that it won't reorder after it.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: add ioctls to save/store mpstate
Marcelo Tosatti [Fri, 11 Apr 2008 16:24:45 +0000 (13:24 -0300)]
KVM: add ioctls to save/store mpstate

So userspace can save/restore the mpstate during migration.

[avi: export the #define constants describing the value]
[christian: add s390 stubs]
[avi: ditto for ia64]

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years ago[SCSI] esp_scsi: Make cur_residue and tot_residue signed.
David S. Miller [Sat, 19 Apr 2008 14:16:38 +0000 (09:16 -0500)]
[SCSI] esp_scsi: Make cur_residue and tot_residue signed.

Many of the overflow checks test whether the value has
gone negative, and we want to retain such checks.

Reported by Julia Lawall.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years agoide-tape: remove tape->merge_stage
Borislav Petkov [Sun, 27 Apr 2008 13:38:34 +0000 (15:38 +0200)]
ide-tape: remove tape->merge_stage

Get rid of the pipeline merge stage but retain the chrdev req caching
functionality by using a merge buffer tape->merge_bh which is flushed in chunks
of several blocks at a time. Also, remove last references to pipelining, e.g.
typedef idetape_stage_s.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: mv tape->merge_stage_size tape->merge_bh_size
Borislav Petkov [Sun, 27 Apr 2008 13:38:34 +0000 (15:38 +0200)]
ide-tape: mv tape->merge_stage_size tape->merge_bh_size

This is the size of the merge buffer.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: mv idetape_empty_write_pipeline ide_tape_flush_merge_buffer
Borislav Petkov [Sun, 27 Apr 2008 13:38:34 +0000 (15:38 +0200)]
ide-tape: mv idetape_empty_write_pipeline ide_tape_flush_merge_buffer

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: mv idetape_discard_read_pipeline ide_tape_discard_merge_buffer
Borislav Petkov [Sun, 27 Apr 2008 13:38:34 +0000 (15:38 +0200)]
ide-tape: mv idetape_discard_read_pipeline ide_tape_discard_merge_buffer

Also, rename its __-low level helper too.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: make __idetape_discard_read_pipeline() of type void
Borislav Petkov [Sun, 27 Apr 2008 13:38:34 +0000 (15:38 +0200)]
ide-tape: make __idetape_discard_read_pipeline() of type void

It always returns 0 which has no effect on tape positioning calculation so
simplify it by converting its type to void, bringing no functional change to the
driver.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove now unused ide_pci_create_host_proc()
Alexey Dobriyan [Sun, 27 Apr 2008 13:38:34 +0000 (15:38 +0200)]
ide: remove now unused ide_pci_create_host_proc()

It creates files in proc with obsoleted ->get_info interface.

Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove /proc/ide/ali
Alexey Dobriyan [Sun, 27 Apr 2008 13:38:33 +0000 (15:38 +0200)]
ide: remove /proc/ide/ali

Bart says: "can be done from user-space and is not especially interesting
even when debugging problems (raw PCI config space dump is far more useful)."

Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: improve buffer pages freeing strategy
Borislav Petkov [Sun, 27 Apr 2008 13:38:33 +0000 (15:38 +0200)]
ide-tape: improve buffer pages freeing strategy

Instead of freeing pages one by one, free them 2^order-wise. Also, mv
__idetape_kfree_stage() to ide_tape_kfree_buffer().

[bart: add updating bh->b_data]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: mv tape->pages_per_stage tape->pages_per_buffer
Borislav Petkov [Sun, 27 Apr 2008 13:38:33 +0000 (15:38 +0200)]
ide-tape: mv tape->pages_per_stage tape->pages_per_buffer

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: mv tape->stage_size tape->buffer_size
Borislav Petkov [Sun, 27 Apr 2008 13:38:33 +0000 (15:38 +0200)]
ide-tape: mv tape->stage_size tape->buffer_size

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: improve buffer allocation strategy
Borislav Petkov [Sun, 27 Apr 2008 13:38:32 +0000 (15:38 +0200)]
ide-tape: improve buffer allocation strategy

Instead of allocating pages for the buffer one by one, take advantage of the
buddy alloc system and request them 2^order at a time. This increases the chance
for bigger buffer parts to be contigious and reduces loop iteration count. While
at it, rename function __idetape_kmalloc_stage() to ide_tape_kmalloc_buffer().

[bart: fold with "ide-tape: fix mem leak" patch to preserve bisectability]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add struct ide_io_ports (take 3)
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:32 +0000 (15:38 +0200)]
ide: add struct ide_io_ports (take 3)

* Add struct ide_io_ports and use it instead of `unsigned long io_ports[]`
  in ide_hwif_t.

* Rename io_ports[] in hw_regs_t to io_ports_array[].

* Use un-named union for 'unsigned long io_ports_array[]' and 'struct
  ide_io_ports io_ports' in hw_regs_t.

* Remove IDE_*_OFFSET defines.

v2:
* scc_pata.c build fix from Stephen Rothwell.

v3:
* Fix ctl_adrr typo in Sparc-specific part of ns87415.c.
  (Noticed by Andrew Morton)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: make ide_unregister() take 'ide_hwif_t *' as an argument (take 2)
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:31 +0000 (15:38 +0200)]
ide: make ide_unregister() take 'ide_hwif_t *' as an argument (take 2)

* Make ide_unregister() take 'ide_hwif_t *hwif' instead of 'unsigned int
  index' (hwif->index) as an argument and update all users accordingly.

While at it:

* Remove unnecessary checks for hwif != NULL from ide-pnp.c::idepnp_remove()
  and delkin_cb.c::delkin_cb_remove().

* Remove needless hwif->chipset assignment from scc_pata.c::scc_remove().

v2:
* Fixup ide_unregister() documentation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: sanitize ide_unregister() usage
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:31 +0000 (15:38 +0200)]
ide: sanitize ide_unregister() usage

* Remove ide_unregister() call from ide_exit()
  (host drivers take care of unregistering hwif-s themselves).

* Remove ide_unregister() call from probe methods of
  bast-ide, palm_bk3710, ide-cs and delkin_cb host drivers
  (ide_find_port() returns only free ide_hwifs[] entries).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agompc8xx-ide: use ide_find_port()
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:30 +0000 (15:38 +0200)]
mpc8xx-ide: use ide_find_port()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add "noacpi" / "acpigtf" / "acpionboot" parameters
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:30 +0000 (15:38 +0200)]
ide: add "noacpi" / "acpigtf" / "acpionboot" parameters

* Rename ide_noacpi{tfs,onboot} to ide_acpi{gtf,onboot} (+ reverse logic).

* Move ide_*acpi* variables to ide-acpi.c and remove unnecessary initializers.

* Add "noacpi" / "acpigtf" / "acpionboot" parameters.

* Obsolete "ide=noacpi" / "ide=acpigtf" / "ide=acpionboot" kernel parameters.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agogayle: add "doubler" parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:30 +0000 (15:38 +0200)]
gayle: add "doubler" parameter

* Add "doubler" parameter to enable support for IDE doublers.

* Obsolete "ide=doubler" kernel parameter.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add "cdrom=" and "chs=" parameters
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:30 +0000 (15:38 +0200)]
ide: add "cdrom=" and "chs=" parameters

* Add "cdrom=" and "chs=" parameters.

* Obsolete "hdx=cdrom" and "hdx=cyls,heads,sects" kernel parameters.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add "nodma|noflush|noprobe|nowerr=" parameters
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:30 +0000 (15:38 +0200)]
ide: add "nodma|noflush|noprobe|nowerr=" parameters

* Add "nodma|noflush|noprobe|nowerr=" parameters.

* Obsolete "hdx=noprobe|none|nowerr|nodma|noflush" kernel parameters.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "hdx=autotune" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
ide: remove obsoleted "hdx=autotune" kernel parameter

* Remove obsoleted "hdx=autotune" kernel parameter
  (we always auto-tune PIO if possible nowadays).

* Remove no longer needed ide_drive_t.autotune flag.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove IDE_HFLAG_NO_AUTOTUNE host flag
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
ide: remove IDE_HFLAG_NO_AUTOTUNE host flag

* Don't set IDE_HFLAG_NO_AUTOTUNE host flag in sgiioc4 and icside
  host drivers - there is no need for it as they don't implement
  ->set_pio_mode method.

* Remove no longer needed IDE_HFLAG_NO_AUTOTUNE host flag.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agocmd640: always auto-tune PIO
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
cmd640: always auto-tune PIO

* Default to tuning PIO0 and disabling prefetch prior to probing
  devices for CONFIG_BLK_DEV_CMD640_ENHANCED=y case.

* Always auto-tune PIO.

* Remove no longer used retrieve_drive_counts().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: always auto-tune PIO in legacy VLB host drivers
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
ide: always auto-tune PIO in legacy VLB host drivers

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: mark "idebus=" kernel parameter as obsoleted (take 2)
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
ide: mark "idebus=" kernel parameter as obsoleted (take 2)

We have "vlb|pci_clock=" parameters now.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add "vlb|pci_clock=" parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
ide: add "vlb|pci_clock=" parameter

* Add "vlb_clock=" parameter for specifying VLB clock frequency (in MHz).

* Add "pci_clock=" parameter for specifying PCI bus clock frequency (in MHz).

While at it:

* qd65xx.c: rename {active,recovery}_cycle variables to {act,rec}_cyc.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove comments markup from Documentation/ide/ide-tape.txt
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove comments markup from Documentation/ide/ide-tape.txt

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipelined mode description from Documentation/ide/ide-tape.txt
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove pipelined mode description from Documentation/ide/ide-tape.txt

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove misc references to pipelined operation in the comments
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove misc references to pipelined operation in the comments

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipelined mode parameters
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove pipelined mode parameters

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific members from struct ide_tape_obj
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific members from struct ide_tape_obj

Bart:
- merge "ide-tape: remove pipeline-specific code from idetape_setup" patch
- cleanup __idetape_discard_read_pipeline()
- cleanup idetape_empty_write_pipeline()
- fix 't' assignment in idetape_setup()
- fix idetape_blkdev_ioctl() w.r.t. 'nr_stages'

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipelined mode tape control flags
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove pipelined mode tape control flags

[bart: sync patch with current code and fix idetape_init_read()]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove remaining pipeline functionality
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove remaining pipeline functionality

The driver is using now solely its own request queue.

- tape->next_stage is always NULL so it is safe to remove
  all code depending on tape->next_stage != NULL

- this patch removes the last place which sets
  IDETAPE_FLAG_PIPELINE_ACTIVE in tape->flags

[bart: add above explanations]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: unwrap idetape_queue_pc_tail()
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: unwrap idetape_queue_pc_tail()

idetape_queue_pc_tail() is a wrapper for its __idetape_queue_pc_tail() counterpart
and has no other functionality. Remove it and call the "wrapped" function
directly.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code from idetape_end_request()
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code from idetape_end_request()

As a side effect, remove unused idetape_kfree_stage() and
idetape_abort_pipeline()

[bart: resurrect taking tape->lock + clearing IDETAPE_FLAG_PIPELINE_ACTIVE]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove idetape_remove_stage_head()
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove idetape_remove_stage_head()

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove idetape_pipeline_size()
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove idetape_pipeline_size()

The computation of the block offset of the the tape position (MTIOCPOS,
MTIOCGET) is not influenced by the stages queued in the pipeline anymore but by
the size of the current buffer which is going to be sent to the drive.

[bart: resurrect deleted idetape_wait_for_pipeline() call]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code in idetape_space_over_filemarks()
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code in idetape_space_over_filemarks()

Since we don't do pipeline read-ahead anymore, we don't have to look for
filemarks we have crossed. Therefore, remove the code chunk that does that and
pass on the command to the tape. As a side effect, remove unused
idetape_wait_first_stage().

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unused parameter from idetape_copy_stage_from_user
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove unused parameter from idetape_copy_stage_from_user

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unused parameter from idetape_copy_stage_to_user
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove unused parameter from idetape_copy_stage_to_user

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code from idetape_add_chrdev_read_request()
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code from idetape_add_chrdev_read_request()

In order to do away with queueing read requests on the pipeline, several things
have to be done:

1. Do not allocate additional pipeline stages in idetape_init_read() until
(tape->nr_stages < max_stages) and do only read operation preparations. As a
collateral result, idetape_add_stage_tail() becomes unused so remove it.

2. Queue the read request's buffer directly thru idetape_queue_rw_tail().

3. Remove now unused idetape_kmalloc_stage() and idetape_switch_buffers().

[bart: simplify the original patch]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape remove pipeline speed/control calculations
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape remove pipeline speed/control calculations

Pipeline handling calculations in idetape_calculate_speeds() can
go since they do not have any effect on other functionality besides:

1. info is only being exported through /proc as a read-only item
(controlled_pipeline_head_speed, uncontrolled_pipeline_head_speed)

2. used in idetape_restart_speed_control() which, in turn, is unrelated to
other code

3. used only for pipeline frames number accounting (tape->pipeline_head),
also unused elsewhere.

4.some variables are:
        only written to: tape->buffer_head;
        unused: tape->tape_head, tape->last_tape_head

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code from idetape_add_chrdev_write_request
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code from idetape_add_chrdev_write_request

Refrain from adding more write requests to the pipeline and queue them
directly on the device's request queue instead.

[bart: re-do for minimal behavior changes]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove tape->cache_stage
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove tape->cache_stage

Prior to allocating a new pipeline stage, the code checked for the existence of
a cached pipeline stage to use. Do away with and stick to normal pipeline
stages only.

[bart: keep idetape_kmalloc_stage() for now]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "hdx=noautotune" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "hdx=noautotune" kernel parameter

Remove obsoleted "hdx=noautotune" kernel parameter
(it has been obsoleted since 1 Nov 2004).

Then make ide_hwif_t.autotune a single bit flag
and remove no longer needed IDE_TUNE_* defines.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idex=" kernel parameters
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "idex=" kernel parameters

* Remove obsoleted "idex=" kernel parameters.

* Make probe_* and cmd640_vlb variables static.

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idex=reset" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "idex=reset" kernel parameter

Remove obsoleted "idex=reset" kernel parameter
(it has been obsoleted since 1 Nov 2004).

Then remove corresponding code from ide_probe_port()
and no longer used ->reset field from ide_hwif_t.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idex=serialize" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "idex=serialize" kernel parameter

Remove obsoleted "idex=serialize" kernel parameter
(it has been obsoleted since 1 Nov 2004).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add "ignore_cable" parameter (take 2)
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:23 +0000 (15:38 +0200)]
ide: add "ignore_cable" parameter (take 2)

Add "ignore_cable" parameter:

* "ide_core.ignore_cable=[interface_number]" boot option if IDE is built-in
  (i.e. "ide_core.ignore_cable=1" to force ignoring cable for "ide1")

* "ignore_cable=[interface_number]" module parameter (for ide_core module)
  if IDE is compiled as module

v2:
* Add ide_port_apply_params() helper
  - use it in ide_device_add_all() and ide_scan_port().

* Make it possible to later disable ignoring cable detection by passing
  "[interface_number]:0" to /sys/module/ide_core/parameters/ignore_cable
  (however sysfs interface is not enabled yet since it needs some other
   IDE changes to make it work reliable).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix icside breakage
Al Viro [Sun, 27 Apr 2008 13:38:23 +0000 (15:38 +0200)]
ide: fix icside breakage

Fallout from commit ac95beedf8bc97b24f9540d4da9952f07221c023

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoKVM: Rename VCPU_MP_STATE_* to KVM_MP_STATE_*
Avi Kivity [Sun, 13 Apr 2008 14:54:35 +0000 (17:54 +0300)]
KVM: Rename VCPU_MP_STATE_* to KVM_MP_STATE_*

We wish to export it to userspace, so move it into the kvm namespace.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: hlt emulation should take in-kernel APIC/PIT timers into account
Marcelo Tosatti [Fri, 11 Apr 2008 17:53:26 +0000 (14:53 -0300)]
KVM: hlt emulation should take in-kernel APIC/PIT timers into account

Timers that fire between guest hlt and vcpu_block's add_wait_queue() are
ignored, possibly resulting in hangs.

Also make sure that atomic_inc and waitqueue_active tests happen in the
specified order, otherwise the following race is open:

CPU0                                        CPU1
                                            if (waitqueue_active(wq))
add_wait_queue()
if (!atomic_read(pit_timer->pending))
    schedule()
                                            atomic_inc(pit_timer->pending)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: do not intercept task switch with NPT
Joerg Roedel [Wed, 9 Apr 2008 14:04:32 +0000 (16:04 +0200)]
KVM: SVM: do not intercept task switch with NPT

When KVM uses NPT there is no reason to intercept task switches. This patch
removes the intercept for it in that case.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Add kvm trace userspace interface
Feng(Eric) Liu [Thu, 10 Apr 2008 12:47:53 +0000 (08:47 -0400)]
KVM: Add kvm trace userspace interface

This interface allows user a space application to read the trace of kvm
related events through relayfs.

Signed-off-by: Feng (Eric) Liu <eric.e.liu@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Stub out kvmtrace
Avi Kivity [Thu, 10 Apr 2008 23:51:52 +0000 (02:51 +0300)]
KVM: ia64: Stub out kvmtrace

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: s390: Stub out kvmtrace
Avi Kivity [Thu, 10 Apr 2008 23:50:40 +0000 (02:50 +0300)]
KVM: s390: Stub out kvmtrace

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Add trace markers
Feng (Eric) Liu [Thu, 10 Apr 2008 19:31:10 +0000 (15:31 -0400)]
KVM: Add trace markers

Trace markers allow userspace to trace execution of a virtual machine
in order to monitor its performance.

Signed-off-by: Feng (Eric) Liu <eric.e.liu@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: add intercept for machine check exception
Joerg Roedel [Wed, 9 Apr 2008 12:15:30 +0000 (14:15 +0200)]
KVM: SVM: add intercept for machine check exception

To properly forward a MCE occured while the guest is running to the host, we
have to intercept this exception and call the host handler by hand. This is
implemented by this patch.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: align shadow CR4.MCE with host
Joerg Roedel [Wed, 9 Apr 2008 12:15:29 +0000 (14:15 +0200)]
KVM: SVM: align shadow CR4.MCE with host

This patch aligns the host version of the CR4.MCE bit with the CR4 active in
the guest. This is necessary to get MCE exceptions when the guest is running.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: SVM: indent svm_set_cr4 with tabs instead of spaces
Joerg Roedel [Wed, 9 Apr 2008 12:15:28 +0000 (14:15 +0200)]
KVM: SVM: indent svm_set_cr4 with tabs instead of spaces

The svm_set_cr4 function is indented with spaces. This patch replaces
them with tabs.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Register ioctl range
Avi Kivity [Sun, 6 Apr 2008 11:25:46 +0000 (14:25 +0300)]
KVM: Register ioctl range

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: MMU: Don't assume struct page for x86
Anthony Liguori [Wed, 2 Apr 2008 19:46:56 +0000 (14:46 -0500)]
KVM: MMU: Don't assume struct page for x86

This patch introduces a gfn_to_pfn() function and corresponding functions like
kvm_release_pfn_dirty().  Using these new functions, we can modify the x86
MMU to no longer assume that it can always get a struct page for any given gfn.

We don't want to eliminate gfn_to_page() entirely because a number of places
assume they can do gfn_to_page() and then kmap() the results.  When we support
IO memory, gfn_to_page() will fail for IO pages although gfn_to_pfn() will
succeed.

This does not implement support for avoiding reference counting for reserved
RAM or for IO memory.  However, it should make those things pretty straight
forward.

Since we're only introducing new common symbols, I don't think it will break
the non-x86 architectures but I haven't tested those.  I've tested Intel,
AMD, NPT, and hugetlbfs with Windows and Linux guests.

[avi: fix overflow when shifting left pfns by adding casts]

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add a guide about how to create kvm guests on ia64
Xiantao Zhang [Tue, 1 Apr 2008 07:08:29 +0000 (15:08 +0800)]
KVM: ia64: Add a guide about how to create kvm guests on ia64

Guide for creating virtual machine on kvm/ia64.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Enable kvm build for ia64
Xiantao Zhang [Fri, 28 Mar 2008 06:58:47 +0000 (14:58 +0800)]
KVM: ia64: Enable kvm build for ia64

Update the related Makefile and KConfig for kvm build

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add kvm sal/pal virtulization support
Xiantao Zhang [Tue, 1 Apr 2008 06:59:30 +0000 (14:59 +0800)]
KVM: ia64: Add kvm sal/pal virtulization support

Some sal/pal calls would be traped to kvm for virtulization
from guest firmware.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add guest interruption injection support
Xiantao Zhang [Tue, 1 Apr 2008 06:58:42 +0000 (14:58 +0800)]
KVM: ia64: Add guest interruption injection support

process.c mainly handle interruption injection, and some faults handling.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Generate offset values for assembly code use
Xiantao Zhang [Tue, 1 Apr 2008 06:57:53 +0000 (14:57 +0800)]
KVM: ia64: Generate offset values for assembly code use

asm-offsets.c will generate offset values used for assembly code
for some fileds of special structures.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add optimization for some virtulization faults
Xiantao Zhang [Tue, 1 Apr 2008 06:57:09 +0000 (14:57 +0800)]
KVM: ia64: Add optimization for some virtulization faults

optvfault.S Add optimization for some performance-critical
virtualization faults.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add processor virtulization support
Xiantao Zhang [Tue, 1 Apr 2008 08:14:28 +0000 (16:14 +0800)]
KVM: ia64: Add processor virtulization support

vcpu.c provides processor virtualization logic for kvm.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add trampoline for guest/host mode switch
Xiantao Zhang [Tue, 1 Apr 2008 06:54:42 +0000 (14:54 +0800)]
KVM: ia64: Add trampoline for guest/host mode switch

trampoline code targets for guest/host world switch.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add mmio decoder for kvm/ia64
Xiantao Zhang [Tue, 1 Apr 2008 06:53:32 +0000 (14:53 +0800)]
KVM: ia64: Add mmio decoder for kvm/ia64

mmio.c includes mmio decoder, and related mmio logics.

Signed-off-by: Anthony Xu <Anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add interruption vector table for vmm
Xiantao Zhang [Tue, 1 Apr 2008 06:52:19 +0000 (14:52 +0800)]
KVM: ia64: Add interruption vector table for vmm

vmm_ivt.S includes an ivt for vmm use.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add TLB virtulization support
Xiantao Zhang [Tue, 1 Apr 2008 06:50:59 +0000 (14:50 +0800)]
KVM: ia64: Add TLB virtulization support

vtlb.c includes tlb/VHPT virtulization.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: VMM module interfaces
Xiantao Zhang [Tue, 1 Apr 2008 06:49:24 +0000 (14:49 +0800)]
KVM: ia64: VMM module interfaces

vmm.c adds the interfaces with kvm/module, and initialize global data area.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add header files for kvm/ia64
Xiantao Zhang [Tue, 1 Apr 2008 08:00:24 +0000 (16:00 +0800)]
KVM: ia64: Add header files for kvm/ia64

kvm_minstate.h : Marcos about Min save routines.
lapic.h: apic structure definition.
vcpu.h : routions related to vcpu virtualization.
vti.h  : Some macros or routines for VT support on Itanium.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add kvm arch-specific core code for kvm/ia64
Xiantao Zhang [Tue, 1 Apr 2008 07:29:29 +0000 (15:29 +0800)]
KVM: ia64: Add kvm arch-specific core code for kvm/ia64

kvm_ia64.c is created to handle kvm ia64-specific core logic.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Add header files for kvm/ia64
Xiantao Zhang [Tue, 1 Apr 2008 06:45:06 +0000 (14:45 +0800)]
KVM: ia64: Add header files for kvm/ia64

Three header files are added:
asm-ia64/kvm.h
asm-ia64/kvm_host.h
asm-ia64/kvm_para.h

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: ia64: Prepare some structure and routines for kvm use
Xiantao Zhang [Tue, 1 Apr 2008 06:42:00 +0000 (14:42 +0800)]
KVM: ia64: Prepare some structure and routines for kvm use

Register structures are defined per SDM.
Add three small routines for kernel:
ia64_ttag, ia64_loadrs, ia64_flushrs

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: s390: Improve pgste accesses
Heiko Carstens [Fri, 4 Apr 2008 14:03:34 +0000 (16:03 +0200)]
KVM: s390: Improve pgste accesses

There is no need to use interlocked updates when the rcp
lock is held. Therefore the simple bitops variants can be
used. This should improve performance.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: s390: rename stfl to kvm_stfl
Heiko Carstens [Fri, 4 Apr 2008 13:12:40 +0000 (15:12 +0200)]
KVM: s390: rename stfl to kvm_stfl

Temporarily rename this function to avoid merge conflicts and/or
dependencies. This function will be removed as soon as git-s390
and kvm.git are finally upstream.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: s390: Fix incorrect return value
Heiko Carstens [Fri, 4 Apr 2008 13:12:35 +0000 (15:12 +0200)]
KVM: s390: Fix incorrect return value

kvm_arch_vcpu_ioctl_run currently incorrectly always returns 0.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: MMU: prepopulate guest pages after write-protecting
Marcelo Tosatti [Fri, 4 Apr 2008 17:56:44 +0000 (14:56 -0300)]
KVM: MMU: prepopulate guest pages after write-protecting

Zdenek reported a bug where a looping "dmsetup status" eventually hangs
on SMP guests.

The problem is that kvm_mmu_get_page() prepopulates the shadow MMU
before write protecting the guest page tables. By doing so, it leaves a
window open where the guest can mark a pte as present while the host has
shadow cached such pte as "notrap". Accesses to such address will fault
in the guest without the host having a chance to fix the situation.

Fix by moving the write protection before the pte prefetch.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: MMU: Only mark_page_accessed() if the page was accessed by the guest
Avi Kivity [Thu, 3 Apr 2008 09:02:21 +0000 (12:02 +0300)]
KVM: MMU: Only mark_page_accessed() if the page was accessed by the guest

If the accessed bit is not set, the guest has never accessed this page
(at least through this spte), so there's no need to mark the page
accessed.  This provides more accurate data for the eviction algortithm.

Noted by Andrea Arcangeli.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: add vm refcounting
Izik Eidus [Sun, 30 Mar 2008 13:01:25 +0000 (16:01 +0300)]
KVM: add vm refcounting

the main purpose of adding this functions is the abilaty to release the
spinlock that protect the kvm list while still be able to do operations
on a specific kvm in a safe way.

Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: function declaration parameter name cleanup
Joerg Roedel [Tue, 1 Apr 2008 14:44:56 +0000 (16:44 +0200)]
KVM: function declaration parameter name cleanup

The kvm_host.h file for x86 declares the functions kvm_set_cr[0348]. In the
header file their second parameter is named cr0 in all cases. This patch
renames the parameters so that they match the function name.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>