Wordpress has the following post types by default, with your custom post types add at the end of the array:
Array
(
[0] => post
[1] => page
[2] => attachment
[3] => revision
[4] => nav_menu_item
[5] => ...all your custom post types
)
So you can loop through them and simply add a meta box to every post type. Note: This won't work for attachment, revision and nav_menu_item, so you want to skip them:
function wpse44962_add_meta_boxes()
{
foreach ( array_keys( $GLOBALS['wp_post_types'] ) as $post_type )
{
// Skip:
if ( in_array( $post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) )
continue;
// You'll have to set $id, $title, $callback yourself:
add_meta_box( $id, $title, $callback, $post_type, 'advanced', 'default' );
}
}
add_action( 'add_meta_boxes', 'wpse44962_add_meta_boxes' );