From patchwork Thu Aug 20 13:46:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard W.M. Jones" X-Patchwork-Id: 42928 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7KDlI88010767 for ; Thu, 20 Aug 2009 13:47:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754609AbZHTNq1 (ORCPT ); Thu, 20 Aug 2009 09:46:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754610AbZHTNq1 (ORCPT ); Thu, 20 Aug 2009 09:46:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64248 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754452AbZHTNq0 (ORCPT ); Thu, 20 Aug 2009 09:46:26 -0400 Received: from int-mx06.intmail.prod.int.phx2.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.19]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7KDkSL6028082 for ; Thu, 20 Aug 2009 09:46:28 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx06.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7KDkRtB028511 for ; Thu, 20 Aug 2009 09:46:27 -0400 Received: from localhost (vpn1-4-139.ams2.redhat.com [10.36.4.139]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7KDkPIn012177 for ; Thu, 20 Aug 2009 09:46:26 -0400 Date: Thu, 20 Aug 2009 14:46:21 +0100 From: "Richard W.M. Jones" To: "kvm@vger.kernel.org" Subject: [PATCH] Workaround segfault when qemu-kvm runs inside a VM Message-ID: <20090820134621.GA10019@amd.home.annexia.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.19 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This was discussed here before so I'll just link to that earlier discussion: http://www.mail-archive.com/kvm@vger.kernel.org/msg19890.html The attached patch is a bit of a hack, but at least it stops qemu-kvm from segfaulting when hardware virtualization isn't available. Rich. diff --git a/exec.c b/exec.c index 705bcf2..2091516 100644 --- a/exec.c +++ b/exec.c @@ -422,9 +422,6 @@ static uint8_t static_code_gen_buffer[DEFAULT_CODE_GEN_BUFFER_SIZE]; static void code_gen_alloc(unsigned long tb_size) { - if (kvm_enabled()) - return; - #ifdef USE_STATIC_CODE_GEN_BUFFER code_gen_buffer = static_code_gen_buffer; code_gen_buffer_size = DEFAULT_CODE_GEN_BUFFER_SIZE;