Quickly hacked test case for memory instructions (clflush, mfence,
sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD
exceptions.
This was useful to test TCG handling of those instructions.
The "fake clwb" part will probably break once a new instruction use
those opcodes.
On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote:
> The value of the migrated vcpu's TSC rate is determined as below.
> 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this
> user-specified value will be used.
> 2. If neither a user-specified TSC rate nor a
Am 04.11.2015 14:26, schrieb Dan Carpenter:
> Smatch complains about a possible out of bounds error:
>
> drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init()
> error: buffer overflow 'pci_cap_length' 20 <= 20
>
> Fix this by making the array larger.
>
> Signed-off-by: Dan
On 04/11/2015 22:33, Gerhard Wiesinger wrote:
>>>
>> What is the problem you are seeing? KVM can emulate task switches; the
>> intercept is set here because of a processor erratum that can mess them
>> up even though, in theory, AMD supports task switching from guest mode.
>
> See old thread:
Accept the clwb instruction (66 0F AE /6) if its corresponding feature
flag is enabled on CPUID[7].
Signed-off-by: Eduardo Habkost
---
target-i386/translate.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/target-i386/translate.c
Detect the clflushopt and pcommit instructions and check their
corresponding feature flags, instead of checking CPUID_SSE and
CPUID_CLFLUSH.
Signed-off-by: Eduardo Habkost
---
target-i386/translate.c | 28
1 file changed, 20 insertions(+), 8
This series makes TCG accept the clwb instruction, and make it check the right
CPUID bits when handling clflushopt and pcommit.
Tested using the kvm-unit-test patch I sent earlier today:
Subject: [kvm-unit-test RFC] x86: Memory instructions test case
Message-Id:
On 04.11.2015 22:27, Paolo Bonzini wrote:
On 04/11/2015 20:33, Gerhard Wiesinger wrote:
Signed-off-by: Gerhard Wiesinger
---
arch/x86/kvm/svm.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 2f9ed1f..e0b00fc
On 04/11/2015 20:33, Gerhard Wiesinger wrote:
> Signed-off-by: Gerhard Wiesinger
> ---
> arch/x86/kvm/svm.c | 7 +++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 2f9ed1f..e0b00fc 100644
> --- a/arch/x86/kvm/svm.c
>
Hi Paolo,
Thanks for applying! I am really sorry that I forgot to delete the line
that clears SECONDARY_EXEC_ENABLE_PML bit in vmx_disable_pml, which is
renamed to vmx_destroy_pml_buffer now.
It won't impact functionality but to make the function consistent, would
you also do below? Sorry for
On 11/4/2015 10:51 AM, Ard Biesheuvel wrote:
> On 4 November 2015 at 19:49, Christopher Covington
> wrote:
>> On 11/04/2015 08:31 AM, Christoffer Dall wrote:
>>> On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote:
On Tue, Nov 3, 2015 at 1:17 PM, Mario
On 11/04/15 19:42, Eduardo Habkost wrote:
> On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote:
> > The value of the migrated vcpu's TSC rate is determined as below.
> > 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this
> > user-specified value will be used.
>
On 11/04/2015 06:51 AM, Will Deacon wrote:
> + mutex_lock(_lock);
> +
> + /* The kvm->cpus array contains a null pointer in the last location */
> + for (i = 0; ; i++) {
> + if (kvm->cpus[i])
> + pthread_kill(kvm->cpus[i]->thread, SIGKVMEXIT);
> +
On 11/04/2015 06:28 PM, Mario Smarduch wrote:
> I spent time debugging 'earlycon' for pl011, ironically using DEBUG_LL, from
> the
> looks of it no mmio uart should work for armv7. It appears earlycon_map()
> requires a fixed mapping similar to arm64.
commit a5f4c561b3b1 ("ARM: 8415/1: early
On 11/05/2015 05:21 AM, Eduardo Habkost wrote:
Quickly hacked test case for memory instructions (clflush, mfence,
sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD
exceptions.
This was useful to test TCG handling of those instructions.
The "fake clwb" part will probably
Hello!
> Actually, I seem to have been just incredibly unlucky with my test
> cycles, because I eventually reproduced the bug without your patches.
Or lucky, without "un" :)
> I'm going to take this version of the series because that's what I
> reviewed and tested.
It's OK, as i wrote, v5
On 11/04/2015 08:35 PM, Eduardo Habkost wrote:
On Fri, Oct 30, 2015 at 01:54:33PM -0700, Richard Henderson wrote:
On 10/29/2015 12:31 AM, Xiao Guangrong wrote:
These instructions are used by NVDIMM drivers and the specification
locates at:
On Fri, Oct 30, 2015 at 01:54:33PM -0700, Richard Henderson wrote:
> On 10/29/2015 12:31 AM, Xiao Guangrong wrote:
> > These instructions are used by NVDIMM drivers and the specification
> > locates at:
> > https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf
> >
> > There
Signed-off-by: Gerhard Wiesinger
---
arch/x86/kvm/svm.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 2f9ed1f..e0b00fc 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -198,6 +198,10 @@ static bool
Hi Sasha,
[adding the kvm list; not sure why it was dropped]
On Wed, Oct 28, 2015 at 01:34:25PM +, Will Deacon wrote:
> On Wed, Oct 28, 2015 at 09:00:07AM -0400, Sasha Levin wrote:
> > On 10/28/2015 08:27 AM, Will Deacon wrote:
> > > On Tue, Oct 27, 2015 at 10:08:44PM -0400, Sasha Levin
On Wed, Nov 04, 2015 at 11:12:41AM +0800, Xiao Guangrong wrote:
> On 11/04/2015 07:00 AM, Eduardo Habkost wrote:
> >On Mon, Nov 02, 2015 at 05:13:10PM +0800, Xiao Guangrong wrote:
> >>Currently file_ram_alloc() is designed for hugetlbfs, however, the memory
> >>of nvdimm can come from either raw
On 03/11/2015 22:17, William Dauchy wrote:
> Hi Paolo,
>
> I was wondering it this could be a valid candidate for -stable, don't you
> think?
> (commit ba60c41)
Indeed, feel free to propose it!
Paolo
> Best regards,
>
> On Sep02 12:33, Sudip Mukherjee wrote:
>> We were taking the exit path
From: Joerg Roedel
The vfio_device_get_from_name() function might return a
non-NULL pointer, when called with a device name that is not
found in the list. This causes undefined behavior, in my
case calling an invalid function pointer later on:
kernel tried to execute
On Wed, Nov 04, 2015 at 11:17:09AM +0800, Xiao Guangrong wrote:
>
>
> On 11/04/2015 07:21 AM, Eduardo Habkost wrote:
> >On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote:
> >[...]
> >>+size_t qemu_file_getlength(const char *file, Error **errp)
> >>+{
> >>+int64_t size;
> >[...]
We mark edge-triggered interrupts with the HW bit set as queued to
prevent the VGIC code from injecting LRs with both the Active and
Pending bits set at the same time while also setting the HW bit,
because the hardware does not support this.
However, this means that we must also clear the queued
We currently schedule a soft timer every time we exit the guest if the
timer did not expire while running the guest. This is really not
necessary, because the only work we do in the timer work function is to
kick the vcpu.
Kicking the vcpu does two things:
(1) If the vpcu thread is on a
Hi Paolo,
Here is the set of changes for v4.4. Some of the commits listed here were
already merged as fixes for v4.3, but since they are not in kvm/next yet, they
show up here. Let me know if you want me to handle this differently somehow.
As usual, there's a lot of churn in the vgic and timer
On Tue, Nov 03, 2015 at 12:44:54PM +0300, Pavel Fedin wrote:
> Hello!
>
> > By this time i'll make a very minimal version of patch 0001, for you to
> > test it. If we have
> > problems with current 0001, which we
> > cannot solve quickly, we could stick to that version then, which will
> >
The GICD_ICFGR allows the bits for the SGIs and PPIs to be read only.
We currently simulate this behavior by writing a hardcoded value to the
register for the SGIs and PPIs on every write of these bits to the
register (ignoring what the guest actually wrote), and by writing the
same value as the
Currently vgic_process_maintenance() processes dealing with a completed
level-triggered interrupt directly, but we are soon going to reuse this
logic for level-triggered mapped interrupts with the HW bit set, so
move this logic into a separate static function.
Probably the most scary part of this
On 11/04/2015 04:56 PM, Igor Mammedov wrote:
On Tue, 3 Nov 2015 22:22:40 +0800
Xiao Guangrong wrote:
On 11/03/2015 09:13 PM, Igor Mammedov wrote:
On Mon, 2 Nov 2015 17:13:29 +0800
Xiao Guangrong wrote:
NVDIMM devices is
On 11/04/2015 08:40 PM, Eduardo Habkost wrote:
On Wed, Nov 04, 2015 at 11:12:41AM +0800, Xiao Guangrong wrote:
On 11/04/2015 07:00 AM, Eduardo Habkost wrote:
On Mon, Nov 02, 2015 at 05:13:10PM +0800, Xiao Guangrong wrote:
Currently file_ram_alloc() is designed for hugetlbfs, however, the
On Tue, 3 Nov 2015 10:45:12 -0800
Andy Lutomirski wrote:
> On Tue, Nov 3, 2015 at 9:59 AM, Cornelia Huck
> wrote:
> > It's just failing very early in the setup phase. As it works for me
> > with a kvm setup, I'm suspecting some error in qemu's
On 11/04/2015 10:44 PM, Eduardo Habkost wrote:
On Wed, Nov 04, 2015 at 11:17:09AM +0800, Xiao Guangrong wrote:
On 11/04/2015 07:21 AM, Eduardo Habkost wrote:
On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote:
[...]
+size_t qemu_file_getlength(const char *file, Error **errp)
From: Mark Rutland
If we panic in hyp mode, we inject a call to panic() into the EL1N host
kernel. If a guest context is active, we first attempt to restore the
minimal amount of state necessary to execute the host kernel with
restore_sysregs.
However, the SP is restored
Some times it is useful for architecture implementations of KVM to know
when the VCPU thread is about to block or when it comes back from
blocking (arm/arm64 needs to know this to properly implement timers, for
example).
Therefore provide a generic architecture callback function in line with
what
From: Pavel Fedin
Correct some old mistakes in the API documentation:
1. VCPU is identified by index (using kvm_get_vcpu() function), but
"cpu id" can be mistaken for affinity ID.
2. Some error codes are wrong.
[ Slightly tweaked some grammer and did some s/CPU
From: Eric Auger
In case a vcpu off PSCI call is called just after we executed the
vcpu_sleep check, we can enter the guest although power_off
is set. Let's check the power_off state in the critical section,
just before entering the guest.
Signed-off-by: Eric Auger
From: Pavel Fedin
Currently we use vgic_irq_lr_map in order to track which LRs hold which
IRQs, and lr_used bitmap in order to track which LRs are used or free.
vgic_irq_lr_map is actually used only for piggy-back optimization, and
can be easily replaced by iteration over
From: Michal Marek
Besides being a coding style issue, it confuses make tags:
ctags: Warning: include/kvm/arm_vgic.h:307: null expansion of name pattern "\1"
ctags: Warning: include/kvm/arm_vgic.h:308: null expansion of name pattern "\1"
ctags: Warning:
Forwarded physical interrupts on arm/arm64 is a tricky concept and the
way we deal with them is not apparently easy to understand by reading
various specs.
Therefore, add a proper documentation file explaining the flow and
rationale of the behavior of the vgic.
Some of this text was contributed
From: Pavel Fedin
1. Remove unnecessary 'irq' argument, because irq number can be retrieved
from the LR.
2. Since cff9211eb1a1f58ce7f5a2d596b617928fd4be0e
("arm/arm64: KVM: Fix arch timer behavior for disabled interrupts ")
LR_STATE_PENDING is queued back by
From: Pavel Fedin
Now we see that vgic_set_lr() and vgic_sync_lr_elrsr() are always used
together. Merge them into one function, saving from second vgic_ops
dereferencing every time.
Signed-off-by: Pavel Fedin
Signed-off-by: Christoffer Dall
The arch timer currently uses edge-triggered semantics in the sense that
the line is never sampled by the vgic and lowering the line from the
timer to the vgic doesn't have any effect on the pending state of
virtual interrupts in the vgic. This means that we do not support a
guest with the
From: Eric Auger
kvm_arch_vcpu_runnable now also checks whether the power_off
flag is set.
Signed-off-by: Eric Auger
Reviewed-by: Christoffer Dall
Signed-off-by: Christoffer Dall
---
From: Eric Auger
The kvm_vcpu_arch pause field is renamed into power_off to prepare
for the introduction of a new pause field. Also vcpu_pause is renamed
into vcpu_sleep since we will sleep until both power_off and pause are
false.
Signed-off-by: Eric Auger
We currently initialize the SGIs to be enabled in the VGIC code, but we
use the VGIC_NR_PPIS define for this purpose, instead of the the more
natural VGIC_NR_SGIS. Change this slightly confusing use of the
defines.
Note: This should have no functional change, as both names are defined
to the
From: Eric Auger
We introduce kvm_arm_halt_guest and resume functions. They
will be used for IRQ forward state change.
Halt is synchronous and prevents the guest from being re-entered.
We use the same mechanism put in place for PSCI former pause,
now renamed power_off. A
The VGIC and timer code for KVM arm/arm64 doesn't have any tracepoints
or tracepoint infrastructure defined. Rewriting some of the timer code
handling showed me how much we need this, so let's add these simple
trace points once and for all and we can easily expand with additional
trace points in
From: Wei Huang
vhost drivers provide guest VMs with better I/O performance and lower
CPU utilization. This patch allows users to select vhost devices under
KVM configuration menu on ARM. This makes vhost support on arm/arm64
on a par with other architectures (e.g. x86, ppc).
The ARM architecture only saves the exit class to the HSR (ESR_EL2 for
arm64) on synchronous exceptions, not on asynchronous exceptions like an
IRQ. However, we only report the exception class on kvm_exit, which is
confusing because an IRQ looks like it exited at some PC with the same
reason as
On 04/11/2015 06:46, Kai Huang wrote:
> I found PML was broken since below commit:
>
> commit feda805fe7c4ed9cf78158e73b1218752e3b4314
> Author: Xiao Guangrong
> Date: Wed Sep 9 14:05:55 2015 +0800
>
> KVM: VMX: unify
Smatch complains about a possible out of bounds error:
drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init()
error: buffer overflow 'pci_cap_length' 20 <= 20
Fix this by making the array larger.
Signed-off-by: Dan Carpenter
diff --git
On 03/11/2015 19:34, Laszlo Ersek wrote:
> Commit b18d5431acc7 ("KVM: x86: fix CR0.CD virtualization") was
> technically correct, but it broke OVMF guests by slowing down various
> parts of the firmware.
>
> Commit fb279950ba02 ("KVM: vmx: obey KVM_QUIRK_CD_NW_CLEARED") quirked the
> first
They are exactly the same, except that handle_mmio_page_fault
has an unused argument and a call to WARN_ON. Remove the unused
argument from the callers, and move the warning to (the former)
handle_mmio_page_fault_common.
---
arch/x86/kvm/mmu.c | 20 +---
On 03/11/2015 22:17, William Dauchy wrote:
> Hi Paolo,
>
> I was wondering it this could be a valid candidate for -stable, don't you
> think?
> (commit ba60c41)
Certainly, feel free to propose it to sta...@vger.kernel.org!
Paolo
> Best regards,
>
> On Sep02 12:33, Sudip Mukherjee wrote:
>>
On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote:
> On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch wrote:
> >
> >
> > On 11/3/2015 9:55 AM, Will Deacon wrote:
> >> On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario Smarduch wrote:
> >>> On 11/3/2015 8:33 AM,
Hello stable release team,
The commit ba60c41 kvm: irqchip: fix memory leak
is fixing commit e73f61e kvm: irqchip: Break up high order allocations of
kvm_irq_routing_table
I believe commit ba60c41 kvm: irqchip: fix memory leak
is a good candidate for -stable. I also got an agreement from
On 04/11/2015 15:49, Christoffer Dall wrote:
> Hi Paolo,
>
> Here is the set of changes for v4.4. Some of the commits listed here were
> already merged as fixes for v4.3, but since they are not in kvm/next yet, they
> show up here. Let me know if you want me to handle this differently
On Wed, 2015-11-04 at 13:53 +0100, Joerg Roedel wrote:
> From: Joerg Roedel
>
> The vfio_device_get_from_name() function might return a
> non-NULL pointer, when called with a device name that is not
> found in the list. This causes undefined behavior, in my
> case calling an
On Wed, 2015-11-04 at 16:26 +0300, Dan Carpenter wrote:
> Smatch complains about a possible out of bounds error:
>
> drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init()
> error: buffer overflow 'pci_cap_length' 20 <= 20
>
> Fix this by making the array larger.
>
> Signed-off-by:
On Wed, 2015-11-04 at 16:26 +0300, Dan Carpenter wrote:
> Smatch complains about a possible out of bounds error:
>
> drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init()
> error: buffer overflow 'pci_cap_length' 20 <= 20
>
> Fix this by making the array larger.
>
> Signed-off-by:
On Wed, 4 Nov 2015 15:29:23 +0100
Cornelia Huck wrote:
> I'm currently suspecting some endianness issues, probably with the ecw
> accesses, which is why I'd be interested in your trace information (as
> I currently don't have a LE test setup at hand.)
I think I've got
On Tue, 3 Nov 2015 22:22:40 +0800
Xiao Guangrong wrote:
>
>
> On 11/03/2015 09:13 PM, Igor Mammedov wrote:
> > On Mon, 2 Nov 2015 17:13:29 +0800
> > Xiao Guangrong wrote:
> >
> >> NVDIMM devices is defined in ACPI 6.0 9.20
Only using 32 memslots for KVM on powerpc is way too low, you can
nowadays hit this limit quite fast by adding a couple of PCI devices
and/or pluggable memory DIMMs to the guest.
x86 already increased the limit to 512 in total, to satisfy 256
pluggable DIMM slots, 3 private slots and 253 slots for
Only using 32 memslots for KVM on powerpc is way too low, you can
nowadays hit this limit quite fast by adding a couple of PCI devices
and/or pluggable memory DIMMs to the guest.
x86 already increased the limit to 512 in total, to satisfy 256
pluggable DIMM slots, 3 private slots and 253 slots for
Now that the patch from Nikunj to support the KVM_CAP_NR_MEMSLOTS
capability on powerpc has been merged to kvm/next, we can/should
increase the amount of memslots on ppc, too.
Since nobody else sent a patch yet (as far as I can see), I'd like
to suggest to increase the slot number to 320 now. Why
Now that the patch from Nikunj to support the KVM_CAP_NR_MEMSLOTS
capability on powerpc has been merged to kvm/next, we can/should
increase the amount of memslots on ppc, too.
Since nobody else sent a patch yet (as far as I can see), I'd like
to suggest to increase the slot number to 320 now. Why
On Wed, 2015-11-04 at 21:20 +0300, Dan Carpenter wrote:
> Sorry, I should have said that I am on linux-next at the start.
>
> > > -static u8 pci_cap_length[] = {
> > > +static u8 pci_cap_length[PCI_CAP_ID_MAX + 1] = {
> > > [PCI_CAP_ID_BASIC] = PCI_STD_HEADER_SIZEOF, /* pci config header
On Wed, Nov 04, 2015 at 08:40:19AM -0800, Joe Perches wrote:
> Doesn't the same thing happen with pci_ext_cap_length?
pci_ext_cap_length is fine as-is but you're right that we probably
should make the size explicit as well. I will fix and resend.
> Both array declarations might be better as
On Wed, Nov 4, 2015 at 9:52 AM, Cornelia Huck wrote:
> On Wed, 4 Nov 2015 15:29:23 +0100
> Cornelia Huck wrote:
>
>> I'm currently suspecting some endianness issues, probably with the ecw
>> accesses, which is why I'd be interested in your
Sorry, I should have said that I am on linux-next at the start.
> > -static u8 pci_cap_length[] = {
> > +static u8 pci_cap_length[PCI_CAP_ID_MAX + 1] = {
> > [PCI_CAP_ID_BASIC] = PCI_STD_HEADER_SIZEOF, /* pci config header */
> > [PCI_CAP_ID_PM] = PCI_PM_SIZEOF,
> >
On 11/04/2015 08:31 AM, Christoffer Dall wrote:
> On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote:
>> On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch
>> wrote:
>>> On 11/3/2015 9:55 AM, Will Deacon wrote:
On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario
There is really no way to safely give a user full access to a DMA
capable device without an IOMMU to protect the host system. There is
also no way to provide DMA translation, for use cases such as device
assignment to virtual machines. However, there are still those users
that want userspace
On 4 November 2015 at 19:49, Christopher Covington wrote:
> On 11/04/2015 08:31 AM, Christoffer Dall wrote:
>> On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote:
>>> On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch
>>> wrote:
On
On 30 October 2015 at 19:20, Andre Przywara wrote:
> When a Makefile variable is set on the make command line, all
> Makefile-internal assignments to that very variable are _ignored_.
> Since we add quite some essential values to CFLAGS internally,
> specifying some CFLAGS
On 4 November 2015 at 12:13, Andre Przywara wrote:
> Hi Riku,
>
> On 04/11/15 10:02, Riku Voipio wrote:
>> On 30 October 2015 at 19:20, Andre Przywara wrote:
>>> When a Makefile variable is set on the make command line, all
>>> Makefile-internal
Hi Riku,
On 04/11/15 10:02, Riku Voipio wrote:
> On 30 October 2015 at 19:20, Andre Przywara wrote:
>> When a Makefile variable is set on the make command line, all
>> Makefile-internal assignments to that very variable are _ignored_.
>> Since we add quite some essential
On Wed, Nov 04, 2015 at 12:02:23PM +0200, Riku Voipio wrote:
> On 30 October 2015 at 19:20, Andre Przywara wrote:
> > When a Makefile variable is set on the make command line, all
> > Makefile-internal assignments to that very variable are _ignored_.
> > Since we add quite
79 matches
Mail list logo