From patchwork Thu Feb 14 03:10:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 1041767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 440Lxr425Bz9sMp for ; Thu, 14 Feb 2019 14:10:56 +1100 (AEDT) Received: from localhost ([127.0.0.1]:38967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gu7QH-0003A1-HX for incoming@patchwork.ozlabs.org; Wed, 13 Feb 2019 22:10:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gu7Pr-000381-Il for qemu-devel@nongnu.org; Wed, 13 Feb 2019 22:10:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gu7Pp-0006RT-Re for qemu-devel@nongnu.org; Wed, 13 Feb 2019 22:10:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gu7Po-0006Qs-Lc for qemu-devel@nongnu.org; Wed, 13 Feb 2019 22:10:21 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AC9910F86 for ; Thu, 14 Feb 2019 03:10:19 +0000 (UTC) Received: from localhost (unknown [10.64.242.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56F2C5C221; Thu, 14 Feb 2019 03:10:14 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 11:10:02 +0800 Message-Id: <20190214031004.32522-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 14 Feb 2019 03:10:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 0/2] hostmem-file: reject invalid pmem file sizes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , Eduardo Habkost , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" v3: * Added Patch 1 by Igor [Wei] * Moved pmem size check after mem_path check [Wei] Guests started with NVDIMMs larger than the underlying host file produce confusing errors inside the guest. This happens because the guest accesses pages beyond the end of the file. Check the pmem file size on startup and print a clear error message if the size is invalid. Igor Mammedov (1): hostmem: simplify ifdef-s in file_backend_memory_alloc() Stefan Hajnoczi (1): hostmem-file: reject invalid pmem file sizes include/qemu/osdep.h | 13 ++++++++++ backends/hostmem-file.c | 32 +++++++++++++++++++++---- util/oslib-posix.c | 53 +++++++++++++++++++++++++++++++++++++++++ util/oslib-win32.c | 5 ++++ 4 files changed, 98 insertions(+), 5 deletions(-) Reviewed-by: Pankaj Gupta