Well here is everything that I've done to my 400. Keep in mind that I'm running a 38mm carb, race gas and my measurements may not be the same for each bike.
First I used a Wiseco TM piston, piston pin and a 20i.d x 24o.d x 30 long needle bearing (if you can't get these I can get them for you, they are only $5 Canadian) and I only use the top ring on the piston. The TM piston is a little taller (from the center of the pin to the crown) than the KX piston, about 2.7mm or 0.10". If left like this, the piston would cover some of the transfer and exhaust ports at BDC and likely knock the head off at TDC! I used one stock 0.02" base gasket, a aluminum spacer plate, 0.05" that I made, and a thicker 0.03" gasket that I also made. I suppose that you could do this in any combination to come up with the 2.7mm difference. When you get it done right the piston should just come to the bottom edge of the transfer and exhaust ports at BDC.
Now I had a space of 0.05" from the top edge of the piston to the gasket surface of the cylinder at TDC, a 0.02" head gasket and 0.06" squish in the cylinder head for a total of 0.13". I want to whittle that down to a total of 0.045" or 0.050" squish, keep in mind that I'm running 110 leaded race gas. I took 0.04" off the head on a milling machine, and 0.04" off the top of the cylinder in a lathe, so when I bolted it all together, with the head gasket, and checked my squish I had 0.05".
I think that you can c.c the head and do more work with the squish angle in the head, but all I wanted was a bike that ran strong and didn't ping, knock or over heat after one lap. The bike runs great with no overheating or knocking now.