erpalma / throttled

Workaround for Intel throttling issues in Linux.
MIT License
2.68k stars 166 forks source link

match supported machines before doing anything #84

Open henning-schild opened 5 years ago

henning-schild commented 5 years ago

At the moment this script just seems to go ahead and mess around with machine specifics, that could go truly wrong if executed on a machine that is not supported. Those mmio regions might be backed by something we better not access. I wrote an ebuild for gentoo (#80) but that can not go upstream with some DMI matching or alike.

erpalma commented 5 years ago

I see what you means, but right now we do not have the full list of "supported" hardware. In the readme it is clear that if you try the tool on your machine, then you are also taking a little "risk". I might add some DMI matching, but I think that could give users a false sense of safety: I can match your T480s, but I don't know what exactly might go wrong if you have a newer revision or a discrete dGPU. We are already checking for the support of some features (e.g. temperature, cTDP), so I guess that the right solution to this problem is to perform more tests on the features advertised by the CPU and, w.r.t. the MCHBAR, I can check if the value is somewhat consistent to what I expect. I need to investigate further on this.

Tl;dr You are right, but I think that the solution should be a bit more general.

henning-schild commented 5 years ago

In fact the whole thing should probably become a platform driver and be done inside the kernel.

DEvil0000 commented 5 years ago

True, true

-------- Ursprüngliche Nachricht -------- Von: Henning Schild notifications@github.com Datum: 18.12.2018 19:29 (GMT+01:00) An: erpalma/lenovo-throttling-fix lenovo-throttling-fix@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Betreff: Re: [erpalma/lenovo-throttling-fix] match supported machines before doing anything (#84)

In fact the whole thing should probably become a platform driver and be done inside the kernel.

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/erpalma/lenovo-throttling-fix","title":"erpalma/lenovo-throttling-fix","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/erpalma/lenovo-throttling-fix"}},"updates":{"snippets":[{"icon":"PERSON","message":"@henning-schild in #84: In fact the whole thing should probably become a platform driver and be done inside the kernel."}],"action":{"name":"View Issue","url":"https://github.com/erpalma/lenovo-throttling-fix/issues/84#issuecomment-448321921"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/erpalma/lenovo-throttling-fix/issues/84#issuecomment-448321921", "url": "https://github.com/erpalma/lenovo-throttling-fix/issues/84#issuecomment-448321921", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

erpalma commented 5 years ago

I investigated a bit on the issue. Actually the CONFIG_TDP (offset 59A0) MCH register is available from gen 4 onward. Maybe I can just check the microarchitecture and add a --force flag to bypass the check for the expert user. Do you agree?

erpalma commented 5 years ago

Please have a look at the testing branch!