FAR 91.109 sets the requirement for a safety pilot, and requires that the safety pilot hold category and class ratings for the aircraft to be flown. There is no requirement for any endorsement, as an endorsement is not a rating.
The safety pilot must hold the appropriate endorsement if acting as pilot in command. Often the safety pilot is designated as PIC, in order for both pilots to log the time as pilot in command. In such a case, when acting as PIC, the safety pilot needs to have category and class ratings, as well as appropriate endorsements (high performance, complex, tailwheel, high-altitude, etc) according to the aircraft flown, the conditions in which the flight will operate, etc. A safety pilot acting as PIC must also be current in accordance with FAR 61.56 (flight review) and 61.57 (recent flight expeience; landings, night, instrument, etc). Additionally, if the safety pilot will be acting as PIC in instrument conditions, then the safety pilot must have an instrument rating.
If the safety pilot is not acting as PIC, he or she is not bound by the constraints of 61.31(f)(1), which sets the requirement for the high performance endorsement.
How may a pilot obtain a high performance endorsement? 61.31(f) requires that the applicant obtain ground and flight training from an authorized instructor and upon being found proficient in the operation of high performance airplanes, receive a one-time logbook endorsement certifying that the applicant is proficient to operate a high performance airplane.
As far as logging goes, it makes no difference if the pilot has an endorsement. Obviously if the pilot does not have the endorsement, the pilot may not act as pilot in command. In such a case, the time must be logged as SIC, unless at some time the safety pilot becomes sole manipulator of the controls. In such a case, a pilot may log PIC time regardless of weather he or she holds the endorsement. This is because to log time as PIC, one must be rated in the airplane, and as stated previously, an endorsement is not a rating.