The diversion was roughly 3 hours into the flight (based on FlightAware), at about 0000 UTC (the 13th).
At "12 MAR 22:50", i.e. about an hour before, the US issued the following NOTAM (notice to airmen):
Those persons described in paragraph a (applicability) below are prohibited from operating in the Baghdad flight information region (FIR) (ORBB) at all altitudes due to heightened militia activities and increased tensions in Iraq, which present an inadvertent risk to U.S. civil aviation operations due to the potential for miscalculation or mis-identification. [converted case from all caps; emphasis added]
KICZ A0036/20 (PDF)
Note: "Those persons" refers to "U.S. air carriers and commercial operators". It's likely the UK issued a similar NOTAM.
Such communication – and the solution (reroute, return, land*) – will typically be sent from BA's ops to the plane via datalink (ACARS).
* Interestingly, the same flight turned around and landed at Istanbul on the 11th, followed by IST–DXB two hours later. This suggests on the 12th (your flight) they planned for this contingency and loaded enough fuel. The longer (Big Dipper) route adds an additional 580 NM (1,100 km) – not accounting for the increase in the air distance due to turning across/into the jet stream.
For how to find out generally, here I used EASA's Conflict Zone Information Bulletin.