[PATCH] kvm: x86: kvm_emulate_wbinvd_noskip should be static

2015-09-27 Thread Geliang Tang
Fixes the following sparse warning: arch/x86/kvm/x86.c:4492:5: warning: symbol 'kvm_emulate_wbinvd_noskip' was not declared. Should it be static? Signed-off-by: Geliang Tang --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/

Re: [PATCH] KVM: x86: fix bogus warning about reserved bits

2015-09-27 Thread Xiao Guangrong
On 09/25/2015 03:49 PM, Paolo Bonzini wrote: On 24/09/2015 12:12, Borislav Petkov wrote: On Thu, Sep 24, 2015 at 11:23:08AM +0800, Xiao Guangrong wrote: +static inline bool +boot_cpu_is_amd(void) +{ + WARN_ON_ONCE(!tdp_enabled); + return shadow_x_mask != 0; shadow_x_mask != 0

[kvm:vtd-pi 23/38] virt/built-in.o: warning: input is not relaxable

2015-09-27 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git vtd-pi head: 7690a83389ca993040950b6ed7b4b5efbd50a782 commit: 3d28100d4df3d7d70072d0d90195d75e9c4b0c48 [23/38] virt: Add virt directory to the top Makefile config: avr32-atngw100_defconfig (attached as .config) reproduce: wget https://gi

[PATCH 3/3] kvm-all: notice KVM of vcpu's TSC rate after migration

2015-09-27 Thread Haozhong Zhang
When a vcpu is created in KVM, its TSC rate is initially identical to the host TSC rate. If its state is migrated to a vcpu on another machine (target machine) which may uses a different host TSC rate, QEMU on the target machine should notice KVM of the migrated vcpu's TSC rate. In case that KVM on

[PATCH 1/3] target-i386: add a subsection of vcpu's TSC rate in vmstate_x86_cpu

2015-09-27 Thread Haozhong Zhang
The newly added subsection 'vmstate_tsc_khz' in this patch results in vcpu's TSC rate being saved on the source machine and loaded on the target machine during the migration. Signed-off-by: Haozhong Zhang --- target-i386/machine.c | 20 1 file changed, 20 insertions(+) diff

[PATCH 2/3] target-i386: initialize vcpu's TSC rate to the value from KVM

2015-09-27 Thread Haozhong Zhang
When creating a vcpu, we initialize its TSC rate to the value from KVM (through ioctl KVM_GET_TSC_KHZ). Signed-off-by: Haozhong Zhang --- target-i386/kvm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 7b0ba17..c2b161a 100644 --- a/target-

[PATCH 11/12] KVM: VMX: Use a scaled host TSC for guest readings of MSR_IA32_TSC

2015-09-27 Thread Haozhong Zhang
This patch makes kvm-intel to return a scaled host TSC plus the TSC offset when handling guest readings to MSR_IA32_TSC. Signed-off-by: Haozhong Zhang --- arch/x86/kvm/vmx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

[PATCH 12/12] KVM: VMX: Dump TSC multiplier in dump_vmcs()

2015-09-27 Thread Haozhong Zhang
This patch enhances dump_vmcs() to dump the value of TSC multiplier field in VMCS. Signed-off-by: Haozhong Zhang --- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d0a2928..b19cdbe 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch

[PATCH 07/12] KVM: x86: Move TSC scaling logic out of call-back read_l1_tsc()

2015-09-27 Thread Haozhong Zhang
Both VMX and SVM scales the host TSC in the same way in call-back read_l1_tsc(), so this patch moves the scaling logic from call-back read_l1_tsc() to a common function kvm_read_l1_tsc(). Signed-off-by: Haozhong Zhang --- arch/x86/kvm/lapic.c | 5 ++--- arch/x86/kvm/svm.c | 3 +-- ar

[PATCH 10/12] KVM: VMX: Setup TSC scaling ratio when a vcpu is loaded

2015-09-27 Thread Haozhong Zhang
This patch makes kvm-intel module to load TSC scaling ratio into TSC multiplier field of VMCS when a vcpu is loaded, so that TSC scaling ratio can take effect if VMX TSC scaling is enabled. Signed-off-by: Haozhong Zhang --- arch/x86/kvm/vmx.c | 6 ++ 1 file changed, 6 insertions(+) diff --g

[PATCH 09/12] KVM: VMX: Enable and initialize VMX TSC scaling

2015-09-27 Thread Haozhong Zhang
This patch exhances kvm-intel module to enable VMX TSC scaling and collects information of TSC scaling ratio during initialization. Signed-off-by: Haozhong Zhang --- arch/x86/include/asm/vmx.h | 4 +++- arch/x86/kvm/vmx.c | 20 +++- 2 files changed, 22 insertions(+), 2 d

[PATCH 05/12] KVM: x86: Replace call-back compute_tsc_offset() with a common function

2015-09-27 Thread Haozhong Zhang
Both VMX and SVM calculate the tsc-offset in the same way, so this patch removes the call-back compute_tsc_offset() and replaces it with a common function kvm_compute_tsc_offset(). Signed-off-by: Haozhong Zhang --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/svm.c | 10

[PATCH 03/12] KVM: x86: Add a common TSC scaling function

2015-09-27 Thread Haozhong Zhang
VMX and SVM calculate the TSC scaling ratio in a similar logic, so this patch generalizes it to a common TSC scaling function. Signed-off-by: Haozhong Zhang --- arch/x86/kvm/svm.c | 48 +++-- arch/x86/kvm/x86.c | 70

[PATCH 04/12] KVM: x86: Replace call-back set_tsc_khz() with a common function

2015-09-27 Thread Haozhong Zhang
Both VMX and SVM propagate virtual_tsc_khz in the same way, so this patch removes the call-back set_tsc_khz() and replaces it with a common function. Signed-off-by: Haozhong Zhang --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/svm.c | 36 ---

[PATCH 0/3] target-i386: save/restore vcpu's TSC rate during migration

2015-09-27 Thread Haozhong Zhang
This patchset enables QEMU to save/restore vcpu's TSC rate during the migration. When cooperating with KVM which supports TSC scaling, guest programs can observe a consistent guest TSC rate even though they are migrated among machines with different host TSC rates. Haozhong Zhang (3): target-i38

[PATCH 08/12] KVM: x86: Use the correct vcpu's TSC rate to compute time scale

2015-09-27 Thread Haozhong Zhang
This patch makes KVM use virtual_tsc_khz rather than the host TSC rate as vcpu's TSC rate to compute the time scale if TSC scaling is enabled. Signed-off-by: Haozhong Zhang --- arch/x86/kvm/x86.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/

[PATCH 06/12] KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset()

2015-09-27 Thread Haozhong Zhang
For both VMX and SVM, if the 2nd argument of call-back adjust_tsc_offset() is the host TSC, then adjust_tsc_offset() will scale it first. This patch moves this common TSC scaling logic to its caller adjust_tsc_offset_host(). Signed-off-by: Haozhong Zhang --- arch/x86/include/asm/kvm_host.h | 13

[PATCH 01/12] KVM: x86: Collect information for setting TSC scaling ratio

2015-09-27 Thread Haozhong Zhang
The number of bits of the fractional part of the 64-bit TSC scaling ratio in VMX and SVM is different. This patch makes the architecture code to collect the number of fractional bits and other related information into variables that can be accessed in the common code. Signed-off-by: Haozhong Zhang

[PATCH 02/12] KVM: x86: Add a common TSC scaling ratio field in kvm_vcpu_arch

2015-09-27 Thread Haozhong Zhang
This patch moves the field of TSC scaling ratio from the architecture struct vcpu_svm to the common struct kvm_vcpu_arch. Signed-off-by: Haozhong Zhang --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 23 +-- arch/x86/kvm/x86.c | 3 +

[PATCH 00/12] KVM: x86: add support for VMX TSC scaling

2015-09-27 Thread Haozhong Zhang
This patchset adds support for VMX TSC scaling feature which is available on Intel Skylake CPU. The specification of VMX TSC scaling can be found at http://www.intel.com/content/www/us/en/processors/timestamp-counter-scaling-virtualization-white-paper.html VMX TSC scaling allows guest TSC which is

Re: [PATCH v3 4/4] scsi: provide UAPI version of scsi/sg.h and scsi/scsi_ioctl.h

2015-09-27 Thread kbuild test robot
Hi Paolo, [auto build test results on v4.3-rc2 -- if it's inappropriate base, please ignore] config: i386-randconfig-a0-201538 (attached as .config) reproduce: git checkout d88f2083643f6dfacba14b2e95217dc6e0a4be37 # save the attached .config to linux build tree make ARCH=i386 All warning

Re: [PATCH v3 2/4] scsi: cleanup scsi/scsi_ioctl.h

2015-09-27 Thread Douglas Gilbert
On 15-09-25 11:27 AM, Paolo Bonzini wrote: SCSI_REMOVAL_* goes together with other SCSI command constants in include/scsi/scsi.h. It is also used outside the implementation of the ioctls (and it is not part of the user API). scsi_fctargaddress/Scsi_FCTargAddress has had no in-tree use since com

Re: [PATCH v3 1/4] scsi: remove old-style type names from sg.h

2015-09-27 Thread Douglas Gilbert
On 15-09-25 11:27 AM, Paolo Bonzini wrote: These will not be exported by the new linux/sg.h header, and scsi/sg.h will not have any user API after linux/sg.h is created. Since they have no user in the kernel, they can be zapped. Cc: James Bottomley Cc: Christoph Hellwig Cc: linux-s...@vger.ke

Re: [PATCH v3 4/4] scsi: provide UAPI version of scsi/sg.h and scsi/scsi_ioctl.h

2015-09-27 Thread Douglas Gilbert
On 15-09-25 11:27 AM, Paolo Bonzini wrote: Provide a UAPI version of the header in the kernel, making it easier for interested projects to use an up-to-date version of the header. The new headers are placed under uapi/linux/ so as not to conflict with the glibc-provided headers in /usr/include/s

Re: [PATCH v3 3/4] scsi: move all obsolete ioctls to scsi_ioctl.h

2015-09-27 Thread Douglas Gilbert
On 15-09-25 11:27 AM, Paolo Bonzini wrote: Some are in scsi.h. Keep them together in preparation for exposing them in UAPI headers. Cc: James Bottomley Cc: Christoph Hellwig Cc: linux-s...@vger.kernel.org Reviewed-by: Bart Van Assche Signed-off-by: Paolo Bonzini Acked-by: Douglas Gilbert