From patchwork Wed Jul 28 15:13:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 114813 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6SFDTbn017558 for ; Wed, 28 Jul 2010 15:13:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754747Ab0G1PN0 (ORCPT ); Wed, 28 Jul 2010 11:13:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57379 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754391Ab0G1PNZ (ORCPT ); Wed, 28 Jul 2010 11:13:25 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6SFDOsH011204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Jul 2010 11:13:24 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SFDNuK031910; Wed, 28 Jul 2010 11:13:23 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 3A6DF18D3C6; Wed, 28 Jul 2010 18:13:23 +0300 (IDT) From: Gleb Natapov To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org Subject: [PATCH 2/2] Remove guest triggerable abort() Date: Wed, 28 Jul 2010 18:13:23 +0300 Message-Id: <1280330003-1467-3-git-send-email-gleb@redhat.com> In-Reply-To: <1280330003-1467-1-git-send-email-gleb@redhat.com> References: <1280330003-1467-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 28 Jul 2010 15:13:29 +0000 (UTC) diff --git a/kvm-all.c b/kvm-all.c index fec6d05..ad46b10 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -437,18 +437,10 @@ static void kvm_set_phys_mem(target_phys_addr_t start_addr, KVMSlot *mem, old; int err; - if (start_addr & ~TARGET_PAGE_MASK) { - if (flags >= IO_MEM_UNASSIGNED) { - if (!kvm_lookup_overlapping_slot(s, start_addr, - start_addr + size)) { - return; - } - fprintf(stderr, "Unaligned split of a KVM memory slot\n"); - } else { - fprintf(stderr, "Only page-aligned memory slots supported\n"); - } - abort(); - } + /* kvm works in page size chunks, but the function may be called + with sub-page size and analigned start address. */ + size = TARGET_PAGE_ALIGN(size); + start_addr = TARGET_PAGE_ALIGN(start_addr); /* KVM does not support read-only slots */ phys_offset &= ~IO_MEM_ROM;