From nobody Sun Feb 8 18:43:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636640995324962.3629301099621; Thu, 11 Nov 2021 06:29:55 -0800 (PST) Received: from localhost ([::1]:51092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlB5O-0000vM-6i for importer@patchew.org; Thu, 11 Nov 2021 09:29:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlAse-00032u-CQ for qemu-devel@nongnu.org; Thu, 11 Nov 2021 09:16:44 -0500 Received: from mga11.intel.com ([192.55.52.93]:59254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlAsc-0006gt-D6 for qemu-devel@nongnu.org; Thu, 11 Nov 2021 09:16:44 -0500 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2021 06:16:40 -0800 Received: from chaop.bj.intel.com ([10.240.192.101]) by orsmga007.jf.intel.com with ESMTP; 11 Nov 2021 06:16:29 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10164"; a="230378286" X-IronPort-AV: E=Sophos;i="5.87,226,1631602800"; d="scan'208";a="230378286" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,226,1631602800"; d="scan'208";a="492556158" From: Chao Peng To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, qemu-devel@nongnu.org Subject: [RFC PATCH 10/13] softmmu/physmem: Add private memory address space Date: Thu, 11 Nov 2021 22:13:49 +0800 Message-Id: <20211111141352.26311-11-chao.p.peng@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211111141352.26311-1-chao.p.peng@linux.intel.com> References: <20211111141352.26311-1-chao.p.peng@linux.intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=192.55.52.93; envelope-from=chao.p.peng@linux.intel.com; helo=mga11.intel.com X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wanpeng Li , jun.nakajima@intel.com, david@redhat.com, "J . Bruce Fields" , dave.hansen@intel.com, "H . Peter Anvin" , Chao Peng , ak@linux.intel.com, Jonathan Corbet , Joerg Roedel , x86@kernel.org, Hugh Dickins , Ingo Molnar , Borislav Petkov , luto@kernel.org, Thomas Gleixner , Vitaly Kuznetsov , Jim Mattson , Sean Christopherson , susie.li@intel.com, Jeff Layton , john.ji@intel.com, Yu Zhang , Paolo Bonzini , Andrew Morton , "Kirill A . Shutemov" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1636640996149100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Chao Peng --- include/exec/address-spaces.h | 2 ++ softmmu/physmem.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/exec/address-spaces.h b/include/exec/address-spaces.h index db8bfa9a92..b3f45001c0 100644 --- a/include/exec/address-spaces.h +++ b/include/exec/address-spaces.h @@ -27,6 +27,7 @@ * until a proper bus interface is available. */ MemoryRegion *get_system_memory(void); +MemoryRegion *get_system_private_memory(void); =20 /* Get the root I/O port region. This interface should only be used * temporarily until a proper bus interface is available. @@ -34,6 +35,7 @@ MemoryRegion *get_system_memory(void); MemoryRegion *get_system_io(void); =20 extern AddressSpace address_space_memory; +extern AddressSpace address_space_private_memory; extern AddressSpace address_space_io; =20 #endif diff --git a/softmmu/physmem.c b/softmmu/physmem.c index f4d6eeaa17..a2d339fd88 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -85,10 +85,13 @@ RAMList ram_list =3D { .blocks =3D QLIST_HEAD_INITIALIZER(ram_list.blocks)= }; =20 static MemoryRegion *system_memory; +static MemoryRegion *system_private_memory; static MemoryRegion *system_io; =20 AddressSpace address_space_io; AddressSpace address_space_memory; +AddressSpace address_space_private_memory; + =20 static MemoryRegion io_mem_unassigned; =20 @@ -2669,6 +2672,11 @@ static void memory_map_init(void) memory_region_init(system_memory, NULL, "system", UINT64_MAX); address_space_init(&address_space_memory, system_memory, "memory"); =20 + system_private_memory =3D g_malloc(sizeof(*system_private_memory)); + + memory_region_init(system_private_memory, NULL, "system-private", UINT= 64_MAX); + address_space_init(&address_space_private_memory, system_private_memor= y, "private-memory"); + system_io =3D g_malloc(sizeof(*system_io)); memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io", 65536); @@ -2680,6 +2688,11 @@ MemoryRegion *get_system_memory(void) return system_memory; } =20 +MemoryRegion *get_system_private_memory(void) +{ + return system_private_memory; +} + MemoryRegion *get_system_io(void) { return system_io; --=20 2.17.1