Chop the garlic and parsley, put them in a pan with a dash of oil and brown gently. After a few minutes, add the porcini mushrooms cut into small pieces and salt. Cook over high heat for 3/4 minutes and after this time add white wine. Turn off the heat and keep aside.
Cook the spaghetti in plenty of boiling water, drain it when ready and add it to the pan with the porcini.
Fry all the ingredients together and add the grated caciocavallo cheese.
Cook all the ingredients in the pan over high heat for a few minutes in order to let the cheese combine properly. Turn off the heat and keep aside.
Cut the bacon into very thin slices and brown it in a non-stick pan with rosemary for a minute.
Serve the spaghetti with the grilled bacon on top.