The iPhone Dev Team have already released a Pwnage tool to jailbreak iPhone OS 3.1, but the thing is the jailbreak may not work on all iPhone handsets.
According to iphone world, the current Pwnage tool will only jailbreak the original iPhone, iPhone 3G and the original iPod Touch and cannot jailbreak the 2nd gen iPod touch, 3rd gen iPod Touch and the iPhone 3GS
Currently a Mac is required to run the Pwnage tool although a Windows version is in the making and expected soon, and if you haven’t already upgraded to iPhone 3.1 it may be prudent to wait as there have been reports of the upgrade working poorly.