[PATCH 2/2] sched/debug: add sched_update_nr_running tracepoint

2019-09-03 Thread Radim Krčmář
they don't need to be protected by CREATE_TRACE_POINTS and moving them closer would be unsightly. Tested-by: Jirka Hladký Tested-by: Jiří Vozár Signed-off-by: Radim Krčmář --- include/trace/events/sched.h | 22 ++ kernel/sched/core.c | 7 ++- kernel/sc

[PATCH 0/2] sched/debug: add sched_update_nr_running tracepoint

2019-09-03 Thread Radim Krčmář
Zijlstra Cc: Thomas Gleixner Cc: Borislav Petkov Cc: Dave Hansen Cc: Steven Rostedt Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Jirka Hladký Cc: Jiří Vozár Cc: x...@kernel.org Radim Krčmář (2): x86/mm/tlb: include tracepoints from tlb.c instead of mmu_context.h sched/

[PATCH 1/2] x86/mm/tlb: include tracepoints from tlb.c instead of mmu_context.h

2019-09-03 Thread Radim Krčmář
asm/mmu_context.h is a tree-wide include that will unnecessarily break the build if CREATE_TRACE_POINTS is defined when including it. Signed-off-by: Radim Krčmář --- arch/x86/include/asm/mmu_context.h | 2 -- arch/x86/mm/tlb.c | 2 ++ 2 files changed, 2 insertions(+), 2

[GIT PULL] KVM fixes for Linux 5.3-rc7

2019-08-30 Thread Radim Krčmář
infinitely looping emulation of a failing syscall while single stepping. - Do not crash the host when nesting is disabled. Alexey Kardashevskiy (1): KVM: PPC: Book3S: Fix incorrect guest-to-user-translation error handling Radim

Re: [PATCH 1/3] KVM: x86: hyper-v: don't crash on KVM_GET_SUPPORTED_HV_CPUID when kvm_intel.nested is disabled

2019-08-27 Thread Radim Krčmář
2019-08-27 18:04+0200, Vitaly Kuznetsov: > If kvm_intel is loaded with nested=0 parameter an attempt to perform > KVM_GET_SUPPORTED_HV_CPUID results in OOPS as nested_get_evmcs_version hook > in kvm_x86_ops is NULL (we assign it in nested_vmx_hardware_setup() and > this only happens in case nested

Re: [PATCH] KVM: x86: Don't update RIP or do single-step on faulting emulation

2019-08-27 Thread Radim Krčmář
2019-08-23 13:55-0700, Sean Christopherson: > Don't advance RIP or inject a single-step #DB if emulation signals a > fault. This logic applies to all state updates that are conditional on > clean retirement of the emulation instruction, e.g. updating RFLAGS was > previously handled by commit

Re: [PATCH v2] KVM: LAPIC: Periodically revaluate to get conservative lapic_timer_advance_ns

2019-08-27 Thread Radim Krčmář
2019-08-15 12:03+0800, Wanpeng Li: > From: Wanpeng Li > > Even if for realtime CPUs, cache line bounces, frequency scaling, presence > of higher-priority RT tasks, etc can still cause different response. These > interferences should be considered and periodically revaluate whether > or not

Re: [PATCH v4 5/5] KVM: LAPIC: add advance timer support to pi_inject_timer

2019-06-17 Thread Radim Krčmář
2019-06-17 19:24+0800, Wanpeng Li: > From: Wanpeng Li > > Wait before calling posted-interrupt deliver function directly to add > advance timer support to pi_inject_timer. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Marcelo Tosatti > Signed-off-by: Wanp

Re: [PATCH v2] KVM: x86: clean up conditions for asynchronous page fault handling

2019-06-17 Thread Radim Krčmář
er_async_pf, this patch > commonizes the code that chooses whether to deliver an async page fault > (kvm_arch_async_page_not_present) and the code that chooses whether a > page fault should be handled synchronously (kvm_can_do_async_pf). > > Signed-off-by: Paolo Bonzini > --- Reviewed-by: Radim Krčmář

Re: [PATCH 22/43] KVM: nVMX: Don't dump VMCS if virtual APIC page can't be mapped

2019-06-17 Thread Radim Krčmář
2019-06-13 19:03+0200, Paolo Bonzini: > From: Sean Christopherson > > ... as a malicious userspace can run a toy guest to generate invalid > virtual-APIC page addresses in L1, i.e. flood the kernel log with error > messages. > > Fixes: 690908104e39d ("KVM: nVMX: allow tests to use bad

Re: [PATCH RESEND v3 2/3] KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL

2019-06-17 Thread Radim Krčmář
2019-06-17 14:31+0800, Xiaoyao Li: > On 6/17/2019 11:32 AM, Xiaoyao Li wrote: > > On 6/16/2019 5:55 PM, Tao Xu wrote: > > > +    if (vmx->msr_ia32_umwait_control != host_umwait_control) > > > +    add_atomic_switch_msr(vmx, MSR_IA32_UMWAIT_CONTROL, > > > + 

Re: [PATCH] KVM: x86: clean up conditions for asynchronous page fault handling

2019-06-13 Thread Radim Krčmář
2019-06-13 13:03+0200, Paolo Bonzini: > Even when asynchronous page fault is disabled, KVM does not want to pause > the host if a guest triggers a page fault; instead it will put it into > an artificial HLT state that allows running other host processes while > allowing interrupt delivery into the

Re: [PATCH] KVM: nVMX: use correct clean fields when copying from eVMCS

2019-06-13 Thread Radim Krčmář
m_exit_controls/pin_based_vm_exec_control/secondary_vm_exec_control > are covered by CONTROL_GRP1. > > Fixes: 945679e301ea0 ("KVM: nVMX: add enlightened VMCS state") > Signed-off-by: Vitaly Kuznetsov > --- Reviewed-by: Radim Krčmář

Re: [PATCH v3 1/2] KVM: LAPIC: Optimize timer latency consider world switch time

2019-06-12 Thread Radim Krčmář
2019-06-12 21:22+0200, Radim Krčmář: > 2019-06-12 08:14-0700, Sean Christopherson: > > On Wed, Jun 12, 2019 at 05:40:18PM +0800, Wanpeng Li wrote: > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > @@ -145,6 +145,12 @@ module_param(tsc_tolerance_ppm, uin

Re: [PATCH v3 1/2] KVM: LAPIC: Optimize timer latency consider world switch time

2019-06-12 Thread Radim Krčmář
2019-06-12 08:14-0700, Sean Christopherson: > On Wed, Jun 12, 2019 at 05:40:18PM +0800, Wanpeng Li wrote: > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > @@ -145,6 +145,12 @@ module_param(tsc_tolerance_ppm, uint, S_IRUGO | > > S_IWUSR); > > static int __read_mostly

Re: [PATCH v3 2/4] KVM: LAPIC: lapic timer interrupt is injected by posted interrupt

2019-06-12 Thread Radim Krčmář
2019-06-12 09:48+0800, Wanpeng Li: > On Wed, 12 Jun 2019 at 04:39, Marcelo Tosatti wrote: > > On Tue, Jun 11, 2019 at 08:17:07PM +0800, Wanpeng Li wrote: > > > From: Wanpeng Li > > > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > > > @@ -133,6 +133,12 @@ inline bool > > >

Re: [PATCH v2 1/3] KVM: LAPIC: Make lapic timer unpinned when timer is injected by posted-interrupt

2019-06-10 Thread Radim Krčmář
_full cover the pCPUs which vCPUs resident, several pCPUs > surplus for housekeeping, disable mwait/hlt/pause vmexits to occupy > the pCPUs, fortunately preemption timer is disabled after mwait is > exposed to guest which makes emulated timer offload can be possible. > > C

Re: [PATCH v2 2/3] KVM: LAPIC: lapic timer interrupt is injected by posted interrupt

2019-06-10 Thread Radim Krčmář
2019-06-06 13:31+0800, Wanpeng Li: > From: Wanpeng Li > > Dedicated instances are currently disturbed by unnecessary jitter due > to the emulated lapic timers fire on the same pCPUs which vCPUs resident. > There is no hardware virtual timer on Intel for guest like ARM. Both > programming timer

Re: [PATCH v3 0/3] KVM: Yield to IPI target if necessary

2019-06-10 Thread Radim Krčmář
2019-05-30 09:05+0800, Wanpeng Li: > The idea is from Xen, when sending a call-function IPI-many to vCPUs, > yield if any of the IPI target vCPUs was preempted. 17% performance > increasement of ebizzy benchmark can be observed in an over-subscribe > environment. (w/ kvm-pv-tlb disabled,

Re: [PATCH v3 2/3] KVM: X86: Implement PV sched yield hypercall

2019-06-10 Thread Radim Krčmář
> over-subscribe environment. (w/ kvm-pv-tlb disabled, testing TLB flush > call-function IPI-many since call-function is not easy to be trigged > by userspace workload). > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Liran Alon > Signed-off-by: Wanpeng Li > --- > di

Re: [RESEND PATCH v3] KVM: x86: Add Intel CPUID.1F cpuid emulation support

2019-06-03 Thread Radim Krčmář
2019-05-26 21:30+0800, Like Xu: > Add support to expose Intel V2 Extended Topology Enumeration Leaf for > some new systems with multiple software-visible die within each package. > > Per Intel's SDM, when CPUID executes with EAX set to 1FH, the processor > returns information about extended

Re: Linux in KVM guest segfaults when hosts runs Linux 5.1

2019-05-13 Thread Radim Krčmář
2019-05-12 13:53+0200, Marc Haber: > since updating my home desktop machine to kernel 5.1.1, KVM guests > started on that machine segfault after booting: [...] > Any idea short of bisecting? It has also been spotted by Borislav and the fix [1] should land in the next kernel update, thanks for the

Re: [PATCH] KVM: X86: Enable IA32_MSIC_ENABLE MONITOR bit when exposing mwait/monitor

2019-05-13 Thread Radim Krčmář
2019-05-13 17:46+0800, Wanpeng Li: > From: Wanpeng Li > > MSR IA32_MSIC_ENABLE bit 18, according to SDM: > > | When this bit is set to 0, the MONITOR feature flag is not set > (CPUID.01H:ECX[bit 3] = 0). > | This indicates that MONITOR/MWAIT are not supported. > | > | Software attempts

[PATCH] Revert "KVM: doc: Document the life cycle of a VM and its resources"

2019-04-29 Thread Radim Krčmář
This reverts commit 919f6cd8bb2fe7151f8aecebc3b3d1ca2567396e. The patch was applied twice. The first commit is eca6be566d47029f945a5f8e1c94d374e31df2ca. Reported-by: Cornelia Huck Signed-off-by: Radim Krčmář --- Documentation/virtual/kvm/api.txt | 17 - 1 file changed, 17

[GIT PULL] KVM fixes for Linux 5.0-rc2

2019-01-12 Thread Radim Krčmář
Linus, The following changes since commit bfeffd155283772bbe78c6a05dec7c0128ee500c: Linux 5.0-rc1 (2019-01-06 17:08:20 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm tags/for-linus for you to fetch changes up to

Re: [PATCH] kvm: Use struct_size() in kmalloc()

2019-01-11 Thread Radim Krčmář
2019-01-04 10:29-0600, Gustavo A. R. Silva: > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct foo { > int stuff; >

Re: [PATCH] KVM/VMX: Avoid return error when flush tlb successfully in the hv_remote_flush_tlb_with_range()

2019-01-11 Thread Radim Krčmář
2019-01-04 15:20+0800, lantianyu1...@gmail.com: > From: Lan Tianyu > > The "ret" is initialized to be ENOTSUPP. The return value of > __hv_remote_flush_tlb_with_range() will be Or with "ret" when ept > table potiners are mismatched. This will cause return ENOTSUPP even if > flush tlb

Re: [patch] kvm: sev: Fail KVM_SEV_INIT if already initialized

2019-01-11 Thread Radim Krčmář
2019-01-02 12:56-0800, David Rientjes: > By code inspection, it was found that multiple calls to KVM_SEV_INIT > could deplete asid bits and overwrite kvm_sev_info's regions_list. > > Multiple calls to KVM_SVM_INIT is not likely to occur with QEMU, but this > should likely be fixed anyway. > >

Re: [PATCH] KVM: validate userspace input in kvm_clear_dirty_log_protect()

2019-01-11 Thread Radim Krčmář
2019-01-08 17:28+0100, Tomas Bortoli: > Hi Paolo, > > On 1/7/19 11:42 PM, Paolo Bonzini wrote: > > On 02/01/19 18:29, Tomas Bortoli wrote: > >>n = kvm_dirty_bitmap_bytes(memslot); > >> + > >> + if (n << 3 < log->num_pages || log->first_page > log->num_pages) > >> + return -EINVAL; >

Re: [PATCH] kvm/eventfd : unnecessory conversion to bool

2019-01-11 Thread Radim Krčmář
2018-12-27 14:22+0800, Peng Hao: > Conversion to bool is not needed in ioeventfd_in_range. > > Signed-off-by: Peng Hao > --- Fixed the typo in subject and queued, thanks.

Re: [PATCH][next] KVM: x86: Fix bit shifting in update_intel_pt_cfg

2019-01-11 Thread Radim Krčmář
2018-12-26 14:40-0600, Gustavo A. R. Silva: > ctl_bitmask in pt_desc is of type u64. When an integer like 0xf is > being left shifted more than 32 bits, the behavior is undefined. > > Fix this by adding suffix ULL to integer 0xf. > > Addresses-Coverity-ID: 1476095 ("Bad bit shift operation") >

Re: [RESEND PATCH] kvm/x86: propagate fetch fault into guest

2019-01-11 Thread Radim Krčmář
2018-12-24 20:00+0800, Peng Hao: > When handling ept misconfig exit, it will call emulate instruction > with insn_len = 0. The decode instruction function may return a fetch > fault and should propagate to guest. > > The problem will result to emulation fail. > KVM internal error. Suberror: 1 >

Re: [PATCH v3] x86/kvmclock : convert to SPDX identifiers

2018-12-20 Thread Radim Krčmář
2018-11-02 17:05+0800, Peng Hao: > Update the verbose license text with the matching SPDX > license identifier. > > Signed-off-by: Peng Hao > --- > arch/x86/kernel/kvmclock.c | 15 +-- > 1 files changed, 1 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/kernel/kvmclock.c

Re: [PATCH] selftests: kvm: report failed stage when exit reason is unexpected

2018-12-20 Thread Radim Krčmář
2018-12-19 12:15+0100, Vitaly Kuznetsov: > When we get a report like > > Test Assertion Failure > x86_64/state_test.c:157: run->exit_reason == KVM_EXIT_IO > pid=955 tid=955 - Success > 10x00401350: main at state_test.c:154 > 20x7fc31c9e9412: ??

Re: [PATCH] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported

2018-12-20 Thread Radim Krčmář
2018-12-19 12:06+0100, Vitaly Kuznetsov: > AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm > knows nothing about it, however, this MSR is among emulated_msrs and > thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS, > of course, fails. > > Report the MSR

Re: [PATCH] KVM: MMU: Introduce single thread to zap collapsible sptes

2018-12-20 Thread Radim Krčmář
er thread to zap collapsible sptes in order to lazy > collapse > small sptes into large sptes during roll-back after live migration fails. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- > @@ -5679,14 +5679,41 @@ static bool kvm_mmu_z

Re: [PATCH V3] kvm:x86 :remove unnecessary recalculate_apic_map

2018-12-13 Thread Radim Krčmář
map has been > deleted. > > Signed-off-by: Peng Hao > --- Reviewed-by: Radim Krčmář

Re: [PATCH] KVM/nVMX: Do not validate that posted_intr_desc_addr is page aligned

2018-10-24 Thread Radim Krčmář
he address to be page aligned. > > > > Only validate that the address does not cross the maximum physical address > > without enforcing a page alignment. > > > > Cc: Paolo Bonzini > > Cc: Radim Krčmář > > Cc: Thomas Gleixner > > Cc: Ingo Molnar >

Re: [PATCH] KVM/nVMX: Do not validate that posted_intr_desc_addr is page aligned

2018-10-24 Thread Radim Krčmář
he address to be page aligned. > > > > Only validate that the address does not cross the maximum physical address > > without enforcing a page alignment. > > > > Cc: Paolo Bonzini > > Cc: Radim Krčmář > > Cc: Thomas Gleixner > > Cc: Ingo Molnar >

[GIT PULL] KVM updates for Linux 4.20-rc1

2018-10-24 Thread Radim Krčmář
Tracing APCB changes s390: vfio-ap: setup APCB mask using KVM dedicated function Punit Agrawal (1): KVM: arm/arm64: Ensure only THP is candidate for adjustment Radim Krčmář (1): Revert "kvm: x86: optimize dr6 restore" Sean Christopherson (22): KVM: vmx: rename

[GIT PULL] KVM updates for Linux 4.20-rc1

2018-10-24 Thread Radim Krčmář
Tracing APCB changes s390: vfio-ap: setup APCB mask using KVM dedicated function Punit Agrawal (1): KVM: arm/arm64: Ensure only THP is candidate for adjustment Radim Krčmář (1): Revert "kvm: x86: optimize dr6 restore" Sean Christopherson (22): KVM: vmx: rename

[GIT PULL] KVM fixes for Linux 4.19-rc3

2018-09-08 Thread Radim Krčmář
dex in xlate function Pierre Morel (1): KVM: s390: vsie: copy wrapping keys to right place Radim Krčmář (3): Merge tag 'kvm-ppc-fixes-4.19-1' of git://git.kernel.org/.../paulus/powerpc Merge tag 'kvm-s390-master-4.19-1' of git://git.kernel.org/.../kvms390/linux Merge tag 'kvm-

[GIT PULL] KVM fixes for Linux 4.19-rc3

2018-09-08 Thread Radim Krčmář
dex in xlate function Pierre Morel (1): KVM: s390: vsie: copy wrapping keys to right place Radim Krčmář (3): Merge tag 'kvm-ppc-fixes-4.19-1' of git://git.kernel.org/.../paulus/powerpc Merge tag 'kvm-s390-master-4.19-1' of git://git.kernel.org/.../kvms390/linux Merge tag 'kvm-

Re: [PATCH v2] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-30 Thread Radim Krčmář
serve enough space for any xAPIC > ID. > > Reported-by: Dan Carpenter > Reviewed-by: Liran Alon > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Liran Alon > Cc: Dan Carpenter > Signed-off-by: Wanpeng Li > --- > v1 -> v2: > * add min > map->max_apic_

Re: [PATCH v2] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-30 Thread Radim Krčmář
serve enough space for any xAPIC > ID. > > Reported-by: Dan Carpenter > Reviewed-by: Liran Alon > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Liran Alon > Cc: Dan Carpenter > Signed-off-by: Wanpeng Li > --- > v1 -> v2: > * add min > map->max_apic_

Re: [PATCH V3 1/2] kvm/x86 : add coalesced pio support

2018-08-29 Thread Radim Krčmář
2018-08-24 19:20+0800, Peng Hao: > Signed-off-by: Peng Hao > --- > include/uapi/linux/kvm.h | 5 +++-- > virt/kvm/coalesced_mmio.c | 8 +--- > virt/kvm/kvm_main.c | 2 ++ > 3 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/include/uapi/linux/kvm.h

Re: [PATCH V3 1/2] kvm/x86 : add coalesced pio support

2018-08-29 Thread Radim Krčmář
2018-08-24 19:20+0800, Peng Hao: > Signed-off-by: Peng Hao > --- > include/uapi/linux/kvm.h | 5 +++-- > virt/kvm/coalesced_mmio.c | 8 +--- > virt/kvm/kvm_main.c | 2 ++ > 3 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/include/uapi/linux/kvm.h

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-19 Thread Radim Krčmář
2018-07-19 18:47+0200, Paolo Bonzini: > On 19/07/2018 18:28, Radim Krčmář wrote: > >> + > >> + kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, ipi_bitmap_high, > >> vector); > > and > > > > kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap[0],

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-19 Thread Radim Krčmář
2018-07-19 18:47+0200, Paolo Bonzini: > On 19/07/2018 18:28, Radim Krčmář wrote: > >> + > >> + kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, ipi_bitmap_high, > >> vector); > > and > > > > kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap[0],

Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs

2018-07-19 Thread Radim Krčmář
2018-07-03 14:21+0800, Wanpeng Li: > From: Wanpeng Li > > The NMI delivery mode of ICR is used to deliver an NMI to the processor, > and the vector information is ignored. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Vitaly Kuznetsov > Signed-off-by: Wanpeng Li

Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs

2018-07-19 Thread Radim Krčmář
2018-07-03 14:21+0800, Wanpeng Li: > From: Wanpeng Li > > The NMI delivery mode of ICR is used to deliver an NMI to the processor, > and the vector information is ignored. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Vitaly Kuznetsov > Signed-off-by: Wanpeng Li

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-19 Thread Radim Krčmář
l 128 vCPUs VM, it is big enough for cloud > environment currently, supporting more vCPUs needs to introduce more > complex logic, in the future this might be extended if needed. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Vitaly Kuznetsov > Signed-off-by: Wanpeng Li >

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-19 Thread Radim Krčmář
l 128 vCPUs VM, it is big enough for cloud > environment currently, supporting more vCPUs needs to introduce more > complex logic, in the future this might be extended if needed. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Vitaly Kuznetsov > Signed-off-by: Wanpeng Li >

Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE

2018-07-18 Thread Radim Krčmář
for saving and restoring a VM > that is in VMX operation. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: H. Peter Anvin > Cc: x...@kernel.org > Cc: k...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Jim Mat

Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE

2018-07-18 Thread Radim Krčmář
for saving and restoring a VM > that is in VMX operation. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: H. Peter Anvin > Cc: x...@kernel.org > Cc: k...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Jim Mat

Re: [PATCH v5 1/2] KVM: Switch 'requests' to be 64-bit (explicitly)

2018-07-18 Thread Radim Krčmář
out of space for x86 due to the hard-coded check. > > The only exception here is ARM32 as it is still 32-bits. What do you mean? I think we're just going to slow down kvm_request_pending() on 32 bit architectures. > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: k...@vger.kernel.org >

Re: [PATCH v5 1/2] KVM: Switch 'requests' to be 64-bit (explicitly)

2018-07-18 Thread Radim Krčmář
out of space for x86 due to the hard-coded check. > > The only exception here is ARM32 as it is still 32-bits. What do you mean? I think we're just going to slow down kvm_request_pending() on 32 bit architectures. > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: k...@vger.kernel.org >

Re: [PATCH v2] KVM: Add coalesced PIO support

2018-07-18 Thread Radim Krčmář
45.42%42.08% 6.37us ( +- 20.37% ) > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Eduardo Habkost > Cc: Peng Hao > Signed-off-by: Peng Hao > Signed-off-by: Wanpeng Li > --- > v1 -> v2: > * add the original author > > Documentation/virtual/kvm/0

Re: [PATCH v2] KVM: Add coalesced PIO support

2018-07-18 Thread Radim Krčmář
45.42%42.08% 6.37us ( +- 20.37% ) > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Eduardo Habkost > Cc: Peng Hao > Signed-off-by: Peng Hao > Signed-off-by: Wanpeng Li > --- > v1 -> v2: > * add the original author > > Documentation/virtual/kvm/0

Re: [PATCH] KVM: VMX: modify macro definition 'R' to 'R ' because of gcc-5+

2018-06-27 Thread Radim Krčmář
2018-06-26 20:59+0800, LiuYang: > GCC 5.4.0 enables raw strings by default and they have higher priority > than macros, thus R is interpreted incorrectly. > Fix it by putting a space between macro R and a string literal. > > Signed-off-by: LiuYang > --- This got fixed in 2012 by b188c81f2e1a

Re: [PATCH] KVM: VMX: modify macro definition 'R' to 'R ' because of gcc-5+

2018-06-27 Thread Radim Krčmář
2018-06-26 20:59+0800, LiuYang: > GCC 5.4.0 enables raw strings by default and they have higher priority > than macros, thus R is interpreted incorrectly. > Fix it by putting a space between macro R and a string literal. > > Signed-off-by: LiuYang > --- This got fixed in 2012 by b188c81f2e1a

[GIT PULL] KVM fixes for Linux 4.18-rc2

2018-06-22 Thread Radim Krčmář
: Prevent KVM_COMPAT from being selected Mark Rutland (1): arm64: Introduce sysreg_clear_set() Radim Krčmář (1): Merge tag 'kvmarm-fixes-for-4.18-1' of git://git.kernel.org/.../kvmarm/kvmarm Vitaly Kuznetsov (1): KVM: fix KVM_CAP_HYPERV_TLBFLUSH paragraph number Documentation

[GIT PULL] KVM fixes for Linux 4.18-rc2

2018-06-22 Thread Radim Krčmář
: Prevent KVM_COMPAT from being selected Mark Rutland (1): arm64: Introduce sysreg_clear_set() Radim Krčmář (1): Merge tag 'kvmarm-fixes-for-4.18-1' of git://git.kernel.org/.../kvmarm/kvmarm Vitaly Kuznetsov (1): KVM: fix KVM_CAP_HYPERV_TLBFLUSH paragraph number Documentation

Re: [PATCH 2/3] x86/kvm: Implement MSR_HWCR support

2018-06-22 Thread Radim Krčmář
2018-06-22 21:09+0200, Borislav Petkov: > On Fri, Jun 22, 2018 at 08:52:38PM +0200, Radim Krčmář wrote: > > msr_info->host_initiated is always going to return true, so it would be > > better to put it outside of __set_mci_status. > > > > Maybe we could just write the

Re: [PATCH 2/3] x86/kvm: Implement MSR_HWCR support

2018-06-22 Thread Radim Krčmář
2018-06-22 21:09+0200, Borislav Petkov: > On Fri, Jun 22, 2018 at 08:52:38PM +0200, Radim Krčmář wrote: > > msr_info->host_initiated is always going to return true, so it would be > > better to put it outside of __set_mci_status. > > > > Maybe we could just write the

Re: [PATCH 3/3] KVM: x86: hyperv: implement PV IPI send hypercalls

2018-06-22 Thread Radim Krčmář
2018-06-22 16:56+0200, Vitaly Kuznetsov: > Using hypercall for sending IPIs is faster because this allows to specify > any number of vCPUs (even > 64 with sparse CPU set), the whole procedure > will take only one VMEXIT. > > Current Hyper-V TLFS (v5.0b) claims that HvCallSendSyntheticClusterIpi >

Re: [PATCH 3/3] KVM: x86: hyperv: implement PV IPI send hypercalls

2018-06-22 Thread Radim Krčmář
2018-06-22 16:56+0200, Vitaly Kuznetsov: > Using hypercall for sending IPIs is faster because this allows to specify > any number of vCPUs (even > 64 with sparse CPU set), the whole procedure > will take only one VMEXIT. > > Current Hyper-V TLFS (v5.0b) claims that HvCallSendSyntheticClusterIpi >

Re: [PATCH 2/3] x86/kvm: Implement MSR_HWCR support

2018-06-22 Thread Radim Krčmář
2018-06-22 11:51+0200, Borislav Petkov: > From: Borislav Petkov > > The hardware configuration register has some useful bits which can be > used by guests. Implement McStatusWrEn which can be used by guests when > injecting MCEs with the in-kernel mce-inject module. > > For that, we need to set

Re: [PATCH 2/3] x86/kvm: Implement MSR_HWCR support

2018-06-22 Thread Radim Krčmář
2018-06-22 11:51+0200, Borislav Petkov: > From: Borislav Petkov > > The hardware configuration register has some useful bits which can be > used by guests. Implement McStatusWrEn which can be used by guests when > injecting MCEs with the in-kernel mce-inject module. > > For that, we need to set

Re: [PATCH 3/3] x86/kvm: Handle all MCA banks

2018-06-22 Thread Radim Krčmář
2018-06-22 20:24+0200, Borislav Petkov: > On Fri, Jun 22, 2018 at 08:16:04PM +0200, Radim Krčmář wrote: > > 2018-06-22 11:51+0200, Borislav Petkov: > > > From: Borislav Petkov > > > > > > Extend the range of MCA banks which get passed to set/get_msr

Re: [PATCH 3/3] x86/kvm: Handle all MCA banks

2018-06-22 Thread Radim Krčmář
2018-06-22 20:24+0200, Borislav Petkov: > On Fri, Jun 22, 2018 at 08:16:04PM +0200, Radim Krčmář wrote: > > 2018-06-22 11:51+0200, Borislav Petkov: > > > From: Borislav Petkov > > > > > > Extend the range of MCA banks which get passed to set/get_msr

Re: [PATCH 3/3] x86/kvm: Handle all MCA banks

2018-06-22 Thread Radim Krčmář
2018-06-22 11:51+0200, Borislav Petkov: > From: Borislav Petkov > > Extend the range of MCA banks which get passed to set/get_msr_mce() to > include all the MSRs of the last bank too. > > Signed-off-by: Borislav Petkov > --- > arch/x86/kvm/x86.c | 5 +++-- > 1 file changed, 3 insertions(+), 2

Re: [PATCH 3/3] x86/kvm: Handle all MCA banks

2018-06-22 Thread Radim Krčmář
2018-06-22 11:51+0200, Borislav Petkov: > From: Borislav Petkov > > Extend the range of MCA banks which get passed to set/get_msr_mce() to > include all the MSRs of the last bank too. > > Signed-off-by: Borislav Petkov > --- > arch/x86/kvm/x86.c | 5 +++-- > 1 file changed, 3 insertions(+), 2

Re: [PATCH 1/3] KVM: fix KVM_CAP_HYPERV_TLBFLUSH paragraph number

2018-06-22 Thread Radim Krčmář
2018-06-22 16:56+0200, Vitaly Kuznetsov: > KVM_CAP_HYPERV_TLBFLUSH collided with KVM_CAP_S390_PSW-BPB, its paragraph > number should now be 8.18. > > Signed-off-by: Vitaly Kuznetsov > --- > Documentation/virtual/kvm/api.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH 1/3] KVM: fix KVM_CAP_HYPERV_TLBFLUSH paragraph number

2018-06-22 Thread Radim Krčmář
2018-06-22 16:56+0200, Vitaly Kuznetsov: > KVM_CAP_HYPERV_TLBFLUSH collided with KVM_CAP_S390_PSW-BPB, its paragraph > number should now be 8.18. > > Signed-off-by: Vitaly Kuznetsov > --- > Documentation/virtual/kvm/api.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH] KVM: VMX: Optimize tscdeadline timer latency

2018-05-29 Thread Radim Krčmář
2018-05-29 16:23+0200, Radim Krčmář: > 2018-05-29 14:53+0800, Wanpeng Li: > > From: Wanpeng Li > > > > 'Commit d0659d946be0 ("KVM: x86: add option to advance tscdeadline > > hrtimer expiration")' advances the tscdeadline (the timer is emulated

Re: [PATCH] KVM: VMX: Optimize tscdeadline timer latency

2018-05-29 Thread Radim Krčmář
2018-05-29 16:23+0200, Radim Krčmář: > 2018-05-29 14:53+0800, Wanpeng Li: > > From: Wanpeng Li > > > > 'Commit d0659d946be0 ("KVM: x86: add option to advance tscdeadline > > hrtimer expiration")' advances the tscdeadline (the timer is emulated

Re: [PATCH] KVM: VMX: Optimize tscdeadline timer latency

2018-05-29 Thread Radim Krčmář
latency (~4450 cycles to ~1660 cycles on > a haswell desktop) for kvm-unit-tests/tscdeadline_latency when testing > busy waits. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > @@ -12444,6 +

Re: [PATCH] KVM: VMX: Optimize tscdeadline timer latency

2018-05-29 Thread Radim Krčmář
latency (~4450 cycles to ~1660 cycles on > a haswell desktop) for kvm-unit-tests/tscdeadline_latency when testing > busy waits. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > @@ -12444,6 +

[GIT PULL] KVM fixes for Linux 4.17-rc7

2018-05-26 Thread Radim Krčmář
hot timebase offset on guest entry KVM: PPC: Book 3S HV: Do ptesync in radix guest exit path Radim Krčmář (2): Merge tag 'kvm-ppc-fixes-4.17-1' of git://git.kernel.org/.../paulus/powerpc KVM: x86: fix #UD address of failed Hyper-V hypercalls Wei Huang (1): KVM: x86: Update cp

[GIT PULL] KVM fixes for Linux 4.17-rc7

2018-05-26 Thread Radim Krčmář
hot timebase offset on guest entry KVM: PPC: Book 3S HV: Do ptesync in radix guest exit path Radim Krčmář (2): Merge tag 'kvm-ppc-fixes-4.17-1' of git://git.kernel.org/.../paulus/powerpc KVM: x86: fix #UD address of failed Hyper-V hypercalls Wei Huang (1): KVM: x86: Update cp

Re: [PATCH v4 5/8] KVM: introduce kvm_make_vcpus_request_mask() API

2018-05-26 Thread Radim Krčmář
2018-05-16 17:21+0200, Vitaly Kuznetsov: > Hyper-V style PV TLB flush hypercalls inmplementation will use this API. > To avoid memory allocation in CONFIG_CPUMASK_OFFSTACK case add > cpumask_var_t argument. > > Signed-off-by: Vitaly Kuznetsov > --- > diff --git

Re: [PATCH v4 5/8] KVM: introduce kvm_make_vcpus_request_mask() API

2018-05-26 Thread Radim Krčmář
2018-05-16 17:21+0200, Vitaly Kuznetsov: > Hyper-V style PV TLB flush hypercalls inmplementation will use this API. > To avoid memory allocation in CONFIG_CPUMASK_OFFSTACK case add > cpumask_var_t argument. > > Signed-off-by: Vitaly Kuznetsov > --- > diff --git a/virt/kvm/kvm_main.c

Re: [PATCH v4 0/8] KVM: x86: hyperv: PV TLB flush for Windows guests

2018-05-26 Thread Radim Krčmář
2018-05-16 17:21+0200, Vitaly Kuznetsov: > Changes since v3 [Radim Krcmar]: > - PATCH2 fixing 'HV_GENERIC_SET_SPARCE_4K' typo added. > - PATCH5 introducing kvm_make_vcpus_request_mask() API added. > - Fix undefined behavior for hv->vp_index >= 64. > - Merge kvm_hv_flush_tlb() and

Re: [PATCH v4 0/8] KVM: x86: hyperv: PV TLB flush for Windows guests

2018-05-26 Thread Radim Krčmář
2018-05-16 17:21+0200, Vitaly Kuznetsov: > Changes since v3 [Radim Krcmar]: > - PATCH2 fixing 'HV_GENERIC_SET_SPARCE_4K' typo added. > - PATCH5 introducing kvm_make_vcpus_request_mask() API added. > - Fix undefined behavior for hv->vp_index >= 64. > - Merge kvm_hv_flush_tlb() and

Re: [PATCH] KVM: X86: prevent integer overflows in KVM_MEMORY_ENCRYPT_REG_REGION

2018-05-26 Thread Radim Krčmář
2018-05-21 10:52-0500, Brijesh Singh: > On 05/19/2018 01:01 AM, Dan Carpenter wrote: > > This is a fix from reviewing the code, but it looks like it might be > > able to lead to an Oops. It affects 32bit systems. > > > > Please note that SEV is not available on 32bit systems. Added this note

Re: [PATCH] KVM: X86: prevent integer overflows in KVM_MEMORY_ENCRYPT_REG_REGION

2018-05-26 Thread Radim Krčmář
2018-05-21 10:52-0500, Brijesh Singh: > On 05/19/2018 01:01 AM, Dan Carpenter wrote: > > This is a fix from reviewing the code, but it looks like it might be > > able to lead to an Oops. It affects 32bit systems. > > > > Please note that SEV is not available on 32bit systems. Added this note

Re: [PATCH] KVM: x86: VMX: fix building without CONFIG_HYPERV

2018-05-26 Thread Radim Krčmář
2018-05-25 17:36+0200, Arnd Bergmann: > The global ms_hyperv variable is part of the hyperv support, so > we get a link error from accessing it in kernels that have this > turned off: > > arch/x86/kvm/vmx.o: In function `alloc_loaded_vmcs': > vmx.c:(.text+0x1654a): undefined reference to

Re: [PATCH] KVM: x86: VMX: fix building without CONFIG_HYPERV

2018-05-26 Thread Radim Krčmář
2018-05-25 17:36+0200, Arnd Bergmann: > The global ms_hyperv variable is part of the hyperv support, so > we get a link error from accessing it in kernels that have this > turned off: > > arch/x86/kvm/vmx.o: In function `alloc_loaded_vmcs': > vmx.c:(.text+0x1654a): undefined reference to

Re: [PATCH] x86/KVM: Fix incorrect SSBD bit in kvm_cpuid_7_0_edx_x86_features

2018-05-25 Thread Radim Krčmář
2018-05-25 13:16-0400, Waiman Long: > As the SSBD bit in kvm_cpuid_7_0_edx_x86_features has been renamed to > SPEC_CTRL_SSBD in the commit 52817587e706 ("x86/cpufeatures: Disentangle > SSBD enumeration"). The corresponding name change needed to be made in > the KVM code as well. > > Fixes:

Re: [PATCH] x86/KVM: Fix incorrect SSBD bit in kvm_cpuid_7_0_edx_x86_features

2018-05-25 Thread Radim Krčmář
2018-05-25 13:16-0400, Waiman Long: > As the SSBD bit in kvm_cpuid_7_0_edx_x86_features has been renamed to > SPEC_CTRL_SSBD in the commit 52817587e706 ("x86/cpufeatures: Disentangle > SSBD enumeration"). The corresponding name change needed to be made in > the KVM code as well. > > Fixes:

Re: [PATCH v3 5/6] KVM: x86: hyperv: simplistic HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE}_EX implementation

2018-05-10 Thread Radim Krčmář
2018-04-16 13:08+0200, Vitaly Kuznetsov: > Implement HvFlushVirtualAddress{List,Space}Ex hypercalls in a simplistic > way: do full TLB flush with KVM_REQ_TLB_FLUSH and kick vCPUs which are > currently IN_GUEST_MODE. > > Signed-off-by: Vitaly Kuznetsov > --- > diff --git

Re: [PATCH v3 5/6] KVM: x86: hyperv: simplistic HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE}_EX implementation

2018-05-10 Thread Radim Krčmář
2018-04-16 13:08+0200, Vitaly Kuznetsov: > Implement HvFlushVirtualAddress{List,Space}Ex hypercalls in a simplistic > way: do full TLB flush with KVM_REQ_TLB_FLUSH and kick vCPUs which are > currently IN_GUEST_MODE. > > Signed-off-by: Vitaly Kuznetsov > --- > diff --git a/arch/x86/kvm/hyperv.c

Re: [PATCH v3 4/6] KVM: x86: hyperv: simplistic HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} implementation

2018-05-10 Thread Radim Krčmář
2018-04-16 13:08+0200, Vitaly Kuznetsov: > Implement HvFlushVirtualAddress{List,Space} hypercalls in a simplistic way: > do full TLB flush with KVM_REQ_TLB_FLUSH and kick vCPUs which are currently > IN_GUEST_MODE. > > Signed-off-by: Vitaly Kuznetsov > --- > diff --git

Re: [PATCH v3 4/6] KVM: x86: hyperv: simplistic HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} implementation

2018-05-10 Thread Radim Krčmář
2018-04-16 13:08+0200, Vitaly Kuznetsov: > Implement HvFlushVirtualAddress{List,Space} hypercalls in a simplistic way: > do full TLB flush with KVM_REQ_TLB_FLUSH and kick vCPUs which are currently > IN_GUEST_MODE. > > Signed-off-by: Vitaly Kuznetsov > --- > diff --git a/arch/x86/kvm/hyperv.c

Re: [PATCH v3 1/6] x86/hyper-v: move struct hv_flush_pcpu{,ex} definitions to common header

2018-05-10 Thread Radim Krčmář
2018-04-16 13:08+0200, Vitaly Kuznetsov: > Hyper-V TLB flush hypercalls definitions will be required for KVM so move > them hyperv-tlfs.h. Structures also need to be renamed as '_pcpu' suffix is > invalid for a general-purpose definition. > > Signed-off-by: Vitaly Kuznetsov

Re: [PATCH v3 1/6] x86/hyper-v: move struct hv_flush_pcpu{,ex} definitions to common header

2018-05-10 Thread Radim Krčmář
2018-04-16 13:08+0200, Vitaly Kuznetsov: > Hyper-V TLB flush hypercalls definitions will be required for KVM so move > them hyperv-tlfs.h. Structures also need to be renamed as '_pcpu' suffix is > invalid for a general-purpose definition. > > Signed-off-by: Vitaly Kuznetsov > --- >

[GIT PULL] KVM fixes for Linux 4.17-rc4

2018-05-06 Thread Radim Krčmář
of vcpu_write_sys_reg() arguments arm64: vgic-v2: Fix proxying of cpuif access Marc Zyngier (1): KVM: arm/arm64: vgic: Fix source vcpu issues for GICv2 SGI Radim Krčmář (1): Merge tag 'kvmarm-fixes-for-4.17-2' of git://git.kernel.org/.../kvmarm/kvmarm Valentin Schneider (1

[GIT PULL] KVM fixes for Linux 4.17-rc4

2018-05-06 Thread Radim Krčmář
of vcpu_write_sys_reg() arguments arm64: vgic-v2: Fix proxying of cpuif access Marc Zyngier (1): KVM: arm/arm64: vgic: Fix source vcpu issues for GICv2 SGI Radim Krčmář (1): Merge tag 'kvmarm-fixes-for-4.17-2' of git://git.kernel.org/.../kvmarm/kvmarm Valentin Schneider (1

[GIT PULL] KVM fixes for Linux 4.17-rc3

2018-04-27 Thread Radim Krčmář
use KarimAllah Ahmed (1): x86/headers/UAPI: Move DISABLE_EXITS KVM capability bits to the UAPI Marc Zyngier (3): KVM: arm/arm64: Close VMID generation race arm64: KVM: Demote SVE and LORegion warnings to debug only arm/arm64: KVM: Add PSCI version selection API Radim Krč

  1   2   3   4   5   6   7   8   9   10   >