Commit f6adeae
KVM: x86/mmu: Handle no-slot faults at the beginning of kvm_faultin_pfn()
Handle the "no memslot" case at the beginning of kvm_faultin_pfn(), just
after the private versus shared check, so that there's no need to
repeatedly query whether or not a slot exists. This also makes it more
obvious that, except for private vs. shared attributes, the process of
faulting in a pfn simply doesn't apply to gfns without a slot.
Opportunistically stuff @fault's metadata in kvm_handle_noslot_fault() so
that it doesn't need to be duplicated in all paths that invoke
kvm_handle_noslot_fault(), and to minimize the probability of not stuffing
the right fields.
Leave the existing handle behind, but convert it to a WARN, to guard
against __kvm_faultin_pfn() unexpectedly nullifying fault->slot.
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Message-ID: <20240228024147.41573-14-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent cd272fc commit f6adeae
1 file changed
Lines changed: 17 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3269 | 3269 | | |
3270 | 3270 | | |
3271 | 3271 | | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
3272 | 3276 | | |
3273 | 3277 | | |
3274 | 3278 | | |
| |||
4349 | 4353 | | |
4350 | 4354 | | |
4351 | 4355 | | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
4352 | 4359 | | |
4353 | 4360 | | |
4354 | 4361 | | |
4355 | 4362 | | |
4356 | 4363 | | |
4357 | | - | |
| 4364 | + | |
4358 | 4365 | | |
4359 | 4366 | | |
4360 | | - | |
| 4367 | + | |
4361 | 4368 | | |
4362 | 4369 | | |
4363 | 4370 | | |
| |||
4369 | 4376 | | |
4370 | 4377 | | |
4371 | 4378 | | |
4372 | | - | |
4373 | | - | |
4374 | | - | |
4375 | | - | |
4376 | | - | |
4377 | | - | |
| 4379 | + | |
| 4380 | + | |
| 4381 | + | |
4378 | 4382 | | |
4379 | 4383 | | |
4380 | 4384 | | |
| |||
4385 | 4389 | | |
4386 | 4390 | | |
4387 | 4391 | | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
4388 | 4395 | | |
4389 | 4396 | | |
4390 | 4397 | | |
| |||
4406 | 4413 | | |
4407 | 4414 | | |
4408 | 4415 | | |
4409 | | - | |
4410 | | - | |
| 4416 | + | |
4411 | 4417 | | |
4412 | 4418 | | |
4413 | 4419 | | |
4414 | 4420 | | |
4415 | 4421 | | |
4416 | 4422 | | |
4417 | | - | |
4418 | 4423 | | |
4419 | 4424 | | |
4420 | 4425 | | |
4421 | | - | |
| 4426 | + | |
4422 | 4427 | | |
4423 | 4428 | | |
4424 | 4429 | | |
| |||
0 commit comments