Commit 6abe9c1
KVM: X86: Move ignore_msrs handling upper the stack
MSR accesses can be one of:
(1) KVM internal access,
(2) userspace access (e.g., via KVM_SET_MSRS ioctl),
(3) guest access.
The ignore_msrs was previously handled by kvm_get_msr_common() and
kvm_set_msr_common(), which is the bottom of the msr access stack. It's
working in most cases, however it could dump unwanted warning messages to dmesg
even if kvm get/set the msrs internally when calling __kvm_set_msr() or
__kvm_get_msr() (e.g. kvm_cpuid()). Ideally we only want to trap cases (2)
or (3), but not (1) above.
To achieve this, move the ignore_msrs handling upper until the callers of
__kvm_get_msr() and __kvm_set_msr(). To identify the "msr missing" event, a
new return value (KVM_MSR_RET_INVALID==2) is used for that.
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>1 parent 02f5fb2 commit 6abe9c1
2 files changed
+56
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
246 | 269 | | |
247 | 270 | | |
248 | 271 | | |
| |||
1516 | 1539 | | |
1517 | 1540 | | |
1518 | 1541 | | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1519 | 1553 | | |
1520 | 1554 | | |
1521 | 1555 | | |
| |||
1537 | 1571 | | |
1538 | 1572 | | |
1539 | 1573 | | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1540 | 1588 | | |
1541 | 1589 | | |
1542 | | - | |
| 1590 | + | |
1543 | 1591 | | |
1544 | 1592 | | |
1545 | 1593 | | |
1546 | 1594 | | |
1547 | 1595 | | |
1548 | | - | |
| 1596 | + | |
1549 | 1597 | | |
1550 | 1598 | | |
1551 | 1599 | | |
| |||
1665 | 1713 | | |
1666 | 1714 | | |
1667 | 1715 | | |
1668 | | - | |
| 1716 | + | |
1669 | 1717 | | |
1670 | 1718 | | |
1671 | 1719 | | |
1672 | 1720 | | |
1673 | | - | |
| 1721 | + | |
1674 | 1722 | | |
1675 | 1723 | | |
1676 | 1724 | | |
| |||
3066 | 3114 | | |
3067 | 3115 | | |
3068 | 3116 | | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
3079 | | - | |
| 3117 | + | |
3080 | 3118 | | |
3081 | 3119 | | |
3082 | 3120 | | |
| |||
3331 | 3369 | | |
3332 | 3370 | | |
3333 | 3371 | | |
3334 | | - | |
3335 | | - | |
3336 | | - | |
3337 | | - | |
3338 | | - | |
3339 | | - | |
3340 | | - | |
3341 | | - | |
3342 | | - | |
3343 | | - | |
3344 | | - | |
| 3372 | + | |
3345 | 3373 | | |
3346 | 3374 | | |
3347 | 3375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
369 | 371 | | |
0 commit comments