Vivek Goyal writes:
> Page fault error handling behavior in kvm seems little inconsistent when
> page fault reports error. If we are doing fault synchronously
> then we capture error (-EFAULT) returned by __gfn_to_pfn_memslot() and
> exit to user space and qemu reports error, "error: kvm run
ed.c | 8 +--
> arch/x86/kvm/svm/sev.c| 2 +-
> arch/x86/kvm/svm/svm.c| 138 +++---
> arch/x86/kvm/svm/svm.h| 20 +++---
> 5 files changed, 85 insertions(+), 85 deletions(-)
Series:
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
ant's cage, do not trust
your eyes', but let's fix it for good.
No functional change intended.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/mmu/paging_tmpl.h | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/pag
Naresh Kamboju writes:
> FYI,
> Linaro test farm selftests kvm test cases results.
> * kvm_mmio_warning_test — SKIP
> * kvm_svm_vmcall_test — SKIP
> * kvm_clear_dirty_log_test — PASS
> * kvm_cr4_cpuid_sync_test — PASS
> * kvm_debug_regs — PASS
> * kvm_demand_paging_test — PASS
> *
"Xu, Like" writes:
> On 2020/6/19 17:40, Vitaly Kuznetsov wrote:
>> Guest crashes are observed on a Cascade Lake system when 'perf top' is
>> launched on the host, e.g.
> Interesting, is it specific to Cascade Lake?
>
Actually no, just reproduced this on a Haswe
74b81f4ef9.
Reported-by: Maxime Coquelin
Signed-off-by: Vitaly Kuznetsov
---
- Perf/KVM interractions are a mystery to me, thus RFC.
---
arch/x86/kvm/vmx/vmx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 36
Paolo Bonzini writes:
> On 18/06/20 13:13, Vitaly Kuznetsov wrote:
>> state_test/smm_test selftests are failing on AMD with:
>> "Unexpected result from KVM_GET_MSRS, r: 51 (failed MSR was 0x345)"
>>
>> MSR_IA32_PERF_CAPABILITIES is an emulated MSR on Int
. This way the code is better prepared to the
eventual appearance of the feature in AMD hardware.
Fixes: 27461da31089 ("KVM: x86/pmu: Support full width counting")
Suggested-by: Jim Mattson
Suggested-by: Paolo Bonzini
Signed-off-by: Vitaly Kuznetsov
---
arch/x8
Paolo Bonzini writes:
> On 17/06/20 13:38, Vitaly Kuznetsov wrote:
>>
>> For KVM_GET_MSR_INDEX_LIST, the promise is "guest msrs that are
>> supported" and I'm not exactly sure what this means. Personally, I see
>> no point in returning MSRs which can't be re
Vivek Goyal writes:
> As of now asynchronous page fault mecahanism assumes host will always be
> successful in resolving page fault. So there are only two states, that
> is page is not present and page is ready.
>
> If a page is backed by a file and that file has been truncated (as
> can be the
Vivek Goyal writes:
> Page fault error handling behavior in kvm seems little inconsistent when
> page fault reports error. If we are doing fault synchronously
> then we capture error (-EFAULT) returned by __gfn_to_pfn_memslot() and
> exit to user space and qemu reports error, "error: kvm run
Babu Moger writes:
> The new intercept bits have been added in vmcb control
> area to support the interception of INVPCID instruction.
>
> The following bit is added to the VMCB layout control area
> to control intercept of INVPCID:
>
> Byte Offset Bit(s) Function
> 14h
Babu Moger writes:
> INVPCID instruction handling is mostly same across both VMX and
> SVM. So, move the code to common x86.c.
>
> Signed-off-by: Babu Moger
> ---
> arch/x86/kvm/vmx/vmx.c | 68 +
> arch/x86/kvm/x86.c | 79
>
Jim Mattson writes:
> On Tue, Jun 16, 2020 at 9:45 AM Vitaly Kuznetsov wrote:
>>
>> Jim Mattson writes:
>>
>> > On Tue, Jun 16, 2020 at 9:14 AM Vitaly Kuznetsov
>> > wrote:
>> >>
>> >> state_test/smm_test selftests are failing
an just dropping it and trying to compile
the whole thing? Leaving #define-s, configs,... aside ...)
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
Jim Mattson writes:
> On Tue, Jun 16, 2020 at 9:14 AM Vitaly Kuznetsov wrote:
>>
>> state_test/smm_test selftests are failing on AMD with:
>> "Unexpected result from KVM_GET_MSRS, r: 51 (failed MSR was 0x345)"
>>
>> MSR_IA32_PERF_CAPABILITIES is an emu
ST.
Fixes: 27461da31089 ("KVM: x86/pmu: Support full width counting")
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/svm/svm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 8ccfa4197d9c..2c423d64fb8f 100644
--- a/arch/x86/kvm/svm/svm.
d your
patch with Hyper-V, it works, so:
Tested-by: Vitaly Kuznetsov
> Plus this whole series to kill of vmalloc_exec entirely:
>
> http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/vmalloc_exec-fixes
>
FWIW, the vmalloc_exec() doing W+X allocation is misleading indeed, thus
Dexuan Cui writes:
>> From: linux-hyperv-ow...@vger.kernel.org
>> On Behalf Of Dexuan Cui
>> Sent: Monday, June 15, 2020 10:42 AM
>> > >
>> > > Hi hch,
>> > > The patch is merged into the mainine recently, but unluckily we noticed
>> > > a warning with CONFIG_DEBUG_WX=y
>> > >
>> > > Should we
-by: Sean Christopherson
Signed-off-by: Vitaly Kuznetsov
---
arch/s390/kvm/kvm-s390.c | 20 +---
arch/x86/kvm/mmu/mmu.c | 4 ++--
include/linux/kvm_host.h | 4 ++--
virt/kvm/async_pf.c | 16 ++--
4 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/arch
KY Srinivasan
>> ; Stephen Hemminger ;
>> Andy Lutomirski ; Peter Zijlstra
>> Subject: Re: hv_hypercall_pg page permissios
>>
>>
>> > On Apr 7, 2020, at 12:38 AM, Christoph Hellwig wrote:
>> >
>> > On Tue, Apr 07, 2020 at 0
Sean Christopherson writes:
>
> I'd also be in favor of changing the return type to a boolean. I think
> you alluded to it earlier, the current semantics are quite confusing as they
> invert the normal "return 0 on success".
Yes, will do a follow-up.
KVM/x86 code has an intertwined mix of:
-
Vivek Goyal writes:
> On Wed, Jun 10, 2020 at 07:55:32PM +0200, Vitaly Kuznetsov wrote:
>> 'Page not present' event may or may not get injected depending on
>> guest's state. If the event wasn't injected, there is no need to
>> inject the corresponding 'page ready' event
cleanup. gfn_to_pfn_async() mentioned in a
comment does not currently exist and, moreover, we can check
kvm_is_error_hva() at the very beginning, before we try to allocate work so
'retry_sync' label can go away completely.
Signed-off-by: Vitaly Kuznetsov
---
virt/kvm/async_pf.c | 19
-by: Vitaly Kuznetsov
---
arch/s390/include/asm/kvm_host.h | 2 +-
arch/s390/kvm/kvm-s390.c | 4 +++-
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/x86.c | 7 +--
include/linux/kvm_host.h | 1 +
virt/kvm/async_pf.c | 2 +-
6 files changed, 12
/output operand. While on it, make sync_with_host()
static inline.
Reported-by: Marcelo Bandeira Condotta
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/x86_64/smm_test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64
state_test/smm_test use KVM_CAP_NESTED_STATE check as an indicator for
nested VMX/SVM presence and this is incorrect. Check for the required
features dirrectly.
Signed-off-by: Vitaly Kuznetsov
---
.../testing/selftests/kvm/include/x86_64/svm_util.h | 1 +
tools/testing/selftests/kvm/include
KVM_CAP_HYPERV_ENLIGHTENED_VMCS will be reported as supported even when
nested VMX is not, fix evmcs_test/hyperv_cpuid tests to check for both.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/x86_64/evmcs_test.c | 5 +++--
tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 3
n this situation.
Vitaly Kuznetsov (2):
KVM: selftests: do not substitute SVM/VMX check with
KVM_CAP_NESTED_STATE check
KVM: selftests: Don't probe KVM_CAP_HYPERV_ENLIGHTENED_VMCS when
nested VMX is unsupported
.../testing/selftests/kvm/include/x86_64/svm_util.h | 1 +
tools/testing/selft
Paolo Bonzini writes:
> On 09/06/20 21:10, Vivek Goyal wrote:
>> Hi Vitaly,
>>
>> Have a question about page ready events.
>>
>> Now we deliver PAGE_NOT_PRESENT page faults only if guest is not in
>> kernel mode. So say kernel tried to access a page and we halted cpu.
>> When page is
(val & 0x20))
> pit_latch_count(pit, channel);
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
Paolo Bonzini writes:
> is_intercept takes an INTERCEPT_* constant, not SVM_EXIT_*; because
> of this, the compiler was removing the body of the conditionals,
> as if is_intercept returned 0.
>
> This unveils a latent bug: when clearing the VINTR intercept,
> int_ctl must also be changed in the
("KVM: selftests: VMX preemption timer migration test")
Reported-by: Marcelo Bandeira Condotta
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/include/x86_64/vmx.h | 4
.../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 4
2 files
Add x86_64/debug_regs to .gitignore.
Reported-by: Marcelo Bandeira Condotta
Fixes: 449aa906e67e ("KVM: selftests: Add KVM_SET_GUEST_DEBUG test")
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/too
ct dentry *debugfs_dentry;
> char dir_name[ITOA_MAX_LEN * 2];
>
> if (!debugfs_initialized())
> return;
>
> snprintf(dir_name, sizeof(dir_name), "vcpu%d", vcpu->vcpu_id);
> - vcpu->debugfs_dentry = debugfs_create_dir(dir_name,
> - vcpu->kvm->debugfs_dentry);
> + debugfs_dentry = debugfs_create_dir(dir_name,
> + vcpu->kvm->debugfs_dentry);
>
> - kvm_arch_create_vcpu_debugfs(vcpu);
> + kvm_arch_create_vcpu_debugfs(vcpu, debugfs_dentry);
> #endif
> }
FWIW,
Reviewed-by: Vitaly Kuznetsov
Thanks!
--
Vitaly
Sean Christopherson writes:
> On Fri, Jun 05, 2020 at 01:59:05PM +0200, Vitaly Kuznetsov wrote:
>> Introduce vmx_handle_memory_failure() as an interim solution.
>
> Heh, "interim". I'll take the over on that :-D.
>
We just need a crazy but real use-case
H=x86", however, works. The problem is that arch specific headers
for x86_64 live in 'tools/arch/x86/include', not in
'tools/arch/x86_64/include'.
Fixes: 66d69e081b52 ("selftests: fix kvm relocatable native/cross builds and
installs")
Reported-by: Marcelo Bandeira Condotta
Signed-off-by
syzbot writes:
> syzbot has found a reproducer for the following crash on:
>
> HEAD commit:cb8e59cc Merge git://git.kernel.org/pub/scm/linux/kernel/g..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=170f49de10
> kernel config:
Vitaly Kuznetsov writes:
> Syzbot reports the following issue:
Noticed while sending: the prefix of the patch should be "KVM: VMX:" as
it is not only nested related...
--
Vitaly
541ab2aeb28251bf7135c7961f3a6080eebcc705.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/x86.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9e41b5135340..0097a97d331f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5647,13
e. We don't seem
to have a good enum describing this tristate, just add "int *ret" to
nested_vmx_get_vmptr() interface to pass the information.
Reported-by: syzbot+2a7156e11dc199bdb...@syzkaller.appspotmail.com
Suggested-by: Sean Christopherson
Signed-off-by: Vitaly Kuznetsov
---
arch
Sean Christopherson writes:
> On Thu, Jun 04, 2020 at 05:33:25PM +0200, Vitaly Kuznetsov wrote:
>> Sean Christopherson writes:
>>
>> > On Thu, Jun 04, 2020 at 04:40:52PM +0200, Paolo Bonzini wrote:
>> >> On 04/06/20 16:31, Vitaly Kuznetsov wrote:
>> &g
Sean Christopherson writes:
> On Thu, Jun 04, 2020 at 04:40:52PM +0200, Paolo Bonzini wrote:
>> On 04/06/20 16:31, Vitaly Kuznetsov wrote:
>
> ...
>
>> > KVM could've handled the request correctly by going to userspace and
>> > performing I/O but
Paolo Bonzini writes:
> On 04/06/20 16:31, Vitaly Kuznetsov wrote:
>> Syzbot reports the following issue:
>>
>> WARNING: CPU: 0 PID: 6819 at arch/x86/kvm/x86.c:618
>> kvm_inject_emulated_page_fault+0x210/0x290 arch/x86/kvm/x86.c:618
>> ...
&
VMXON/VMPTRLD/VMCLEAR with
anything but normal memory. Just inject #GP to find insane ones.
Reported-by: syzbot+2a7156e11dc199bdb...@syzkaller.appspotmail.com
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx/nested.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions(-)
Paolo Bonzini writes:
> On 04/06/20 12:53, Vitaly Kuznetsov wrote:
>> Exception we're trying to inject comes from
>>
>> nested_vmx_get_vmptr()
>> kvm_read_guest_virt()
>>kvm_read_guest_virt_helper()
>> vcpu->arch.walk_mmu->gva_to_gp
syzbot writes:
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit:cb8e59cc Merge git://git.kernel.org/pub/scm/linux/kernel/g..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=14dedfe210
> kernel config:
"Huang, Kai" writes:
> On Wed, 2020-05-27 at 10:39 +0200, Vitaly Kuznetsov wrote:
>> Sean Christopherson writes:
>>
>> > On Mon, May 25, 2020 at 06:15:25PM +0300, Kirill A. Shutemov wrote:
>> > > On Mon, May 25, 2020 at 04:58:51PM +0200, Vitaly
)
Reported-by: kbuild test robot
Signed-off-by: Vitaly Kuznetsov
---
- I'm failing to see why this was compiling when 28447ea41542 ("xen: Move
xen_setup_callback_vector() definition to include/xen/hvm.h") was
submitted, just keeping playing whack-a-mole game fixing the immediate
issue,
Sean Christopherson writes:
> I'll looking into writing a script to run all selftests with a single
> command, unless someone already has one laying around?
Is 'make run_tests' in tools/testing/selftests/kvm/ what you're looking
for?
--
Vitaly
The following commit has been merged into the x86/entry branch of tip:
Commit-ID: 28447ea4154239025044381144f849ff749ee9ef
Gitweb:
https://git.kernel.org/tip/28447ea4154239025044381144f849ff749ee9ef
Author:Vitaly Kuznetsov
AuthorDate:Wed, 20 May 2020 18:16:00 +02:00
Paolo Bonzini writes:
> On 25/05/20 16:41, Vitaly Kuznetsov wrote:
>> +case MSR_KVM_ASYNC_PF_ACK:
>> +if (data & 0x1) {
>> +vcpu->arch.apf.pageready_pending = false;
>> +
Paolo Bonzini writes:
> On 25/05/20 16:41, Vitaly Kuznetsov wrote:
>> Concerns were expressed around APF events delivery when CPU is not
>> in user mode (KVM_ASYNC_PF_SEND_ALWAYS), e.g.
>> https://lore.kernel.org/kvm/ed71d0967113a35f670a9625a058b8e6e0b2f104.158354799
Vivek Goyal writes:
> On Mon, May 25, 2020 at 04:41:17PM +0200, Vitaly Kuznetsov wrote:
>>
>
> [..]
>> diff --git a/arch/x86/include/asm/kvm_host.h
>> b/arch/x86/include/asm/kvm_host.h
>> index 0a6b35353fc7..c195f63c1086 100644
>> --- a/arch/x86/include/a
= 52)
> - mask &= ~1ull;
> + if (shadow_phys_bits < 52)
> + mask = BIT_ULL(51) | PT_PRESENT_MASK;
> + else
> + mask = 0;
>
> kvm_mmu_set_mmio_spte_mask(mask, mask, ACC_WRITE_MASK | ACC_USER_MASK);
> }
Nice cleanup,
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
--- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -9414,6 +9414,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
> fx_init(vcpu);
>
> vcpu->arch.maxphyaddr = cpuid_query_maxphyaddr(vcpu);
> + vcpu->arch.tdp_level = kvm_x86_ops.get_tdp_level(vcpu);
>
&
Sean Christopherson writes:
> On Mon, May 25, 2020 at 06:15:25PM +0300, Kirill A. Shutemov wrote:
>> On Mon, May 25, 2020 at 04:58:51PM +0200, Vitaly Kuznetsov wrote:
>> > > @@ -727,6 +734,15 @@ static void __init kvm_init_platform(void)
>> > >
pin_user_pages.rst lives in Documentation/core-api/, not Documentation/vm/,
adjust all links accordingly.
Fixes: 3faa52c03f44 ("mm/gup: track FOLL_PIN pages")
Fixes: eddb1c228f79 ("mm/gup: introduce pin_user_pages*() and FOLL_PIN")
Signed-off-by: Vitaly Kuznetsov
---
inc
av Petkov
> Cc: Thomas Gleixner
> Cc: Paolo Bonzini
> Cc: Sean Christopherson
> Cc: Vitaly Kuznetsov
> Cc: Wanpeng Li
> Cc: Jim Mattson
> Cc: Joerg Roedel
> Cc: H. Peter Anvin
> Cc: x...@kernel.org
> Cc: k...@vger.kernel.org
> Signed-off-by: John Hubbard
&
"Kirill A. Shutemov" writes:
> On Mon, May 25, 2020 at 05:22:10PM +0200, Vitaly Kuznetsov wrote:
>> "Kirill A. Shutemov" writes:
>>
>> > hvclock is shared between the guest and the hypervisor. It has to be
>> > accessible
"Kirill A. Shutemov" writes:
> Wire up hypercalls for the feature and define VM_KVM_PROTECTED.
>
> Signed-off-by: Kirill A. Shutemov
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/kvm/cpuid.c | 3 +++
> arch/x86/kvm/x86.c | 9 +
> include/linux/mm.h | 4
> 4 files changed, 17
"Kirill A. Shutemov" writes:
> Add infrastructure that handles protected memory extension.
>
> Arch-specific code has to provide hypercalls and define non-zero
> VM_KVM_PROTECTED.
>
> Signed-off-by: Kirill A. Shutemov
> ---
> include/linux/kvm_host.h | 4 ++
> mm/mprotect.c| 1
"Kirill A. Shutemov" writes:
> hvclock is shared between the guest and the hypervisor. It has to be
> accessible by host.
>
> Signed-off-by: Kirill A. Shutemov
> ---
> arch/x86/kernel/kvmclock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c
"Kirill A. Shutemov" writes:
> New helpers copy_from_guest()/copy_to_guest() to be used if KVM memory
> protection feature is enabled.
>
> Signed-off-by: Kirill A. Shutemov
> ---
> include/linux/kvm_host.h | 4 +++
> virt/kvm/kvm_main.c | 78 ++--
> 2
"Kirill A. Shutemov" writes:
> Provide basic helpers, KVM_FEATURE and a hypercall.
>
> Host side doesn't provide the feature yet, so it is a dead code for now.
>
> Signed-off-by: Kirill A. Shutemov
> ---
> arch/x86/include/asm/kvm_para.h | 5 +
> arch/x86/include/uapi/asm/kvm_para.h
Introduce new capability to indicate that KVM supports interrupt based
delivery of 'page ready' APF events. This includes support for both
MSR_KVM_ASYNC_PF_INT and MSR_KVM_ASYNC_PF_ACK.
Signed-off-by: Vitaly Kuznetsov
---
Documentation/virt/kvm/cpuid.rst | 6 ++
Documentation/virt/kvm
-by: Andy Lutomirski
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_host.h | 1 -
arch/x86/include/uapi/asm/kvm_para.h | 2 +-
arch/x86/kernel/kvm.c| 3 ---
arch/x86/kvm/x86.c | 13 +
4 files changed, 10 insertions(+), 9 deletions
apf_put_user_ready() temporary puts both flags and
token information, this will be changed to put token only when we switch
to interrupt based notifications.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/include/asm/kvm_para.h | 4 ++--
arch/x86/include/uapi
n theory, we may erroneously drop two
valid events.
Revert the commit.
Reviewed-by: Gavin Shan
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/x86.c | 23 +--
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c17e6eb9a
to
kvm_arch_can_dequeue_async_page_present [Vivek Goyal]
- 'KVM: x86: deprecate KVM_ASYNC_PF_SEND_ALWAYS' patch added.
v1: https://lore.kernel.org/kvm/20200511164752.2158645-1-vkuzn...@redhat.com/
QEMU patches for testing: https://github.com/vittyvk/qemu.git (async_pf2_v2
branch)
Vitaly Kuznetsov (10):
Revert "KVM: asy
ate. Introduce
kvm_arch_async_page_present_queued() and KVM_REQ_APF_READY to do the job.
Signed-off-by: Vitaly Kuznetsov
---
Documentation/virt/kvm/msr.rst | 16 +++-
arch/s390/include/asm/kvm_host.h | 2 ++
arch/x86/include/asm/kvm_host.h | 3 +++
arch/x86/include/uapi/
We already have kvm_write_guest_offset_cached(), introduce read analogue.
Signed-off-by: Vitaly Kuznetsov
---
include/linux/kvm_host.h | 3 +++
virt/kvm/kvm_main.c | 19 ++-
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/include/linux/kvm_host.h b/include
events in the
documentation as they are causing confusion. Use 'page not present'
and 'page ready' everywhere instead.
Signed-off-by: Vitaly Kuznetsov
---
Documentation/virt/kvm/msr.rst | 102 +++
arch/x86/include/asm/kvm_host.h | 4 +-
arch/x86/include/uapi
er much.
Signed-off-by: Vitaly Kuznetsov
---
arch/s390/include/asm/kvm_host.h | 2 +-
arch/s390/kvm/kvm-s390.c | 2 +-
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/x86.c | 2 +-
virt/kvm/async_pf.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
dif
KVM now supports using interrupt for 'page ready' APF event delivery and
legacy mechanism was deprecated. Switch KVM guests to the new one.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/entry/entry_32.S | 5
arch/x86/entry/entry_64.S | 5
arch/x86/include/asm
else this means
that the underlying hypervisor is misbehaving. Leave WARN_ON_ONCE()
to catch that.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/mmu/mmu.c | 17 ++---
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index
Vivek Goyal writes:
> On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote:
>> Currently, APF mechanism relies on the #PF abuse where the token is being
>> passed through CR2. If we switch to using interrupts to deliver page-ready
>> notifications we need a
Paolo Bonzini writes:
> However, interrupts for 'page ready' do have a bunch of advantages (more
> control on what can be preempted by the notification, a saner check for
> new page faults which is effectively a bug fix) so it makes sense to get
> them in more quickly (probably 5.9 at this point
Paolo Bonzini writes:
> We can immediately leave SVM guest mode in svm_check_nested_events
> now that we have the nested_run_pending mechanism. This makes
> things easier because we can run the rest of inject_pending_event
> with GIF=0, and KVM will naturally end up requesting the next
>
彭浩(Richard) writes:
> pic_in_kernel(),ioapic_in_kernel() and irqchip_kernel() have the
> same implementation.
'pic_in_kernel()' name is misleading, one may think this is about lapic
and it's not. Also, ioapic_in_kernel() doesn't have that many users, can
we maybe converge on using irqchip_*()
Maxim Levitsky writes:
> On Wed, 2020-05-20 at 18:33 +0200, Vitaly Kuznetsov wrote:
>> Maxim Levitsky writes:
>>
>> > This msr is only available when the host supports WAITPKG feature.
>> >
>> > This breaks a nested guest, if the L1 hypervisor i
struct kvm_vm *vm;
> @@ -136,8 +178,11 @@ int main(int argc, char *argv[])
> vcpu_regs_get(vm, VCPU_ID, );
>
> if (kvm_check_cap(KVM_CAP_NESTED_STATE)) {
> - vcpu_alloc_vmx(vm, _pages_gva);
> - vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva);
> + if (kvm_get_supported_cpuid_entry(0x8001)->ecx & CPUID_SVM)
> + vcpu_alloc_svm(vm, _gva);
> + else
> + vcpu_alloc_vmx(vm, _gva);
> + vcpu_args_set(vm, VCPU_ID, 1, nested_gva);
> } else {
> pr_info("will skip nested state checks\n");
> vcpu_args_set(vm, VCPU_ID, 1, 0);
With two nitpicks above,
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
D_EVMCS))
> + | KVM_STATE_NESTED_EVMCS | KVM_STATE_NESTED_MTF_PENDING))
> break;
>
> /* nested_run_pending implies guest_mode. */
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
Maxim Levitsky writes:
> This msr is only available when the host supports WAITPKG feature.
>
> This breaks a nested guest, if the L1 hypervisor is set to ignore
> unknown msrs, because the only other safety check that the
> kernel does is that it attempts to read the msr and
> rejects it if it
> min(INTEL_PMC_MAX_GENERIC, x86_pmu.num_counters_gp))
> continue;
> - }
> default:
> break;
> }
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
IG_X86 and the later is only compiled
in when CONFIG_XEN_PVHVM.
Resolve the issue by moving xen_setup_callback_vector() declaration to
arch neutral 'include/xen/hvm.h' as the implementation lives in arch
neutral drivers/xen/events/events_base.c.
Reported-by: kbuild test robot
Signed-off-by: Vitaly Kuz
kbuild test robot writes:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/entry
> head: 095b7a3e7745e6fb7cf0a1c09967c4f43e76f8f4
> commit: fad1940a6a856f59b073e8650e02052ce531154c [4/80] x86/xen: Split HVM
> vector callback setup and interrupt gate allocation
>
Sunil Muthuswamy writes:
> Linux has support for free page reporting now (36e66c554b5c) for
> virtualized environment. On Hyper-V when virtually backed VMs are
> configured, Hyper-V will advertise cold memory discard capability,
> when supported. This patch adds the support to hook into the free
t_cpu_has_bug(X86_BUG_L1TF));
> + rsvd_bits(low_phys_bits, boot_cpu_data.x86_cache_bits -
> 1);
> + }
>
> shadow_nonpresent_or_rsvd_lower_gfn_mask =
> GENMASK_ULL(low_phys_bits - 1, PAGE_SHIFT);
This indeed seems to fix previously-completely-broken 'npt=0' case,
checked with AMD EPYC 7401P.
Tested-by: Vitaly Kuznetsov
--
Vitaly
Anastassios Nanos writes:
> Moreover, it doesn't involve *any* mode switch at all while printing
> out the result of the addition of these two registers -- which I
> guess for a simple use-case like this it isn't much.
> But if we were to scale this to a large number of exits (and their
>
Sean Christopherson writes:
> On Thu, May 14, 2020 at 07:22:50PM -0400, Peter Xu wrote:
>> On Thu, May 14, 2020 at 03:56:24PM -0700, Sean Christopherson wrote:
>> > On Thu, May 14, 2020 at 06:05:16PM -0400, Peter Xu wrote:
>> > > E.g., shm_open() with a handle and fill one 0xff page, then remap
Sean Christopherson writes:
> On Thu, May 14, 2020 at 08:05:39PM +0200, Vitaly Kuznetsov wrote:
>> All PTEs in KVM_MEM_ALLONES slots point to the same read-only page
>> in KVM so instead of mapping each page upon first access we can map
>> everything aggressively.
>>
Sean Christopherson writes:
> On Thu, May 14, 2020 at 08:05:37PM +0200, Vitaly Kuznetsov wrote:
>> PCIe config space can (depending on the configuration) be quite big but
>> usually is sparsely populated. Guest may scan it by accessing individual
>> device's page which, w
Vivek Goyal writes:
> On Mon, May 11, 2020 at 06:47:44PM +0200, Vitaly Kuznetsov wrote:
>> Concerns were expressed around (ab)using #PF for KVM's async_pf mechanism,
>> it seems that re-using #PF exception for a PV mechanism wasn't a great
>> idea after all. The Grand Plan
. This will free userspace of obligation to allocate
real memory. Later, this will also allow us to speed up access to these
holes as we can aggressively map the whole slot upon first fault.
Suggested-by: Michael S. Tsirkin
Signed-off-by: Vitaly Kuznetsov
---
Documentation/virt/kvm/api.rst | 22
Label names in kvm_init() are horrible, rename them to make it obvious
what we are going to do on the failure path.
Signed-off-by: Vitaly Kuznetsov
---
virt/kvm/kvm_main.c | 33 -
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/virt/kvm/kvm_main.c
All PTEs in KVM_MEM_ALLONES slots point to the same read-only page
in KVM so instead of mapping each page upon first access we can map
everything aggressively.
Suggested-by: Michael S. Tsirkin
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/mmu/mmu.c | 20 ++--
arch
No functional change intended. We will need to analyze slot information
to map PTEs for KVM_MEM_ALLONES slots aggressively.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/mmu/mmu.c | 14 --
arch/x86/kvm/mmu/paging_tmpl.h | 7 +--
2 files changed, 13 insertions(+), 8
Test the newly introduced KVM_MEM_ALLONES memslots:
- Reads from all pages return '0xff'
- Writes to all pages cause KVM_EXIT_MMIO
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/Makefile | 1 +
.../testing/selftests/kvm/include/kvm_util.h | 1 +
tools/testing
) on Intel/AMD
with and wiuthout EPT/NPT. I haven't tested memslot modifications yet.
Patches are against kvm/next.
Vitaly Kuznetsov (5):
KVM: rename labels in kvm_init()
KVM: x86: introduce KVM_MEM_ALLONES memory
KVM: x86: move kvm_vcpu_gfn_to_memslot() out of try_async_pf()
KVM: x86
401 - 500 of 4372 matches
Mail list logo