I can understand the theory behind the different privilege levels x86_64 arch has. Read a lot about them in the intel/amd dev guides.
But what I cannot afford to understand is when (practical use cases) do we need different privilege level. Why do we use a kernel stack for example with DPL 0 and not 3 (we would just run the code segment with cpl 0).
I am confused about that.
Could you please explain with real world example(s)/dangers?
Thanks
Edit:
I am more interested in the cases the kernel sets a more privileged profile to an application stack