The invention provides compounds having the general formula I: and pharmaceutically acceptable salts thereof, wherein the variables R A , R AA , subscript n, ring A, X 2 , L, subscript m, X 1 , R 1 , R 2 , R 3 , R 4 , R 5 , and R N have the meaning as described herein; compositions containing such compounds; and such compounds and compositions for use in methods of treatment.