I am reading the book "Writing Operating System from Scratch" by Nick Blundell. In one of the chapters, it is explained how we make transition from 16bit mode to 32bit mode. It says that before moving to 32bit mode we should ensure that all the instructions in 16bit mode which are currently inside the pipeline (instruction pipeline inside CPU) are executed. To accomplish this it says, we should make a far jump which causes a pipeline flush which the book says is completing all instructions currently in the different stages of the pipeline.
But what I understood about pipeline flushing is removing all the instructions after the conditional branch from the instruction pipeline due to changed flow of the program.
I am confused between these descriptions, could someone please explain what happens during pipeline flushing.
Further, the book says a near jump may not be sufficient to do pipeline flushing. I do not understand this as well.
There is a similar question :
Stalling and Flushing in MIPS Piplining
But could someone please explain about this in somewhat more detail.
Thanks in advance!!