Commit Graph

1195 Commits

Author SHA1 Message Date
bouyer
916e2df623 Properly implemement pci_intr_disestablish(9), so that interrupt
handlers stop being called when the device has been detached.
Should fix PR port-xen/47720 (which turns out to not be related to raidframe).
While there fix possible races in event_remove_handler() and pirq_establish().
2015-03-14 10:49:36 +00:00
joerg
2c045a6b19 valid_ipimask is only used under DIAGNOSTIC, so only define it then. 2015-02-07 20:01:48 +00:00
ozaki-r
3cde4cbc35 Pass a correct firmware size (instead of 0) to firmware_free
firmware_free now uses kmem_free(9) instead of free(9),
so we need to pass a correct size to it.
2015-01-07 07:05:48 +00:00
uebayasi
c455480f99 Include files.sljit as i386/amd64 do. 2015-01-04 07:34:14 +00:00
christos
c182898b0d We have three sets of DTYPE_ constants in the kernel:
altq		Drop 		Type
	disklabel	Disk 		Type
	file		Descriptor	Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
2015-01-02 19:42:05 +00:00
christos
429dd9f14e these call dk_ioctl, no need to call disk_ioctl anymore. 2015-01-02 01:13:00 +00:00
christos
51cd9004b7 pass dev to disk_ioctl 2014-12-31 20:39:07 +00:00
christos
03a0e9092a there is no ibcs2 in amd64 [yet?] 2014-12-15 13:48:51 +00:00
ozaki-r
a83e862961 Add two new compat files for Xen on amd64 2014-12-15 07:35:09 +00:00
msaitoh
2fb8c49793 Modify around cpu_identify() to not to break the dmesg of cpus with AB_VERBOSE
or AB_DEBUG.
2014-12-08 15:22:47 +00:00
bouyer
4ae5e12ef4 Revert sys/arch/x86/x86/pmap.c 1.185; a CPU needs to get pmap updates,
especially for pmap_kernel(), as soon as it is up.
Instead move all pmap-related cpu_info initialisations, including
initializing ci_kpm_mtx, in cpu_attach_common() from cpu_init()
(ci_pmap and ci_tlbstate as already initialized in cpu_attach_common()).
2014-11-27 16:29:44 +00:00
uebayasi
104daad189 Use LINKSCRIPT. 2014-11-15 12:36:42 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos
3814d4cb39 now that privcmd_map_obj cleans up correctly, don't double free... 2014-10-17 16:37:02 +00:00
uebayasi
2757cc55ca Mark machdep files. 2014-10-11 06:07:48 +00:00
christos
58f906ec2f correct error paths; still need to verify that the "didn't give us back..."
case is correct.
2014-10-03 20:56:24 +00:00
christos
486adf8389 fix leak. 2014-09-21 16:56:44 +00:00
christos
a9ba82b09e fix leak. 2014-09-21 16:53:38 +00:00
bouyer
bb4d9fb08c Make Xen kernels compile without DIAGNOSTIC 2014-09-21 12:46:15 +00:00
tls
ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
wiz
87561671c1 defintion -> definition 2014-08-03 19:14:24 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland
8c70ef39af Add d_discard to all struct bdevsw instances I could find.
I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
2014-07-25 08:02:18 +00:00
joerg
cb03441189 Restrict -mno-fp-ret-in-387 to GCC. 2014-07-20 16:51:29 +00:00
bouyer
af396dde5a Sync DEFCOPTS and CFLAGS with i386 and amd64 counterparts.
Especially -fno-omit-frame-pointer
2014-07-17 10:49:45 +00:00
pgoyette
3b2f43a7dd Define a macro to check hypervisor version. OK cherry@ 2014-06-14 02:53:02 +00:00
bouyer
2745b95e5c As proposed in
https://mail-index.netbsd.org/tech-kern/2014/05/21/msg017098.html
remove dk_start() and dk_iodone() from dksubr.c and move the related code
to the underlying driver.
This increase complexity only marginally: the underlying drivers have
to do the while() loop themselves, but this can now be done properly with
bufq_peek()/bufq_get(), removing the buffer from the queue at the right time.
This handle both the recursion and reordering issues (the reordering
issue is described here:
https://mail-index.netbsd.org/tech-kern/2014/05/19/msg017089.html
the recursion isssue is PR #25240).

Difference with the patch posted to tech-kern@: KASSERT() that the
buffer we remove with bufq_get() is the same as the one we bufq_peek()'d
just before.
Hopefully this will allow more disk drivers to use dksubr.c
2014-05-25 19:23:49 +00:00
rmind
8011b285c0 Implement MI IPI interface with cross-call support. 2014-05-19 22:47:53 +00:00
cherry
b3b58e3b56 Use the hypervisor to copy/zero pages. This saves us the extra overheads
of setting up temporary kernel mapping/unmapping.

riz@ reports savings of about 2s on a 120s kernel build.
2014-05-06 04:26:23 +00:00
christos
9c96bd6b84 Change findroot() to cpu_bootconf() since this is what it does. Remove bogus
comment.
2014-04-03 15:53:05 +00:00
christos
e58a356cba make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
2014-03-29 19:28:24 +00:00
christos
e93b33c96c correct/add protection against snprintf overflow. 2014-03-27 18:22:56 +00:00
skrll
8f2cde0556 Mechanically replace simplelock with kmutex_t. 2014-03-20 06:48:54 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
dsl
7f1790d7c1 Use the global pci_mode to avoid 'set but not used' warnings from gcc 4.8.3. 2014-03-03 22:09:32 +00:00
dsl
e405c62563 Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
  removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
  (or remove it entirely).
2014-02-12 23:24:09 +00:00
dsl
742d777c6d Move sys/arch/amd64/amd64/fpu.c and sys/arch/amd64/include/fpu.h
into sys/arch/x86 in preparation for using the same code for i386.
2014-02-11 20:17:16 +00:00
dsl
519a61193d Convert the amd64 build to use x86/cpu_extended_state.h so that the fpu
definitions match those of i386.
Mostly just structure and field renames, in addition:
1) process_xmm_to_s87() and process_s87_to_xmm() moved into
   x86/convert_xmm_s87.c so they can be used by amd64's netbsd32 code.
2) The linux signal code simplified to use a structure copy for ths fxsave
   data - it matches the hardware definition and won't change.
2014-02-07 22:40:22 +00:00
bouyer
454d551267 Revert previous: calling fpuinit() leads to a panic, as a domU is not
allowed to manipulate cr0 directly. Xen doesn't need this, the fpu is
handled by the hypervisor.
2014-02-01 20:07:07 +00:00
dsl
cd7408c584 Add a direct call to fpuinit().
I'm not sure this is architecturally the best place, but I think it
  is where npxattach() used to get called.
Might fix FP support in domu
2014-02-01 17:48:04 +00:00
bouyer
cf5eda804a Move back call to pci_mode_detect() outside of #ifdef PCI_BUS_FIXUP.
Even if mode is not used, the call to pci_mode_detect() is mandatory to
initialize the PCI subsystem.
Fix "panic booting -current DOM0" reported by Patrick Welche on port-xen.
2014-01-31 10:37:01 +00:00
dsl
51a0d6b173 Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
  is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
  to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
  cpu_configure(), this enables FP emulation for a 486SX.
  (for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
  save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
  it might have got lost!
2014-01-26 19:16:16 +00:00
dsl
7c4ad3905a Remove the borked definition of ELF64_Shalf from some more places.
Remove the _KERNEL parts of some clones of sys/elf_exec.h
One might ask why this file has got cloned so many times.
2014-01-03 16:50:54 +00:00
bouyer
6c985f14ae Remove the "evtchn_do_event: handler %p didn't lower ipl %d %d\n" printf.
With help from Robert Elz we've finally figured out what's going on, and
it actually isn't a bug in the handler, but related to spin mutexes.
When a spin mutex is released, the IPL isn't lowered back if the
curcpu is holding other spin mutexes. This is because mutexes may not
be released in order (and, in this case, the CPU in interrupted while
it holds a spin mutex at IPL < IPL_SCHED).
Also remove the test and resetting the IPL, it will be reset anyway
inside the loop, or at the end of the loop.
2013-12-03 20:51:00 +00:00
christos
f0ceb57840 revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
2013-12-01 01:05:16 +00:00
jnemeth
35562477e8 Change xpq_flush_cache to just do WBINVD letting the hypervisor trap and
handle it as MMUEXT_FLUSH_CACHE is a privileged hypervisor operation.
2013-11-10 01:19:13 +00:00
christos
8c82a95aec fix unused variable warnings 2013-11-08 02:23:52 +00:00
mrg
f6ff08e141 - move variables inside their #ifdef use
- remove unused and set-but-unused variables
- use __USE() in a particularly ugly case

with these, and a couple of other changes, amd64 gcc 4.8.1 world
is able to complete build.sh release.
2013-11-06 06:23:15 +00:00
drochner
23780ff8df Use the MI "pcu" framework for bookkeeping of npx/fpu states on x86.
This reduces the amount of MD code enormously, and makes it easier
to implement support for newer CPU features which require more fpu
state, or for fpu usage by the kernel.
For access to FPU state across CPUs, an xcall kthread is used now
rather than a dedicated IPI.
No user visible changes intended.
2013-10-23 20:18:50 +00:00
bouyer
2327114209 Fix memory leak if the provided mac address isn't valid. 2013-10-20 11:37:53 +00:00