We present a design study of an innovative scheme to generate high rep rate (MHz-class) GeV electron beams by adopting a two-pass two-way acceleration in a superconducting (SC) linac operated in continuous wave (CW) mode. The electron beam is accelerated twice by being reinjected in opposite direction of propagation into the linac after the first passage. Acceleration in opposite directions is accomplished thanks to standing waves supported in rf cavities. The task of recirculating the electron beam when it leaves the linac after first pass is performed by a bubble-shaped arc compressor composed by a sequence of double bend achromat. In this paper we address the main issues inherent to the two-pass acceleration process and the preservation of the electron beam quality parameters (emittance, energy spread, peak current) required to operate x-ray free electron lasers (FEL) with low jitters in the amplitude, spectral and temporal domain, as achieved by operating in seeding and/or oscillator mode a CW FEL up to 1 MHz rep rate. Detailed start-toend simulations are shown to assess the capability of this new scheme to double the electron beam energy as well as to compress the electron bunch length from picoseconds down to tens of femtoseconds. The advantage of such a scheme is to halve the requested linac length for the same final electron beam energy, which is typically in the few GeV range, as needed to drive an x-ray FEL. The AC power to supply the cryogenic plant is also significantly reduced with respect to a conventional single-pass SC linac for the same final energy. We are reporting also x-ray FEL simulations for typical values of wavelengths of interest (in the 200 eV-8 keV photon energy range) to better illustrate the potentiality of this new scheme.