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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 66ED2C433ED for ; Fri, 30 Apr 2021 19:33:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 02D5A613EA for ; Fri, 30 Apr 2021 19:33:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02D5A613EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cs.pub.ro Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.120739.228350 (Exim 4.92) (envelope-from ) id 1lcYsv-00057e-1F; Fri, 30 Apr 2021 19:33:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 120739.228350; Fri, 30 Apr 2021 19:33:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lcYsu-00057X-UW; Fri, 30 Apr 2021 19:33:08 +0000 Received: by outflank-mailman (input) for mailman id 120739; Fri, 30 Apr 2021 19:33:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lcYss-00057S-W3 for xen-devel@lists.xenproject.org; Fri, 30 Apr 2021 19:33:07 +0000 Received: from mx.upb.ro (unknown [141.85.13.200]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9330d184-cde3-4af2-afff-fdf45d01dbbe; Fri, 30 Apr 2021 19:33:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 4C6C7B56006A; Fri, 30 Apr 2021 22:33:04 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qwi_VDOIRYLe; Fri, 30 Apr 2021 22:33:02 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 6ED13B56007A; Fri, 30 Apr 2021 22:33:02 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZmGTByysu8Uy; Fri, 30 Apr 2021 22:33:02 +0300 (EEST) Received: from [192.168.1.35] (unknown [188.25.174.245]) by mx.upb.ro (Postfix) with ESMTPSA id A5F42B56006A; Fri, 30 Apr 2021 22:33:01 +0300 (EEST) 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: 9330d184-cde3-4af2-afff-fdf45d01dbbe X-Virus-Scanned: amavisd-new at upb.ro Subject: Re: [PATCH 1/5] tools/debugger: Fix PAGE_SIZE redefinition error To: Tim Deegan Cc: xen-devel@lists.xenproject.org, Ian Jackson , Wei Liu , Julien Grall References: <0cd234096c9bfa8d29eac9906553af79d378733e.1619524463.git.costin.lupu@cs.pub.ro> <128f6672-eec7-fc8b-d43c-1e53d93d93b0@cs.pub.ro> From: Costin Lupu Message-ID: <3e7f6771-1f1a-eb00-95f8-5ef6998091be@cs.pub.ro> Date: Fri, 30 Apr 2021 22:33:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 4/30/21 9:45 PM, Tim Deegan wrote: > At 14:36 +0300 on 30 Apr (1619793419), Costin Lupu wrote: >> Hi Tim, >> >> On 4/29/21 10:58 PM, Tim Deegan wrote: >>> Hi, >>> >>> At 15:05 +0300 on 27 Apr (1619535916), Costin Lupu wrote: >>>> If PAGE_SIZE is already defined in the system (e.g. in >>>> /usr/include/limits.h header) then gcc will trigger a redefinition error >>>> because of -Werror. This commit also protects PAGE_SHIFT definitions for >>>> keeping consistency. >>> >>> Thanks for looking into this! I think properly speaking we should fix >>> this by defining KDD_PAGE_SHIFT and KDD_PAGE_SIZE in kdd.h and using >>> those everywhere we currently use PAGE_SIZE/PAGE_SHIFT. in kdd.c and >>> kdd-xen.c. If for some reason we ever ended up with a system-defined >>> PAGE_SIZE that wasn't 4096u then we would not want to use it here >>> because it would break our guest operations. >> >> As discussed for another patch of the series, an agreed solution that >> would apply for other libs as well would be to use XC_PAGE_* macros >> instead of PAGE_* macros. I've just sent a v2 doing that. Please let me >> know if you think it would be better to introduce the KDD_PAGE_* >> definitions instead. > > Sorry to be annoying, but yes, please do introduce the KDD_ versions. > All the xen-specific code in KDD lives in kdd-xen.c; kdd.c shouldn't > include any xen headers. No worries, will do. I imagined that might be the case for kdd.c, but I wasn't sure. Cheers, Costin