Commit eaa46a2
Marc Zyngier
Merge branch kvm-arm64/mpidr-reset into kvmarm-master/next
* kvm-arm64/mpidr-reset:
: .
: Fixes for CLIDR_EL1 and MPIDR_EL1 being accidentally mutable across
: a vcpu reset, courtesy of Oliver. From the cover letter:
:
: "For VM-wide feature ID registers we ensure they get initialized once for
: the lifetime of a VM. On the other hand, vCPU-local feature ID registers
: get re-initialized on every vCPU reset, potentially clobbering the
: values userspace set up.
:
: MPIDR_EL1 and CLIDR_EL1 are the only registers in this space that we
: allow userspace to modify for now. Clobbering the value of MPIDR_EL1 has
: some disastrous side effects as the compressed index used by the
: MPIDR-to-vCPU lookup table assumes MPIDR_EL1 is immutable after KVM_RUN.
:
: Series + reproducer test case to address the problem of KVM wiping out
: userspace changes to these registers. Note that there are still some
: differences between VM and vCPU scoped feature ID registers from the
: perspective of userspace. We do not allow the value of VM-scope
: registers to change after KVM_RUN, but vCPU registers remain mutable."
: .
KVM: selftests: arm64: Test vCPU-scoped feature ID registers
KVM: selftests: arm64: Test that feature ID regs survive a reset
KVM: selftests: arm64: Store expected register value in set_id_regs
KVM: selftests: arm64: Rename helper in set_id_regs to imply VM scope
KVM: arm64: Only reset vCPU-scoped feature ID regs once
KVM: arm64: Reset VM feature ID regs from kvm_reset_sys_regs()
KVM: arm64: Rename is_id_reg() to imply VM scope
Signed-off-by: Marc Zyngier <maz@kernel.org>4 files changed
Lines changed: 142 additions & 50 deletions
File tree
- arch/arm64
- include/asm
- kvm
- tools/testing/selftests/kvm/aarch64
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1318 | 1318 | | |
1319 | 1319 | | |
1320 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
1321 | 1323 | | |
1322 | 1324 | | |
1323 | 1325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | 701 | | |
707 | 702 | | |
708 | 703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1568 | 1568 | | |
1569 | 1569 | | |
1570 | 1570 | | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1571 | 1579 | | |
1572 | 1580 | | |
1573 | | - | |
| 1581 | + | |
| 1582 | + | |
1574 | 1583 | | |
1575 | | - | |
| 1584 | + | |
1576 | 1585 | | |
1577 | 1586 | | |
1578 | 1587 | | |
1579 | 1588 | | |
1580 | 1589 | | |
1581 | 1590 | | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1582 | 1596 | | |
1583 | 1597 | | |
1584 | 1598 | | |
| |||
3510 | 3524 | | |
3511 | 3525 | | |
3512 | 3526 | | |
3513 | | - | |
| 3527 | + | |
3514 | 3528 | | |
3515 | | - | |
3516 | | - | |
| 3529 | + | |
3517 | 3530 | | |
3518 | 3531 | | |
3519 | 3532 | | |
3520 | 3533 | | |
3521 | 3534 | | |
3522 | 3535 | | |
| 3536 | + | |
| 3537 | + | |
3523 | 3538 | | |
3524 | | - | |
3525 | | - | |
3526 | | - | |
3527 | | - | |
3528 | | - | |
3529 | | - | |
3530 | | - | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
3531 | 3544 | | |
3532 | | - | |
| 3545 | + | |
3533 | 3546 | | |
3534 | 3547 | | |
3535 | 3548 | | |
| |||
3541 | 3554 | | |
3542 | 3555 | | |
3543 | 3556 | | |
| 3557 | + | |
3544 | 3558 | | |
3545 | 3559 | | |
3546 | | - | |
3547 | | - | |
3548 | 3560 | | |
3549 | 3561 | | |
3550 | 3562 | | |
3551 | | - | |
| 3563 | + | |
3552 | 3564 | | |
3553 | 3565 | | |
3554 | | - | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
3555 | 3571 | | |
3556 | 3572 | | |
| 3573 | + | |
| 3574 | + | |
3557 | 3575 | | |
3558 | 3576 | | |
3559 | 3577 | | |
| |||
3979 | 3997 | | |
3980 | 3998 | | |
3981 | 3999 | | |
3982 | | - | |
3983 | | - | |
3984 | | - | |
3985 | | - | |
3986 | | - | |
3987 | | - | |
3988 | | - | |
3989 | | - | |
3990 | 4000 | | |
3991 | 4001 | | |
3992 | 4002 | | |
| |||
4015 | 4025 | | |
4016 | 4026 | | |
4017 | 4027 | | |
4018 | | - | |
| 4028 | + | |
4019 | 4029 | | |
4020 | 4030 | | |
4021 | 4031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
| 330 | + | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
349 | 351 | | |
350 | 352 | | |
351 | 353 | | |
| |||
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
377 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
378 | 388 | | |
379 | 389 | | |
380 | 390 | | |
| |||
398 | 408 | | |
399 | 409 | | |
400 | 410 | | |
401 | | - | |
402 | | - | |
403 | | - | |
| 411 | + | |
404 | 412 | | |
405 | 413 | | |
406 | 414 | | |
| |||
414 | 422 | | |
415 | 423 | | |
416 | 424 | | |
417 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
418 | 428 | | |
419 | 429 | | |
420 | 430 | | |
| |||
425 | 435 | | |
426 | 436 | | |
427 | 437 | | |
428 | | - | |
429 | 438 | | |
430 | 439 | | |
431 | 440 | | |
| |||
436 | 445 | | |
437 | 446 | | |
438 | 447 | | |
439 | | - | |
440 | | - | |
| 448 | + | |
| 449 | + | |
441 | 450 | | |
442 | 451 | | |
443 | 452 | | |
| |||
448 | 457 | | |
449 | 458 | | |
450 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
451 | 532 | | |
452 | 533 | | |
453 | 534 | | |
454 | 535 | | |
455 | 536 | | |
456 | 537 | | |
457 | | - | |
| 538 | + | |
458 | 539 | | |
459 | 540 | | |
460 | 541 | | |
| |||
467 | 548 | | |
468 | 549 | | |
469 | 550 | | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
476 | 557 | | |
477 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
478 | 562 | | |
479 | | - | |
480 | 563 | | |
481 | 564 | | |
| 565 | + | |
| 566 | + | |
482 | 567 | | |
483 | 568 | | |
484 | 569 | | |
| |||
0 commit comments