public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Suprateeka R Hegde <hegdesmailbox@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: gnu-gabi@sourceware.org
Subject: Re: RFC: ABI support for special memory area
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <88608944-14c9-9d28-80d1-32283521683b@gmail.com> (raw)
In-Reply-To: <CAMe9rOpp33=Nc_jJTYas8=L+XXN=H43_t_jmQCqp63s+fi3o1w@mail.gmail.com>

On 02-Mar-2017 09:34 PM, H.J. Lu wrote:
> On Thu, Mar 2, 2017 at 7:16 AM, Suprateeka R Hegde
> <hegdesmailbox@gmail.com> wrote:
>> On 23-Feb-2017 09:49 PM, H.J. Lu wrote:
>>>
>>>  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.
>>>
>>
>> Since this is a design that allows vendor specific extension and
>> implementation, would it OK if we make it more generic?
>
> Yes.
>
>> Instead of a fixed 3 arguments (type, addr, len), how about something like a
>> pointer to a generic MBIND_CONTEXT struct (say of type __gnu_mbind_context
>> defined)?  And let the implementation define the actual struct.
>
> We can add more arguments.  But they must be predefined since
> __gnu_mbind_setup is called from ld.so which must know what to
> pass to __gnu_mbind_setup.

<snip>

> __gnu_mbind_setup is platform specific.  We can pass as
> much as we need to __gnu_mbind_setup.  But they have to be fixed.

I didnt understand this. Predefined/fixed where and how? As part of the 
ABI support? Or part of the implementation?

If it is going to part of ABI, then we need to finalize and define it 
now. If it is part of the implementation, then __gnu_mbind_setup must be 
documented in the ABI as just a guideline to the implementer.

What I meant by being generic is to have flexibility in number of 
arguments. Here is an incomplete/pseudo code of what I am trying to tell:

enum __gnu_mbind_instance {
    GNU_MBIND_DEFAULT,
    GNU_MBIND_OVERRIDDEN
};

typedef struct {
    __gnu_mbind_instance mb_inst; // mandatory. ABI specified
#ifdef VENDOR_1
    type1 identifier1; // optional implementation defined
    type2 identifier2; // optional implementation defined
    ...
    typeN identifierN; // optional implementation defined
#endif
// Add vendor/implementation as necessary
} __gnu_mbind_context;

int __gnu_mbind_setup(__gnu_mbind_context*);

Now, for MCDRAM instance, from my understanding:

typedef struct {
    __gnu_mbind_instance mb_inst;
#ifdef VENDOR_MCDARM
    unsigned int type;
    void *addr;
    size_t length;
#endif
} __gnu_mbind_context;

int
__gnu_mbind_setup (__gnu_mbind_context* mbind_context)
{
    /* Even if real implementation exist, check and allow disabling 
special memory bindings */
    if (mbind_context->mb_inst == GNU_MBIND_DEFAULT) {
       return 0;
    }
    else {
       // return real_implementation_result;
    }
}

If that is not what you are telling, I want to understand how to use it 
vendor specific way.


>> I would like to handle NVM/NVMe (long back I had mentioned about
>> PT_PERSISTENT) through this MBIND and my implementation of handling NVM/NVMe
>> needs more data to be passed to such "setup" functions.
>
> I call it MBIND since a MBIND segment is inside a LOAD segment and
> my real __gnu_mbind_setup will call mbind to move a MBIND region to
> a NUMA node after it has been loaded and relocated. We can give it
> a different name if you have a better one.

I dont have any comment on this MBIND naming. It sounds good.

--
Supra

  reply	other threads:[~2017-03-03 12:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:00 H.J. Lu
2017-01-01  0:00 ` Carlos O'Donell
2017-01-01  0:00   ` H.J. Lu
2017-01-01  0:00     ` Carlos O'Donell
2017-01-01  0:00       ` H.J. Lu
2017-01-01  0:00         ` Florian Weimer
2017-01-01  0:00           ` H.J. Lu
2017-01-01  0:00 ` Suprateeka R Hegde
2017-01-01  0:00   ` H.J. Lu
2017-01-01  0:00     ` Suprateeka R Hegde [this message]
2017-01-01  0:00       ` H.J. Lu
2017-01-01  0:00         ` Carlos O'Donell
2017-01-01  0:00           ` Suprateeka R Hegde
2017-01-01  0:00             ` H.J. Lu
2017-01-01  0:00               ` Suprateeka R Hegde
2017-01-01  0:00                 ` H.J. Lu
2017-01-01  0:00                   ` H.J. Lu
2017-01-01  0:00                     ` Suprateeka R Hegde
2017-01-01  0:00                       ` H.J. Lu
2017-01-01  0:00                         ` Suprateeka R Hegde
2017-01-01  0:00                           ` H.J. Lu
2017-01-01  0:00                             ` Suprateeka R Hegde
2017-01-01  0:00                               ` H.J. Lu
2017-01-01  0:00                                 ` Suprateeka R Hegde
2017-01-01  0:00                                   ` H.J. Lu
2017-01-01  0:00                                     ` Suprateeka R Hegde
2017-01-01  0:00                                       ` H.J. Lu
2017-01-01  0:00                     ` Florian Weimer
2017-01-01  0:00                       ` H.J. Lu
2017-01-01  0:00                         ` Florian Weimer
2017-01-01  0:00                           ` H.J. Lu
2017-01-01  0:00                             ` Florian Weimer
2017-01-01  0:00                               ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88608944-14c9-9d28-80d1-32283521683b@gmail.com \
    --to=hegdesmailbox@gmail.com \
    --cc=gnu-gabi@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).