linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter
@ 2022-03-08  8:18 Wanpeng Li
  2022-03-08 12:13 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wanpeng Li @ 2022-03-08  8:18 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel

From: Wanpeng Li <wanpengli@tencent.com>

When the "nopv" command line parameter is used, it should not waste 
memory for kvmclock.

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
---
 arch/x86/kernel/kvmclock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index c5caa73..16333ba 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -239,7 +239,7 @@ static void __init kvmclock_init_mem(void)
 
 static int __init kvm_setup_vsyscall_timeinfo(void)
 {
-	if (!kvm_para_available() || !kvmclock)
+	if (!kvm_para_available() || !kvmclock || nopv)
 		return 0;
 
 	kvmclock_init_mem();
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter
  2022-03-08  8:18 [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter Wanpeng Li
@ 2022-03-08 12:13 ` Paolo Bonzini
  2022-03-09  1:36   ` Wanpeng Li
  2022-04-08  7:44 ` Wanpeng Li
  2022-04-08 16:47 ` Paolo Bonzini
  2 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2022-03-08 12:13 UTC (permalink / raw)
  To: Wanpeng Li, linux-kernel, kvm
  Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
	Joerg Roedel

On 3/8/22 09:18, Wanpeng Li wrote:
> From: Wanpeng Li <wanpengli@tencent.com>
> 
> When the "nopv" command line parameter is used, it should not waste
> memory for kvmclock.
> 
> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
> ---
>   arch/x86/kernel/kvmclock.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index c5caa73..16333ba 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -239,7 +239,7 @@ static void __init kvmclock_init_mem(void)
>   
>   static int __init kvm_setup_vsyscall_timeinfo(void)
>   {
> -	if (!kvm_para_available() || !kvmclock)
> +	if (!kvm_para_available() || !kvmclock || nopv)
>   		return 0;
>   
>   	kvmclock_init_mem();

Perhaps instead !kvm_para_available() && nopv should clear the kvmclock 
variable?

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter
  2022-03-08 12:13 ` Paolo Bonzini
@ 2022-03-09  1:36   ` Wanpeng Li
  0 siblings, 0 replies; 5+ messages in thread
From: Wanpeng Li @ 2022-03-09  1:36 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: LKML, kvm, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel

On Tue, 8 Mar 2022 at 20:13, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 3/8/22 09:18, Wanpeng Li wrote:
> > From: Wanpeng Li <wanpengli@tencent.com>
> >
> > When the "nopv" command line parameter is used, it should not waste
> > memory for kvmclock.
> >
> > Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
> > ---
> >   arch/x86/kernel/kvmclock.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> > index c5caa73..16333ba 100644
> > --- a/arch/x86/kernel/kvmclock.c
> > +++ b/arch/x86/kernel/kvmclock.c
> > @@ -239,7 +239,7 @@ static void __init kvmclock_init_mem(void)
> >
> >   static int __init kvm_setup_vsyscall_timeinfo(void)
> >   {
> > -     if (!kvm_para_available() || !kvmclock)
> > +     if (!kvm_para_available() || !kvmclock || nopv)
> >               return 0;
> >
> >       kvmclock_init_mem();
>
> Perhaps instead !kvm_para_available() && nopv should clear the kvmclock
> variable?

Do you mean if (!kvm_para_available() && nopv) return 0? I
misunderstand why they are the same. :)

    Wanpeng

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter
  2022-03-08  8:18 [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter Wanpeng Li
  2022-03-08 12:13 ` Paolo Bonzini
@ 2022-04-08  7:44 ` Wanpeng Li
  2022-04-08 16:47 ` Paolo Bonzini
  2 siblings, 0 replies; 5+ messages in thread
From: Wanpeng Li @ 2022-04-08  7:44 UTC (permalink / raw)
  To: LKML, kvm
  Cc: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel

ping,
On Tue, 8 Mar 2022 at 16:19, Wanpeng Li <kernellwp@gmail.com> wrote:
>
> From: Wanpeng Li <wanpengli@tencent.com>
>
> When the "nopv" command line parameter is used, it should not waste
> memory for kvmclock.
>
> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
> ---
>  arch/x86/kernel/kvmclock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index c5caa73..16333ba 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -239,7 +239,7 @@ static void __init kvmclock_init_mem(void)
>
>  static int __init kvm_setup_vsyscall_timeinfo(void)
>  {
> -       if (!kvm_para_available() || !kvmclock)
> +       if (!kvm_para_available() || !kvmclock || nopv)
>                 return 0;
>
>         kvmclock_init_mem();
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter
  2022-03-08  8:18 [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter Wanpeng Li
  2022-03-08 12:13 ` Paolo Bonzini
  2022-04-08  7:44 ` Wanpeng Li
@ 2022-04-08 16:47 ` Paolo Bonzini
  2 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2022-04-08 16:47 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: linux-kernel, kvm, Sean Christopherson, Vitaly Kuznetsov,
	Wanpeng Li, Jim Mattson, Joerg Roedel

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-08 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08  8:18 [PATCH] x86/kvm: Don't waste kvmclock memory if there is nopv parameter Wanpeng Li
2022-03-08 12:13 ` Paolo Bonzini
2022-03-09  1:36   ` Wanpeng Li
2022-04-08  7:44 ` Wanpeng Li
2022-04-08 16:47 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).