From patchwork Tue Sep 11 07:51:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pingfan liu X-Patchwork-Id: 183057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 745DB2C0092 for ; Tue, 11 Sep 2012 18:35:38 +1000 (EST) Received: from localhost ([::1]:57638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBLHZ-0008Lp-Sr for incoming@patchwork.ozlabs.org; Tue, 11 Sep 2012 03:53:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBLH2-0007Og-0Z for qemu-devel@nongnu.org; Tue, 11 Sep 2012 03:52:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBLH0-0007Kx-Ns for qemu-devel@nongnu.org; Tue, 11 Sep 2012 03:52:43 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:40218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBLH0-0007Kq-Hs for qemu-devel@nongnu.org; Tue, 11 Sep 2012 03:52:42 -0400 Received: by pbbrp12 with SMTP id rp12so439967pbb.4 for ; Tue, 11 Sep 2012 00:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=L7G2wzMSWLuxGxva0bKbzLNz9rDwA0ehVa73y19rLmk=; b=p5CNHsvtl+rvV7YYJcVw8mBBjllUbkUfLKEb2Y9dF9lV4XtOW40KhsdS0b+YLefa7B rdGS+DeFQlF+fdmLa7smb7EcEjbKvWW0BOgKsPwrdeAni1X00PZOpeE+RFvn7aGOgMl+ XVIGHhQQ64S/r4vxEGRZdxu0jfYrP+N0QhvTZOxV5ovMKNiVM9tzGBmJreOt6PpX0zBz YBBdtWCl6SsOr4PRp3ci42X7kyS+QjKDfXnHwYMu1LAunfYkuPg0IGkFTJhPekcUeBqd LQU1Rd7ujKSw7LhLjFnVIzyVtgjxTchaesxcapus9wfCfAoP2hvtnW2y8Kyy7p6VCqEd kWow== Received: by 10.68.193.194 with SMTP id hq2mr10317845pbc.93.1347349961803; Tue, 11 Sep 2012 00:52:41 -0700 (PDT) Received: from localhost ([202.108.130.138]) by mx.google.com with ESMTPS id wl4sm1178006pbc.17.2012.09.11.00.52.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 00:52:40 -0700 (PDT) From: Liu Ping Fan To: qemu-devel@nongnu.org Date: Tue, 11 Sep 2012 15:51:46 +0800 Message-Id: <1347349912-15611-6-git-send-email-qemulist@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1347349912-15611-1-git-send-email-qemulist@gmail.com> References: <1347349912-15611-1-git-send-email-qemulist@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Jan Kiszka , Marcelo Tosatti , Avi Kivity , Anthony Liguori , Paolo Bonzini Subject: [Qemu-devel] [PATCH V3 05/11] memory: introduce ref, unref interface for MemoryRegionOps X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Liu Ping Fan This pair of interface help to decide when dispatching, whether we can pin mr without big lock or not. Signed-off-by: Liu Ping Fan --- memory.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/memory.h b/memory.h index bd1bbae..9039411 100644 --- a/memory.h +++ b/memory.h @@ -25,6 +25,7 @@ #include "iorange.h" #include "ioport.h" #include "int128.h" +#include "qemu/object.h" typedef struct MemoryRegionOps MemoryRegionOps; typedef struct MemoryRegion MemoryRegion; @@ -66,6 +67,8 @@ struct MemoryRegionOps { target_phys_addr_t addr, uint64_t data, unsigned size); + int (*ref)(MemoryRegion *mr); + void (*unref)(MemoryRegion *mr); enum device_endian endianness; /* Guest-visible constraints: */