Message ID | 20210622175739.3610207-1-seanjc@google.com (mailing list archive) |
---|---|
Headers | show |
Series | KVM: x86/mmu: Bug fixes and summer cleaning | expand |
On 22/06/21 19:56, Sean Christopherson wrote: > Patch 01 is the only patch that is remotely 5.13 worthy, and even then > only because it's about as safe as a patch can be. Everything else is far > from urgent as these bugs have existed for quite some time. Maybe patch 54 (not sarcastic), but I agree it's not at all necessary. This is good stuff, I made a few comments but almost all of them (all except the last comment on patch 9, "Unconditionally zap unsync SPs") are cosmetic and I can resolve them myself. I'd like your input on renaming is_{cr0,cr4,efer}_* to is_mmu_* (and possibly reduce the four underscores to two...). If I get remarks by tomorrow, I'll get this into 5.14, otherwise consider everything but the first eight patches queued only for 5.15. > I labeled the "sections" of this mess in the shortlog below. > > P.S. Does anyone know how PKRU interacts with NPT? I assume/hope NPT > accesses, which are always "user", ignore PKRU, but the APM doesn't > say a thing. If PKRU is ignored, KVM has some fixing to do. If PKRU > isn't ignored, AMD has some fixing to do:-) > > P.S.S. This series pulled in one patch from my vCPU RESET/INIT series, > "Properly reset MMU context at vCPU RESET/INIT", as that was needed > to fix a root_level bug on VMX. My goal is to get the RESET/INIT > series refreshed later this week and thoroughly bombard everyone. Note that it won't get into 5.14 anyway, since I plan to send my first pull request to Linus as soon as Friday. Paolo
On Wed, Jun 23, 2021, Paolo Bonzini wrote: > On 22/06/21 19:56, Sean Christopherson wrote: > > Patch 01 is the only patch that is remotely 5.13 worthy, and even then > > only because it's about as safe as a patch can be. Everything else is far > > from urgent as these bugs have existed for quite some time. > > Maybe patch 54 (not sarcastic), but I agree it's not at all necessary. > > This is good stuff, I made a few comments but almost all of them (all except > the last comment on patch 9, "Unconditionally zap unsync SPs") are cosmetic > and I can resolve them myself. The 0-day bot also reported some warnings. vcpu_to_role_regs() needs to be static, the helpers are added without a user. I liked the idea of adding the helpers in one patch, but I can't really defend adding them without a user. :-/ arch/x86/kvm/mmu/mmu.c:209:26: warning: no previous prototype for function 'vcpu_to_role_regs' [-Wmissing-prototypes] struct kvm_mmu_role_regs vcpu_to_role_regs(struct kvm_vcpu *vcpu) ^ arch/x86/kvm/mmu/mmu.c:209:1: note: declare 'static' if the function is not intended to be used outside of this translation unit struct kvm_mmu_role_regs vcpu_to_role_regs(struct kvm_vcpu *vcpu) ^ static arch/x86/kvm/mmu/mmu.c:199:1: warning: unused function '____is_cr0_wp' [-Wunused-function] BUILD_MMU_ROLE_REGS_ACCESSOR(cr0, wp, X86_CR0_WP); > > I'd like your input on renaming is_{cr0,cr4,efer}_* to is_mmu_* (and > possibly reduce the four underscores to two...). > > If I get remarks by tomorrow, I'll get this into 5.14, otherwise consider > everything but the first eight patches queued only for 5.15. > > > I labeled the "sections" of this mess in the shortlog below. > > > > P.S. Does anyone know how PKRU interacts with NPT? I assume/hope NPT > > accesses, which are always "user", ignore PKRU, but the APM doesn't > > say a thing. If PKRU is ignored, KVM has some fixing to do. If PKRU > > isn't ignored, AMD has some fixing to do:-) > > > > P.S.S. This series pulled in one patch from my vCPU RESET/INIT series, > > "Properly reset MMU context at vCPU RESET/INIT", as that was needed > > to fix a root_level bug on VMX. My goal is to get the RESET/INIT > > series refreshed later this week and thoroughly bombard everyone. > > Note that it won't get into 5.14 anyway, since I plan to send my first pull > request to Linus as soon as Friday. Good to know. I'll still try to get it out tomorrow as I'll be on vacation for a few weeks starting Friday, and I'm afraid I'll completely forget what's in the series :-)
On 23/06/21 23:06, Sean Christopherson wrote: >> >> This is good stuff, I made a few comments but almost all of them (all except >> the last comment on patch 9, "Unconditionally zap unsync SPs") are cosmetic >> and I can resolve them myself. > The 0-day bot also reported some warnings. vcpu_to_role_regs() needs to be > static, the helpers are added without a user. I liked the idea of adding the > helpers in one patch, but I can't really defend adding them without a user. :-/ Yep, I noticed them too. We can just mark them static inline, which is a good idea anyway and enough to shut up the compiler (clang might behave different in this respect for .h and .c files, but again it's just a warning and not a bisection breakage). Paolo > arch/x86/kvm/mmu/mmu.c:209:26: warning: no previous prototype for function 'vcpu_to_role_regs' [-Wmissing-prototypes] > struct kvm_mmu_role_regs vcpu_to_role_regs(struct kvm_vcpu *vcpu) > ^ > arch/x86/kvm/mmu/mmu.c:209:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > struct kvm_mmu_role_regs vcpu_to_role_regs(struct kvm_vcpu *vcpu) > ^ > static > arch/x86/kvm/mmu/mmu.c:199:1: warning: unused function '____is_cr0_wp' [-Wunused-function] > BUILD_MMU_ROLE_REGS_ACCESSOR(cr0, wp, X86_CR0_WP); >
On Wed, Jun 23, 2021, Paolo Bonzini wrote: > On 23/06/21 23:06, Sean Christopherson wrote: > > > > > > This is good stuff, I made a few comments but almost all of them (all except > > > the last comment on patch 9, "Unconditionally zap unsync SPs") are cosmetic > > > and I can resolve them myself. > > The 0-day bot also reported some warnings. vcpu_to_role_regs() needs to be > > static, the helpers are added without a user. I liked the idea of adding the > > helpers in one patch, but I can't really defend adding them without a user. :-/ > > Yep, I noticed them too. > > We can just mark them static inline, which is a good idea anyway and enough But they already are static inline :-( > to shut up the compiler (clang might behave different in this respect for .h > and .c files, but again it's just a warning and not a bisection breakage). I was worried about the CONFIG_KVM_WERROR=y case.
On 24/06/21 00:08, Sean Christopherson wrote: >> We can just mark them static inline, which is a good idea anyway and enough > But they already are static inline:-( Yep, I noticed later. :/ Probably the clang difference below? >> to shut up the compiler (clang might behave different in this respect for .h >> and .c files, but again it's just a warning and not a bisection breakage). > > I was worried about the CONFIG_KVM_WERROR=y case. CONFIG_KVM_WERROR can always be disabled. "Unused" warnings do sometimes happen in the middle of large series. Paolo