Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5365685pxb; Wed, 19 Jan 2022 17:10:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzi/Z07o1jIo44kPEHg7h1CDpfKUMFXVcUZ2jwBwBOBXk2udESfABjrZLy9vu5Z0k7LJP+c X-Received: by 2002:a17:90a:1c01:: with SMTP id s1mr7715013pjs.233.1642641028148; Wed, 19 Jan 2022 17:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642641028; cv=none; d=google.com; s=arc-20160816; b=YN5TRT8hCLlrGxg3/VDixDw0q6urX1qBrO01n1wZ5kyxUke7gJ19ArNCQOcYOa+crk mXW6SEW7yu0EFkrlpoRC6QEyJ2i3k52qvFHKfVShnu/SLqd77BBWwkEDg+bl9fxdfzo5 XzOtGpd1pbGnRArXsnHzVdbrKDlYKD/CyuAr89f+aBnTpJ5HV9/Yu2o1Km/bqBmfAb5z Vb5rF4ilpunG5aQfc0nfgO46ntPBLMkixoEN7mmrRSOH1xfocBH+i4ecXeW5oK32Mg/0 riZvKBJTlBWCVjtnAQuIa0kPKuWhQ/yNZmRjRYZqVbzJWDHCQKKCYStvygLzb43yAsHV /LPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=iFgNmHuHt5y/j3H8Tutu8lSHsdboxVy4VCgXSl8Gp+c=; b=EwV6EErthbo9FUy3IW2Yk8jRiaiYLLVRtSnp2FRzpFIGL6qquEyMn1yAHUQeu3zDIZ NzWRsvn73S1UFC1dOe2u/8gEEboAa3O9X6GKJV7yYWE8C9Yh+/elefz8EPDGRfVezTcn hPOPQkNtB5KoKlrfn+aYLw4dGaU3i34KdlmlQ/+W88saJsdbLmdphEWKAKLZXdHl6kG3 W3esdx0zuwjZ6bgNaCtyUuahc2SDbIRcaK3tH8i3w+hvI2Xa3OlG+pujyGaesCq0R0y7 BBh7MEZvMrfmrsBwJcQ/2w7DN8UXqCVXXZLK5GebpiinNJFIXpRoUuyaeRts+RS4ynR7 LJNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e4Voc0fM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amsat.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si1767975plh.314.2022.01.19.17.10.16; Wed, 19 Jan 2022 17:10:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e4Voc0fM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amsat.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232653AbiARJlX (ORCPT + 99 others); Tue, 18 Jan 2022 04:41:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiARJlU (ORCPT ); Tue, 18 Jan 2022 04:41:20 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 944ACC061574; Tue, 18 Jan 2022 01:41:20 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id w26so26294503wmi.0; Tue, 18 Jan 2022 01:41:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=iFgNmHuHt5y/j3H8Tutu8lSHsdboxVy4VCgXSl8Gp+c=; b=e4Voc0fMOqW5qm9lcEfLiDnhnQlQ6ZFzbAF5cwxJ5mcDpg1XMC/Vyh+ISO1xjBLFHn OZBmu2WBQ32xYA5gY6rZ5u/wY0gIMbMOaCXhmxdWEL/YktAbkUhPn0sBgNnD6WBfO4DZ 3lgS5FAKp1slZEpEdZdF1kvBqji5sCHgY1Z5VYVRUY5XCBAh4H+zmAMqkWOKBen3pCKS 2xp25/UlpA2npVVRg0Krh4ljjtJgh7O4WBzK2+ajjOeLfP6kc35kOL5O3XeLGrYVEt5e +OOlNWim2KvAfRD1p+w92PjKRBI7tqlc3+o8+GuaLoT3fyKPHPFgTwxzDUtGyu1OKYTj y4Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=iFgNmHuHt5y/j3H8Tutu8lSHsdboxVy4VCgXSl8Gp+c=; b=atcAkC9mnci5kNM9gmNnlk0Ni14vVJUA31kP/Ch6m+S0ufatAy3YG8MxtKRIaaK3nH XqeBbh10U++lqbYjsKHZ/bOR8YlWpd76edSLYgtgBdStRKDSPRDCCFeVe2j65AFJxxYU lcyKNXWFf1bSskToyGeh5v+qlwb2SeLeqtYjoMcREPeImG6oqMn93cD0g6BJlqrjaymc 85bq8rgS8iZe9EhssBqkyq5LMMaQjC9P+18uecP7KSHqsTEcn4IWntO0r2ZnV/+WxTmP z9lS+whu8quyYViFroKWctyKH1HxlcSPeQasFJICQQzAKizjG50643aF5OdfHStThHcH HDig== X-Gm-Message-State: AOAM531nOHqpJVOXwkBnfOIYEmvRF+RkG9yo0LZvcbJw2zZHDNNZ6V9u LYCJgftGRqdOuroyMcHFMbc= X-Received: by 2002:a1c:1f82:: with SMTP id f124mr888011wmf.157.1642498879254; Tue, 18 Jan 2022 01:41:19 -0800 (PST) Received: from [192.168.1.40] (154.red-83-50-83.dynamicip.rima-tde.net. [83.50.83.154]) by smtp.gmail.com with ESMTPSA id v13sm18556810wro.90.2022.01.18.01.41.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jan 2022 01:41:18 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Message-ID: <0ea887e9-1fd4-1962-cbaa-92b648b28b53@amsat.org> Date: Tue, 18 Jan 2022 10:41:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [RFC PATCH 10/13] softmmu/physmem: Add private memory address space Content-Language: en-US To: Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, qemu-devel@nongnu.org Cc: Wanpeng Li , jun.nakajima@intel.com, david@redhat.com, "J . Bruce Fields" , dave.hansen@intel.com, "H . Peter Anvin" , 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" References: <20211111141352.26311-1-chao.p.peng@linux.intel.com> <20211111141352.26311-11-chao.p.peng@linux.intel.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20211111141352.26311-11-chao.p.peng@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/11/21 15:13, Chao Peng wrote: > 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); > > /* 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); > > extern AddressSpace address_space_memory; > +extern AddressSpace address_space_private_memory; > extern AddressSpace address_space_io; > > #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 = { .blocks = QLIST_HEAD_INITIALIZER(ram_list.blocks) }; > > static MemoryRegion *system_memory; > +static MemoryRegion *system_private_memory; > static MemoryRegion *system_io; > > AddressSpace address_space_io; > AddressSpace address_space_memory; > +AddressSpace address_space_private_memory; > + > > static MemoryRegion io_mem_unassigned; > > @@ -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"); > > + system_private_memory = g_malloc(sizeof(*system_private_memory)); > + > + memory_region_init(system_private_memory, NULL, "system-private", UINT64_MAX); > + address_space_init(&address_space_private_memory, system_private_memory, "private-memory"); Since the description is quite scarce, I don't understand why we need to add this KVM specific "system-private" MR/AS to all machines on all architectures. > system_io = g_malloc(sizeof(*system_io)); > memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io", > 65536); (We already want to get ride of the "io" MR/AS which is specific to x86 or machines). > @@ -2680,6 +2688,11 @@ MemoryRegion *get_system_memory(void) > return system_memory; > } > > +MemoryRegion *get_system_private_memory(void) > +{ > + return system_private_memory; > +} > + > MemoryRegion *get_system_io(void) > { > return system_io;