Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283243 > unrolled thread

[PATCH] x86/rapl: Do not load in a guest

Started byBorislav Petkov <bp@alien8.de>
First post2015-12-03 19:30 +0100
Last post2015-12-04 23:50 +0100
Articles 4 on this page of 24 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-03 19:30 +0100
    Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-03 19:40 +0100
      Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-03 19:50 +0100
        Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-03 20:10 +0100
          Re: [PATCH] x86/rapl: Do not load in a guest "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-04 00:10 +0100
            Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 00:30 +0100
              Re: [PATCH] x86/rapl: Do not load in a guest "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-04 01:40 +0100
    Re: [PATCH] x86/rapl: Do not load in a guest Ingo Molnar <mingo@kernel.org> - 2015-12-04 08:50 +0100
      Re: [PATCH] x86/rapl: Do not load in a guest Ingo Molnar <mingo@kernel.org> - 2015-12-04 09:30 +0100
        Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 11:30 +0100
          Re: [PATCH] x86/rapl: Do not load in a guest Paolo Bonzini <pbonzini@redhat.com> - 2015-12-04 11:50 +0100
            Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 12:00 +0100
              Re: [PATCH] x86/rapl: Do not load in a guest Ingo Molnar <mingo@kernel.org> - 2015-12-04 13:00 +0100
                Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 18:50 +0100
                  Re: [PATCH] x86/rapl: Do not load in a guest Paolo Bonzini <pbonzini@redhat.com> - 2015-12-04 19:00 +0100
                  Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 19:10 +0100
                    Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 19:20 +0100
                      Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 19:30 +0100
                        Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 19:50 +0100
                          Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 20:50 +0100
      Re: [PATCH] x86/rapl: Do not load in a guest Peter Zijlstra <peterz@infradead.org> - 2015-12-04 09:30 +0100
        Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 19:00 +0100
          Re: [PATCH] x86/rapl: Do not load in a guest Peter Zijlstra <peterz@infradead.org> - 2015-12-04 23:20 +0100
            Re: [PATCH] x86/rapl: Do not load in a guest "H. Peter Anvin" <hpa@zytor.com> - 2015-12-04 23:50 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1283627

FromPeter Zijlstra <peterz@infradead.org>
Date2015-12-04 09:30 +0100
Message-ID<qBTUC-dS-1@gated-at.bofh.it>
In reply to#1283613
On Fri, Dec 04, 2015 at 08:42:06AM +0100, Ingo Molnar wrote:
> 
> * Borislav Petkov <bp@alien8.de> wrote:
> 
> > From: Borislav Petkov <bp@suse.de>
> > 
> > qemu/kvm doesn't support RAPL and RAPL doesn't have a CPUID feature bit
> > so check whether we're in a guest instead.
> 
> So when a hypervisor starts supporting RAPL we'll disable the driver erroneously?
> 
> Isn't there any better method to detect RAPL support?
> 
> So in particular in drivers/powercap/intel_rapl.c there's an enumerated list of 
> CPU models, which is used via a x86_match_cpu() call. That's still not ideal (it 
> does not work on hypervisors for example), but even better would be to detect RAPL 
> support in some other fashion, that does not rely on us statically enumerating CPU 
> models that support it.

RAPL isn't enumerated, the best we could do is attempt to write to one
of the writable MSRs and see if that 'works'.

Also, yuck @ powercap/intel_rapl.c for doing rdmsr_on_cpu() +
wrmsr_on_cpu() all over the place.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1284122

FromJacob Pan <jacob.jun.pan@linux.intel.com>
Date2015-12-04 19:00 +0100
Message-ID<qC2Oe-5RV-11@gated-at.bofh.it>
In reply to#1283627
On Fri, 4 Dec 2015 09:22:56 +0100
Peter Zijlstra <peterz@infradead.org> wrote:

> Also, yuck @ powercap/intel_rapl.c for doing rdmsr_on_cpu() +
> wrmsr_on_cpu() all over the place.
Can you please be more specific? is the concern related to the
overhead of IPI? I am doing these calls based on MSR CPU scope and
consider the fact that access is less frequent.

Thanks,

Jacob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1284299

FromPeter Zijlstra <peterz@infradead.org>
Date2015-12-04 23:20 +0100
Message-ID<qC6RP-bp-11@gated-at.bofh.it>
In reply to#1284122
On Fri, Dec 04, 2015 at 09:51:02AM -0800, Jacob Pan wrote:
> On Fri, 4 Dec 2015 09:22:56 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > Also, yuck @ powercap/intel_rapl.c for doing rdmsr_on_cpu() +
> > wrmsr_on_cpu() all over the place.
> Can you please be more specific? is the concern related to the
> overhead of IPI? I am doing these calls based on MSR CPU scope and
> consider the fact that access is less frequent.

Yeah, its just offensive to do an IPI to read a value, then twiddle a
few bits on the value and then IPI again to store the value.

I know its low freq, and that MSR access is slow, but *groan*.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1284313

From"H. Peter Anvin" <hpa@zytor.com>
Date2015-12-04 23:50 +0100
Message-ID<qC7kR-l8-13@gated-at.bofh.it>
In reply to#1284299
On December 4, 2015 2:14:46 PM PST, Peter Zijlstra <peterz@infradead.org> wrote:
>On Fri, Dec 04, 2015 at 09:51:02AM -0800, Jacob Pan wrote:
>> On Fri, 4 Dec 2015 09:22:56 +0100
>> Peter Zijlstra <peterz@infradead.org> wrote:
>> 
>> > Also, yuck @ powercap/intel_rapl.c for doing rdmsr_on_cpu() +
>> > wrmsr_on_cpu() all over the place.
>> Can you please be more specific? is the concern related to the
>> overhead of IPI? I am doing these calls based on MSR CPU scope and
>> consider the fact that access is less frequent.
>
>Yeah, its just offensive to do an IPI to read a value, then twiddle a
>few bits on the value and then IPI again to store the value.
>
>I know its low freq, and that MSR access is slow, but *groan*.

Yes, for that it would be better to invoke a common routine to do all the accesses on the target CPU.  MSR accesses may be slow, but IPIs are way slower.
-- 
Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web