From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Starting a VM using /dev/kvm Date: Wed, 20 Nov 2013 18:28:57 +0100 Message-ID: <528CF159.10001@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Jim MacArthur Return-path: Received: from mail-qe0-f43.google.com ([209.85.128.43]:37236 "EHLO mail-qe0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865Ab3KTR3D (ORCPT ); Wed, 20 Nov 2013 12:29:03 -0500 Received: by mail-qe0-f43.google.com with SMTP id 2so4132026qeb.16 for ; Wed, 20 Nov 2013 09:29:03 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 20/11/2013 00:56, Jim MacArthur ha scritto: > I haven't been able to find much information on it, but by reading the > API document and stracing qemu I've put together a small program which > creates a VM, VCPU, and sets up some memory. All of these ioctls > return successfully, but trying to run always returns with exit code > 17 and suberror 1 which so far as I can tell seems to be a problem > with page tables. I'm on an x86_64 host. > > The question is, how does a new vcpu start up? Will it start in full > 64-bit mode or 16-bit real mode? By default it start in 16-bit real mode, with CS=0xf000 and EIP=0xfff0, but CS.base = 0xffff0000. However, you can send ioctls to modify CR0/CR4/EFER and place the VCPU in whatever mode you'd like to have. > And will I need a full set of > translation tables to run a single instruction or can I just point it > at some memory and expect it to run? Real mode doesn't need page tables of course, and so does 32-bit protected mode with CR0.PG=0. However, 64-bit mode only exists with paging (and PAE) enabled. So you need page tables to enable 64-bit mode. Paolo