Use an NPN inverter. The collector goes to the 12 Volt supply via a resistor of say 22k and with a 100 Ohm resistor from the collector to the gate of the P channel.
You should study the P channel data sheet to see if it has internal protection for the gate insulation, otherwise the spikes will destroy the P channel.
If there is no protection, read the data sheet to determine what voltage the Gate - Source insulation can withstand. It is usually about 20 Volt.
So connect a 15 Volt Zener between the NPN collector and gnd with the cathode connected to the collector.