kernel_task on Macbook hogging CPU even after OS upgrades/downgrades; possible Flash malware?
When a system is infected with malware, the best course of action is format the drive and restore known-good backup from before the malware infection. 

If you just reinstall the operating system on top of your infected system, while keeping all your own files on your drive, you're in high risk of keeping the malware - and/or simply reinfecting the system quickly after the upgrade.

In theory malware could change the firmware of the SMC or something like that, to persist even when the drive is formatted - but in practice Flash malware is very unlikely to do so.

However, I'm not entirely convinced that your problem with kernel_task is related to the malware. I would suggest rebooting your computer into "Recovery mode" by holding the Command and R buttons during boot. When in "Recovery Mode", open the Terminal and run the command:

top -ocpu


This should show a live updating overview of the currently running processes, sorted with the most CPU using process at the top.

If you still have kernel_task at the top spot with a large percentage, the problem is most likely unrelated to the malware, and could instead indicate a hardware problem regarding cooling. This could be a problem with a fan not operating properly, cooling paste, or even a sensor issue.