Genesis 41,55:
וַתִּרְעַב֙ כָּל-אֶ֣רֶץ מִצְרַ֔יִם וַיִּצְעַ֥ק הָעָ֛ם אֶל-פַּרְעֹ֖ה לַלָּ֑חֶם וַיֹּ֨אמֶר פַּרְעֹ֤ה לְכָל-מִצְרַ֨יִם֙ לְכ֣וּ אֶל-יוֹסֵ֔ף אֲשֶׁר-יֹאמַ֥ר לָכֶ֖ם תַּֽעֲשֽׂוּ:
And when all the land of Egypt was famished, the people cried to Pharaoh for bread; and Pharaoh said to all the Egyptians, Go to Joseph; what he said to you, do.
What did Yosef say to do? Rashi explained that he told the Egyptians to circumcise themselves.
We know why Yosef tells them this. But how does Rashi know this piece of information?