Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFkil-0004OL-FQ for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:37:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFkik-0004NL-SJ for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:37:58 -0500 Received: from [199.232.76.173] (port=42069 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFkik-0004N4-Cq for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:37:58 -0500 Received: from mx20.gnu.org ([199.232.41.8]:37898) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFkij-0002AN-Lk for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:37:57 -0500 Received: from hall.aurel32.net ([88.191.82.174]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFkij-0006FP-0G for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:37:57 -0500 Date: Wed, 2 Dec 2009 09:37:56 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 06/11] Add support for S390x system emulation Message-ID: <20091202083756.GW2310@hall.aurel32.net> References: <1259241800-2810-1-git-send-email-agraf@suse.de> <1259241800-2810-7-git-send-email-agraf@suse.de> <20091130181844.GA12174@volta.aurel32.net> <20091202080933.GQ2310@hall.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Carsten Otte , qemu-devel@nongnu.org On Wed, Dec 02, 2009 at 09:27:21AM +0100, Alexander Graf wrote: > > On 02.12.2009, at 09:09, Aurelien Jarno wrote: > > > On Mon, Nov 30, 2009 at 11:19:06PM +0100, Alexander Graf wrote: > >> > >> On 30.11.2009, at 19:18, Aurelien Jarno wrote: > >> > >>> On Thu, Nov 26, 2009 at 02:23:15PM +0100, Alexander Graf wrote: > >>>> Let's enable the basics for system emulation so we can run virtual machines > >>>> with KVM! > >>> > >>> I don't really understand while this whole patch is not merged in patch > >>> number 1. Otherwise, please find the comments below. > >> > >> Historical reasons. To keep Uli's stripped down version separate from my code. > >> > >>> > >>>> Signed-off-by: Alexander Graf > >>>> --- > >>>> target-s390x/cpu.h | 153 ++++++++++++++++++++++++++++++++++++- > >>>> target-s390x/exec.h | 5 + > >>>> target-s390x/helper.c | 22 +++++ > >>>> target-s390x/machine.c | 30 +++++++ > >>>> 4 files changed, 208 insertions(+), 2 deletions(-) > >>>> create mode 100644 default-configs/s390x-softmmu.mak > >>>> create mode 100644 target-s390x/machine.c > >>>> > >>>> diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak > >>>> new file mode 100644 > >>>> index 0000000..e69de29 > >>>> diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h > >>>> index f45b00c..a74745c 100644 > >>>> --- a/target-s390x/cpu.h > >>>> +++ b/target-s390x/cpu.h > >>>> @@ -30,8 +30,7 @@ > >>>> > >>>> #include "softfloat.h" > >>>> > >>>> -#define NB_MMU_MODES 2 // guess > >>>> -#define MMU_USER_IDX 0 // guess > >>>> +#define NB_MMU_MODES 2 > >>>> > >>>> typedef union FPReg { > >>>> struct { > >>>> @@ -77,6 +76,15 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) > >>>> } > >>>> #endif > >>>> > >>>> +#define MMU_MODE0_SUFFIX _kernel > >>>> +#define MMU_MODE1_SUFFIX _user > >>>> +#define MMU_USER_IDX 1 > >>>> +static inline int cpu_mmu_index (CPUState *env) > >>>> +{ > >>>> + /* XXX: Currently we don't implement virtual memory */ > >>>> + return 0; > >>> > >>> Is it correct? It means that memory access will aways be kernel memory > >>> accesses. IIRC, even with KVM enabled, softmmu accesses are possible in > >>> some cases (devices ?). > >> > >> I can't imagine any hardware using the CPU's MMU to write to RAM. That's what IOMMUs are for. > >> > >> The only 2 consumers are: > >> > >> 1) tcg > >> 2) gdb / monitor > >> > >> With 2) being broken, because we can't resolve virtual addresses to physical addresses. But that won't change until someone implements the softmmu emulation target for real. > > > > If it is sure it is never used, I would prefer to see an abort(). > > Otherwise it's fine. > > I don't think I understand where you want to put the abort(). > In inline cpu_mmu_index(), just before the return, to make sure this function is never called, as it is clearly wrong. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net