Commit e300614
committed
KVM: cleanup and add shortcuts to kvm_range_has_memory_attributes()
Use a guard to simplify early returns, and add two more easy
shortcuts. If the requested attributes are invalid, the attributes
xarray will never show them as set. And if testing a single page,
kvm_get_memory_attributes() is more efficient.
Reviewed-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent de80252 commit e300614
1 file changed
+20
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2398 | 2398 | | |
2399 | 2399 | | |
2400 | 2400 | | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
2401 | 2409 | | |
2402 | 2410 | | |
2403 | 2411 | | |
| |||
2406 | 2414 | | |
2407 | 2415 | | |
2408 | 2416 | | |
| 2417 | + | |
2409 | 2418 | | |
2410 | | - | |
2411 | 2419 | | |
2412 | 2420 | | |
2413 | | - | |
| 2421 | + | |
| 2422 | + | |
2414 | 2423 | | |
2415 | | - | |
2416 | | - | |
2417 | | - | |
2418 | | - | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2419 | 2430 | | |
2420 | | - | |
2421 | 2431 | | |
2422 | 2432 | | |
2423 | 2433 | | |
2424 | 2434 | | |
2425 | 2435 | | |
2426 | | - | |
2427 | | - | |
2428 | | - | |
2429 | | - | |
| 2436 | + | |
| 2437 | + | |
2430 | 2438 | | |
2431 | 2439 | | |
2432 | | - | |
2433 | | - | |
2434 | | - | |
2435 | | - | |
2436 | | - | |
2437 | | - | |
2438 | | - | |
2439 | | - | |
2440 | | - | |
2441 | | - | |
2442 | | - | |
| 2440 | + | |
2443 | 2441 | | |
2444 | 2442 | | |
2445 | 2443 | | |
| |||
0 commit comments