I see that Stas Sergeev has been credited for some vm86 changes.
I must have missed the patches, if they were ever sent on the
mailinglist.
It seems to me, that either one hunk must have failed while
these patches got applied, or there is some confusion about the
CHECK_IF_IN_TRAP macro used in handle_vm86_fault().
Originally the CHECK_IF_IN_TRAP looked like this:
#define CHECK_IF_IN_TRAP \
if (VMPI.vm86dbg_active && VMPI.vm86dbg_TFpendig) \
pushw(ssp,sp,popw(ssp,sp) | TF_MASK);
With Manfreds and mine modifications of the push and pop macros
the macro had to be changed into this:
#define CHECK_IF_IN_TRAP \
if (VMPI.vm86dbg_active && VMPI.vm86dbg_TFpendig) \
pushw(ssp,sp,popw(ssp,sp, regs, VM86_SIGSEGV) | TF_MASK, regs, VM86_SIGSEGV);
I have always considered the macro to be unecesarry complex.
It works by poping a flagregister from the stack, changing it,
and pushing it back. In all places the macro is used, the flags
will afterwards be poped from the stack.
A simplification would be to make the change after poping the
flags. This will however make a minor change to the final result,
which is why I didn't do it right away. The value left in the
stacksegment will not have been changed with the simplified
version, but it would have with the original version. However
since the discarded value could get overwritten at any time by
an interrupt, and since any code relying on the value would be
buggy, I do consider the simplification to be safe.
In that case the macro would get to look like this:
#define CHECK_IF_IN_TRAP \
if (VMPI.vm86dbg_active && VMPI.vm86dbg_TFpendig) \
newflags |= TF_MASK;
This is assuming Stas' way to use the macro. However since it
looks like Stas' use the old macro, I think his code is buggy.
I think the current version will change the wrong value on the
stack, and lead to unpredictable results.
Perhaps somebody with a little more understanding of the code
could clear some of this out. And BTW does anybody happen to
know some software actually using the feature implemented by
CHECK_IF_IN_TRAP?
I would appreachiate some comments on this subject.
-- Kasper Dupont -- der bruger for meget tid på usenet. For sending spam use mailto:razor-report@daimi.au.dk - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/