It’s not entirely obvious how to do this, but it can be done if you compile your own kernel. The trick is enabling BIGSMP before you select the number of CPUs. If you don’t, you’ll get an error saying more than 8 cores is an invalid option.
Kernel compilation instructions for Ubuntu are here: https://help.ubuntu.com/community/Kernel/Compile
When it comes time to set kernel configuration parameters, make sure to select: