Files
android_kernel_xiaomi_sm8450/include/linux
Sean Christopherson 736c291c9f KVM: x86: Use gpa_t for cr2/gpa to fix TDP support on 32-bit KVM
Convert a plethora of parameters and variables in the MMU and page fault
flows from type gva_t to gpa_t to properly handle TDP on 32-bit KVM.

Thanks to PSE and PAE paging, 32-bit kernels can access 64-bit physical
addresses.  When TDP is enabled, the fault address is a guest physical
address and thus can be a 64-bit value, even when both KVM and its guest
are using 32-bit virtual addressing, e.g. VMX's VMCS.GUEST_PHYSICAL is a
64-bit field, not a natural width field.

Using a gva_t for the fault address means KVM will incorrectly drop the
upper 32-bits of the GPA.  Ditto for gva_to_gpa() when it is used to
translate L2 GPAs to L1 GPAs.

Opportunistically rename variables and parameters to better reflect the
dual address modes, e.g. use "cr2_or_gpa" for fault addresses and plain
"addr" instead of "vaddr" when the address may be either a GVA or an L2
GPA.  Similarly, use "gpa" in the nonpaging_page_fault() flows to avoid
a confusing "gpa_t gva" declaration; this also sets the stage for a
future patch to combing nonpaging_page_fault() and tdp_page_fault() with
minimal churn.

Sprinkle in a few comments to document flows where an address is known
to be a GVA and thus can be safely truncated to a 32-bit value.  Add
WARNs in kvm_handle_page_fault() and FNAME(gva_to_gpa_nested)() to help
document such cases and detect bugs.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-01-08 18:16:02 +01:00
..
2019-08-09 09:15:05 +02:00
2019-09-16 09:56:27 -07:00
2019-11-12 11:43:29 -05:00
2019-10-31 16:54:00 +05:30
2019-08-20 22:09:52 +02:00
2019-11-15 23:44:48 +01:00
2019-12-03 07:36:38 -07:00
2019-11-26 10:26:26 +01:00
2019-10-09 19:33:43 -07:00
2019-12-03 11:20:37 +01:00
2019-12-08 12:42:19 +01:00
2019-09-05 19:52:33 -06:00
2019-12-09 10:36:44 -08:00
2019-11-20 09:40:10 +01:00
2019-12-01 12:59:06 -08:00
2019-09-05 11:40:54 +02:00
2019-10-02 06:36:50 -07:00
2019-07-05 21:34:50 +02:00
2019-06-26 13:19:46 -07:00
2019-10-04 12:31:46 -07:00
2019-10-15 13:34:25 +02:00
2019-11-11 09:02:56 +01:00
2019-12-04 19:44:14 -08:00
2019-09-02 11:43:54 +01:00
2019-12-25 17:08:33 -07:00
2019-10-15 20:40:06 -07:00
2019-09-05 12:32:05 +02:00
2019-08-14 15:30:35 +02:00
2019-08-08 09:09:25 +02:00
2019-11-15 13:49:04 -05:00
2019-11-14 19:06:47 -08:00
2019-07-08 19:25:19 -07:00
2019-11-06 08:55:23 -05:00
2019-10-09 12:06:19 -04:00
2019-11-06 08:55:23 -05:00
2019-07-26 17:01:29 -06:00
2019-11-13 19:09:47 +08:00
2019-07-16 19:23:25 -07:00
2019-12-06 10:47:28 +01:00
2019-08-23 16:39:26 +01:00
2019-10-19 22:55:46 +02:00
2019-11-14 13:07:48 +08:00
2019-12-04 19:44:14 -08:00
2019-10-10 14:55:24 -07:00
2019-12-01 06:29:17 -08:00
2019-11-13 12:15:34 -08:00
2020-01-02 16:15:33 -08:00
2019-11-13 00:33:21 +11:00
2019-11-07 07:00:26 +01:00
2019-08-30 07:27:17 -07:00
2019-08-01 20:51:22 +02:00
2019-08-20 17:05:05 +02:00
2019-07-31 19:03:35 +02:00
2019-11-14 12:20:02 +08:00
2019-10-14 15:04:01 -07:00