The game knows.
EXTRA damage and
THE damage, so only the 2 points of AN damage is negated by magic resistance, and only it (THE damage) is magical.
This also fits with Fire weapons, which deals extra damage that is magical but doens't affect the base weapon.