How to Make infinite loop of post

A very basic example,

$args = array(  'post_type' => 'post', 'posts_per_page' => -1 );
$query= new WP_Query($args);
while ( $query->have_posts() ) : $query->the_post();

    the_content(); //example, use whatever template functions you like...

endwhile;
wp_reset_postdata(); //reset Post Data
wp_reset_query(); //destroy query incase of using multiple queries on same page

Important:

Note, that this is probably an inefficient way to achieve what you want because if your post_type contains many posts it may impede your sites performance because the parameter posts_per_page => -1 will load all posts from the given posts type within your slider.

To improve performance you should restrict your slider content to a special category and use the category parameter 'cat' => $id where $id is in integer value 1, 2, 3 etc.

Better still, I’d personally confine my slides to a custom post type and add 'post_type' => 'slider_posts' but this assumes you have registered a custom post type before hand.

Its important that you read http://codex.wordpress.org/Class_Reference/WP_Query which contains a great deal of information surrounding the various parameters you can use with WP_Query to achieve custom control of what data you retrieve.