Why does the BIOS entry point start with a WBINVD instruction?

前端 未结 3 1644
一个人的身影
一个人的身影 2021-02-07 09:03

I\'m investigating the BIOS code in my machine (x86_64 Linux, IvyBridge). I use the following procedure to dump the BIOS code:

$ sudo cat /proc/iomem | grep ROM
         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-07 09:25

    According to this Dr. Dobb's article written by Pete Dice of Intel back in 2011:

    Because the processor cache is not enabled by default, it is not uncommon to flush cache in this step with a WBINV instruction. The WBINV is not needed on newer processors, but it doesn't hurt anything.

    I'm not sure what WBINVD has to do with cache not being enabled by default. I thought he might have meant that WBINVD would enable the cache but the documentation doesn't say anything about the instruction having this effect. I think the second sentence confirms Margaret's suspicion that this is a case of cargo cult.

提交回复
热议问题