You don’t really need “resurface” or “shave” either cylinder block or cylinder head unless they have corrosion damages or have deformed due to overheating. Cleaning up both surfaces should be sufficient. But you don’t really know until you take the cylinder head out. Most likely you’ll need “resurface” or “shave” your cylinder head with a new head, because that’s how you have to fix it when the head gasket is blown. Based on CX-5 diesel owners’ experience in Taiwan who are having the same overheating problem, the cylinder head usually cracked and a new head is needed. Some have block damage along with the head, and entire engine needs to be replaced. Their experience with resurfaced or shaved cylinder block with a new head is not good. With higher compression ratio coming with the shaved cylinder block, usually the engine would fail again in short period of time. The government of Taiwan has forced Mazda Taiwan to warranty all diesel engines FOREVER and they have to give the owner a new engine if the overheating problem happens. I believe this’s the reason why Mazda Taiwan has stopped importing all popular diesel models into Taiwan since 2019 MY. The fix by shaving the cylinder block with new head and head gasket simply is not an acceptable fix as the root of problem is still there.
If I were you, I’d find a used working 2.2L diesel engine, then sell the CX-5 ASAP.