Fix p > 1, not necessarily integer, with p(d − 2) < d. We study the p-fold selfintersection local time of a simple random walk on the lattice Z d up to time t. This is the p-norm of the vector of the walker's local times, ℓ t . We derive precise logarithmic asymptotics of the expectation of exp{θ t ℓ t p } for scales θ t > 0 that are bounded from above, possibly tending to zero. The speed is identified in terms of mixed powers of t and θ t , and the precise rate is characterized in terms of a variational formula, which is in close connection to the GagliardoNirenberg inequality. As a corollary, we obtain a large-deviation principle for ℓ t p /(tr t ) for deviation functions r t satisfying tr t ≫ E[ ℓ t p ]. Informally, it turns out that the random walk homogeneously squeezes in a t-dependent box with diameter of order ≪ t 1/d to produce the required amount of self-intersections. Our main tool is an upper bound for the joint density of the local times of the walk.MSC 2000. 60K37, 60F10, 60J55.