Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Sep 2020 21:38:25 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Wei Hu <weh@microsoft.com>, avg@freebsd.org
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: MSR accesses that slows down the hypervisor/host
Message-ID:  <20200917183825.GU94807@kib.kiev.ua>
In-Reply-To: <SG2P153MB0352C010CAA61A46BD28C964BB3E0@SG2P153MB0352.APCP153.PROD.OUTLOOK.COM>
References:  <SG2P153MB0352138F1A840E8663C039C2BB210@SG2P153MB0352.APCP153.PROD.OUTLOOK.COM> <20200916135727.GO94807@kib.kiev.ua> <SG2P153MB0352C010CAA61A46BD28C964BB3E0@SG2P153MB0352.APCP153.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 17, 2020 at 05:34:22AM +0000, Wei Hu wrote:
> > From: Konstantin Belousov <kostikbel@gmail.com>
> > Sent: Wednesday, September 16, 2020 9:57 PM
> > To: Wei Hu <weh@microsoft.com>
> > Cc: freebsd-hackers@freebsd.org
> > Subject: Re: MSR accesses that slows down the hypervisor/host
> > 
> > Where do you see accesses to MSR_LS_CFG ?  I can only find manipulations of
> > that MSR in init_amd(), and then it is all under check that we are not
> > virtualized.
> > 
> Yes, it is only accessed in init_amd() at boot time. So it is less concerned. MSR_AMDK8_IPM
> is accessed in cpu_idle() all the time, so it is the key place to optimize.
> 
> > For MSR_AMDK8_IPM access in cpu_idle(), it seems that the workaround was
> > applied too wide. It might be that we do not need to do it on recent CPUs, but I
> > need to spent more time looking at datasheets to confirm/deny.
> > 
> > But, do you (hypervisor) indeed allow guest to initiate C1 or deeper idle state ?
> > If not, perhaps as the first measure, we can avoid manipulating
> > MSR_AMDK8_IPM under hypervisor at all.
> 
> You are right a guest cannot initiate C1 or deeper idle state when running on Hyper-V.
> So skipping the read of MSR_AMDK8_IPM when running under this hypervisor would 
> Be a viable solution. 

https://reviews.freebsd.org/D26470



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200917183825.GU94807>