This ioctl function is supposed to return a negative error code or zero
on success. copy_to_user() returns zero or the number of bytes
remaining to be copied.
Signed-off-by: Dan Carpenter
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 457acf3..1aa373f 100644
--- a/drivers/vfio/vfi
In vfio_pci_ioctl() there is a potential integer underflow where we
might allocate less data than intended. We check that hdr.count is not
too large, but we don't check whether it is negative:
drivers/vfio/pci/vfio_pci.c
312 if (hdr.argsz - minsz < hdr.count * size ||
313
On Wed, Jun 27, 2012 at 01:23:23PM -0600, Alex Williamson wrote:
> On Wed, 2012-06-27 at 15:37 +0300, Dan Carpenter wrote:
> > On Mon, Jun 25, 2012 at 10:55:52PM -0600, Alex Williamson wrote:
> > > Hi,
> > >
> > > VFIO has been kicking around for well over a year now and has been
> > > posted nume
The "count" variable is unsigned here so the test for errors doesn't
work.
Signed-off-by: Dan Carpenter
diff --git a/drivers/vfio/pci/vfio_pci_config.c
b/drivers/vfio/pci/vfio_pci_config.c
index a4f7321..10bc6a8 100644
--- a/drivers/vfio/pci/vfio_pci_config.c
+++ b/drivers/vfio/pci/vfio_pci_con
On Thu, Jun 28, 2012 at 01:31:29AM +0300, Michael S. Tsirkin wrote:
> On Wed, Jun 27, 2012 at 04:04:18PM -0600, Alex Williamson wrote:
> > On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote:
> > > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > > > @@ -71,6 +130,14 @@
This patch adds the watchdog emulation in KVM. The watchdog
emulation is enabled by KVM_ENABLE_CAP(KVM_CAP_PPC_WDT) ioctl.
The kernel timer are used for watchdog emulation and emulates
h/w watchdog state machine. On watchdog timer expiry, it exit to QEMU
if TCR.WRC is non ZERO. QEMU can reset/shutd
Since NMI can not be disabled around VM enter, there is a race between
receiving NMI to kick a guest and entering the guests on slave CPUs.If the
NMI is received just before entering VM, after the NMI handler is invoked,
it continues entering the guest and the effect of the NMI will be lost.
This
Make interrupts on slave CPUs handled by guests without VM EXIT.
This reduces CPU usage by the host to transfer interrupts of assigned
PCI devices from the host to guests. It also reduces cost of VM EXIT
and quickens response of guests to the interrupts.
When a slave CPU is dedicated to a vCPU, ex
For slave CPUs, it is inapropriate to request TLB flush using IPI.
because the IPI may be sent to a KVM guest when the slave CPU is running
the guest with direct interrupt routing.
Instead, it registers a TLB flush request in per-cpu bitmask and send a NMI
to interrupt execution of the guest. Then
When a PCI device is assigned to a guest running on slave CPUs, this
routes the device's MSI/MSI-X interrupts directly to the guest.
Because the guest uses a different interrupt vector from the host,
vector remapping is required. This is safe because slave CPUs only handles
interrupts for the assi
Adds a facility to use hrtimer on slave CPUs.
To initialize hrtimer when slave CPUs are activated, and to shutdown hrtimer
when slave CPUs are stopped, this patch adds the slave cpu notifier chain,
which call registered callbacks when slave CPUs are up, dying, and died.
The registered callbacks a
Page faults which occured by the guest running on slave CPUs cannot be
handled on slave CPUs because it is running on idle process context.
With this patch, the page fault happened in a slave CPU is notified to
online CPU using struct kvm_access_fault, and is handled after the
user-process for the
Add some fix-ups that proxy slab operations on online CPUs for the guest,
in order to avoid touching slab on slave CPUs where some slab functions
are not activated.
Currently, slab may be touched on slave CPUs in following 3 cases.
For each cases, the fix-ups below are introduced:
* kvm_mmu_commi
Add some definitions to use PIN_BASED_PREEMPTION_TIMER.
When PIN_BASED_PREEMPTION_TIMER is enabled, the guest will exit
with reason=EXIT_REASON_PREEMPTION_TIMER when the counter specified in
VMX_PREEMPTION_TIMER_VALUE becomes 0.
This patch also adds a dummy handler for EXIT_REASON_PREEMPTION_TIMER
Enable APIC to handle interrupts on slave CPUs, and enables interrupt
routing to slave CPUs by setting IRQ affinity.
As slave CPUs which run a KVM guest handle external interrupts directly in
the vCPUs, the guest's vector/IRQ mapping is different from the host's.
That requires interrupts to be rou
Add a facility to use IRQ vector different from online CPUs on slave CPUs.
When alternative vector for IRQ is registered by remap_slave_vector_irq()
and the IRQ affinity is set only to slave CPUs, the device is configured
to use the alternative vector.
Current patch only supports MSI and Intel CP
Avoid exiting from a guest on slave CPU even if HLT instruction is
executed. Since the slave CPU is dedicated to a vCPU, exit on HLT is
not required, and avoiding VM exit will improve the guest's performance.
This is a partial revert of
10166744b80a ("KVM: VMX: remove yield_on_hlt")
Cc:
Replace local_irq_disable/enable with local_irq_save/restore in the path
where is executed on slave CPUs. This is required because irqs are disabled
while the guest is running on the slave CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Moln
If the slave CPU receives an interrupt in running a guest, current
implementation must once go back to onilne CPUs to handle the interupt.
This behavior will be replaced by later patch, which introduces direct
interrupt handling mechanism by the guest.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivi
Add an interface to set/get slave CPU dedicated to the vCPUs.
By calling ioctl with KVM_GET_SLAVE_CPU, users can get the slave CPU id
for the vCPU. -1 is returned if a slave CPU is not set.
By calling ioctl with KVM_SET_SLAVE_CPU, users can dedicate the specified
slave CPU to the vCPU. The CPU mu
Add path to migrate execution of vcpu_enter_guest to a slave CPU when
vcpu->arch.slave_cpu is set.
After moving to the slave CPU, it goes back to the online CPU when the
guest is exited by reasons that cannot be handled by the slave CPU only
(e.g. handling async page faults).
On migration, kvm_ar
Enable virtualization when slave CPUs are activated, and disable when
the CPUs are dying using slave CPU notifier call chain.
In x86, TSC kHz must also be initialized by tsc_khz_changed when the
new slave CPUs are activated.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc:
Add a facility of using offlined CPUs as slave CPUs. Slave CPUs are
specialized to exclusively run functions specified by online CPUs,
which do not run user processes.
To use this feature, build the kernel with CONFIG_SLAVE_CPU=y.
A slave CPU is launched by calling cpu_slave_up() when the CPU is
Split memory hotplug function from cpu_up() as cpu_memory_up(), which will
be used for assigning memory area to off-lined cpus at following patch
in this series.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
i
Hello,
This RFC patch series provides facility to dedicate CPUs to KVM guests
and enable the guests to handle interrupts from passed-through PCI devices
directly (without VM exit and relay by the host).
With this feature, we can improve throughput and response time of the device
and the host's CP
rfci instruction and CSRR0/1 registers are emulated.
Signed-off-by: Scott Wood
Signed-off-by: Stuart Yoder
Signed-off-by: Bharat Bhushan
---
arch/powerpc/kvm/booke_emulate.c | 25 +
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kvm/booke
On Wed, 2012-06-27 at 17:51 +0300, Gleb Natapov wrote:
> On Wed, Jun 27, 2012 at 08:29:04AM -0600, Alex Williamson wrote:
> > On Wed, 2012-06-27 at 16:58 +0300, Gleb Natapov wrote:
> > > On Tue, Jun 26, 2012 at 11:10:08PM -0600, Alex Williamson wrote:
> > > > This new ioctl enables an eventfd to be
On Thu, 2012-06-28 at 01:28 +0300, Michael S. Tsirkin wrote:
> On Wed, Jun 27, 2012 at 03:28:19PM -0600, Alex Williamson wrote:
> > On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote:
> > > On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote:
> > > > On Wed, 2012-06-27 at 12:51
On Thu, 28 Jun 2012 11:12:51 +0800
Xiao Guangrong wrote:
> > struct kvm_arch_memory_slot {
> > + unsigned long *rmap_pde[KVM_NR_PAGE_SIZES - 1];
> > struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1];
> > };
> >
>
> It looks little complex than before - need manage more alloc-ed/f
On 06/28/2012 10:01 AM, Takuya Yoshikawa wrote:
> This makes it possible to loop over rmap_pde arrays in the same way as
> we do over rmap so that we can optimize kvm_handle_hva_range() easily in
> the following patch.
>
> Signed-off-by: Takuya Yoshikawa
> ---
> arch/x86/include/asm/kvm_host.h |
On Thu, 2012-06-28 at 10:59 +0900, Namhyung Kim wrote:
> Ok, thanks. But how about other ones? Did you add all of 4 into you
> queue?
Ah, no I didn't. I actually would like Arnaldo to do that.
Arnaldo,
Can you pull patches 1,3 & 4 into your repo, and add my:
Acked-by: Steven Rostedt
Thanks!
On 06/21/2012 12:13 PM, Gleb Natapov wrote:
On Tue, Jun 19, 2012 at 04:51:04PM -0400, Rik van Riel wrote:
On Wed, 20 Jun 2012 01:50:50 +0530
Raghavendra K T wrote:
In ple handler code, last_boosted_vcpu (lbv) variable is
serving as reference point to start when we enter.
Also statistical
On Wed, 27 Jun 2012 21:52:44 -0400, Steven Rostedt wrote:
> On Thu, 2012-06-28 at 10:16 +0900, Namhyung Kim wrote:
>> [CC'ing David]
>>
>> Hi, Steve
>>
>> On Wed, 27 Jun 2012 09:20:24 -0400, Steven Rostedt wrote:
>> > On Wed, 2012-06-27 at 15:54 +0300, Avi Kivity wrote:
>> >
>> >> Acked-by: Avi K
When we invalidate a THP page, we call the handler with the same
rmap_pde argument 512 times in the following loop:
for each guest page in the range
for each level
unmap using rmap
This patch avoids these extra handler calls by changing the loop order
like this:
for each level
This makes it possible to loop over rmap_pde arrays in the same way as
we do over rmap so that we can optimize kvm_handle_hva_range() easily in
the following patch.
Signed-off-by: Takuya Yoshikawa
---
arch/x86/include/asm/kvm_host.h |2 +-
arch/x86/kvm/mmu.c |6 +++---
arch/
When we tested KVM under memory pressure, with THP enabled on the host,
we noticed that MMU notifier took a long time to invalidate huge pages.
Since the invalidation was done with mmu_lock held, it not only wasted
the CPU but also made the host harder to respond.
This patch mitigates this by usi
When guest's memory is backed by THP pages, MMU notifier needs to call
kvm_unmap_hva(), which in turn leads to kvm_handle_hva(), in a loop to
invalidate a range of pages which constitute one huge page:
for each page
for each memslot
if page is in memslot
unmap using rmap
This
This restricts hva handling in mmu code and makes it easier to extend
kvm_handle_hva() so that it can treat a range of addresses later in this
patch series.
Signed-off-by: Takuya Yoshikawa
Cc: Alexander Graf
Cc: Paul Mackerras
---
arch/powerpc/kvm/book3s_64_mmu_hv.c |6 +++---
arch/x86/kvm
We can treat every level uniformly.
Signed-off-by: Takuya Yoshikawa
---
arch/x86/kvm/mmu.c | 12 ++--
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 3b53d9e..d3e7e6a 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@
Updated patch 3 and 6 so that unmap handler be called with exactly same
rmap arguments as before, even if kvm_handle_hva_range() is called with
unaligned [start, end).
Please see the comments I added there.
Takuya
Takuya Yoshikawa (6):
KVM: MMU: Use __gfn_to_rmap() to clean up kvm_han
On Thu, 2012-06-28 at 10:16 +0900, Namhyung Kim wrote:
> [CC'ing David]
>
> Hi, Steve
>
> On Wed, 27 Jun 2012 09:20:24 -0400, Steven Rostedt wrote:
> > On Wed, 2012-06-27 at 15:54 +0300, Avi Kivity wrote:
> >
> >> Acked-by: Avi Kivity
> >
> > Thanks Avi!
> >
>
> Can you give me your ack's too (
On Wed, 2012-06-27 at 21:44 -0300, Marcelo Tosatti wrote:
> The advantage is the added prefix?
All messages are automatically prefixed.
For instance:
> > - printk(KERN_WARNING "Fail to find correlated MSI-X entry!\n");
> > + pr_warn("Fail to find correlated MSI-X entry!\n");
On Sat, Jun 23, 2012 at 11:22:07AM +0200, Jan Kiszka wrote:
> On 2012-06-23 02:22, Marcelo Tosatti wrote:
> > On Sat, Jun 23, 2012 at 12:55:49AM +0200, Jan Kiszka wrote:
> >> Should have declared this [RFC] in the subject and CC'ed kvm...
> >>
> >> On 2012-06-23 00:45, Jan Kiszka wrote:
> >>> This
The advantage is the added prefix?
$ grep limit Documentation/CodingStyle
The limit on the length of lines is 80 columns and this is a strongly
preferred limit.
On Wed, Jun 13, 2012 at 08:20:21PM -0700, Joe Perches wrote:
> Use a more current logging style.
>
> Convert printks to pr_.
> Add pr
On Fri, Jun 15, 2012 at 11:34:31AM +0800, Guo Chao wrote:
>
> Signed-off-by: Guo Chao
> ---
> arch/x86/kvm/vmx.c |2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index f48cef3..7593693 100644
> --- a/arch/x86/kvm/vmx.c
> +++
[CC'ing David]
Hi, Steve
On Wed, 27 Jun 2012 09:20:24 -0400, Steven Rostedt wrote:
> On Wed, 2012-06-27 at 15:54 +0300, Avi Kivity wrote:
>
>> Acked-by: Avi Kivity
>
> Thanks Avi!
>
Can you give me your ack's too (for this and other ones in the series)?
And if you ok, I can route this and futur
At 06/27/2012 10:39 PM, Jan Kiszka Wrote:
> On 2012-06-27 09:02, Wen Congyang wrote:
>> When the guest is panicked, it will write 0x1 to the port KVM_PV_PORT.
>> So if qemu reads 0x1 from this port, we can do the folloing three
>> things according to the parameter -onpanic:
>> 1. emit QEVENT_GUEST_
On Wed, Jun 27, 2012 at 04:04:18PM -0600, Alex Williamson wrote:
> On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote:
> > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > > @@ -71,6 +130,14 @@ irqfd_inject(struct work_struct *work)
> > > kvm_set_irq(kvm, KVM_USERSPAC
On Wed, Jun 27, 2012 at 03:28:19PM -0600, Alex Williamson wrote:
> On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote:
> > On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote:
> > > On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote:
> > > > On Tue, Jun 26, 2012 at 11:
On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote:
> On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote:
> > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > > In order to inject an interrupt from an external source using an
> > > irqfd, we need to allocat
On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote:
> On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > @@ -71,6 +130,14 @@ irqfd_inject(struct work_struct *work)
> > kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 0);
> > }
> >
> > +static void
> > +irq
On 27.06.2012, at 23:30, Benjamin Herrenschmidt wrote:
> On Wed, 2012-06-27 at 14:30 +0200, Alexander Graf wrote:
>> Thanks, applied to ppc-next. Next time, please base on top of a newer
>> git base - I had to manually fix the patch to apply.
>
> It was based on top of qemu master from yesterday
On Wed, 2012-06-27 at 14:30 +0200, Alexander Graf wrote:
> Thanks, applied to ppc-next. Next time, please base on top of a newer
> git base - I had to manually fix the patch to apply.
It was based on top of qemu master from yesterday. As you know that's
what I work on top of. Did you make sure you
On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote:
> On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote:
> > On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote:
> > > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > > > In order to inject an inter
On Wed, 2012-06-27 at 12:34 +0300, Michael S. Tsirkin wrote:
> On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > In order to inject an interrupt from an external source using an
> > irqfd, we need to allocate a new irq_source_id. This allows us to
> > assert and (later) de-asser
On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote:
> On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> > In order to inject an interrupt from an external source using an
> > irqfd, we need to allocate a new irq_source_id. This allows us to
> > assert and (later) de-asser
Is Kemari still in active development?
On Sun, Dec 4, 2011 at 9:45 PM, OHMURA Kei wrote:
> On 2011/12/02 21:51, Pradeep Kumar wrote:
>> It fixes build failure.
>>
>> I hit this error, after succsfull migration and sync.
>>
>> (qemu) qemu-system-x86_64: fill buffer failed, Interrupted system call
On 06/28/2012 01:57 AM, Raghavendra K T wrote:
On 06/24/2012 12:04 AM, Raghavendra K T wrote:
On 06/23/2012 02:30 AM, Raghavendra K T wrote:
On 06/22/2012 08:41 PM, Andrew Jones wrote:
[...]
(benchmark values will be attached in reply to this mail)
pv_benchmark_summary.bz2
Description: app
On 06/24/2012 12:04 AM, Raghavendra K T wrote:
On 06/23/2012 02:30 AM, Raghavendra K T wrote:
On 06/22/2012 08:41 PM, Andrew Jones wrote:
[...]
My run for other benchmarks did not have Rik's patches, so re-spinning
everything with that now.
Here is the detailed info on env and benchmark I am
On Wed, Jun 27, 2012 at 02:12:18PM -0600, Alex Williamson wrote:
> On Wed, 2012-06-27 at 12:21 +0300, Michael S. Tsirkin wrote:
> > On Tue, Jun 26, 2012 at 11:09:32PM -0600, Alex Williamson wrote:
> > > We only know of one so far.
> > >
> > > Signed-off-by: Alex Williamson
> >
> > Ugh. So we hav
On Wed, 2012-06-27 at 12:21 +0300, Michael S. Tsirkin wrote:
> On Tue, Jun 26, 2012 at 11:09:32PM -0600, Alex Williamson wrote:
> > We only know of one so far.
> >
> > Signed-off-by: Alex Williamson
>
> Ugh. So we have a bug: we should have sanitized the fields.
> If there's buggy userspace that
On Wed, 2012-06-27 at 15:37 +0300, Dan Carpenter wrote:
> On Mon, Jun 25, 2012 at 10:55:52PM -0600, Alex Williamson wrote:
> > Hi,
> >
> > VFIO has been kicking around for well over a year now and has been
> > posted numerous times for review. The pre-requirements are finally
> > available in lin
On Wed, Jun 27, 2012 at 04:54:54PM +0800, Yanfei Zhang wrote:
> This patch export offsets of fields via /sys/devices/cpu/vmcs/.
> Individual offsets are contained in subfiles named by the filed's
> encoding, e.g.: /sys/devices/cpu/vmcs/0800
>
> Signed-off-by: zhangyanfei
> ---
> drivers/base/cor
On Wed, 2012-06-27 at 09:09 -0700, Randy Dunlap wrote:
> On 06/26/2012 08:22 PM, Stephen Rothwell wrote:
>
> > Hi all,
> >
> > This tree was not built between each merge, but only after merging all
> > the trees.
> >
> > Changes since 20120626:
> >
> > New tree: vfio
>
>
> on x86_64:
>
> C
On 2012-06-27 17:39, Peter Lieven wrote:
> Hi all,
>
> i debugged this further and found out that kvm-kmod-3.0 is working with
> qemu-kvm-1.0.1 while kvm-kmod-3.3 and kvm-kmod-3.4 are not. What is
> working as well is kvm-kmod-3.4 with an old userspace (qemu-kvm-0.13.0).
> Has anyone a clue which
The memory subsystem will now take care of flushing whenever affected
regions are accessed or the memory mapping changes.
Signed-off-by: Jan Kiszka
---
kvm-all.c |2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index f8e4328..a1d32f6 100644
--- a/kv
Simplify the code as we are using now only a subset of the original
features of memory_region_update_topology.
Signed-off-by: Jan Kiszka
---
memory.c | 39 +++
1 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/memory.c b/memory.c
index 8b1218e
This MMIO area is an entry gate to legacy PC ISA devices, addressed via
PIO over there. Quite a few of the PIO ports have side effects on access
like starting/stopping timers that must be executed properly ordered
/wrt the CPU. So we have to remove the coalescing mark.
Acked-by: Hervé Poussineau
Wrap also simple operations consisting only of a single step with
memory_region_transaction_begin/commit. This allows to perform
additional steps like coalesced MMIO flushing from a single place.
This requires dropping some micro-optimizations: The skipping of
topology updates after updating disab
Flush pending coalesced MMIO before performing mapping or state changes
that could affect the event orderings or route the buffered requests to
a wrong region.
Signed-off-by: Jan Kiszka
---
memory.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/memory.c b/memory.c
inde
In preparation of stopping to flush coalesced MMIO unconditionally on
vmexits, mark VGA MMIO and PIO regions as synchronous /wrt coalesced
MMIO and flush the buffer explicitly on PIO accesses that do not use
generic memory regions yet.
Signed-off-by: Jan Kiszka
---
hw/cirrus_vga.c |7 +++
Instead of flushing pending coalesced MMIO requests on every vmexit,
this provides a mechanism to selectively flush when memory regions
related to the coalesced one are accessed. This first of all includes
the coalesced region itself but can also applied to other regions, e.g.
of the same device, b
Changes in v2:
- added memory_region_clear_flush_coalesced
- call memory_region_clear_flush_coalesced from
memory_region_clear_coalescing
- wrap all region manipulations via memory_region_transaction_begin/
commit internally
- flush coalesced MMIO only on memory_region_transaction_begin
On Wed, Jun 27, 2012 at 9:06 AM, Michael S. Tsirkin wrote:
> On Wed, Jun 27, 2012 at 08:48:55AM -0700, Frank Swiderski wrote:
>> On Tue, Jun 26, 2012 at 7:56 PM, Rusty Russell wrote:
>> > On Wed, 27 Jun 2012 00:41:06 +0300, "Michael S. Tsirkin"
>> > wrote:
>> >> On Tue, Jun 26, 2012 at 01:32:58
On Wed, Jun 27, 2012 at 08:48:55AM -0700, Frank Swiderski wrote:
> On Tue, Jun 26, 2012 at 7:56 PM, Rusty Russell wrote:
> > On Wed, 27 Jun 2012 00:41:06 +0300, "Michael S. Tsirkin"
> > wrote:
> >> On Tue, Jun 26, 2012 at 01:32:58PM -0700, Frank Swiderski wrote:
> >> > This implementation of a v
On Tue, Jun 26, 2012 at 7:56 PM, Rusty Russell wrote:
> On Wed, 27 Jun 2012 00:41:06 +0300, "Michael S. Tsirkin"
> wrote:
>> On Tue, Jun 26, 2012 at 01:32:58PM -0700, Frank Swiderski wrote:
>> > This implementation of a virtio balloon driver uses the page cache to
>> > "store" pages that have be
Hi all,
i debugged this further and found out that kvm-kmod-3.0 is working with
qemu-kvm-1.0.1 while kvm-kmod-3.3 and kvm-kmod-3.4 are not. What is
working as well is kvm-kmod-3.4 with an old userspace (qemu-kvm-0.13.0).
Has anyone a clue which new KVM feature could cause this if a vcpu is in
Instead of getting an exact leaf, follow the spec and fall back to the last
main leaf instead. This lets us easily emulate the cpuid instruction in the
emulator.
Signed-off-by: Avi Kivity
---
arch/x86/include/asm/kvm_emulate.h | 4 +--
arch/x86/kvm/emulate.c | 53 ++
The operand size for these instructions is 8 bytes in long mode, even without
a REX prefix. Set it explicitly.
Triggered while booting Linux with emulate_invalid_guest_state=1.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/x86
We correctly default to SS when BP is used as a base in 16-bit address mode,
but we don't do that for 32-bit mode.
Fix by adjusting the default to SS when either ESP or EBP is used as the base
register.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 17 ++---
1 file changed,
Null SS is valid in long mode; allow loading it.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index db95a55..fe4340f 100644
--- a/arch/x86/kvm/emulate.c
+++ b/
memop is not initialized; this can lead to a two-byte operation
following a 4-byte operation to see garbage values. Usually
truncation fixes things fot us later on, but at least in one case
(call abs) it doesn't.
Fix by moving memop to the auto-initialized field area.
Signed-off-by: Avi Kivity
On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote:
> @@ -71,6 +130,14 @@ irqfd_inject(struct work_struct *work)
> kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 0);
> }
>
> +static void
> +irqfd_inject_level(struct work_struct *work)
> +{
> + struct _irqfd *irq
Our emulation should be complete enough that we can emulate guests
while they are in big real mode, or in a mode transition that is not
virtualizable without unrestricted guest support.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -
If instruction emulation fails, report it properly to userspace.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 661df185..591dcea 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x8
This allows us to reuse the code without populating ctxt->src and
overriding ctxt->op_bytes.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 30f4912..acc647d
Checking EFLAGS.IF is incorrect as we might be in interrupt shadow. If
that is the case, the main loop will notice that and not inject the interrupt,
causing an endless loop.
Fix by using vmx_interrupt_allowed() to check if we can inject an interrupt
instead.
Signed-off-by: Avi Kivity
---
arch
If we return early from an invalid guest state emulation loop, make
sure we return to it later if the guest state is still invalid.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index d
Guest software doesn't actually depend on it, but vmx will refuse us
entry if we don't. Set the bit in both the cached segment and memory,
just to be nice.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kv
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 92a1add..97d9a99 100644
--- a/ar
Opcode 0F 00 /2. Used by isolinux durign the protected mode transition.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index cfa5cc3..7b575ad 100644
--- a/arch/x8
Some operations want to modify the descriptor later on, so save the
address for future use.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7b575ad..99e3df
Opcodes 0F C8 - 0F CF.
Used by the SeaBIOS cdrom code (though not in big real mode).
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b4b326e..cfa5
Process the event, possibly injecting an interrupt, before continuing.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 26e6bdf..661df185 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
Opcode C8.
Only ENTER with lexical nesting depth 0 is implemented, since others are
very rare. We'll fail emulation if nonzero lexical depth is used so data
is not corrupted.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 28 +++-
1 file changed, 27 insertions(+
Commit 2adb5ad9fe1 removed ByteOp from MOVZX/MOVSX, replacing them by
SrcMem8, but neglected to fix the dependency in the emulation code
on ByteOp. This caused the instruction not to have any effect in
some circumstances.
Fix by replacing the check for ByteOp with the equivalent src.op_bytes == 1
Opcode 9F.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 5053e9e..90b549e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3227,6 +3227,13
Opcodes 0F 01 /0 and 0F 01 /1
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 33 +++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7552c0a..5053e9e 100644
--- a/arch/x86/kvm/emulate.c
+++
Opcode c9; used by some variants of Windows during boot, in big real mode.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/emulate.c | 25 -
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 24c8425..33ccd75 100
Otherwise, if the guest ends up looping, we never exit the srcu critical
section, which causes synchronize_srcu() to hang.
Signed-off-by: Avi Kivity
---
arch/x86/kvm/vmx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a9c0e40.
1 - 100 of 205 matches
Mail list logo