mbox series

[kvm,v6,0/2] shrink vcpu_vmx down to order 2

Message ID 20181031234928.144206-1-marcorr@google.com (mailing list archive)
Headers show
Series shrink vcpu_vmx down to order 2 | expand

Message

Marc Orr Oct. 31, 2018, 11:49 p.m. UTC
Compared to the last version, I've:
(1) dropped the vmalloc patches
(2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch
    struct to be sized according to fpu_kernel_xstate_size
(3) Added minimum FPU checks in KVM's x86 init logic to avoid memory
    corruption issues.

Marc Orr (2):
  kvm: x86: Use task structs fpu field for user
  kvm: x86: Dynamically allocate guest_fpu

 arch/x86/include/asm/kvm_host.h | 10 +++---
 arch/x86/kvm/svm.c              | 10 ++++++
 arch/x86/kvm/vmx.c              | 10 ++++++
 arch/x86/kvm/x86.c              | 55 ++++++++++++++++++++++++---------
 4 files changed, 65 insertions(+), 20 deletions(-)

Comments

Jim Mattson May 21, 2021, 8:58 p.m. UTC | #1
On Wed, Oct 31, 2018 at 4:49 PM Marc Orr <marcorr@google.com> wrote:
>
> Compared to the last version, I've:
> (1) dropped the vmalloc patches
> (2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch
>     struct to be sized according to fpu_kernel_xstate_size
> (3) Added minimum FPU checks in KVM's x86 init logic to avoid memory
>     corruption issues.
>
> Marc Orr (2):
>   kvm: x86: Use task structs fpu field for user
>   kvm: x86: Dynamically allocate guest_fpu
>
>  arch/x86/include/asm/kvm_host.h | 10 +++---
>  arch/x86/kvm/svm.c              | 10 ++++++
>  arch/x86/kvm/vmx.c              | 10 ++++++
>  arch/x86/kvm/x86.c              | 55 ++++++++++++++++++++++++---------
>  4 files changed, 65 insertions(+), 20 deletions(-)
>
> --

Whatever happened to this series?
Paolo Bonzini May 24, 2021, 12:50 p.m. UTC | #2
On 21/05/21 22:58, Jim Mattson wrote:
> On Wed, Oct 31, 2018 at 4:49 PM Marc Orr <marcorr@google.com> wrote:
>>
>> Compared to the last version, I've:
>> (1) dropped the vmalloc patches
>> (2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch
>>      struct to be sized according to fpu_kernel_xstate_size
>> (3) Added minimum FPU checks in KVM's x86 init logic to avoid memory
>>      corruption issues.
>>
>> Marc Orr (2):
>>    kvm: x86: Use task structs fpu field for user
>>    kvm: x86: Dynamically allocate guest_fpu
>>
>>   arch/x86/include/asm/kvm_host.h | 10 +++---
>>   arch/x86/kvm/svm.c              | 10 ++++++
>>   arch/x86/kvm/vmx.c              | 10 ++++++
>>   arch/x86/kvm/x86.c              | 55 ++++++++++++++++++++++++---------
>>   4 files changed, 65 insertions(+), 20 deletions(-)
>>
>> --
> 
> Whatever happened to this series?

There was a question about the usage of kmem_cache_create_usercopy, and 
a v7 was never sent.

Paolo
Sean Christopherson May 24, 2021, 10:44 p.m. UTC | #3
On Mon, May 24, 2021, Paolo Bonzini wrote:
> On 21/05/21 22:58, Jim Mattson wrote:
> > On Wed, Oct 31, 2018 at 4:49 PM Marc Orr <marcorr@google.com> wrote:
> > > 
> > > Compared to the last version, I've:
> > > (1) dropped the vmalloc patches
> > > (2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch
> > >      struct to be sized according to fpu_kernel_xstate_size
> > > (3) Added minimum FPU checks in KVM's x86 init logic to avoid memory
> > >      corruption issues.
> > > 
> > > Marc Orr (2):
> > >    kvm: x86: Use task structs fpu field for user
> > >    kvm: x86: Dynamically allocate guest_fpu
> > > 
> > >   arch/x86/include/asm/kvm_host.h | 10 +++---
> > >   arch/x86/kvm/svm.c              | 10 ++++++
> > >   arch/x86/kvm/vmx.c              | 10 ++++++
> > >   arch/x86/kvm/x86.c              | 55 ++++++++++++++++++++++++---------
> > >   4 files changed, 65 insertions(+), 20 deletions(-)
> > > 
> > > --
> > 
> > Whatever happened to this series?
> 
> There was a question about the usage of kmem_cache_create_usercopy, and a v7
> was never sent.

What's that go to do with anything? :-D

  b666a4b69739 ("kvm: x86: Dynamically allocate guest_fpu")
  240c35a3783a ("kvm: x86: Use task structs fpu field for user")
Jim Mattson May 24, 2021, 11:01 p.m. UTC | #4
On Mon, May 24, 2021 at 3:44 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Mon, May 24, 2021, Paolo Bonzini wrote:
> > On 21/05/21 22:58, Jim Mattson wrote:
> > > On Wed, Oct 31, 2018 at 4:49 PM Marc Orr <marcorr@google.com> wrote:
> > > >
> > > > Compared to the last version, I've:
> > > > (1) dropped the vmalloc patches
> > > > (2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch
> > > >      struct to be sized according to fpu_kernel_xstate_size
> > > > (3) Added minimum FPU checks in KVM's x86 init logic to avoid memory
> > > >      corruption issues.
> > > >
> > > > Marc Orr (2):
> > > >    kvm: x86: Use task structs fpu field for user
> > > >    kvm: x86: Dynamically allocate guest_fpu
> > > >
> > > >   arch/x86/include/asm/kvm_host.h | 10 +++---
> > > >   arch/x86/kvm/svm.c              | 10 ++++++
> > > >   arch/x86/kvm/vmx.c              | 10 ++++++
> > > >   arch/x86/kvm/x86.c              | 55 ++++++++++++++++++++++++---------
> > > >   4 files changed, 65 insertions(+), 20 deletions(-)
> > > >
> > > > --
> > >
> > > Whatever happened to this series?
> >
> > There was a question about the usage of kmem_cache_create_usercopy, and a v7
> > was never sent.
>
> What's that go to do with anything? :-D
>
>   b666a4b69739 ("kvm: x86: Dynamically allocate guest_fpu")
>   240c35a3783a ("kvm: x86: Use task structs fpu field for user")

So, that's what the series was trimmed down to. Thanks!

Did we still manage to get down to order 2?
Sean Christopherson May 25, 2021, midnight UTC | #5
On Mon, May 24, 2021, Jim Mattson wrote:
> On Mon, May 24, 2021 at 3:44 PM Sean Christopherson <seanjc@google.com> wrote:
> >
> > On Mon, May 24, 2021, Paolo Bonzini wrote:
> > > On 21/05/21 22:58, Jim Mattson wrote:
> > > > On Wed, Oct 31, 2018 at 4:49 PM Marc Orr <marcorr@google.com> wrote:
> > > > >
> > > > > Compared to the last version, I've:
> > > > > (1) dropped the vmalloc patches
> > > > > (2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch
> > > > >      struct to be sized according to fpu_kernel_xstate_size
> > > > > (3) Added minimum FPU checks in KVM's x86 init logic to avoid memory
> > > > >      corruption issues.
> > > > >
> > > > > Marc Orr (2):
> > > > >    kvm: x86: Use task structs fpu field for user
> > > > >    kvm: x86: Dynamically allocate guest_fpu
> > > > >
> > > > >   arch/x86/include/asm/kvm_host.h | 10 +++---
> > > > >   arch/x86/kvm/svm.c              | 10 ++++++
> > > > >   arch/x86/kvm/vmx.c              | 10 ++++++
> > > > >   arch/x86/kvm/x86.c              | 55 ++++++++++++++++++++++++---------
> > > > >   4 files changed, 65 insertions(+), 20 deletions(-)
> > > > >
> > > > > --
> > > >
> > > > Whatever happened to this series?
> > >
> > > There was a question about the usage of kmem_cache_create_usercopy, and a v7
> > > was never sent.
> >
> > What's that go to do with anything? :-D
> >
> >   b666a4b69739 ("kvm: x86: Dynamically allocate guest_fpu")
> >   240c35a3783a ("kvm: x86: Use task structs fpu field for user")
> 
> So, that's what the series was trimmed down to. Thanks!
> 
> Did we still manage to get down to order 2?

Yep, almost made it to order-1!

Current size (without 8 bytes from CONFIG_HYPERV=y) is 9728.