From nobody Thu Nov 28 02:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1679615230; cv=none; d=zohomail.com; s=zohoarc; b=fesEjwNtjLysw1WQi+mQCNTiDz58Zyj0WZqUgbSQakw2S8rWdu9FRIXhPXqDuEhX2CUGdBBBr+iU2s7IpgUSuK4FEahUW/r2O6mL4R8JHtS861VDokI/cvWa8dTkVBy929Y6An5j8DER7JaBxbAAAXvSb1otzpHvQC77X97v1bo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679615230; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=p3Evj6aP9fVKGcnDlT8c6VOxZJchvmW1KukSl/8SRBg=; b=OVcWASg7aE/05J5ty2/vD0DF4u/3eB0fRdriZpF5vZdvk9MVNAoqEpeGx8txcDWJJJ7Ja/eOm1mR22RkLnKPwKEXIBMs0jSHiFzdkvUYPkgPGnDoZ1yvuwUQ41JA37QMpzeeJ1k0S6++h3AwVE1Znhtjz3LmR10ch0rKI8sDtbY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 167961523032410.417219935518574; Thu, 23 Mar 2023 16:47:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.514106.796075 (Exim 4.92) (envelope-from ) id 1pfUdo-0005pA-5A; Thu, 23 Mar 2023 23:46:44 +0000 Received: by outflank-mailman (output) from mailman id 514106.796075; Thu, 23 Mar 2023 23:46:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pfUdo-0005p3-25; Thu, 23 Mar 2023 23:46:44 +0000 Received: by outflank-mailman (input) for mailman id 514106; Thu, 23 Mar 2023 23:46:42 +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 1pfUdm-0005ox-B9 for xen-devel@lists.xenproject.org; Thu, 23 Mar 2023 23:46:42 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f346c116-c9d4-11ed-85db-49a42c6b2330; Fri, 24 Mar 2023 00:46:40 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f346c116-c9d4-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1679615200; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MnU/WGWktkDUHHsW9r8YWjgsy8o+oR4Jpo7vpNNYvzs=; b=Obg4E+xmYh1b1yfgKL3q2gx7v6UGR6LutzNXkCb9QwJnq/Mz7sbJjxJG 4ZhwyRV6chOLt6BNNBPPUJr6DKB632+P9T6/tu0liT9lx7z7CU42dcNSq /OmIuhHdhnXjZ3zYfXM0Vnhp6yKhAZZJQc7qT3Lo77654FKmeSIGP92/j 4=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 104524112 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:slKeCKMowQ2L7JLvrR3Zl8FynXyQoLVcMsEvi/4bfWQNrUor3zBRy mZNDGzSbvqIMzamLot/bIu+9h9QuZKBztVmSAto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvLrRC9H5qyo42tD5AdmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0t9MK0QR6 PtbETkIQwmzq+mU5LmdZuY506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w2Nk+ojx5nYz/7DLoXmuuyi2a5WDpfsF+P/oI84nTJzRw327/oWDbQUoXSGZgPwh/B/ Aoq+UzhBikrJuag8ACr7yutgrXDozvmet8NQejQGvlC3wTImz175ActfUS/iem0jAi5Qd03A 1wZ/G8ioLY/8GSvT8LhRFuorXicpBkeVtFMVeog52ml6IDZ/gKYDWgsVSNaZZots8peeNAx/ gbXxZWzX2Up6eDLDyvHrd94sA9eJwAsFkUnOjIDDjIM5vT6kK04rDbEaPpsRfvdYsLOJd3g/ 9ybhHFg2ORI05Nbjv7TEUPv2Gz1+MWQJuIhzkCOBz/+sFskDGKwT9bwgWU3+8qsO2pworOpm HEf0/aT4+kVZX1mvHzcGb5ddF1FChvsDdE9vbKMN8N7n9hV0yT/Fb28GRknTKuTDu4KeCXyf GjYsh5L6ZlYMROCNPEoMt/gVZlylPa+SbwJs8w4ifIQCqWdiSfdpH0+DaJu9zmFfLcQfVEXZ s7ALJfE4YcyAqV71jumL9ogPUsQ7nlmnwv7HMmrpylLJJLCPBZ5v59ZagrRBg34hYvYyDjoH yF3bpXbm0sCCryuMkE6M+c7dDg3EJTyPriuw+Q/SwJJClMO9L0JYxMJ/Y4cRg== IronPort-HdrOrdr: A9a23:iv9aVqHePZSWuoAdpLqE7MeALOsnbusQ8zAXPidKOHtom62j5q STdZEgviMc5wx8ZJhNo7+90cq7IU80l6Qa3WB5B97LNmTbUQCTTb1K3M/PxCDhBj271sM179 YET0GmMqySMbGtt7eZ3DWF X-IronPort-AV: E=Sophos;i="5.98,286,1673931600"; d="scan'208";a="104524112" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH] x86/shadow: Fix build with no PG_log_dirty Date: Thu, 23 Mar 2023 23:46:21 +0000 Message-ID: <20230323234621.2591154-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1679615232474100001 Gitlab Randconfig found: arch/x86/mm/shadow/common.c: In function 'shadow_prealloc': arch/x86/mm/shadow/common.c:1023:18: error: implicit declaration of funct= ion 'paging_logdirty_levels'; did you mean 'paging_log_dirty_init'? [-Wer= ror=3Dimplicit-function-declaration] 1023 | count +=3D paging_logdirty_levels(); | ^~~~~~~~~~~~~~~~~~~~~~ | paging_log_dirty_init arch/x86/mm/shadow/common.c:1023:18: error: nested extern declaration of = 'paging_logdirty_levels' [-Werror=3Dnested-externs] Move the declaration outside of #if PG_log_dirty. Fixes: 33fb3a661223 ("x86/shadow: account for log-dirty mode when pre-alloc= ating") Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu An alternative would be to double paging_logdirty_levels() up in the else case, returning 0. The underlying logc in shadow_prealloc() succumbs to DCE either way. --- xen/arch/x86/include/asm/paging.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/p= aging.h index 38bec8af2ed1..2ca22f20adff 100644 --- a/xen/arch/x86/include/asm/paging.h +++ b/xen/arch/x86/include/asm/paging.h @@ -149,6 +149,10 @@ struct paging_mode { /*************************************************************************= **** * Log dirty code */ =20 +#define paging_logdirty_levels() \ + (DIV_ROUND_UP(PADDR_BITS - PAGE_SHIFT - (PAGE_SHIFT + 3), \ + PAGE_SHIFT - ilog2(sizeof(mfn_t))) + 1) + #if PG_log_dirty =20 /* get the dirty bitmap for a specific range of pfns */ @@ -187,10 +191,6 @@ bool paging_mfn_is_dirty(const struct domain *d, mfn_t= gmfn); #define L4_LOGDIRTY_IDX(pfn) ((pfn_x(pfn) >> (PAGE_SHIFT + 3 + PAGETABLE_O= RDER * 2)) & \ (LOGDIRTY_NODE_ENTRIES-1)) =20 -#define paging_logdirty_levels() \ - (DIV_ROUND_UP(PADDR_BITS - PAGE_SHIFT - (PAGE_SHIFT + 3), \ - PAGE_SHIFT - ilog2(sizeof(mfn_t))) + 1) - #ifdef CONFIG_HVM /* VRAM dirty tracking support */ struct sh_dirty_vram { --=20 2.30.2