Measure along the top of the wall, from one corner outward to the end.
Mark out the measurement on a piece of ceiling trim, with two marks along the top of the piece and the measured span between them.
Set the trim on your miter saw, upside down and backward from the position it will be on the ceiling. Therefore, if the trim is coming off the right side of the corner, set it on the left side of the blade, sitting flat on the side that will be going up against the ceiling.
Turn the blade 45 degrees pointing inward, toward the middle of the measured span. Cut it.
Slide the trim so the other end is in front of the blade, keeping it in the same position (upside down and backward). Swivel the blade 45 degrees in the opposite direction as it was, so it's still pointing toward the measured span. Make the cut.
Repeat to cut a piece for each span of the ceiling, mitering each of the ends.
Hold the first cut pieces of trim in place at the top of the wall and affix it there, shooting nails from your trim nailer every 12 inches. Do the same for each of the other pieces of trim. The mitered ends should butt to each other in corners.
Make the mitered cuts there go 45 degrees outward, away from the measured span of the trim, instead of inward, if there are any outside corners on the ceiling, such as around chimneys.