Correct resolution of xstrerror(). Switch from -liberty (which has PIC
problems as a local library) to directly linking xstrerror.c with
liblto_plugin.
Fix in gcc.old by <christos>
PR 52674 by myself
GCC passes liblto_plugin.so in the linker invocation (part of "gcc -v file.c"):
ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=/usr/libexec/lto-wrapper \
-plugin-opt=-fresolution=/var/tmp//ccxda9Ar.res \
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc \
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s \
-plugin-opt=-pass-through=-lgcc --eh-frame-hdr -dc -dp -e _start \
-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crti.o \
/usr/lib/crtbegin.o /var/tmp//cc7A7mOK.o --as-needed -lgcc_s --no-as-needed \
-lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o \
/usr/lib/crtn.o
When attempting to use GNU GOLD, liblto_plugin.so cannot be used because it \
has missing symbol xstrerror:
ld: error: /usr/libexec/liblto_plugin.so: could not load plugin library: \
/usr/libexec/liblto_plugin.so: Undefined PLT symbol "xstrerror" (symnum = 38)
From Makefiles and sources inspection, liblto_plugin.so shall be linked with \
libiberty (-liberty), a utility GNU library for internal usage with helping \
functions.
PR 52674 by myself
GCC passes liblto_plugin.so in the linker invocation (part of "gcc -v file.c"):
ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=/usr/libexec/lto-wrapper \
-plugin-opt=-fresolution=/var/tmp//ccxda9Ar.res \
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc \
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s \
-plugin-opt=-pass-through=-lgcc --eh-frame-hdr -dc -dp -e _start \
-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crti.o \
/usr/lib/crtbegin.o /var/tmp//cc7A7mOK.o --as-needed -lgcc_s --no-as-needed \
-lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o \
/usr/lib/crtn.o
When attempting to use GNU GOLD, liblto_plugin.so cannot be used because it \
has missing symbol xstrerror:
ld: error: /usr/libexec/liblto_plugin.so: could not load plugin library: \
/usr/libexec/liblto_plugin.so: Undefined PLT symbol "xstrerror" (symnum = 38)
From Makefiles and sources inspection, liblto_plugin.so shall be linked with \
libiberty (-liberty), a utility GNU library for internal usage with helping \
functions.
PR 52674 by myself
The purpose of this change is to expose the x86/include/intr.h API
to drivers. Specifically the following functions:
void *intr_establish_xname(...);
void *intr_establish(...);
void intr_disestablish(...);
while maintaining the old API from xen/include/evtchn.h, specifically
the following functions:
int event_set_handler(...);
int event_remove_handler(...);
This is so that if things break, we can keep using the old API until
everything stabilises. This is a stepping stone towards getting the
actual XEN event callback path rework code in place - which can be
done opaquely behind the intr.h API - NetBSD/XEN specific drivers that
have been ported to the intr.h API should then work without
significant further modifications.
hardware interrupts to XEN callbacks called 'events'. This function
combines both the allocation and the binding.
This change is the first part of breaking up that combination into
xen_pirq_alloc() and the binding will happen as part of the
pic_addroute() callback of a new pseudo PIC_XEN
This code will be added later on.
context switch performance by not saving to memory FPU registers that are
known to be in their initial state or known not to have changed since the
last time they were saved to memory.
Our code is now compatible with the internal state tracking engine:
- We don't modify the in-memory FPU state after doing an XSAVE/XSAVEOPT.
That is to say, we always call XRSTOR first.
- During a fork, the whole in-memory FPU state area is memcopied in the
new PCB, and CR0_TS is set. Next time the forked thread uses the FPU it
will fault, we migrate the area, call XRSTOR and clear CR0_TS. During
this XRSTOR XSTATE_BV still contains the initial values, and it forces
a reload of XINUSE.
- Whenever software wants to change the in-memory FPU state, it manually
sets XSTATE_BV[i]=1, which forces XINUSE[i]=1.
- The address of the state passed to xrstor is always the same for a
given LWP.
fpu_save_area_clear is changed not to force a reload of CW if fx_cw is
the standard FPU value. This way we have XINUSE[i]=0 for x87, and xsaveopt
will optimize this state.
Small benchmark:
switch lwp to cpu2
do float operation
switch lwp to cpu3
do float operation
Doing this 10^6 times in a loop, my cpu goes on average from 28,2 seconds
to 20,8 seconds.
runtime, since only entries for exceptions/traps are registered with
the hypervisor and interrupts are managed via a completely different
mechanism.
This change uses the idt_vec_reserve() mechanism nevertheless,
modifying it slightly to only do namespace management in XEN, while on
native it will continue to do idt entry init as before.
Rationale: Consistent API usage and potential future merging of
XEN/non-XEN code.
There are no functional changes in this commit.
were written previously - but that's just style.) This is not csh...
Use the correct test operator to test for an empty file (rather than
testing for an empty file name...)
Write test ('[') commands in a way that is defined to work, rather than
just happens to - we can afford the (negligible) performance hit here.