From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12195 invoked by alias); 23 Feb 2017 16:20:02 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 12062 invoked by uid 89); 23 Feb 2017 16:20:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-qk0-f176.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0vnFhefyjbtSgpe604TPZy71NwLHpRbQf6jM2rw3qio=; b=QthfdDtUrXf1h2ZbSW0k+/jo4KwnfYiHcb0r5VulIVnUCNdulqcWlv0bdbOy07+LDx O5/4WLGawBK7p8pXbUKVZEfbVj6Dv8cEGmz9GZKXqY3KsA9omo4vRSUI5kXuNPrU/gnb NJEuACDg1qhZ5js5c2XqlLq6GssBYkcizkr8+GKr6nGtlinr+hCsp1iL8Zqhf8u1yZdS DG4SXhjO24imtBeDL8iMkqu+d11KY+XnaJHvPoATY5rQmp+Ga4YICx4hNvwA/YDp8IkA Ieow1jsu09xJJ+AuCXA/3VR051Xc4mJX/KnS+QtmHDlXwt0/p57EpEQD4Kk6ExOm3X54 I06g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0vnFhefyjbtSgpe604TPZy71NwLHpRbQf6jM2rw3qio=; b=a7KJU1gY14k7zeGzSNtQ0h6y3fxVZepaO37yzNwuQeTCOj3alKVWNB1sUY6TwhD07L Vk6vlP9dAZmB4QFJHaYAAWCN9LOFB8OpKtQZAyGqQ9W7fen65T1QkDV4hAx5dh86MF1Q QjU+ATRndxU9nvQrxtG4tVe3NumTbobzcItctutFFXJe4R+v69m5LefjlQA9H0BK2LWQ 0/GCvRHIeMERZa6IV4pbn8jmJtW2uvw2yQmyf/+tGFDkqZ2ncCB7mGNBJl/yptIZBto4 W7WXUzMMTW5uUsxESXXEe4FkN8fc4JMbYPykltdI/3JmUMxJyE5N9HI7GBwguMh/jK/9 Mu6A== X-Gm-Message-State: AMke39ns7WGkMZ34qypwJZWW4av26KGSAN8AKOr4pRG8lqp7Mr3zDxS7Xcj+EHMjPhmYOKAu2koMxdKsSQcg6Q== X-Received: by 10.55.166.10 with SMTP id p10mr36945107qke.100.1487866798393; Thu, 23 Feb 2017 08:19:58 -0800 (PST) MIME-Version: 1.0 From: "H.J. Lu" Date: Sun, 01 Jan 2017 00:00:00 -0000 Message-ID: Subject: RFC: ABI support for special memory area To: gnu-gabi@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017-q1/txt/msg00000.txt.bz2 A system may have MCDRAM or other types of memory in addition to normal RAM. Here is an ABI proposal to allow placement in a section whose sh_info field indicates the special memory type. Any comments? H.J. --- To section attributes, add #define SHF_GNU_MBIND 0x00100000 for sections used to place data or text into a special memory area. The section names should start with ".mbind" so that they won't be grouped together with normal sections by link editor. The sh_info field indicates the special memory type. To the "Program Header" section, add an inclusive range of segment types for GNU_MBIND segments: #define PT_GNU_MBIND_NUM 4096 #define PT_GNU_MBIND_LO (PT_LOOS + 0x474e555) #define PT_GNU_MBIND_HI (PT_GNU_MBIND_LO + PT_GNU_MBIND_NUM - 1) The array element specifies the location and size of a special memory area. Each GNU_MBIND segment contains one GNU_MBIND section and the segment type is PT_GNU_MBIND_LO plus the sh_info value. If the sh_info value is greater than PT_GNU_MBIND_NUM, no GNU_MBIND segment will be created. Each GNU_MBIND segment must be aligned at page boundary. The interpretation of the special memory area information is implementation-dependent. Implementations may ignore GNU_MBIND segment. Run-time support int __gnu_mbind_setup (unsigned int type, void *addr, size_t length); It sets up special memory area of 'type' and 'length' at 'addr' where 'addr' is a multiple of page size. It returns zero for success, positive value of ERRNO for non-fatal error and negative value of ERRNO for fatal error. After all shared objects and the executable file are loaded, relocations are processed, for each GNU_MBIND segment in a shared object or the executable file, run-time loader calls __gnu_mbind_setup with type, address and length. The default implementation of __gnu_mbind_setup is int __gnu_mbind_setup (unsigned int type, void *addr, size_t length) { return 0; } which can be overridden by a different implementation at link-time.