Re: [PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-06-28 Thread Anthony Harivel
Marcelo Tosatti, Jun 28, 2023 at 19:26: Hi Marcelo, > On Fri, Jun 16, 2023 at 04:08:30PM +0200, Anthony Harivel wrote: > This feature is activated with -accel kvm,rapl=true. > >> I suppose this should be a CPU flag instead? -cpu xxx,rapl=on. It's possible yes then I might need to make sure that

Re: [PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-06-28 Thread Marcelo Tosatti
On Fri, Jun 16, 2023 at 04:08:30PM +0200, Anthony Harivel wrote: > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > interface (Running Average Power Limit) for advertising the accumulated > energy consumption of various power domains (e.g. CPU packages, DRAM, > etc.). > > T

[PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-06-16 Thread Anthony Harivel
Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL interface (Running Average Power Limit) for advertising the accumulated energy consumption of various power domains (e.g. CPU packages, DRAM, etc.). The consumption is reported via MSRs (model specific registers) like MSR_PKG_E

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-26 Thread Marcelo Tosatti
On Wed, May 24, 2023 at 04:53:49PM +0200, Anthony Harivel wrote: > set=UTF-8 > Status: RO > Content-Length: 24102 > Lines: 667 > > Marcelo Tosatti, May 19, 2023 at 20:28: > > Hi Marcelo, > > > > > > +/* Assuming those values are the same accross physical > > > > > system/packages */ > > > >

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-24 Thread Anthony Harivel
Marcelo Tosatti, May 19, 2023 at 20:28: Hi Marcelo, > > > > +/* Assuming those values are the same accross physical > > > > system/packages */ > > > > +maxcpus = get_maxcpus(0); /* Number of CPUS per packages */ > > > > +maxpkgs = numa_max_node(); /* Number of Packages on the system

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-19 Thread Marcelo Tosatti
Hi Anthony, On Thu, May 18, 2023 at 04:26:51PM +0200, Anthony Harivel wrote: > Marcelo Tosatti, May 17, 2023 at 17:43: > > Hi Marcelo, > > > On Wed, May 17, 2023 at 03:07:30PM +0200, Anthony Harivel wrote: > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h > > > index 8504aaac6807..14f9c290

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-19 Thread Anthony Harivel
Philippe Mathieu-Daudé, May 19, 2023 at 13:32: Hi Philippe, > > +/* > > + * Package statistic > > + * @ e_start: package energy counter before the sleep > > + * @ e_end: package energy counter after the sleep > > + * @ e_delta: delta of package energy counter > > + * @ e_ratio: store the energy r

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-19 Thread Philippe Mathieu-Daudé
Hi Anthony, On 17/5/23 15:07, Anthony Harivel wrote: Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL interface (Running Average Power Limit) for advertising the accumulated energy consumption of various power domains (e.g. CPU packages, DRAM, etc.). The consumption is rep

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-18 Thread Anthony Harivel
Marcelo Tosatti, May 17, 2023 at 17:43: Hi Marcelo, > On Wed, May 17, 2023 at 03:07:30PM +0200, Anthony Harivel wrote: > diff --git a/target/i386/cpu.h b/target/i386/cpu.h > > index 8504aaac6807..14f9c2901680 100644 > > --- a/target/i386/cpu.h > > +++ b/target/i386/cpu.h > > @@ -396,6 +396,10 @@

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-17 Thread Marcelo Tosatti
On Wed, May 17, 2023 at 03:07:30PM +0200, Anthony Harivel wrote: > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > interface (Running Average Power Limit) for advertising the accumulated > energy consumption of various power domains (e.g. CPU packages, DRAM, > etc.). > > T

[RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-17 Thread Anthony Harivel
Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL interface (Running Average Power Limit) for advertising the accumulated energy consumption of various power domains (e.g. CPU packages, DRAM, etc.). The consumption is reported via MSRs (model specific registers) like MSR_PKG_E