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 X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86C98C10DCE for ; Sun, 15 Mar 2020 22:25:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 476DB206B1 for ; Sun, 15 Mar 2020 22:25:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DTbziD03" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 476DB206B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDbh9-0004Ug-2S for qemu-devel@archiver.kernel.org; Sun, 15 Mar 2020 18:25:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37827) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDbcn-00032U-32 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 18:20:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDbcl-0001fN-KH for qemu-devel@nongnu.org; Sun, 15 Mar 2020 18:20:48 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:56255 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDbcl-0001b4-FH for qemu-devel@nongnu.org; Sun, 15 Mar 2020 18:20:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584310847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y2D7bkdwvbndMrUyNh6sDviBz4171BxInLQo0HF5lyY=; b=DTbziD03Wqy4fXYy1V/0eODE2f6WtyH0/iiz+CTxemDxrhi5RSr3RITi2OBTsu9n8Q2vc2 2oHhV2q1yTTVR3ZAn3vCxR/J/Q7NUmnb1r1DpWPZOQGx7s9FJXnDsiOuXNwRo7GiN95qWa 8M76/iCCYvrKtD8dnSrJQWIqcAH7mAk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145-q2kg3AAHOKW1LD9bmFb1eA-1; Sun, 15 Mar 2020 18:20:45 -0400 X-MC-Unique: q2kg3AAHOKW1LD9bmFb1eA-1 Received: by mail-wm1-f71.google.com with SMTP id s15so2519001wmc.0 for ; Sun, 15 Mar 2020 15:20:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jli2nez5UekOBc427wJHMKwGcjgVsf+7alJp/mq+nCI=; b=hru0K/04bYCMh1GdhjdSfrJRt95cTQEMnRNgAqTRTcMt4B3vsVwY444wocmpyL2qYy OooNnqjbVGoL7HlqmYJvuGC2uRo9vvfjAwJTIFWUp8vMbL+o3B0+m5RcP75CHHcu7wfa YOCwIh4sp4CbNF5PHwCxNlQyJ0qkcm7F4svXdk1Pis0smBKYrMCzh1JYKq2OODGVWLBD P5nq8Mzr8hx56iWF379CLPp2RIoqVyb2poOFR5FE7OWKi4iriIVbzGlDuOKAuahu7GJp 1bOUXTvTzvuYDCBH29fL6zziyMoRSm8kqak/1dOOfrj5mx3WG9th1osW+bJbBNIvQhp0 IKfQ== X-Gm-Message-State: ANhLgQ1nuPUFW9cqEsZA+QBpQ2jB3qyJKT8/Zl6IuXOJ5WGe84bUN+mK YA92cAULnzFZdagtolTPvsHYpnwbwTzWhimw2IZQN+3p5HEQ0hBww0mAgKZazRn8Oe6Vtcl87zR Uy8c9shjV3+rnXiQ= X-Received: by 2002:a05:6000:10c6:: with SMTP id b6mr8106423wrx.130.1584310844204; Sun, 15 Mar 2020 15:20:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs6KxVepLGqG+3FvdCYOFEixDOrgXfo9SUxpugF5dxHBxknKmVnV7QCaGv3YG5nhvVlnzHbwA== X-Received: by 2002:a05:6000:10c6:: with SMTP id b6mr8106393wrx.130.1584310843984; Sun, 15 Mar 2020 15:20:43 -0700 (PDT) Received: from [192.168.1.40] (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id c2sm27522294wma.39.2020.03.15.15.20.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Mar 2020 15:20:43 -0700 (PDT) Subject: Re: [PATCH 09/14] exec: Drop redundant #ifdeffery To: Richard Henderson , qemu-devel@nongnu.org References: <20200313183652.10258-1-philmd@redhat.com> <20200313183652.10258-10-philmd@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Sun, 15 Mar 2020 23:20:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Alistair Francis , qemu-riscv@nongnu.org, Eduardo Habkost , Sagar Karandikar , David Hildenbrand , Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Palmer Dabbelt , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 3/15/20 9:39 PM, Richard Henderson wrote: > On 3/13/20 11:36 AM, Philippe Mathieu-Daud=C3=A9 wrote: >> Signed-off-by: Philippe Mathieu-Daud=C3=A9 >> --- >> exec.c | 4 ---- >> 1 file changed, 4 deletions(-) >> >> diff --git a/exec.c b/exec.c >> index 7bc9828c5b..f258502966 100644 >> --- a/exec.c >> +++ b/exec.c >> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot { >> unsigned long dirty[]; >> }; >> =20 >> -#endif >> - >> -#if !defined(CONFIG_USER_ONLY) >> - >> static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes) >> { >> static unsigned alloc_hint =3D 16; >> >=20 > There's even more than that. Looking further down, >=20 >> 745 #endif >> 746 >> 747 #if !defined(CONFIG_USER_ONLY) >=20 > This is the #endif that paired with the one at 190. >=20 > Later, >=20 >> 988 #if defined(CONFIG_USER_ONLY) > ... >> 1000 #else > ... >> 1031 #endif >> 1032 >> 1033 #ifndef CONFIG_USER_ONLY >=20 > So those three lines are redundant. >=20 > Later, >=20 >> 1252 #if !defined(CONFIG_USER_ONLY) > ... >> 1438 #endif /* defined(CONFIG_USER_ONLY) */ >> 1439 >> 1440 #if !defined(CONFIG_USER_ONLY) >=20 > Clearly these ifdefs are very hard to follow. I would thus welcome a spl= it of > this file. >=20 > Possibly into exec-common.c (with functions present in both softmmu and > user-only, with ifdefs *inside* functions only), and exec-system.c (with = no > /#if.*CONFIG_USER_ONLY/). >=20 > But exec.c is over 4000 lines, so if there's another logical split into e= ven > more files, that would be even better. OK, I am taking notes for the 5.0 cycle. We can drop this patch for this series objective, as it is mostly cosmetic. >=20 >=20 > r~ >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jDbcr-000335-DJ for mharc-qemu-riscv@gnu.org; Sun, 15 Mar 2020 18:20:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37815) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDbcm-00032P-N1 for qemu-riscv@nongnu.org; Sun, 15 Mar 2020 18:20:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDbcl-0001eW-H5 for qemu-riscv@nongnu.org; Sun, 15 Mar 2020 18:20:48 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:56303 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDbcl-0001ZO-9w for qemu-riscv@nongnu.org; Sun, 15 Mar 2020 18:20:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584310846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y2D7bkdwvbndMrUyNh6sDviBz4171BxInLQo0HF5lyY=; b=hP5LgxDDtKidkMd0wxZbcDsg+nF+IRCq5TeuUxiMNC/YlycBLP5tVNUacaupkiR3/dkNkg qfeySuK45E3Ajx7vV1ptf/9hWfS2B8h95ZkEGNPIchGL2kPDssX3OItO4evjWx3zda3yLD tQ5agTWT3HOr93Z2LsUTvcMyIzfX9Zg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-JIaEPWZrNj-yVB16c-5apw-1; Sun, 15 Mar 2020 18:20:45 -0400 X-MC-Unique: JIaEPWZrNj-yVB16c-5apw-1 Received: by mail-wm1-f71.google.com with SMTP id i24so2972359wml.1 for ; Sun, 15 Mar 2020 15:20:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jli2nez5UekOBc427wJHMKwGcjgVsf+7alJp/mq+nCI=; b=iR97m9seu6UTke/7lXILuCztCKBvIALTZlH1LUdpaIfhJJ4qfO7H2pRIoIF7/Jt/ym SCzysgvaSNyXYlDrKiB+Dk8I364sTiEtENANIZZjmDB9RWHe8gHxKQODLnhmIjhH2roA lMPnq1ywFKMd3mlpE3GDB2S55mUG/zJyoCZFdHy8R8qPJIp1F0K/NKRcZwci8iMmG/3s uQkn+1W0LdcNiFxtp2Y22wb6tBix3Z1bfpo7s8dlm20GEbJQdciN6L2A0ozlTjh8ePh/ U1RodD3yTxuS3oAB3QZ1lfXORHcX4jaRE3csy3IMIK9ep/+J68ibwWFLgbIKqO9ckrBx 9WAg== X-Gm-Message-State: ANhLgQ1Zjwbv0NEWWAxKhqiWqVpCcSisWPWlYlW7DzLZJyNf1NAbYWlS vtXciFE27XO2SdDpZiXmICeRVjXmZbuYN3d5zD+XLKKaaB2SBbYeEmK2FfAwEHjhHzTWKFfLkqv 3M0llo3IKbZOefjY= X-Received: by 2002:a05:6000:10c6:: with SMTP id b6mr8106425wrx.130.1584310844210; Sun, 15 Mar 2020 15:20:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs6KxVepLGqG+3FvdCYOFEixDOrgXfo9SUxpugF5dxHBxknKmVnV7QCaGv3YG5nhvVlnzHbwA== X-Received: by 2002:a05:6000:10c6:: with SMTP id b6mr8106393wrx.130.1584310843984; Sun, 15 Mar 2020 15:20:43 -0700 (PDT) Received: from [192.168.1.40] (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id c2sm27522294wma.39.2020.03.15.15.20.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Mar 2020 15:20:43 -0700 (PDT) Subject: Re: [PATCH 09/14] exec: Drop redundant #ifdeffery To: Richard Henderson , qemu-devel@nongnu.org Cc: Peter Maydell , qemu-riscv@nongnu.org, Eduardo Habkost , Sagar Karandikar , David Hildenbrand , Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Alistair Francis , David Gibson , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Palmer Dabbelt , Richard Henderson References: <20200313183652.10258-1-philmd@redhat.com> <20200313183652.10258-10-philmd@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Sun, 15 Mar 2020 23:20:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Mar 2020 22:20:51 -0000 On 3/15/20 9:39 PM, Richard Henderson wrote: > On 3/13/20 11:36 AM, Philippe Mathieu-Daud=C3=A9 wrote: >> Signed-off-by: Philippe Mathieu-Daud=C3=A9 >> --- >> exec.c | 4 ---- >> 1 file changed, 4 deletions(-) >> >> diff --git a/exec.c b/exec.c >> index 7bc9828c5b..f258502966 100644 >> --- a/exec.c >> +++ b/exec.c >> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot { >> unsigned long dirty[]; >> }; >> =20 >> -#endif >> - >> -#if !defined(CONFIG_USER_ONLY) >> - >> static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes) >> { >> static unsigned alloc_hint =3D 16; >> >=20 > There's even more than that. Looking further down, >=20 >> 745 #endif >> 746 >> 747 #if !defined(CONFIG_USER_ONLY) >=20 > This is the #endif that paired with the one at 190. >=20 > Later, >=20 >> 988 #if defined(CONFIG_USER_ONLY) > ... >> 1000 #else > ... >> 1031 #endif >> 1032 >> 1033 #ifndef CONFIG_USER_ONLY >=20 > So those three lines are redundant. >=20 > Later, >=20 >> 1252 #if !defined(CONFIG_USER_ONLY) > ... >> 1438 #endif /* defined(CONFIG_USER_ONLY) */ >> 1439 >> 1440 #if !defined(CONFIG_USER_ONLY) >=20 > Clearly these ifdefs are very hard to follow. I would thus welcome a spl= it of > this file. >=20 > Possibly into exec-common.c (with functions present in both softmmu and > user-only, with ifdefs *inside* functions only), and exec-system.c (with = no > /#if.*CONFIG_USER_ONLY/). >=20 > But exec.c is over 4000 lines, so if there's another logical split into e= ven > more files, that would be even better. OK, I am taking notes for the 5.0 cycle. We can drop this patch for this series objective, as it is mostly cosmetic. >=20 >=20 > r~ >=20