From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5DD0C54EE9 for ; Tue, 20 Sep 2022 23:20:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.409602.652596 (Exim 4.92) (envelope-from ) id 1oamXO-0005DS-Hv; Tue, 20 Sep 2022 23:20:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 409602.652596; Tue, 20 Sep 2022 23:20:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oamXO-0005DL-FG; Tue, 20 Sep 2022 23:20:22 +0000 Received: by outflank-mailman (input) for mailman id 409602; Tue, 20 Sep 2022 23:20:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oamXN-0005DF-2z for xen-devel@lists.xenproject.org; Tue, 20 Sep 2022 23:20:21 +0000 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [2a00:1450:4864:20::635]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cb08ac5d-393a-11ed-9647-05401a9f4f97; Wed, 21 Sep 2022 01:20:19 +0200 (CEST) Received: by mail-ej1-x635.google.com with SMTP id a26so9833673ejc.4 for ; Tue, 20 Sep 2022 16:20:19 -0700 (PDT) Received: from [127.0.0.1] (dynamic-078-054-006-055.78.54.pool.telefonica.de. [78.54.6.55]) by smtp.gmail.com with ESMTPSA id er12-20020a056402448c00b0044ee91129f9sm629755edb.70.2022.09.20.16.20.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Sep 2022 16:20:18 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cb08ac5d-393a-11ed-9647-05401a9f4f97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date; bh=GtMxYIRvAVAlD5MIJW3CMU+hdQDh/A1FNoJWhhLH0qE=; b=pm+buGeFehD8BASPCqH113rGynSJwN6wxPzkq6dds4CXX+4p5I3dBJkJJS01RL+Tai jXH2C6g6rtblZqjB1SsUvwxyKHQi8PI5uw0Y+ftr+xqd8CxhaxojBqt0sbvWrNQ3QgwT HPi85aRbWX3nCZ/mx03/0M4ol+mefKDFl/abg2tUrRmQyeLI6HGQ8OT1RcyuobJttOxN tv9FNW7Rw6H99aA2h0obQ/oBQ2ZcBAUOcOrWNRg7zTAeetnuaOg44KKGVxIGps1+/op4 BKH/r6CYUtGxJTGZtHM13rOeRwpoBPxI5vWiYm45neZhCA9By3jialVV75S3lBm/f6Ct DOpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=GtMxYIRvAVAlD5MIJW3CMU+hdQDh/A1FNoJWhhLH0qE=; b=oin8XeziYvdGIKVJv3pWzVvwCIRi0TpZ7bZZhSeFuFHbS6khD6MZPYi5HiWjRgxwHr cx4kGHNvwrYKiUonMdkfp+MgYYDddIFauGh1QyzaNCsNjAjaEX44Frc0qXPYFdEAmH2f 0xz2+3omdJLUdZIfWicI8KPHmnewJmag0vVCar0G+bEuftBGauqGq6Vr8zHUKsQKD4ai fk5Dexv7+Uo8fiWi7MS/sYUZyrhRwtmGKRdiH6/TbfYz4JH4pNQ5MW9lnRCuM0nh0Vr7 7WFEeDqbHhgLvReeQgbGI7lTtt6dhM1DrbUZ4KUYt1WuKh4ecKgNnoHHer5+GWb+q6kL VKyA== X-Gm-Message-State: ACrzQf3vqYBEth8fmupHNtUvkoGke9TSmlUaTeoZhrVn6HbwMT7/o64T 0gw0MpuEZouCcF3F+aC5tGU= X-Google-Smtp-Source: AMsMyM6/qMtYXfOb9sMZlghUptjRyYcuSU6AakPT4+aCBhB0cHXdoKH/wQKSzUALkR93qIrs+7A3TQ== X-Received: by 2002:a17:907:1690:b0:77c:37be:2345 with SMTP id hc16-20020a170907169000b0077c37be2345mr18459194ejc.359.1663716019170; Tue, 20 Sep 2022 16:20:19 -0700 (PDT) Date: Tue, 20 Sep 2022 23:20:11 +0000 From: Bernhard Beschow To: BALATON Zoltan , =?ISO-8859-1?Q?Philippe_Mathieu-Daud=E9?= CC: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Magnus Damm , Aleksandar Rikalo , Bandan Das , Matthew Rosato , Daniel Henrique Barboza , Sergio Lopez , Alexey Kardashevskiy , Xiaojuan Yang , Cameron Esfahani , Michael Rolnik , Song Gao , Jagannathan Raman , Greg Kurz , Kamil Rytarowski , Peter Xu , Joel Stanley , Alistair Francis , "Dr. David Alan Gilbert" , Paolo Bonzini , haxm-team@intel.com, Roman Bolshakov , Markus Armbruster , Eric Auger , David Gibson , =?ISO-8859-1?Q?Daniel_P=2E_Berrang=E9?= , Christian Borntraeger , =?ISO-8859-1?Q?C=E9dric_Le_Goater?= , Stefan Hajnoczi , qemu-block@nongnu.org, Eduardo Habkost , =?ISO-8859-1?Q?Herv=E9_Poussineau?= , qemu-ppc@nongnu.org, Cornelia Huck , Palmer Dabbelt , Helge Deller , Stefano Stabellini , qemu-riscv@nongnu.org, Stafford Horne , Paul Durrant , Havard Skinnemoen , Elena Ufimtseva , Alexander Graf , Thomas Huth , Alex Williamson , Wenchao Wang , Tony Krowiak , Marcel Apfelbaum , qemu-s390x@nongnu.org, =?ISO-8859-1?Q?Marc-Andr=E9_Lureau?= , Mark Cave-Ayland , Eric Farman , Reinoud Zandijk , Alexander Bulekov , Yanan Wang , "Edgar E. Iglesias" , Gerd Hoffmann , Tyrone Ting , xen-devel@lists.xenproject.org, Yoshinori Sato , John Snow , Richard Henderson , Darren Kenny , kvm@vger.kernel.org, Qiuhao Li , John G Johnson , Bin Meng , Sunil Muthuswamy , Max Filippov , qemu-arm@nongnu.org, Marcelo Tosatti , Peter Maydell , Anthony Perard , Andrew Jeffery , Artyom Tarasenko , Halil Pasic , "Maciej S. Szmigiero" , Jason Wang , David Hildenbrand , Laurent Vivier , Alistair Francis , Jason Herne Subject: Re: [PATCH 9/9] exec/address-spaces: Inline legacy functions In-Reply-To: <7411d60-2bc0-f927-752-56184958c790@eik.bme.hu> References: <20220919231720.163121-1-shentey@gmail.com> <20220919231720.163121-10-shentey@gmail.com> <7411d60-2bc0-f927-752-56184958c790@eik.bme.hu> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 20=2E September 2022 09:02:41 UTC schrieb BALATON Zoltan : > > >On Tue, 20 Sep 2022, Philippe Mathieu-Daud=C3=A9 via wrote: > >> On 20/9/22 01:17, Bernhard Beschow wrote: >>> The functions just access a global pointer and perform some pointer >>> arithmetic on top=2E Allow the compiler to see through this by inlinin= g=2E >>=20 >> I thought about this while reviewing the previous patch, =2E=2E=2E >>=20 >>> Signed-off-by: Bernhard Beschow >>> --- >>> include/exec/address-spaces=2Eh | 30 ++++++++++++++++++++++++++---- >>> softmmu/physmem=2Ec | 28 ---------------------------- >>> 2 files changed, 26 insertions(+), 32 deletions(-) >>>=20 >>> diff --git a/include/exec/address-spaces=2Eh b/include/exec/address-sp= aces=2Eh >>> index b31bd8dcf0=2E=2E182af27cad 100644 >>> --- a/include/exec/address-spaces=2Eh >>> +++ b/include/exec/address-spaces=2Eh >>> @@ -23,29 +23,51 @@ >>> #ifndef CONFIG_USER_ONLY >>> +#include "hw/boards=2Eh" >>=20 >> =2E=2E=2E but I'm not a fan of including this header here=2E It is rest= ricted to system emulation, but still=2E=2E=2E Let see what the others thin= k=2E > >Had the same thought first if this would break user emulation but I don't= know how that works (and this include is withing !CONFIG_USER_ONLY)=2E I'v= e checked in configure now and it seems that softmmu is enabled/disabled wi= th system, which reminded me to a previous conversation where I've suggeste= d renaming softmmu to sysemu as that better shows what it's really used for= and maybe the real softmmu part should be split from it but I don't rememb= er the details=2E If it still works with --enable-user --disable-system the= n maybe it's OK and only confusing because of misnaming sysemu as softmmu= =2E I've compiled all architectures w/o any --{enable,disable}-{user,system} f= lags and I had compile errors only when putting the include outside the gua= rd=2E So this in particular doesn't seem to be a problem=2E Best regards, Bernhard > >Reagrds, >BALATON Zoltan > >>> /** >>> * Get the root memory region=2E This is a legacy function, provide= d for >>> * compatibility=2E Prefer using SysBusState::system_memory directly= =2E >>> */ >>> -MemoryRegion *get_system_memory(void); >>> +inline MemoryRegion *get_system_memory(void) >>> +{ >>> + assert(current_machine); >>> + >>> + return ¤t_machine->main_system_bus=2Esystem_memory; >>> +} >>> /** >>> * Get the root I/O port region=2E This is a legacy function, provi= ded for >>> * compatibility=2E Prefer using SysBusState::system_io directly=2E >>> */ >>> -MemoryRegion *get_system_io(void); >>> +inline MemoryRegion *get_system_io(void) >>> +{ >>> + assert(current_machine); >>> + >>> + return ¤t_machine->main_system_bus=2Esystem_io; >>> +} >>> /** >>> * Get the root memory address space=2E This is a legacy function, = provided for >>> * compatibility=2E Prefer using SysBusState::address_space_memory d= irectly=2E >>> */ >>> -AddressSpace *get_address_space_memory(void); >>> +inline AddressSpace *get_address_space_memory(void) >>> +{ >>> + assert(current_machine); >>> + >>> + return ¤t_machine->main_system_bus=2Eaddress_space_memory; >>> +} >>> /** >>> * Get the root I/O port address space=2E This is a legacy function= , provided >>> * for compatibility=2E Prefer using SysBusState::address_space_io d= irectly=2E >>> */ >>> -AddressSpace *get_address_space_io(void); >>> +inline AddressSpace *get_address_space_io(void) >>> +{ >>> + assert(current_machine); >>> + >>> + return ¤t_machine->main_system_bus=2Eaddress_space_io; >>> +} >>> #endif >>> diff --git a/softmmu/physmem=2Ec b/softmmu/physmem=2Ec >>> index 07e9a9171c=2E=2Edce088f55c 100644 >>> --- a/softmmu/physmem=2Ec >>> +++ b/softmmu/physmem=2Ec >>> @@ -2674,34 +2674,6 @@ static void memory_map_init(SysBusState *sysbus= ) >>> address_space_init(&sysbus->address_space_io, system_io, "I/O"); >>> } >>> -MemoryRegion *get_system_memory(void) >>> -{ >>> - assert(current_machine); >>> - >>> - return ¤t_machine->main_system_bus=2Esystem_memory; >>> -} >>> - >>> -MemoryRegion *get_system_io(void) >>> -{ >>> - assert(current_machine); >>> - >>> - return ¤t_machine->main_system_bus=2Esystem_io; >>> -} >>> - >>> -AddressSpace *get_address_space_memory(void) >>> -{ >>> - assert(current_machine); >>> - >>> - return ¤t_machine->main_system_bus=2Eaddress_space_memory; >>> -} >>> - >>> -AddressSpace *get_address_space_io(void) >>> -{ >>> - assert(current_machine); >>> - >>> - return ¤t_machine->main_system_bus=2Eaddress_space_io; >>> -} >>> - >>> static void invalidate_and_set_dirty(MemoryRegion *mr, hwaddr addr, >>> hwaddr length) >>> { >>=20 >>=20 >>=20