<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/x86/kvm, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-06-20T19:01:45+00:00</updated>
<entry>
<title>KVM: X86: Lower the default timer frequency limit to 200us</title>
<updated>2018-06-20T19:01:45+00:00</updated>
<author>
<name>Wanpeng Li</name>
<email>wanpengli@tencent.com</email>
</author>
<published>2018-05-05T11:02:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f882b432dd4da459473002dede4632ce24a28999'/>
<id>urn:sha1:f882b432dd4da459473002dede4632ce24a28999</id>
<content type='text'>
[ Upstream commit 4c27625b7a67eb9006963ed2bcf8e53b259b43af ]

Anthoine reported:
 The period used by Windows change over time but it can be 1
 milliseconds or less. I saw the limit_periodic_timer_frequency
 print so 500 microseconds is sometimes reached.

As suggested by Paolo, lower the default timer frequency limit to a
smaller interval of 200 us (5000 Hz) to leave some headroom. This
is required due to Windows 10 changing the scheduler tick limit
from 1024 Hz to 2048 Hz.

Reported-by: Anthoine Bourgeois &lt;anthoine.bourgeois@blade-group.com&gt;
Suggested-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Darren Kenny &lt;darren.kenny@oracle.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Radim Krčmář &lt;rkrcmar@redhat.com&gt;
Cc: Anthoine Bourgeois &lt;anthoine.bourgeois@blade-group.com&gt;
Cc: Darren Kenny &lt;darren.kenny@oracle.com&gt;
Cc: Jan Kiszka &lt;jan.kiszka@web.de&gt;
Signed-off-by: Wanpeng Li &lt;wanpengli@tencent.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>x86: Delay skip of emulated hypercall instruction</title>
<updated>2018-06-20T19:01:41+00:00</updated>
<author>
<name>Marian Rotariu</name>
<email>mrotariu@bitdefender.com</email>
</author>
<published>2018-04-30T09:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9332f10ed8ff01b20bfb25af59ebde534c9edf4d'/>
<id>urn:sha1:9332f10ed8ff01b20bfb25af59ebde534c9edf4d</id>
<content type='text'>
[ Upstream commit 6356ee0c9602004e0a3b4b2dad68ee2ee9385b17 ]

The IP increment should be done after the hypercall emulation, after
calling the various handlers. In this way, these handlers can accurately
identify the the IP of the VMCALL if they need it.

This patch keeps the same functionality for the Hyper-V handler which does
not use the return code of the standard kvm_skip_emulated_instruction()
call.

Signed-off-by: Marian Rotariu &lt;mrotariu@bitdefender.com&gt;
[Hyper-V hypercalls also need kvm_skip_emulated_instruction() - Paolo]
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kvm: apic: Flush TLB after APIC mode/address change if VPIDs are in use</title>
<updated>2018-06-20T19:01:29+00:00</updated>
<author>
<name>Junaid Shahid</name>
<email>junaids@google.com</email>
</author>
<published>2018-04-26T20:09:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf70b9d07d0f75e95ea89daeb2e1b5e43cc9f13b'/>
<id>urn:sha1:cf70b9d07d0f75e95ea89daeb2e1b5e43cc9f13b</id>
<content type='text'>
[ Upstream commit a468f2dbf921d02f5107378501693137a812999b ]

Currently, KVM flushes the TLB after a change to the APIC access page
address or the APIC mode when EPT mode is enabled. However, even in
shadow paging mode, a TLB flush is needed if VPIDs are being used, as
specified in the Intel SDM Section 29.4.5.

So replace vmx_flush_tlb_ept_only() with vmx_flush_tlb(), which will
flush if either EPT or VPIDs are in use.

Signed-off-by: Junaid Shahid &lt;junaids@google.com&gt;
Reviewed-by: Jim Mattson &lt;jmattson@google.com&gt;
Signed-off-by: Radim Krčmář &lt;rkrcmar@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kvm: x86: move MSR_IA32_TSC handling to x86.c</title>
<updated>2018-06-20T19:01:16+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2018-04-13T09:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=20cddb963158fbc43c8f06b47653964105a6f8ba'/>
<id>urn:sha1:20cddb963158fbc43c8f06b47653964105a6f8ba</id>
<content type='text'>
[ Upstream commit dd259935e4eec844dc3e5b8a7cd951cd658b4fb6 ]

This is not specific to Intel/AMD anymore.  The TSC offset is available
in vcpu-&gt;arch.tsc_offset.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>X86/KVM: Properly update 'tsc_offset' to represent the running guest</title>
<updated>2018-06-20T19:01:16+00:00</updated>
<author>
<name>KarimAllah Ahmed</name>
<email>karahmed@amazon.de</email>
</author>
<published>2018-04-14T03:10:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5abeefab1aa453aeaccb231d56bca45b777d1c60'/>
<id>urn:sha1:5abeefab1aa453aeaccb231d56bca45b777d1c60</id>
<content type='text'>
[ Upstream commit e79f245ddec17bbd89d73cd0169dba4be46c9b55 ]

Update 'tsc_offset' on vmentry/vmexit of L2 guests to ensure that it always
captures the TSC_OFFSET of the running guest whether it is the L1 or L2
guest.

Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Radim Krčmář &lt;rkrcmar@redhat.com&gt;
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Jim Mattson &lt;jmattson@google.com&gt;
Suggested-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: KarimAllah Ahmed &lt;karahmed@amazon.de&gt;
[AMD changes, fix update_ia32_tsc_adjust_msr. - Paolo]
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>x86: Add check for APIC access address for vmentry of L2 guests</title>
<updated>2018-06-20T19:01:14+00:00</updated>
<author>
<name>Krish Sadhukhan</name>
<email>krish.sadhukhan@oracle.com</email>
</author>
<published>2018-04-11T05:10:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=840b23eb8a5bb737077c7d4c54cd69a6444b7aa1'/>
<id>urn:sha1:840b23eb8a5bb737077c7d4c54cd69a6444b7aa1</id>
<content type='text'>
[ Upstream commit f0f4cf5b306620282db0c59ff963012e1973e025 ]

According to the sub-section titled 'VM-Execution Control Fields' in the
section titled 'Basic VM-Entry Checks' in Intel SDM vol. 3C, the following
vmentry check must be enforced:

    If the 'virtualize APIC-accesses' VM-execution control is 1, the
    APIC-access address must satisfy the following checks:

	- Bits 11:0 of the address must be 0.
	- The address should not set any bits beyond the processor's
	  physical-address width.

This patch adds the necessary check to conform to this rule. If the check
fails, we cause the L2 VMENTRY to fail which is what the associated unit
test (following patch) expects.

Reviewed-by: Mihai Carabas &lt;mihai.carabas@oracle.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Jim Mattson &lt;jmattson@google.com&gt;
Reviewed-by: Wanpeng Li &lt;wanpengli@tencent.com&gt;
Signed-off-by: Krish Sadhukhan &lt;krish.sadhukhan@oracle.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>KVM: X86: fix incorrect reference of trace_kvm_pi_irte_update</title>
<updated>2018-06-20T19:01:14+00:00</updated>
<author>
<name>hu huajun</name>
<email>huhuajun@linux.alibaba.com</email>
</author>
<published>2018-04-11T07:16:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f970fe650fa05eac1ef9f6e9238a66cf57b04f86'/>
<id>urn:sha1:f970fe650fa05eac1ef9f6e9238a66cf57b04f86</id>
<content type='text'>
[ Upstream commit 2698d82e519413c6ad287e6f14b29e0373ed37f8 ]

In arch/x86/kvm/trace.h, this function is declared as host_irq the
first input, and vcpu_id the second, instead of otherwise.

Signed-off-by: hu huajun &lt;huhuajun@linux.alibaba.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access</title>
<updated>2018-06-16T07:43:44+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2018-06-06T15:38:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e4717b5bfaebac92f892e50270f001f66f9cb4f'/>
<id>urn:sha1:3e4717b5bfaebac92f892e50270f001f66f9cb4f</id>
<content type='text'>
commit 3c9fa24ca7c9c47605672916491f79e8ccacb9e6 upstream.

The functions that were used in the emulation of fxrstor, fxsave, sgdt and
sidt were originally meant for task switching, and as such they did not
check privilege levels.  This is very bad when the same functions are used
in the emulation of unprivileged instructions.  This is CVE-2018-10853.

The obvious fix is to add a new argument to ops-&gt;read_std and ops-&gt;write_std,
which decides whether the access is a "system" access or should use the
processor's CPL.

Fixes: 129a72a0d3c8 ("KVM: x86: Introduce segmented_write_std", 2017-01-12)
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system</title>
<updated>2018-06-16T07:43:42+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2018-06-06T15:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2ec2e04aa191612945c611697d456c4a2f4c8147'/>
<id>urn:sha1:2ec2e04aa191612945c611697d456c4a2f4c8147</id>
<content type='text'>
commit ce14e868a54edeb2e30cb7a7b104a2fc4b9d76ca upstream.

Int the next patch the emulator's .read_std and .write_std callbacks will
grow another argument, which is not needed in kvm_read_guest_virt and
kvm_write_guest_virt_system's callers.  Since we have to make separate
functions, let's give the currently existing names a nicer interface, too.

Fixes: 129a72a0d3c8 ("KVM: x86: Introduce segmented_write_std", 2017-01-12)
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>kvm: nVMX: Enforce cpl=0 for VMX instructions</title>
<updated>2018-06-16T07:43:41+00:00</updated>
<author>
<name>Felix Wilhelm</name>
<email>fwilhelm@google.com</email>
</author>
<published>2018-06-11T07:43:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b775e0be2c1006a540cdf4982dc588d641e09b2e'/>
<id>urn:sha1:b775e0be2c1006a540cdf4982dc588d641e09b2e</id>
<content type='text'>
commit 727ba748e110b4de50d142edca9d6a9b7e6111d8 upstream.

VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.

Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Wilhelm &lt;fwilhelm@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
