[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    RE: MSR accesses that slows down the hypervisor/host
From:       Wei Hu via freebsd-hackers <freebsd-hackers () freebsd ! org>
Date:       2020-09-20 7:41:12
Message-ID: SG2P153MB03521E6C5A0870A42097E8C8BB3D0 () SG2P153MB0352 ! APCP153 ! PROD ! OUTLOOK ! COM
[Download RAW message or body]

> > > 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://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews
> .freebsd.org%2FD26470&amp;data=02%7C01%7Cweh%40microsoft.com%7C8
> 7f5f82583ee428f49c108d85b38e9c3%7C72f988bf86f141af91ab2d7cd011db4
> 7%7C1%7C0%7C637359647283571535&amp;sdata=JdKxHO1sM2InD7Eo793FF
> RIpj5AQmowcc%2BLGW19dlH4%3D&amp;reserved=0

Thanks for the quick response. I will review the change and do some tests on Hyper-V.

Wei
_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic