Paul Mackerras
aa04b4cc5b
KVM: PPC: Allocate RMAs (Real Mode Areas) at boot for use by guests
...
This adds infrastructure which will be needed to allow book3s_hv KVM to
run on older POWER processors, including PPC970, which don't support
the Virtual Real Mode Area (VRMA) facility, but only the Real Mode
Offset (RMO) facility. These processors require a physically
contiguous, aligned area of memory for each guest. When the guest does
an access in real mode (MMU off), the address is compared against a
limit value, and if it is lower, the address is ORed with an offset
value (from the Real Mode Offset Register (RMOR)) and the result becomes
the real address for the access. The size of the RMA has to be one of
a set of supported values, which usually includes 64MB, 128MB, 256MB
and some larger powers of 2.
Since we are unlikely to be able to allocate 64MB or more of physically
contiguous memory after the kernel has been running for a while, we
allocate a pool of RMAs at boot time using the bootmem allocator. The
size and number of the RMAs can be set using the kvm_rma_size=xx and
kvm_rma_count=xx kernel command line options.
KVM exports a new capability, KVM_CAP_PPC_RMA, to signal the availability
of the pool of preallocated RMAs. The capability value is 1 if the
processor can use an RMA but doesn't require one (because it supports
the VRMA facility), or 2 if the processor requires an RMA for each guest.
This adds a new ioctl, KVM_ALLOCATE_RMA, which allocates an RMA from the
pool and returns a file descriptor which can be used to map the RMA. It
also returns the size of the RMA in the argument structure.
Having an RMA means we will get multiple KMV_SET_USER_MEMORY_REGION
ioctl calls from userspace. To cope with this, we now preallocate the
kvm->arch.ram_pginfo array when the VM is created with a size sufficient
for up to 64GB of guest memory. Subsequently we will get rid of this
array and use memory associated with each memslot instead.
This moves most of the code that translates the user addresses into
host pfns (page frame numbers) out of kvmppc_prepare_vrma up one level
to kvmppc_core_prepare_memory_region. Also, instead of having to look
up the VMA for each page in order to check the page size, we now check
that the pages we get are compound pages of 16MB. However, if we are
adding memory that is mapped to an RMA, we don't bother with calling
get_user_pages_fast and instead just offset from the base pfn for the
RMA.
Typically the RMA gets added after vcpus are created, which makes it
inconvenient to have the LPCR (logical partition control register) value
in the vcpu->arch struct, since the LPCR controls whether the processor
uses RMA or VRMA for the guest. This moves the LPCR value into the
kvm->arch struct and arranges for the MER (mediated external request)
bit, which is the only bit that varies between vcpus, to be set in
assembly code when going into the guest if there is a pending external
interrupt request.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-12 13:16:57 +03:00
..
ABI
backlight: new driver for the ADP8870 backlight devices
2011-06-15 20:03:59 -07:00
accounting
Documentation: update cgroupfs mount point
2011-06-15 21:52:50 -07:00
acpi
ACPI: Split out custom_method functionality into an own driver
2011-05-29 01:50:40 -04:00
aoe
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
arm
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable
2011-05-25 21:47:48 +01:00
auxdisplay
blackfin
Blackfin: document SPI CS limitations with CPHA=0
2010-08-06 12:55:52 -04:00
block
Fix common misspellings
2011-03-31 11:26:23 -03:00
blockdev
cciss: add cciss_tape_cmds module paramter
2011-05-06 08:23:59 -06:00
cdrom
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
cgroups
Documentation: fix cgroup blkio throttle filenames
2011-07-06 13:17:51 -07:00
connector
Documentation/: it's -> its where appropriate
2010-04-23 02:09:52 +02:00
console
cpu-freq
[CPUFREQ] Add documentation for sampling_down_factor
2011-03-16 17:54:31 -04:00
cpuidle
cris
crypto
development-process
docs: update the development process document
2011-03-25 14:30:31 -06:00
device-mapper
Fix common misspellings
2011-03-31 11:26:23 -03:00
devicetree
Merge branches 'devel', 'devel-stable' and 'fixes' into for-linus
2011-05-27 22:59:57 +01:00
DocBook
Merge git://git.infradead.org/mtd-2.6
2011-05-27 20:06:53 -07:00
driver-model
driver core: remove the driver-model structures from the documentation
2011-05-06 18:01:05 -07:00
dvb
Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6
2011-04-07 11:14:49 -07:00
early-userspace
fault-injection
lkdtm: add debugfs access and loosen KPROBE ties
2010-03-06 11:26:32 -08:00
fb
Fix common misspellings
2011-03-31 11:26:23 -03:00
filesystems
rcu: Use softirq to address performance regression
2011-06-14 15:25:39 -07:00
firmware_class
firmware: Update hotplug script
2010-08-05 13:53:34 -07:00
frv
hid
HID: Move hiddev.txt to the new Documentation/hid directory
2011-03-22 11:43:51 +01:00
hwmon
hwmon: (k10temp) Update documentation for Fam12h
2011-07-03 13:32:54 +02:00
i2c
i2c-i801: SMBus patch for Intel Panther Point DeviceIDs
2011-05-24 20:58:49 +02:00
i2o
Fix common misspellings
2011-03-31 11:26:23 -03:00
ia64
Fix common misspellings
2011-03-31 11:26:23 -03:00
ide
infiniband
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
input
Input: elantech - describe further the protocol
2011-05-16 22:48:24 -07:00
ioctl
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
2011-05-25 16:55:55 -07:00
isdn
Fix common misspellings
2011-03-31 11:26:23 -03:00
ja_JP
HOWTO: sync up Documentaion/ja_JP/HOWTO
2011-04-19 16:53:45 -07:00
kbuild
Merge branch 'kconfig-for-40' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
2011-05-25 16:54:01 -07:00
kdump
kdump: update kexec-tools URL and Vivek's email
2010-11-25 14:36:38 +01:00
ko_KR
Docs/Kconfig: Update: osdl.org -> linuxfoundation.org
2010-11-15 23:50:13 +01:00
laptops
acer-wmi: Delete out-of-date documentation
2011-05-27 12:36:46 -04:00
leds
Documentation: consolidate leds files to leds/ subdir
2011-04-04 17:51:47 -07:00
m68k
make
kbuild: introduce HDR_ARCH_LIST for headers_install_all
2010-12-14 22:16:19 +01:00
mips
Fix common misspellings
2011-03-31 11:26:23 -03:00
misc-devices
Fix common misspellings
2011-03-31 11:26:23 -03:00
mmc
mmc: MMC boot partitions support.
2011-05-24 21:01:21 -04:00
mn10300
mtd
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
namespaces
netlabel
Documentation/: it's -> its where appropriate
2010-04-23 02:09:52 +02:00
networking
Merge branch 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs
2011-05-27 10:25:02 -07:00
nfc
NFC: Driver for NXP Semiconductors PN544 NFC chip.
2011-01-13 08:03:19 -08:00
parisc
PCI
Fix common misspellings
2011-03-31 11:26:23 -03:00
pcmcia
pcmcia: use autoconfiguration feature for ioports and iomem
2010-09-29 17:20:24 +02:00
power
PM / Runtime: Update documentation regarding driver removal
2011-07-02 14:27:11 +02:00
powerpc
Fix common misspellings
2011-03-31 11:26:23 -03:00
pps
pps: add parallel port PPS signal generator
2011-01-13 08:03:21 -08:00
prctl
pti
Kernel documentation for the PTI feature.
2011-05-13 16:31:00 -07:00
ptp
ptp: Added a brand new class driver for ptp clocks.
2011-05-23 13:01:00 -07:00
rapidio
rapidio: add RapidIO documentation
2011-03-23 19:46:41 -07:00
RCU
rcu: Decrease memory-barrier usage based on semi-formal proof
2011-05-26 09:42:23 -07:00
s390
Documentation: fix minor typos/spelling
2011-04-04 17:51:47 -07:00
scheduler
Documentation: update cgroupfs mount point
2011-06-15 21:52:50 -07:00
scsi
[SCSI] megaraid_sas: Version and Changelog update
2011-05-24 12:36:06 -04:00
security
Create Documentation/security/,
2011-05-19 15:59:38 -07:00
serial
Fix common misspellings
2011-03-31 11:26:23 -03:00
sh
sh: clkfwk: Kill off unused clk_set_rate_ex().
2010-11-15 18:25:12 +09:00
sound
Merge branch 'topic/hda' into for-linus
2011-05-22 10:01:35 +02:00
sparc
spi
Fix common misspellings
2011-03-31 11:26:23 -03:00
sysctl
coredump: add support for exe_file in core name
2011-05-26 17:12:36 -07:00
target
[SCSI] tcm_mod_builder.py: Fix generated *_drop_nodeacl() handler
2011-03-23 11:36:45 -05:00
telephony
Fix common misspellings
2011-03-31 11:26:23 -03:00
thermal
thermal: Add event notification to thermal framework
2011-01-12 00:08:35 -05:00
timers
doc: timers-howto: fix a typo ("unsgined")
2011-05-17 10:52:02 +02:00
trace
sched: Get rid of lock_depth
2011-04-24 13:18:38 +02:00
usb
USB: Fix up URB error codes to reflect implementation.
2011-06-17 11:28:21 -07:00
video4linux
[media] uvcvideo: Add driver documentation
2011-05-20 09:30:36 -03:00
virtual
KVM: PPC: Allocate RMAs (Real Mode Areas) at boot for use by guests
2011-07-12 13:16:57 +03:00
vm
Documentation: update cgroupfs mount point
2011-06-15 21:52:50 -07:00
w1
Fix common misspellings
2011-03-31 11:26:23 -03:00
watchdog
Fix common misspellings
2011-03-31 11:26:23 -03:00
wimax
x86
x86, gart: Rename pci-gart_64.c to amd_gart_64.c
2011-05-10 17:22:06 +02:00
zh_CN
Translated Documentation/email-clients.txt
2011-05-06 17:59:20 -07:00
.gitignore
add random binaries to .gitignore
2010-04-08 11:34:34 +02:00
00-INDEX
Merge branch 'docs-security' into docs-move
2011-05-20 09:10:04 -07:00
applying-patches.txt
atomic_ops.txt
Documentation/atomic_ops.txt: avoid volatile in sample code
2011-05-26 17:12:34 -07:00
bad_memory.txt
basic_profiling.txt
binfmt_misc.txt
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
braille-console.txt
bt8xxgpio.txt
btmrvl.txt
BUG-HUNTING
bus-virt-phys-mapping.txt
documentation: fix almost duplicate filenames (IO/io-mapping.txt)
2010-07-20 17:49:30 +00:00
cachetlb.txt
mm: convert mm->cpu_vm_cpumask into cpumask_var_t
2011-05-25 08:39:21 -07:00
Changes
Documentation/Changes: minor corrections
2011-03-22 17:44:17 -07:00
circular-buffers.txt
Document Linux's circular buffering capabilities
2010-03-24 16:31:22 -07:00
coccinelle.txt
scripts/coccinelle: update for compatability with Coccinelle 0.2.4
2010-12-03 12:27:01 +01:00
CodingStyle
Documentation: update CodingStyle memory allocators
2011-07-06 13:17:51 -07:00
cpu-hotplug.txt
Fix common misspellings
2011-03-31 11:26:23 -03:00
cpu-load.txt
cputopology.txt
topology/sysfs: Provide book id and siblings attributes
2010-09-09 20:41:25 +02:00
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
Fix common misspellings
2011-03-31 11:26:23 -03:00
devices.txt
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
2010-10-28 09:35:11 -07:00
DMA-API-HOWTO.txt
Documentation: DMA-API-HOWTO.txt: rename ARCH_KMALLOC_MINALIGN to ARCH_DMA_MINALIGN
2010-08-14 11:56:46 -07:00
DMA-API.txt
dma-mapping: remove dma_is_consistent API
2010-08-11 08:59:21 -07:00
DMA-attributes.txt
DMA-ISA-LPC.txt
dmaengine.txt
dmaengine: Add API documentation for slave dma usage
2011-05-25 14:49:20 -07:00
dontdiff
Documentation: update dontdiff file
2011-05-23 15:14:11 -07:00
dynamic-debug-howto.txt
Merge branch 'docs-next' of git://git.lwn.net/linux-2.6
2011-03-27 19:46:59 -07:00
edac.txt
Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6
2011-04-07 11:14:49 -07:00
eisa.txt
Fix common misspellings
2011-03-31 11:26:23 -03:00
email-clients.txt
Documentation/email-clients.txt: update Thunderbird docs with wordwrap plugin
2011-01-13 08:03:15 -08:00
feature-removal-schedule.txt
Documentation/feature-removal-schedule.txt: remove ns_cgroup from feature-removal-schedule.txt
2011-06-15 20:04:02 -07:00
flexible-arrays.txt
flex_array: flex_array_prealloc takes a number of elements, not an end
2011-04-28 16:12:47 -04:00
futex-requeue-pi.txt
gcov.txt
gpio.txt
Revert "gpiolib: annotate gpio-intialization with __must_check"
2011-01-13 17:26:46 -08:00
highuid.txt
HOWTO
Documentation: update LXR web link
2011-05-23 15:14:11 -07:00
hw_random.txt
hwspinlock.txt
drivers: hwspinlock: add framework
2011-02-17 09:52:03 -08:00
init.txt
init/main.c: improve usability in case of init binary failure
2010-03-06 11:26:29 -08:00
initrd.txt
Intel-IOMMU.txt
intel_txt.txt
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
io-mapping.txt
io_ordering.txt
iostats.txt
Documentation/iostats.txt: bit-size reference etc.
2011-03-23 20:44:18 +01:00
IPMI.txt
IPMI: Add the document description of ipmi_get_smi_info
2010-12-14 00:22:00 -05:00
IRQ-affinity.txt
bitmap, irq: add smp_affinity_list interface to /proc/irq
2011-05-25 08:39:45 -07:00
IRQ.txt
irqflags-tracing.txt
Fix common misspellings
2011-03-31 11:26:23 -03:00
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt
docbook: warn on unused doc entries
2010-09-11 16:49:21 -07:00
kernel-docs.txt
Documentation: update kernel-docs.txt
2011-01-06 09:59:38 -08:00
kernel-parameters.txt
usb-storage: redo incorrect reads
2011-06-07 09:05:42 -07:00
kmemcheck.txt
kmemleak.txt
Documentation: update kmemleak supported archs
2011-06-15 21:52:50 -07:00
kobject.txt
kobject: documentation: Update to refer to kset-example.c.
2010-03-19 07:12:20 -07:00
kprobes.txt
tree-wide: fix comment/printk typos
2010-11-01 15:38:34 -04:00
kref.txt
kref: Fix typo in kref documentation
2011-03-07 13:20:05 -08:00
ldm.txt
Documentation: update broken web addresses.
2010-08-04 15:21:40 +02:00
local_ops.txt
lockdep-design.txt
lockstat.txt
Documentation: Add statistics about nested locks
2011-05-28 17:03:29 +02:00
logo.gif
logo.txt
magic-number.txt
take coda-private headers out of include/linux
2011-01-12 20:02:48 -05:00
Makefile
[media] Remove the old V4L1 v4lgrab.c file
2010-12-29 08:17:12 -02:00
ManagementStyle
mca.txt
md.txt
md:Documentation/md.txt - fix typo
2011-06-09 11:43:04 +10:00
media-framework.txt
Fix common misspellings
2011-03-31 11:26:23 -03:00
memory-barriers.txt
smp: Document transitivity for memory barriers.
2011-03-04 08:05:49 -08:00
memory-hotplug.txt
memory hotplug: Allow memory blocks to span multiple memory sections
2011-02-03 16:08:57 -08:00
memory.txt
mono.txt
mutex-design.txt
mutex: Fix annotations to include it in kernel-locking docbook
2010-09-03 08:19:51 +02:00
nmi_watchdog.txt
nommu-mmap.txt
numastat.txt
oops-tracing.txt
panic: Add taint flag TAINT_FIRMWARE_WORKAROUND ('I')
2010-05-19 08:37:43 +01:00
padata.txt
Documentation/padata.txt: fix typos etc.
2010-08-11 08:59:18 -07:00
parport-lowlevel.txt
parport.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
printk-formats.txt
Documentation: update printk-formats.txt
2011-06-15 21:52:50 -07:00
prio_tree.txt
rbtree.txt
Documentation: remove anticipatory scheduler info
2010-11-11 12:09:59 +01:00
rfkill.txt
Document the rfkill sysfs ABI
2010-03-10 17:09:33 -05:00
robust-futex-ABI.txt
robust-futexes.txt
rt-mutex-design.txt
variable name fix to Documentation/rt-mutex-design.txt
2010-06-05 17:39:09 +02:00
rt-mutex.txt
rtc.txt
RTC: Fix up rtc.txt documentation to reflect changes to generic rtc layer
2011-03-09 11:25:10 -08:00
SAK.txt
SecurityBugs
Fix common misspellings
2011-03-31 11:26:23 -03:00
serial-console.txt
sgi-ioc4.txt
sgi-visws.txt
SM501.txt
sparse.txt
update email address
2010-07-19 10:56:54 +02:00
spinlocks.txt
locking: Remove deprecated lock initializers
2011-01-27 12:30:38 +01:00
stable_api_nonsense.txt
doc: stable_api_nonsense.txt: fix paragraph to make more sense.
2011-03-30 12:02:05 +02:00
stable_kernel_rules.txt
Documentation: -stable rules: upstream commit ID requirement reworded
2010-04-22 15:24:56 -07:00
SubmitChecklist
Documentation: update SubmitChecklist for O=objdir and kconfig testing
2010-05-24 07:31:20 -07:00
SubmittingDrivers
Fix common misspellings
2011-03-31 11:26:23 -03:00
SubmittingPatches
Documentation: update GregKH links
2011-05-23 15:14:11 -07:00
svga.txt
sysfs-rules.txt
Fix typos in comments
2010-03-16 11:47:56 +01:00
sysrq.txt
documentation: update sysrq.txt magic sysrq keys
2010-10-26 17:32:41 -07:00
unaligned-memory-access.txt
unicode.txt
unshare.txt
VGA-softcursor.txt
vgaarbiter.txt
Documentation: fix vgaarbiter.txt typos etc.
2011-05-23 15:14:11 -07:00
video-output.txt
volatile-considered-harmful.txt
Documentation/volatile-considered-harmful.txt: correct cpu_relax() documentation
2010-03-24 16:31:20 -07:00
workqueue.txt
workqueue: Document debugging tricks
2011-03-31 13:40:42 +02:00
xz.txt
decompressors: add XZ decompressor module
2011-01-13 08:03:24 -08:00
zorro.txt