In Milan, the home side opened the scoring when Tonali curled a free kick into the top near corner in the 12th minute. It was also his first goal for Milan and only a second in Serie A for the former Brescia midfielder.
Cagliari leveled three minutes later as Deiola headed in a delightful lofted pass from João Pedro but Milan restored its lead almost immediately when Leão’s effort was deflected in.
Giroud joined Milan from Chelsea in the offseason and the 34-year-old scored his first goal in the 24th. Brahim Díaz raced forward from the center of midfield and sent a ball through to Giroud, who fired it into the far side of the net.
Giroud also converted a penalty two minutes from halftime after Cagliari midfielder Kevin Strootmann handled the ball just inside the penalty area.
Salernitana had narrowly lost its first match back in the top flight for more than 20 years as it was defeated 3-2 by Bologna last week.
It was a lot more humiliating in its first home match following a second-half capitulation.
Lorenzo Pellegrini broke the deadlock three minutes into the second half and also scored Roma’s fourth.