mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge branch 'kvm-updates/2.6.37' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.37' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (321 commits) KVM: Drop CONFIG_DMAR dependency around kvm_iommu_map_pages KVM: Fix signature of kvm_iommu_map_pages stub KVM: MCE: Send SRAR SIGBUS directly KVM: MCE: Add MCG_SER_P into KVM_MCE_CAP_SUPPORTED KVM: fix typo in copyright notice KVM: Disable interrupts around get_kernel_ns() KVM: MMU: Avoid sign extension in mmu_alloc_direct_roots() pae root address KVM: MMU: move access code parsing to FNAME(walk_addr) function KVM: MMU: audit: check whether have unsync sps after root sync KVM: MMU: audit: introduce audit_printk to cleanup audit code KVM: MMU: audit: unregister audit tracepoints before module unloaded KVM: MMU: audit: fix vcpu's spte walking KVM: MMU: set access bit for direct mapping KVM: MMU: cleanup for error mask set while walk guest page table KVM: MMU: update 'root_hpa' out of loop in PAE shadow path KVM: x86 emulator: Eliminate compilation warning in x86_decode_insn() KVM: x86: Fix constant type in kvm_get_time_scale KVM: VMX: Add AX to list of registers clobbered by guest switch KVM guest: Move a printk that's using the clock before it's ready KVM: x86: TSC catchup mode ...
This commit is contained in:
commit
1765a1fe5d
73 changed files with 6701 additions and 2389 deletions
|
|
@ -32,6 +32,7 @@
|
|||
* The pointer to our (page) of device descriptions.
|
||||
*/
|
||||
static void *kvm_devices;
|
||||
struct work_struct hotplug_work;
|
||||
|
||||
struct kvm_device {
|
||||
struct virtio_device vdev;
|
||||
|
|
@ -327,6 +328,47 @@ static void scan_devices(void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* match for a kvm device with a specific desc pointer
|
||||
*/
|
||||
static int match_desc(struct device *dev, void *data)
|
||||
{
|
||||
if ((ulong)to_kvmdev(dev_to_virtio(dev))->desc == (ulong)data)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotplug_device tries to find changes in the device page.
|
||||
*/
|
||||
static void hotplug_devices(struct work_struct *dummy)
|
||||
{
|
||||
unsigned int i;
|
||||
struct kvm_device_desc *d;
|
||||
struct device *dev;
|
||||
|
||||
for (i = 0; i < PAGE_SIZE; i += desc_size(d)) {
|
||||
d = kvm_devices + i;
|
||||
|
||||
/* end of list */
|
||||
if (d->type == 0)
|
||||
break;
|
||||
|
||||
/* device already exists */
|
||||
dev = device_find_child(kvm_root, d, match_desc);
|
||||
if (dev) {
|
||||
/* XXX check for hotplug remove */
|
||||
put_device(dev);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* new device */
|
||||
printk(KERN_INFO "Adding new virtio device %p\n", d);
|
||||
add_kvm_device(d, i);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* we emulate the request_irq behaviour on top of s390 extints
|
||||
*/
|
||||
|
|
@ -334,7 +376,7 @@ static void kvm_extint_handler(u16 code)
|
|||
{
|
||||
struct virtqueue *vq;
|
||||
u16 subcode;
|
||||
int config_changed;
|
||||
u32 param;
|
||||
|
||||
subcode = S390_lowcore.cpu_addr;
|
||||
if ((subcode & 0xff00) != VIRTIO_SUBCODE_64)
|
||||
|
|
@ -343,18 +385,28 @@ static void kvm_extint_handler(u16 code)
|
|||
/* The LSB might be overloaded, we have to mask it */
|
||||
vq = (struct virtqueue *)(S390_lowcore.ext_params2 & ~1UL);
|
||||
|
||||
/* We use the LSB of extparam, to decide, if this interrupt is a config
|
||||
* change or a "standard" interrupt */
|
||||
config_changed = S390_lowcore.ext_params & 1;
|
||||
/* We use ext_params to decide what this interrupt means */
|
||||
param = S390_lowcore.ext_params & VIRTIO_PARAM_MASK;
|
||||
|
||||
if (config_changed) {
|
||||
switch (param) {
|
||||
case VIRTIO_PARAM_CONFIG_CHANGED:
|
||||
{
|
||||
struct virtio_driver *drv;
|
||||
drv = container_of(vq->vdev->dev.driver,
|
||||
struct virtio_driver, driver);
|
||||
if (drv->config_changed)
|
||||
drv->config_changed(vq->vdev);
|
||||
} else
|
||||
|
||||
break;
|
||||
}
|
||||
case VIRTIO_PARAM_DEV_ADD:
|
||||
schedule_work(&hotplug_work);
|
||||
break;
|
||||
case VIRTIO_PARAM_VRING_INTERRUPT:
|
||||
default:
|
||||
vring_interrupt(0, vq);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -383,6 +435,8 @@ static int __init kvm_devices_init(void)
|
|||
|
||||
kvm_devices = (void *) real_memory_size;
|
||||
|
||||
INIT_WORK(&hotplug_work, hotplug_devices);
|
||||
|
||||
ctl_set_bit(0, 9);
|
||||
register_external_interrupt(0x2603, kvm_extint_handler);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue