Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFkYf-00056J-QS for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:27:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFkYb-00055n-1I for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:27:33 -0500 Received: from [199.232.76.173] (port=47232 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFkYa-00055h-SH for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:27:28 -0500 Received: from mx20.gnu.org ([199.232.41.8]:37367) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFkYa-00018w-7p for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:27:28 -0500 Received: from cantor.suse.de ([195.135.220.2] helo=mx1.suse.de) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFkYZ-0005jv-1q for qemu-devel@nongnu.org; Wed, 02 Dec 2009 03:27:27 -0500 Subject: Re: [Qemu-devel] [PATCH 06/11] Add support for S390x system emulation Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20091202080933.GQ2310@hall.aurel32.net> Date: Wed, 2 Dec 2009 09:27:21 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: 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> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Carsten Otte , qemu-devel@nongnu.org On 02.12.2009, at 09:09, Aurelien Jarno wrote: > On Mon, Nov 30, 2009 at 11:19:06PM +0100, Alexander Graf wrote: >>=20 >> On 30.11.2009, at 19:18, Aurelien Jarno wrote: >>=20 >>> 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! >>>=20 >>> I don't really understand while this whole patch is not merged in = patch >>> number 1. Otherwise, please find the comments below. >>=20 >> Historical reasons. To keep Uli's stripped down version separate from = my code. >>=20 >>>=20 >>>> 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 >>>>=20 >>>> 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 @@ >>>>=20 >>>> #include "softfloat.h" >>>>=20 >>>> -#define NB_MMU_MODES 2 // guess >>>> -#define MMU_USER_IDX 0 // guess >>>> +#define NB_MMU_MODES 2 >>>>=20 >>>> typedef union FPReg { >>>> struct { >>>> @@ -77,6 +76,15 @@ static inline void cpu_clone_regs(CPUState *env, = target_ulong newsp) >>>> } >>>> #endif >>>>=20 >>>> +#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; >>>=20 >>> 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 ?). >>=20 >> I can't imagine any hardware using the CPU's MMU to write to RAM. = That's what IOMMUs are for. >>=20 >> The only 2 consumers are: >>=20 >> 1) tcg >> 2) gdb / monitor >>=20 >> 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. >=20 > 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(). Alex=