Commit 3fd55b5
committed
KVM: x86: Pull CPUID capabilities from boot_cpu_data only as needed
Don't memcpy() all of boot_cpu_data.x86_capability, and instead explicitly
fill each kvm_cpu_cap_init leaf during kvm_cpu_cap_init(). While clever,
copying all kernel capabilities risks over-reporting KVM capabilities,
e.g. if KVM added support in __do_cpuid_func(), but neglected to init the
supported set of capabilities.
Note, explicitly grabbing leafs deliberately keeps Linux-defined leafs as
0! KVM should never advertise Linux-defined leafs; any relevant features
that are "real", but scattered, must be gathered in their correct hardware-
defined leaf.
Link: https://lore.kernel.org/r/20241128013424.4096668-54-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 75c489e commit 3fd55b5
1 file changed
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
682 | | - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
| 689 | + | |
688 | 690 | | |
689 | 691 | | |
690 | 692 | | |
691 | 693 | | |
| 694 | + | |
| 695 | + | |
692 | 696 | | |
693 | | - | |
694 | | - | |
695 | | - | |
| 697 | + | |
696 | 698 | | |
697 | 699 | | |
698 | 700 | | |
| |||
790 | 792 | | |
791 | 793 | | |
792 | 794 | | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | 795 | | |
797 | 796 | | |
798 | 797 | | |
| |||
0 commit comments