From: Stephane Eranian <eranian@hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Help! Need to add a flag to ia64 thread flags
Date: Wed, 13 Jun 2007 17:21:06 +0000 [thread overview]
Message-ID: <20070613172106.GA3002@frankl.hpl.hp.com> (raw)
In-Reply-To: <1181754124.6148.37.camel@localhost>
Hello Lee,
On Wed, Jun 13, 2007 at 01:02:04PM -0400, Lee Schermerhorn wrote:
> Stephane:
>
> I need to add a flag to the ia64 thread info flags to support my
> automigration work. I was using TIF_NOTIFY_RESUME which you removed. I
> didn't notice that happening, but even if I did, I couldn't/wouldn't
> have objected because my patches are still [maybe always?] out of tree.
>
Welcome to my world!
I remove TIF_NOTIFY_RESUME because it was unused on all but IA-64.
And there it was used by perfmon (v2.0) which I replace by a more
explicit TIF flag.
> Now, I've tried to add an automigration-specific flag, called
> TIF_MIGRATION_WORK--to the flags to trigger entry to do_notify_resume()
> to handle auto-migration. However, I'm getting errors from the
> assembler in arch/ia64/kernel/fsys.S where ever the instruction:
>
> and r?=TIF_ALLWORK_MASK,r?
>
> occurs, complaining that "Operand 2 of 'and' should be an 8-bit integer
> (-128-127)". This is worrisome to begin with, as thread information
> flags comment says that "pending work-to-be-done flags are in
> least-significant 16 bits", while the code currently only supports
> "8-bits". What's more interesting is that I've used bit '7' for the
> TIF_MIGRATION_WORK flag. That should fit in the range (-128 - 127),
> right? Maybe the assembler is confused by sign extension of the signed
> 8-bit int?
>
Funny! I went through exactly the same thought process when I remove the TIF
flag. Yes, the instruction say imm8, so you'd expect that a 8-bit constant
would fit. But, if you look closer and especially to the pseudo-code describing
the instruction you'll see that there is sign-extension going on, so the
assembler is not wrong. What I do not understand is what's the point of
sign-extension on a AND (bitwise) operation?
> For my testing, I can probably use your 'PERFMON_WORK flag, but that's
> probably not a good long term solution. Any ideas how to proceed longer
> term to support >7 pending work flags?
>
In anycase, there is no solution to your problem but to modify entry.S
to deal with the bit-width limitation, i.e, you need to load the constant
into a register and then do the and. You probably understand now, why
I thought is was easier to remove unused TIF flags....
--
-Stephane
prev parent reply other threads:[~2007-06-13 17:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-13 17:02 Help! Need to add a flag to ia64 thread flags Lee Schermerhorn
2007-06-13 17:21 ` Stephane Eranian [this message]
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=20070613172106.GA3002@frankl.hpl.hp.com \
--to=eranian@hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
/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