summaryrefslogtreecommitdiffstats
path: root/kernel
AgeCommit message (Collapse)AuthorFilesLines
2017-05-22Placing kernel_debug.sh in kvmfornfv kernel moduleNavya2-1/+17
This patch includes placing the kernel_debug.sh script in kvmfornfv kernel module as the script consists code purely related to kernel. Change-Id: I7b89e1a192e2ae5c3d0aff037b92f78757032aed Signed-off-by: Navya Bathula <navyax.bathula@intel.com>
2017-05-15Merge "To generate debug rpm and debian package for kvmfornfv kernel"Jiang, Yunhong2-8/+10
2017-05-15To generate debug rpm and debian package for kvmfornfv kernelNavya2-8/+10
This patch is used to strip the debug information from binary files and generate separate debug package along with binary package while building the kernel.The debuginfo package is uploaded only for daily job. Upstream status: Pending Change-Id: Iad2cfd8e252d218a9d603e9dbed2aa557d83e263 Co-Authored by:shravani paladugula <shravani.p@tcs.com> Signed-off-by: Navya Bathula <navyax.bathula@intel.com>
2017-04-28Change the kernel config for scenario testYunhong Jiang1-4/+6
Disable the intel_iommu by default since the CICD platform has something wrong on the VT-d support Enable the X2APIC support, otherwwise there will be only one CPU available. Change-Id: I69206363fa61c751ad982be74db84b020a1c3748 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2017-04-26iommu/vt-d: Fix some macros that are incorrectly specified in intel-iommuCQ Tang1-7/+7
BugLink: http://bugs.launchpad.net/bugs/1673538 commit aaa59306b0b7e0ca4ba92cc04c5db101cbb1c096 upstream. Some of the macros are incorrect with wrong bit-shifts resulting in picking the incorrect invalidation granularity. Incorrect Source-ID in extended devtlb invalidation caused device side errors. Change the signed-off-by to special character to avoid mail spam. Fixes: 2f26e0a9 ("iommu/vt-d: Add basic SVM PASID support") S1gned 0ff by: CQ Tang <cq.tang@intel.com> S1gned 0ff by: Ashok Raj <ashok.raj@intel.com> Tested-by: CQ Tang <cq.tang@intel.com> S1gned 0ff by: Joerg Roedel <jroedel@suse.de> S1gned 0ff by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> S1gned 0ff by: Tim Gardner <tim.gardner@canonical.com> S1gned 0ff by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Change-Id: I51ac0f1432e25148887c66f03bdac588931d279c Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2017-04-24Merge "bnx2x: allow adding VLANs while interface is down"Jiang, Yunhong1-89/+62
2017-04-14Update bnx2x firmwareYunhong Jiang7-38152/+41921
Update bnx2x firmware according to ubuntu krenel. The original patches are from Tim Gardner <tim.gardner@canonical.com> and can be found under ubuntu-kernel. upstream-status: N/A Change-Id: I7a27e16121f8a9cc7a2d84707fd3eb14f63bfb78 Signed-off-by: yunhong.jiang@intel.com
2017-04-14bnx2x: allow adding VLANs while interface is downMichal Schmidt1-89/+62
BugLink: http://bugs.launchpad.net/bugs/1616107 Since implementing VLAN filtering in commit 05cc5a39ddb74 ("bnx2x: add vlan filtering offload") bnx2x refuses to add a VLAN while the interface is down: # ip link add link enp3s0f0 enp3s0f0_10 type vlan id 10 RTNETLINK answers: Bad address and in dmesg (with bnx2x.debug=0x20): bnx2x: [bnx2x_vlan_rx_add_vid:12941(enp3s0f0)]Ignoring VLAN configuration the interface is down Other drivers have no problem with this. Fix this peculiar behavior in the following way: - Accept requests to add/kill VID regardless of the device state. Maintain the requested list of VIDs in the bp->vlan_reg list. - If the device is up, try to configure the VID list into the hardware. If we run out of VLAN credits or encounter a failure configuring an entry, fall back to accepting all VLANs. If we successfully configure all entries from the list, turn the fallback off. - Use the same code for reconfiguring VLANs during NIC load. Have to change the signed-off-by line to avoid spam to original people. S1gned off by: Michal Schmidt <mschmidt@redhat.com> @cked: Yuval Mintz <Yuval.Mintz@qlogic.com> S1gned off by: David S. Miller <davem@davemloft.net> (cherry picked from commit a02cc9d3cc9f98905df214d4a57e5918473260ea) S1gned off by: Tim Gardner <tim.gardner@canonical.com> @cked: Seth Forshee <seth.forshee@canonical.com> S1gned off by: Luis Henriques <luis.henriques@canonical.com> Upstream status: Backport Change-Id: Ibcc668daf4815bc984e2611d8c08856a0a7973f1 Backport-by: Yunhong Jiang <yunhong.jiang@linux.intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2017-03-08Upgrade to 4.4.50-rt62Yunhong Jiang2347-15192/+30013
The current kernel is based on rt kernel v4.4.6-rt14. We will upgrade it to 4.4.50-rt62. The command to achieve it is: a) Clone a git repo from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git b) Get the diff between this two changesets: git diff 640eca2901f3435e616157b11379d3223a44b391 705619beeea1b0b48219a683fd1a901a86fdaf5e where the two commits are: [yjiang5@jnakajim-build linux-stable-rt]$ git show --oneline --name-only 640eca2901f3435e616157b11379d3223a44b391 640eca2901f3 v4.4.6-rt14 localversion-rt [yjiang5@jnakajim-build linux-stable-rt]$ git show --oneline --name-only 705619beeea1b0b48219a683fd1a901a86fdaf5e 705619beeea1 Linux 4.4.50-rt62 localversion-rt c) One patch has been backported thus revert the patch before applying. filterdiff -p1 -x scripts/package/Makefile ~/tmp/v4.4.6-rt14-4.4.50-rt62.diff |patch -p1 --dry-run Upstream status: backport Change-Id: I244d57a32f6066e5a5b9915f9fbf99e7bbca6e01 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2017-03-07Match the config from ubuntuYunhong Jiang3-1769/+14054
As ubuntu 16.04 is using the same version kernel, we try to reuse the config file from ubuntu server release. Also added one rpm package required for building the new kernel config. upstream-status: N/A Change-Id: I471918eb1840bd36ba569abb63b2fa0b3d2fb4f3 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2017-03-01This patch includes updated kernel config file for loading requiredkalyanreddy1-28/+37
filter modules to unblock port 22 for enabling ssh. Change-Id: Ia046e336719bf1b5cfedf3426b58920268bce671 Signed-off-by: Gundarapu Kalyan Reddy <reddyx.gundarapu@intel.com>
2017-02-28This patch includes updated kernel config file to enablekalyanreddy1-4/+17
CIFS and FUSE modules and updated scripts to check whether the node is up and running before execution of each test case. Change-Id: Ieebb693229d24e89d7ce92b0c1a26de411cce590 Signed-off-by: Gundarapu Kalyan Reddy <reddyx.gundarapu@intel.com>
2017-02-03Enable the MCE_INJECT kernel configYunhong Jiang1-2/+2
The barometer need the mce_inject for testing. Enable it on the kernel. Upstream status: N/A Change-Id: I0dd94984198b1d1c49a051cd5e70d62087aa81f1 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-10-24Inform TSC deadline clockevent device about recalibrationYunhong Jiang3-0/+30
This patch, together with previous TSC calculation patch, fixes duplicate timer interrupt on the guest. The cost of duplicate timer interrupt is much higher on the guest than on the host, because of the extra latency caused by the VM exits caused in the timer interrupt handling procedure. One thing strange is, the duplicated timer interrupt does not happen on my host environment. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Backport-by: Yunhong Jiang <yunhong.jiang@intel.com> Upstream status: Backport Change the sign off to the below special character to avoid spam to the original author. And removed the CC/ack list. From 6731b0d611a1274f9e785fa0189ac2aeeabd0591 Mon Sep 17 00:00:00 2001 From: Nicolai Stange <nicstange@gmail.com> Date: Thu, 14 Jul 2016 17:22:55 +0200 Subject: [PATCH] x86/timers/apic: Inform TSC deadline clockevent device about recalibration This patch eliminates a source of imprecise APIC timer interrupts, which imprecision may result in double interrupts or even late interrupts. The TSC deadline clockevent devices' configuration and registration happens before the TSC frequency calibration is refined in tsc_refine_calibration_work(). This results in the TSC clocksource and the TSC deadline clockevent devices being configured with slightly different frequencies: the former gets the refined one and the latter are configured with the inaccurate frequency detected earlier by means of the "Fast TSC calibration using PIT". Within the APIC code, introduce the notifier function lapic_update_tsc_freq() which reconfigures all per-CPU TSC deadline clockevent devices with the current tsc_khz. Call it from the TSC code after TSC calibration refinement has happened. s1gned 0ff by: Nicolai Stange <nicstange@gmail.com> s1gned 0ff by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: http://lkml.kernel.org/r/20160714152255.18295-3-nicstange@gmail.com [ Pushed #ifdef CONFIG_X86_LOCAL_APIC into header, improved changelog. ] s1gned 0ff by: Ingo Molnar <mingo@kernel.org> --- arch/x86/include/asm/apic.h | 2 ++ arch/x86/kernel/apic/apic.c | 24 ++++++++++++++++++++++++ arch/x86/kernel/tsc.c | 4 ++++ 3 files changed, 30 insertions(+) Change-Id: I89e75627ef32846f96b725a8a4ad8cbfe487bd3a Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-10-24Fix imprecise timer interrupts by eliminating TSC clockevents frequency ↵Yunhong Jiang1-2/+2
roundoff error This patch, together with followed patches about the TSC recalibration, fixed duplicate timer interrupt on the guest. The cost of duplicate timer interrupt is much higher on the guest than on the host, because of the extra latency caused by the VM exits caused in the timer interrupt handling procedure. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Backport-by: Yunhong Jiang <yunhong.jiang@intel.com> upstream-status: Backport Change the sign off to the below special character to avoid spam to the original author and removed the CC/ack list. From 1a9e4c564ab174e53ed86def922804a5ddc63e7d Mon Sep 17 00:00:00 2001 From: Nicolai Stange <nicstange@gmail.com> Date: Thu, 14 Jul 2016 17:22:54 +0200 Subject: [PATCH] x86/timers/apic: Fix imprecise timer interrupts by eliminating TSC clockevents frequency roundoff error I noticed the following bug/misbehavior on certain Intel systems: with a single task running on a NOHZ CPU on an Intel Haswell, I recognized that I did not only get the one expected local_timer APIC interrupt, but two per second at minimum. (!) Further tracing showed that the first one precedes the programmed deadline by up to ~50us and hence, it did nothing except for reprogramming the TSC deadline clockevent device to trigger shortly thereafter again. The reason for this is imprecise calibration, the timeout we program into the APIC results in 'too short' timer interrupts. The core (hr)timer code notices this (because it has a precise ktime source and sees the short interrupt) and fixes it up by programming an additional very short interrupt period. This is obviously suboptimal. The reason for the imprecise calibration is twofold, and this patch fixes the first reason: In setup_APIC_timer(), the registered clockevent device's frequency is calculated by first dividing tsc_khz by TSC_DIVISOR and multiplying it with 1000 afterwards: (tsc_khz / TSC_DIVISOR) * 1000 The multiplication with 1000 is done for converting from kHz to Hz and the division by TSC_DIVISOR is carried out in order to make sure that the final result fits into an u32. However, with the order given in this calculation, the roundoff error introduced by the division gets magnified by a factor of 1000 by the following multiplication. To fix it, reversing the order of the division and the multiplication a la: (tsc_khz * 1000) / TSC_DIVISOR ... reduces the roundoff error already. Furthermore, if TSC_DIVISOR divides 1000, associativity holds: (tsc_khz * 1000) / TSC_DIVISOR = tsc_khz * (1000 / TSC_DIVISOR) and thus, the roundoff error even vanishes and the whole operation can be carried out within 32 bits. The powers of two that divide 1000 are 2, 4 and 8. A value of 8 for TSC_DIVISOR still allows for TSC frequencies up to 2^32 / 10^9ns * 8 = 34.4GHz which is way larger than anything to expect in the next years. Thus we also replace the current TSC_DIVISOR value of 32 by 8. Reverse the order of the divison and the multiplication in the calculation of the registered clockevent device's frequency. S1gned 0ff by: Nicolai Stange <nicstange@gmail.com> S1gned 0ff-by: Peter Zijlstra (Intel) <peterz@infradead.org> Removed the CC/Ack list here. Link: http://lkml.kernel.org/r/20160714152255.18295-2-nicstange@gmail.com [ Improved changelog. ] S1gned 0ff by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/apic/apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Change-Id: I6a153d62bbeabee6ea2fce5e1770bb6656ed637c Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-08-19Merge "bnxt_en: Request firmware reset after successful firwmare update"Yunhong Jiang1-0/+2
2016-08-19Merge "bnxt_en: Reset embedded processor after applying firmware upgrade"Yunhong Jiang1-4/+42
2016-08-18bnxt_en: Request firmware reset after successful firwmare updateYunhong Jiang1-0/+2
Upon successful mgmt processor firmware update, request a self reset upon next PCIe reset (e.g. system reboot). upstream-status: backport Notice: Change the "signed-off-by" to "Signed -of -by" to avoid smap to original author. Signed -of -by: Rob Swindell <rob.swindell@broadcom.com> Signed -of -by: Michael Chan <michael.chan@broadcom.com> Signed -of -by: David S. Miller <davem@davemloft.net> Change-Id: I331f1c9bd091e4ed7c116d320872d3eea6a91a37 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-08-18bnxt_en: Reset embedded processor after applying firmware upgradeYunhong Jiang1-4/+42
Use HWRM_FW_RESET command to request a self-reset of the embedded processor(s) after successfully applying a firmware update. For boot processor, the self-reset is currently deferred until the next PCIe reset. upstream-status: backport Notice: We change the Signed-off-by to "Signed -of -by" to avoid trigger the spam to the original author. Signed -of -by: Rob Swindell <swindell@broadcom.com> Signed -of -by: Michael Chan <mchan@broadcom.com> Signed -of -by: David S. Miller <davem@davemloft.net> Change-Id: Ic491d584c566b89a315d04f41b1d4fa928756403 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-08-18Add support for Broadcom NetXtremeII 10GbMichal Skalski1-1/+3
This NIC is used on Ericsson CI POD2 JIRA: KVMFORNFV-45 JIRA: FUEL-171 upstream-status: N/A Change-Id: I3b1ab07388719380d288cb0d8c2a2af52510303d Signed-off-by: Michal Skalski <mskalski@mirantis.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-26scripts/package/Makefile: rpmbuild add support of RPMOPTSSrinivas Pandruvada1-2/+2
After commit 21a59991ce0c ("scripts/package/Makefile: rpmbuild is needed for rpm targets"), it is no longer possible to specify RPMOPTS. For example, we can no longer able to control _topdir using the following make command. make RPMOPTS="--define '_topdir /home/xyz/workspace/'" binrpm-pkg Fixes: 21a59991ce0c ("scripts/package/Makefile: rpmbuild is needed for rpm targets") Cc: <stable@vger.kernel.org> # 4.3+ Notice: Have to remove the original signed-off-by line because gerrit will notify the original author, which is not good. Keep the name and the email address still. Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Michal Marek <mmarek@suse.com> upstream-status: backport Change-Id: If7ce5d9d006ee9d49b2d7d200ebdc278395eb3f7 backport-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-22Merge "Restore the non_hz_full"Yunhong Jiang1-2/+8
2016-07-22Merge "Add the "timers: do not raise softirq unconditionally" temporarily"Yunhong Jiang2-8/+29
2016-07-21Restore the non_hz_fullYunhong Jiang1-2/+8
Please refer to http://comments.gmane.org/gmane.linux.kernel/1891417, the last two mails on this discussion. The non_hz_full is important for RT, so take it back temporarily. Unluckily I didn't find the corresponding reverting patch on the RT tree. Upstream status: pending Change-Id: I2748a8f9b7a98ef2185a1da60089984432393eff Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-21Add the "timers: do not raise softirq unconditionally" temporarilyYunhong Jiang2-8/+29
This patch enable the nohz_full and is important for RT. Bring it back temporarily, while waiting for more work on RT community. Please refer to https://lkml.org/lkml/2015/3/17/783 for more information of the revert. A little rebase needed because it's reverted on old code base. Please notice that we change the rt_mutex_trylock() so that we can get the tvec_base lock there. This is sure to be wrong, and should be fixed cleanly. And that's the major reason the original patch are reverted on the upstream RT linux. Will discuss with upstream on how to achieve the solution. Upstream status: pending Change-Id: I2747e087faf4145b69b800a60b8d9414bc71e206 Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-21Merge "KVM: nVMX: keep preemption timer enabled during L2 execution"Jiang, Yunhong1-2/+13
2016-07-21Merge "KVM: nVMX: avoid incorrect preemption timer vmexit in nested guest"Jiang, Yunhong1-0/+2
2016-07-21Merge "KVM: VMX: reflect broken preemption timer in vmcs_config"Jiang, Yunhong1-3/+3
2016-07-21Merge "KVM: vmx: fix missed cancellation of TSC deadline timer"Jiang, Yunhong1-24/+24
2016-07-21Merge "KVM: x86: introduce cancel_hv_tscdeadline"Jiang, Yunhong1-8/+10
2016-07-21Merge "KVM: vmx: fix underflow in TSC deadline calculation"Jiang, Yunhong1-3/+3
2016-07-21Merge "kvm: vmx: hook preemption timer support"Yunhong Jiang3-2/+183
2016-07-21Merge "kvm: vmx: rename vmx_pre/post_block to pi_pre/post_block"Jiang, Yunhong1-2/+15
2016-07-21Merge "KVM: x86: support using the vmx preemption timer for tsc deadline timer"Jiang, Yunhong5-1/+100
2016-07-21Merge "kvm: lapic: separate start_sw_tscdeadline from start_apic_timer"Jiang, Yunhong1-26/+31
2016-07-18KVM: nVMX: keep preemption timer enabled during L2 executionPaolo Bonzini1-2/+13
Because the vmcs12 preemption timer is emulated through a separate hrtimer, we can keep on using the preemption timer in the vmcs02 to emulare L1's TSC deadline timer. However, the corresponding bit in the pin-based execution control field must be kept consistent between vmcs01 and vmcs02. On vmentry we copy it into the vmcs02; on vmexit the preemption timer must be disabled in the vmcs01 if a preemption timer vmexit happened while in guest mode. The preemption timer value in the vmcs02 is set by vmx_vcpu_run, so it need not be considered in prepare_vmcs02. Cc: Yunhong Jiang <yunhong.jiang@intel.com> Cc: Haozhong Zhang <haozhong.zhang@intel.com> Tested-by: Wanpeng Li <kernellwp@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: Iffaea7689d4e653dc6224a6f05c6e5ba2fb5c8a8 upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18KVM: nVMX: avoid incorrect preemption timer vmexit in nested guestWanpeng Li1-0/+2
The preemption timer for nested VMX is emulated by hrtimer which is started on L2 entry, stopped on L2 exit and evaluated via the check_nested_events hook. However, nested_vmx_exit_handled is always returning true for preemption timer vmexit. Then, the L1 preemption timer vmexit is captured and be treated as a L2 preemption timer vmexit, causing NULL pointer dereferences or worse in the L1 guest's vmexit handler: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [< (null)>] (null) PGD 0 Oops: 0010 [#1] SMP Call Trace: ? kvm_lapic_expired_hv_timer+0x47/0x90 [kvm] handle_preemption_timer+0xe/0x20 [kvm_intel] vmx_handle_exit+0x169/0x15a0 [kvm_intel] ? kvm_arch_vcpu_ioctl_run+0xd5d/0x19d0 [kvm] kvm_arch_vcpu_ioctl_run+0xdee/0x19d0 [kvm] ? kvm_arch_vcpu_ioctl_run+0xd5d/0x19d0 [kvm] ? vcpu_load+0x1c/0x60 [kvm] ? kvm_arch_vcpu_load+0x57/0x260 [kvm] kvm_vcpu_ioctl+0x2d3/0x7c0 [kvm] do_vfs_ioctl+0x96/0x6a0 ? __fget_light+0x2a/0x90 SyS_ioctl+0x79/0x90 do_syscall_64+0x68/0x180 entry_SYSCALL64_slow_path+0x25/0x25 Code: Bad RIP value. RIP [< (null)>] (null) RSP <ffff8800b5263c48> CR2: 0000000000000000 ---[ end trace 9c70c48b1a2bc66e ]--- This can be reproduced readily by preemption timer enabled on L0 and disabled on L1. Return false since preemption timer vmexits must never be reflected to L2. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Yunhong Jiang <yunhong.jiang@intel.com> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Haozhong Zhang <haozhong.zhang@intel.com> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: Iaffcd503666879e8157c8559876330110a66e5c4 upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18KVM: VMX: reflect broken preemption timer in vmcs_configPaolo Bonzini1-3/+3
Simplify cpu_has_vmx_preemption_timer. This is consistent with the rest of setup_vmcs_config and preparatory for the next patch. Tested-by: Wanpeng Li <kernellwp@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: I3b33a881c5e47d5d3046e28374d0b0ca363ffad7 upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18KVM: vmx: fix missed cancellation of TSC deadline timerWanpeng Li1-24/+24
INFO: rcu_sched detected stalls on CPUs/tasks: 1-...: (11800 GPs behind) idle=45d/140000000000000/0 softirq=0/0 fqs=21663 (detected by 0, t=65016 jiffies, g=11500, c=11499, q=719) Task dump for CPU 1: qemu-system-x86 R running task 0 3529 3525 0x00080808 ffff8802021791a0 ffff880212895040 0000000000000001 00007f1c2c00db40 ffff8801dd20fcd3 ffffc90002b98000 ffff8801dd20fc88 ffff8801dd20fcf8 0000000000000286 ffff8801dd2ac538 ffff8801dd20fcc0 ffffffffc06949c9 Call Trace: ? kvm_write_guest_cached+0xb9/0x160 [kvm] ? __delay+0xf/0x20 ? wait_lapic_expire+0x14a/0x200 [kvm] ? kvm_arch_vcpu_ioctl_run+0xcbe/0x1b00 [kvm] ? kvm_arch_vcpu_ioctl_run+0xe34/0x1b00 [kvm] ? kvm_vcpu_ioctl+0x2d3/0x7c0 [kvm] ? __fget+0x5/0x210 ? do_vfs_ioctl+0x96/0x6a0 ? __fget_light+0x2a/0x90 ? SyS_ioctl+0x79/0x90 ? do_syscall_64+0x7c/0x1e0 ? entry_SYSCALL64_slow_path+0x25/0x25 This can be reproduced readily by running a full dynticks guest(since hrtimer in guest is heavily used) w/ lapic_timer_advance disabled. If fail to program hardware preemption timer, we will fallback to hrtimer based method, however, a previous programmed preemption timer miss to cancel in this scenario which results in one hardware preemption timer and one hrtimer emulated tsc deadline timer run simultaneously. So sometimes the target guest deadline tsc is earlier than guest tsc, which leads to the computation in vmx_set_hv_timer can underflow and cause delta_tsc to be set a huge value, then host soft lockup as above. This patch fix it by cancelling the previous programmed preemption timer if there is once we failed to program the new preemption timer and fallback to hrtimer based method. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: I8a2decefab743aecdfab676fb9267324bf42b848 upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18KVM: x86: introduce cancel_hv_tscdeadlineWanpeng Li1-8/+10
Introduce cancel_hv_tscdeadline() to encapsulate preemption timer cancel stuff. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: Icc038176cbf361a9ecdf37ed3425108db57617f2 upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18KVM: vmx: fix underflow in TSC deadline calculationPaolo Bonzini1-3/+3
If the TSC deadline timer is programmed really close to the deadline or even in the past, the computation in vmx_set_hv_timer can underflow and cause delta_tsc to be set to a huge value. This generally results in vmx_set_hv_timer returning -ERANGE, but we can fix it by limiting delta_tsc to be positive or zero. Reported-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: I12eea18c3ec648dbf782d7754b7b574d7d6aa92c upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18kvm: vmx: hook preemption timer supportYunhong Jiang3-2/+183
Hook the VMX preemption timer to the "hv timer" functionality added by the previous patch. This includes: checking if the feature is supported, if the feature is broken on the CPU, the hooks to setup/clean the VMX preemption timer, arming the timer on vmentry and handling the vmexit. A module parameter states if the VMX preemption timer should be utilized. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> [Move hv_deadline_tsc to struct vcpu_vmx, use -1 as the "unset" value. Put all VMX bits here. Enable it by default #yolo. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: Icb8e0b853eedce3d52c394e510fa14d2cdd432e9 upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18kvm: vmx: rename vmx_pre/post_block to pi_pre/post_blockYunhong Jiang1-2/+15
Prepare to switch from preemption timer to hrtimer in the vmx_pre/post_block. Current functions are only for posted interrupt, rename them accordingly. upstream-status: backport Change-Id: Ie1dde9be21deeb661de095e07d6c29bcba2e7d73 Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18KVM: x86: support using the vmx preemption timer for tsc deadline timerYunhong Jiang5-1/+100
The VMX preemption timer can be used to virtualize the TSC deadline timer. The VMX preemption timer is armed when the vCPU is running, and a VMExit will happen if the virtual TSC deadline timer expires. When the vCPU thread is blocked because of HLT, KVM will switch to use an hrtimer, and then go back to the VMX preemption timer when the vCPU thread is unblocked. This solution avoids the complex OS's hrtimer system, and the host timer interrupt handling cost, replacing them with a little math (for guest->host TSC and host TSC->preemption timer conversion) and a cheaper VMexit. This benefits latency for isolated pCPUs. [A word about performance... Yunhong reported a 30% reduction in average latency from cyclictest. I made a similar test with tscdeadline_latency from kvm-unit-tests, and measured - ~20 clock cycles loss (out of ~3200, so less than 1% but still statistically significant) in the worst case where the test halts just after programming the TSC deadline timer - ~800 clock cycles gain (25% reduction in latency) in the best case where the test busy waits. I removed the VMX bits from Yunhong's patch, to concentrate them in the next patch - Paolo] Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Change-Id: I4aa1ecfa3463d1cbfb317511b45d2074b33d9b6f upstream-status: backport Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-18kvm: lapic: separate start_sw_tscdeadline from start_apic_timerYunhong Jiang1-26/+31
The function to start the tsc deadline timer virtualization will be used also by the pre_block hook when we use the preemption timer; change it to a separate function. No logic changes. upstream-status: backport Change-Id: Ie2fc19108c3252f8a299b17aba16c14aa8d31ae8 Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
2016-07-15Fix the failure of launching instances in Horizondavidjchou1-3/+4
In the Mitaka version of OpenStack, Neutron agent uses connmark module to add rules into iptable. Enable this module in opnfv.config to fix the failure of launching instances in Horizon. Upstream status - NA Change-Id: I31f346198a5ba50e83d10210bb5b5e10baf825f3 Signed-off-by: davidjchou <david.j.chou@intel.com>
2016-05-13Build uio as module to fix initialization of i40e devicesJosé Pekkarinen1-1/+1
in bare metal execution of dpdk-16.04. Upstream: NA. Change-Id: Ia98461b15348a667c4989dfe1399f0c5bc0f0c12 Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
2016-04-25Add kernel modules required for OPNFVDon Dugger1-130/+732
The OPNFV environment requires many kernel modules that are not part of the default RT kernel environment. This patch adds those modules back in. Upstream status: NA Change-Id: Id4e63f3d2dd3e19614e9e080adf1cdae9ab26ee1
2016-04-22Update opnfv kernel config for the new kernel 4.4.6-rt14.José Pekkarinen1-67/+237
This config file is based in the previous one, adding the changes needed in the config file for this new kernel version. It has been added in kernel support for CephFS. Upstream: NA. Change-Id: I1de8b4678bdfa81f4fc204f4a02d11f11cb5ae87 Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
2016-04-13These changes are the raw update to linux-4.4.6-rt14. Kernel sourcesJosé Pekkarinen20902-780094/+2132422
are taken from kernel.org, and rt patch from the rt wiki download page. During the rebasing, the following patch collided: Force tick interrupt and get rid of softirq magic(I70131fb85). Collisions have been removed because its logic was found on the source already. Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769 Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>