Commit Graph

1819 Commits

Author SHA1 Message Date
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
christos
db89e006d6 kill sprintf 2014-03-26 08:04:19 +00:00
christos
b2543b9136 use cpu_{g,s}etmodel 2014-03-24 20:06:31 +00:00
christos
9e287239f7 need compat_netbsd.h 2014-03-20 20:44:42 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
martin
bbeaaa76ed #ifdef a variable like its use 2014-03-12 12:54:33 +00:00
para
4d3aae87b7 mark a diagnostic only variable 2014-03-11 20:54:29 +00:00
dsl
3a107b0ac4 Add support for saving the AVX-256 ymm registers during FPU context switches.
Add support for the forthcoming AVX-512 registers.
Code compiled with -mavx seems to work, but I've not tested context
  switches with live ymm registers.
There is a small cost on fork/exec (a larger area is copied/zerod),
  but I don't think the ymm registers are read/written unless they
  have been used.
The code use XSAVE on all cpus, I'm not brave enough to enable XSAVEOPT.
2014-02-25 22:16:52 +00:00
dsl
1bda540607 Add the XCR bits for snazzy upcoming features.
Define a mask for the fpu releated ones - only these wll be enabled.
The memory bound ones will need saving on every context switch.
2014-02-25 22:11:11 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
dsl
c8b478cd74 Fix a 'stupido' that stopped (amongst other things) the cpu brand string
being read.
The most obvious side effect the anita tests failed to detect they were
  running under qemu - so reported failures under qemu for things
  that qemu doesn't support.
2014-02-25 17:56:03 +00:00
dsl
a1bc28e807 Rename (the recently added) 'x86_xsave_size' to 'x86_fpu_save_size'
and default to 512 (the size of the fxsave structure).
2014-02-23 22:38:40 +00:00
dsl
21ead8e9af Add fpu_set_default_cw() and use it in the emulations to set the default
x87 control word.
This means that nothing outside fpu.c cares about the internals of the
  fpu save area.
New kernel modules won't load with the old kernel - but that won't matter.
2014-02-23 22:35:27 +00:00
dsl
f9cd6e68d1 Determine whether the cpu supports xsave (and hence AVX).
The result is only written to sysctl nodes at the moment.
I see:
machdep.fpu_save = 3 (implies xsaveopt)
machdep.xsave_size = 832
machdep.xsave_features = 7
Completely common up the i386 and amd64 machdep sysctl creation.
2014-02-23 12:56:40 +00:00
dsl
fc194a52bb Re-use the unused ci_cpu_serial[3] to save the highest cpuid values
for the normal and extended leafs.
(The 'normal' one might be luring in the global cpulevel.)
Read the 'extended feature' from cpuid.80000001.%ecx/edx into
    ci_feat_val[3/2] just after saving cpuid.1.%ecx/dx in ci_feat_val[1/0]
    instead of doing it separately for amd k678 and via c3 processors
    in their probe functions and repeating it for all cpus a few instructions
    later when x86_cpu_topology() is called.
x86_cpu_topology() is only called from cpu_probe() and really doesn't
  deserve its own source file. Chasing the setup code is bad enough anyway.
2014-02-22 17:48:08 +00:00
dsl
8b623c15d9 Move the amd64 and i386 pcb to the bottom of the uarea, and move the
kernel stack to the top.
Change the pcb layouts so that fpu save area is at the end and is
  64byte aligned ready for xsave (saving the ymm registers).
Welcome to 6.99.32
2014-02-20 18:19:09 +00:00
dsl
3b3cbac768 This needs stdint.h in userspace (for uint64_t) 2014-02-20 18:14:11 +00:00
dsl
480bf53618 Add explicit #include <x86/fpu.h> instead of relying on pcb.h including it. 2014-02-19 21:23:01 +00:00
dsl
ae3b84a62b It seems that firefox includes machine/fpu.h on amd64.
Add the file back so that the firwfox source doesn't have to depend
on the version of netbsd it is being compiled for.
(The i386 version doesn't play the same games in its SIGFPE handler.)
2014-02-18 18:39:10 +00:00
dsl
b5e700c786 Load and save the fpu registers (for copies to/from userspace) using
helper functions in arch/x86/x86/fpu.c
They (hopefully) ensure that we write to the entire buffer and don't load
  values that might cause faults in kernel.
Also zero out the 'pad' field of the i386 mcontext fp area that I think
  once contained the registers of any Weitek fpu.
  Dunno why it wasn't pasrt of the union.
Some of these copies could be removed if the code directly copied the save
  area to/from userspace addresses.
2014-02-15 22:20:41 +00:00
dsl
b9df3e93ac Remove all references to MDL_USEDFPU and deferred fpu initialisation.
The cost of zeroing the save area on exec is minimal.
This stops the FP registers of a random process being used the first
  time an lwp uses the fpu.
sendsig_siginfo() and get_mcontext() now unconditionally copy the FP
registers.
I'll remove the double-copy for signal handlers soon.
get_mcontext() might have been leaking kernel memory to userspace - and
  may still do so if i386_use_fxsave is false (short copies).
2014-02-15 10:11:14 +00:00
dsl
1a42f747d5 Check the argument types for the fpu asm functions. 2014-02-13 19:37:08 +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
6cb5447c23 Change the argument to fpudna() to be the trapframe.
Move the checks for fpu traps in kernel into x86/fpu.c.
Remove the code from amd64/trap.c related to fpu traps (they've not gone
  there for ages - expect to panic in kernel mode).
In fpudna():
- Don't actually enable hardware interrupts unless we need to
  allow in IPIs.
- There is no point in enabling them when they are blocked in software
  (by splhigh()).
- Keep the splhigh() to avoid a load of the KASSERTS() firing.
2014-02-12 19:53:49 +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
2736f96cdb Add x86_stmxcsr for amd64. 2014-02-09 17:07:41 +00:00
dsl
43beae7c02 Add compatibility for some userspace code (eg firefox) that seems to look
inside the ucontext structure passed to signal handlers to modify the
  xmm registers.
This should make the code compile - I'm not at all sure it works as expected,
  the interactions between FP and signal handlers aren't at all clear.
AFAICT the FP state is saved on the user stack when the handler is called,
  however the FP trap code can already done odd things to the FPU....
2014-02-09 14:44:42 +00:00
dsl
36d637262e Add bit defs for more of the x87 status register. 2014-02-08 22:36:50 +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
dsl
a3bf2d1fce Userspace (especially libkvm) build better is cpu_extended_state.h
is exported.
2014-02-07 21:52:46 +00:00
dsl
27a8f3e1e9 Move all the hardware register layout for the x86 cpus into a header
that can also be used by amd64.
Add in skeleton definitions for XSAVE and AVX.
Update some comments to match reality.
2014-02-07 19:36:15 +00:00
dsl
b2f9af25a4 There is no need to check for recursive calls into fpudna().
Rename the associated ci_fpsaving field to 'unused'.
I'm not sure they could ever happen, you could get unwanted calls into
  the fpu trap code while saving state when using INT13 - but these are
  different.
The return value from the i386 fpudna() was always 1 - possibly a historic
  relic of the kernel fp emulation. Remove and don't check in trap.S.
The amd64 and i386 fpudna() code is now almost identical.
2014-02-04 21:09:23 +00:00
dsl
52252605c4 Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
  i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
  which irq was used for fpu exceptions, but we only support 'internal'
  now).  Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
  checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
  the question as to whether it is needed at all!
2014-02-02 22:41:20 +00:00
jakllsch
1e7506fdf0 Stopgap to prevent genfb from stealing console. Revisit later. 2014-01-27 23:11:50 +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
taca
b9e8d8ee67 Fix build problem when there is no com(4) but ucom(4). 2014-01-26 15:49:25 +00:00
msaitoh
e4bf50ce42 PUCCN improvements:
- Fix a bug that the puc cn mechanism doesn't use the UART's frequency
   in pucdata.c's table.

 - Add a new option PUC_CNAUTO. If this option is set, consinit() in
   x86/x86/consinit.c checks puc com device to use it as console.
   Without this option, the behavior is the same as before.

 - Add a new config parameter PUC_CNBUS. The old code scans bus #0 only.
   If PUC_CNBUS is set, the specified number's bus will be scanned.

 - Rename comcnprobe() to puc_cnprobe() to make it clear.

 - Rename comcninit() to puc_cninit() to make it clear.

 - Add code for a device that a device's com register is MMIO (#if0 ed).
2014-01-26 10:54:24 +00:00
joerg
3d66511c09 Reduce amount of -no-integrated-as on x86 as .code16 is now supported by
LLVM.
2014-01-15 22:25:22 +00:00
christos
5a3fb681a6 Comment about missing stackframe member initialization (Richard Hansen)
I haven't studied the code, but I'm concerned that not initializing
sf->sf_edi could potentially leak a few bytes of information to a new
userspace process.
2014-01-11 17:14:00 +00:00
christos
be5445b6bd Add softint case (Richard Hansen) 2014-01-11 17:10:40 +00:00
msaitoh
5f07a8b14e Add Energy Performance Bias bit. 2014-01-04 21:09:39 +00:00
msaitoh
3468c7c6bf Remove duplicated entry. Modify comments a bit. 2014-01-04 19:08:43 +00:00
msaitoh
3c10ad5307 Add Z68 LPC. 2014-01-04 02:59:17 +00:00
msaitoh
4c6bef9716 Temporary disable C2000 PCU because the behavior of the wdog is little strange. 2014-01-04 02:09:12 +00:00
dsl
95739e63cd Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
of the fp save area to all the process_read_fpregs() and
  process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
  just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
  to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.
2014-01-04 00:10:02 +00:00
msaitoh
f8748bc5e6 Add C2000 Platform Controller Unit(PCU). 2014-01-03 23:18:48 +00:00
dsl
be74e0a9c9 Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
2014-01-01 18:57:15 +00:00
jakllsch
42b1fe2393 Give cpu_comcnprobe a chance of working on Mode 2 PCI config space. 2013-12-25 17:24:39 +00:00
msaitoh
0f129fa49e move XCR0 definitions to next to CR0's. 2013-12-25 13:14:36 +00:00
christos
0a2552741e use __func__ 2013-12-24 15:42:56 +00:00
msaitoh
70dd5b41f9 CPUID leaf 2 and 4 are only for Intel processors.
Almost the same as usr.sbin/cpuctl/arch/i386.c rev. 1.52.
2013-12-23 11:40:57 +00:00
msaitoh
5aff38d633 Fix comment. 2013-12-18 03:20:19 +00:00
msaitoh
7abb5a02b6 Make new function named tsc_is_invariant() to avoid code duplication.
The behavior of acpicpu_md_flags() will change on some CPUs because
the detecting code of invariant TSC is replaced with newer code.
2013-12-11 02:14:08 +00:00
dsl
7d3a3fd1aa Remove the now-unused CPU_MAXMODEL and CPU_DEFMODEL 2013-12-08 18:08:34 +00:00
dsl
c4cd1a519d Add some definitions for cpu 'extended state'.
These are needed for support of the AVX SIMD instructions.
Nothing yet uses them.
2013-12-08 18:00:51 +00:00
msaitoh
fed068bb70 Update invariant TSC detect code from both Intel and AMD documents.
The best way to check whether the TSC counter is invariant or not is to check
CPUID 80000007.
2013-12-08 04:07:38 +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
rmind
2312c4ca30 Switch XC_HIGHPRI to run at IPL_SOFTSERIAL i.e. the highest software level.
Adjust pcu(9) to this xcall(9) change.  This may fix the problems after
x86 FPU was converted to use PCU, since it avoids heavy contention at the
lower levels (particularly, IPL_SOFTNET).  This is a good illustration why
software interrupts should generally avoid any blocking on locks.
2013-11-26 20:29:40 +00:00
msaitoh
66501cca1f - Add some AMD Fn80000001 extended features %ecx bits definitions from
the document (AMD64 Architecture ProgrammerVolume 3: General-Purpose and
  System Instructions. Document revision 3.20)

-  "s/MXX/MMXX/" because this bit is "MMX eXtention".
2013-11-20 17:50:39 +00:00
jruoho
3649cbb139 Allow 4-bit range for MSR_THERM_CONTROL. 2013-11-20 13:52:30 +00:00
martin
d0d1f96433 Remove an unused variable 2013-11-17 19:22:06 +00:00
martin
93ac0a3a04 Remove unused variable 2013-11-17 18:08:08 +00:00
msaitoh
b1a32cacda Modify some macros and add some new macros for CPU family and model
to reduce code duplication and to avoid bug.

CPUID_TO_STEPPING(cpuid)	(not changed)

CPUID_TO_FAMILY(cpuid)		(new)
CPUID_TO_MODEL(cpuid)		(new)

	Return the display family and the display model.
	The macro names are the same as FreeBSD.

CPUID_TO_BASEFAMILY(cpuid)	(The old name was CPUID2FAMILY)
CPUID_TO_BASEMODEL(cpuid)	(The old name was CPUID2MODEL)

	Only for the base field.

CPUID_TO_EXTFAMILY(cpuid)	(The old name was CPUID2EXTFAMILY)
CPUID_TO_EXTMODEL(cpuid)	(The old name was CPUID2EXTMODEL)

	Only for the extended field.

See http://mail-index.netbsd.org/port-amd64/2013/11/12/msg001978.html
2013-11-15 08:47:55 +00:00
msaitoh
6431e0a75a Check the CPU display model instead of the base model. Re-enable the
checking for Atom and Silvermont.
2013-11-12 16:57:30 +00:00
msaitoh
421dcec454 Fix calculation of the cpu family (display family) in x86_cpu_topology().
More than bit 3 in cpu_family variable is checked in the function, so the
variable is assumed that it is not the base family but the display family
(base family + extended family).
2013-11-12 16:35:57 +00:00
msaitoh
e79e7d04d8 Revert previos. I accidentally committed a debug code. Sorry. 2013-11-12 16:15:54 +00:00
msaitoh
37d8a76f09 Fix a bug in last commit. Check correct variable. 2013-11-12 16:13:56 +00:00
msaitoh
60a409c1ff Fix calculation of the cpu model (display model) in cpu_probe_amd_cache().
The CPUID2MODEL() must be used only when the CPUID2FAMILY() macro returns
0xf or 0x6. Also fix a bug that CPUID2EXTMODEL() is _ADDED_. The correct way
is shifting the return value of CPUID2EXTMODEL() 4bit left and _OR_ it.
2013-11-12 16:11:39 +00:00
msaitoh
0e93695dc9 Fix calculation of the cpu model (display model) in coretemp_tjmax().
The CPUID2MODEL() macro returns only low 4bit, so the checking against 0x17
doesn't work correctly. The correct way is to use the display model.
Remove incorrect extmodel check. Same as FreeBSD.
2013-11-12 15:58:38 +00:00
msaitoh
4ebdac3180 Calcurate the processor family correctly. The extended family bits
should be added only when the base family is 0xf.
2013-11-12 15:08:01 +00:00
christos
27021b9452 CID 1128377: Comment out unreachable code; model is only 4 bits wide, so
none of these constants can ever match.
2013-11-11 17:02:53 +00:00
christos
abc81f7c5e use __unused instead of __USE and void cast to mark iterator variable unused
where needed (from phone)
2013-11-10 00:50:13 +00:00
msaitoh
c09afb26e1 space -> tab 2013-11-08 19:05:52 +00:00
christos
90f2e15193 fix unused variables 2013-11-08 01:41:45 +00:00
msaitoh
caea426a27 Get bus clock for some Atom processors. 2013-11-07 18:17:13 +00:00
mrg
8284ffb919 gcc 4.8 issues:
- avoid running over the end of an array (this is a real bug, but
  i didn't really look closely at what memory is clobbered.  it
  may not actually matter.)
- move variables inside their #if usage.
2013-11-06 20:19:03 +00:00
christos
6bdd8d8ebf initialize cii before using it. 2013-11-05 16:04:13 +00:00
msaitoh
c622541618 Support prefetch size. 2013-10-28 05:41:49 +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
msaitoh
ea7bd36351 Check cpuid leaf 4 for newer Intel CPU to know the cache information. 2013-10-21 06:33:11 +00:00
msaitoh
a5b582da9e - Add Intel Deterministic Cache Parameter Leaf (CPUID leaf 4).
This definitions are required to know cache information of
  newer Intel CPU.
- Fix comment.
2013-10-21 06:11:49 +00:00
christos
6a8eb50e91 remove set but unused variables 2013-10-17 21:12:24 +00:00
christos
148f2a4a9b __USE() unused variables 2013-10-17 20:59:16 +00:00
christos
b56b5d923d __USE a debugging variable 2013-10-17 20:58:55 +00:00
jakllsch
5dbec99fd5 Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.
2013-10-06 16:34:48 +00:00
rmind
931d487d87 Remove some unused variables. 2013-10-05 16:50:31 +00:00
gson
95c92af30e Force PCI mode 1 when running under QEMU, to work around QEMU bug 897771.
This should also make it possible to boot NetBSD under versions of KVM
that have inherited said QEMU bug.  Fixes PR kern/45671.
2013-10-05 11:20:34 +00:00
msaitoh
07c34455c2 Sort definitions. No functional change.
- CPUID_FEAT_BLACKLIST is for Fn00000001 %edx, so move it.
- Sort CPUID definitions with initial EAX value.
2013-10-04 17:53:19 +00:00
msaitoh
b688898b59 Add comment about CPUID Processor extended state Enumeration Fn0000000d %eax. 2013-10-04 17:21:43 +00:00
jakllsch
9463b0231c Use '\n' at the end of all aprint_error_dev() format strings. 2013-09-17 01:16:45 +00:00
msaitoh
14076ae099 Add Shared L2 TLB and some cache and tlb entries from the latest document. 2013-09-14 17:21:19 +00:00
msaitoh
66afe11791 Add some definitions of Intel's cpuid feature from the latest document. 2013-09-14 17:18:18 +00:00
jmcneill
04ca6cb022 md_root_setconf also depends on option MEMORY_DISK_DYNAMIC 2013-08-31 12:26:56 +00:00
jmcneill
1265ac6952 Add support for using a raw file-system image as memory disk root with
the x86 bootloader.
2013-08-30 16:42:17 +00:00
christos
788cc034d2 Use the default mp definition tables for ancient machines. From Felix
Deichmann.
2013-08-21 16:37:31 +00:00
drochner
4f7f7eac50 add feature flag definitions for the last round of Intel instruction
set extensions (AVX512 et al.)
2013-08-12 18:16:19 +00:00
yamt
43137dd04c fix validness check of sensor value
this change is intended to mirror what ipmitool does.
(their macros for these bits are IS_READING_UNAVAILABLE and
IS_SCANNING_DISABLED.)

see also:
    second-gen-interface-spec-v2-rev1-4
    Table 35-15, Get Sensor Reading Command

might fix PR/46833 from Francois Tigeot

reviewed by Masanobu SAITOH and Tom Ivar Helbekkmo
tested by Tom Ivar Helbekkmo
2013-08-12 15:40:34 +00:00
macallan
fd02c1f334 hand genfb the virtual address of the actual framebuffer, not the upper
left corner of the text area
now centering works and we don't scribble past the mapped VRAM when trying
to clear the screen in 32bit colour
2013-07-31 19:27:51 +00:00
soren
7f65496e43 Blocking memory space accesses on the SIS 85C496 chipset turned out to be
a bit too heavy-handed and similar cases are unlikely to crop up again,
so simplify by eliminating pci_bus_flags().

Closes PR port-i386/20410.
2013-07-31 14:05:33 +00:00
msaitoh
ad60ec6602 Style change. 2013-07-26 05:46:19 +00:00
msaitoh
b6ccf3bacb Add some new bit definitions of Structured Extended Feature Flags Enumeration
Leaf from the document (Intel 64 and IA-32 Architectures Software Developer's
Manual).
2013-07-25 16:34:29 +00:00
msaitoh
15389b84a6 Fix the bit positions in CPUID_SEF_FLAGS macro. On snprintb(), position 1
means LSB(bit0). The bit position from HLE to SMAP was 1 bit right shifted.
The bit position of BMI1 was completely wrong.
2013-07-25 16:31:33 +00:00
macallan
bc460f321e fix width vs height typo
from imre at vdsz.com
2013-07-25 15:09:27 +00:00
soren
4f69980004 Allow console on com_puc without a compile-time option so that PC servers
can become headless after the first reboot (sadly, e.g. Intel AMT presents
as a com_puc, but doesn't appear in the BIOS serial port table, so you need
a keyboard and monitor to install and set the installboot parameters first).

Fix com_puc console on devices with offset BAR's.
2013-07-22 13:40:36 +00:00
soren
e943400c80 A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa
2013-07-17 21:26:28 +00:00
msaitoh
629a712518 Add some new TLB and cache entries from document (Table 3-22 Encoding of CPUID
Leaf 2 Descriptors, Intel 64 and IA-32 Architectures Software Developer's
Manual Vol. 2A.)
2013-07-17 15:26:38 +00:00
msaitoh
449b90bab6 Fix 0x0d's DCACHE entry and 0xeb's L3CACHE entry from the document
(Table 3-22 Encoding of CPUID Leaf 2 Descriptors, Intel 64 and IA-32
Architectures Software Developer's Manual Vol. 2A.)
2013-07-17 15:22:43 +00:00
gdt
36854f2e86 #endif comments 2013-07-06 12:11:54 +00:00
gdt
f8e5069c8e Add #endif comments (only). 2013-07-06 12:03:11 +00:00
christos
9b40dbcce2 make a diagnostic message more informative. 2013-07-02 22:39:45 +00:00
christos
61276308e7 - remove unused variable
- call rdmsr() twice to avoid the 5.4210108624275222e-18% probability that
  rdmsr() returns 0.
From dsl@
2013-07-02 00:01:17 +00:00
jakllsch
9e60c83703 Print the ioapic version using unambiguous base.
From Felix Deichmann.
2013-06-28 14:31:49 +00:00
christos
b7b444d5e5 back out previous, fix is in tsc.c 2013-06-27 00:38:18 +00:00
christos
babd098e06 detect a bad msr tsc and don't use it. 2013-06-27 00:37:34 +00:00
christos
e7d3ff1397 PR/47967: Jeff Rizzo: Add a probe for QEMU to disable it from claiming it
has MSR_TSC. Fixes DTRACE crashing because it returned a frequency of 0.
2013-06-26 20:52:28 +00:00
matt
b1e43fe49f Use sy_invoke 2013-06-26 17:18:52 +00:00
uebayasi
35b9dd9fed Remove obsolete comment. OK'ed by rmind@. 2013-06-23 23:49:28 +00:00
msaitoh
23a617d62c Add Intel 8 Series / C220 Series LPC devices. 2013-06-04 13:59:16 +00:00
christos
cba6ac5833 Complete the dosparts -> mbrparts conversion. Only x86k new uses dosparts
because it also uses struct dos_partition.
2013-05-16 19:06:45 +00:00
christos
7b3a97f482 Complete the dosparts -> mbrparts conversion. Only x86k new uses dosparts
because it also uses struct dos_partition.
2013-05-16 19:06:44 +00:00
christos
5021bb4477 Complete the dosparts -> mbrparts conversion. Only x86k new uses dosparts
because it also uses struct dos_partition.
2013-05-16 19:06:44 +00:00
jakllsch
fb9266188c use IO_VGA as symbolic constant for 0x3c0 in x86_genfb_set_mapreg() 2013-05-03 15:42:29 +00:00
christos
c7de6e5ccf If we have both wedge and partition info, use the partition info in the
wedge case too. From mlelstv.
XXX: pullup-6
2013-04-28 14:32:55 +00:00
joerg
89a508fbb5 Systematically include sys/featuretest.h when _NETBSD_SOURCE is used.
Some are redundant, but make verification with grep much easier.
2013-04-27 21:35:24 +00:00
christos
37ddcb991e de-duplication police arrests sysctl. 2013-04-12 16:59:38 +00:00
chs
9027ae94cf remove unused variable declaration. 2013-03-31 19:45:06 +00:00
chs
4f901db954 yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both.  fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.
2013-03-31 19:34:24 +00:00
chs
f08eca0c18 only use db_printf() if we're actually called from DDB.
this prevents the boot-time one from pausing the boot process.
2013-03-25 01:34:59 +00:00
chs
f8a67d48b6 redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.
2013-03-25 01:30:37 +00:00
christos
cbcfee84d5 PR/47677 Aktado: x86_errata() should be avoided if NetBSD runs as a KVM guest.
XXX: pullup to 6
2013-03-21 13:22:37 +00:00
msaitoh
24d5b42322 KNF a bit. 2013-03-19 06:34:28 +00:00
jmmv
76512a9d94 Synchronize the clock periodically in vmt(4).
Add periodic clock synchronization to vmt(4) so that the guest clock
remains synchronized even when the host is suspended (which is a very
typical situation in a laptop).

Do this by default once per minute, but provide a sysctl to tune this
value (machdep.vmt0.clock_sync.period).

Sent to tech-kern@ for review and addressed a couple of issues.
2013-03-16 01:26:52 +00:00
yamt
3652d3afc6 some more definitions 2013-03-06 11:51:40 +00:00
dyoung
93a2640c3e Several registers and bitfields named IOAPIC_* actually belong to the
LAPIC, so rename them LAPIC_* and move to a more appropriate header
file.
2013-01-26 17:37:39 +00:00
christos
25ad3883ce Allow for non inlined definitions for RUMP 2013-01-22 22:09:44 +00:00
riastradh
4ac5510164 Match the C600's ichlpcib. 2013-01-12 20:33:59 +00:00
dsl
5c34b7d59f Correct the comment about the extended family and model bits.
Add some definitions related to the process extended state enumeration.
2013-01-06 22:37:36 +00:00
dsl
804a1dd71e Add some missing bit definitions to CPUID2 and those for XCR0.
Taken from the August 2012 Intel SDM (intel_x86_325462.pdf).
Split all the snprintb() format strings to make them (almost) readable.
Fix CPUID_AMD_FLAGS4 to not try to print bits \41 and \42.
2013-01-03 23:03:57 +00:00
christos
8c34a4cc0e don't leak a vnode on error 2012-12-29 21:57:13 +00:00
msaitoh
749b436486 Add Intel 7 series' LPC devices. 2012-12-19 05:52:00 +00:00
pgoyette
c768421a3a With recent introduction of conditionals for the various MP options, we
broke the build for x86 systems that have MULTIPROCESSOR but which do not
include MPBIOS.  So let's try to untangle things just a bit.  Presented
on current-users (and referenced on source-changes-d) without any comment.

XXX We really should find a better method to select kernel options; #ifdef
spaghetti is rather sub-optimal.
2012-12-12 22:43:35 +00:00
jakllsch
5c1c4e1fcf Reflect that this file is now for the x86 ports and not just i386 in comments. 2012-12-09 21:30:02 +00:00
jakllsch
dd049cd624 Remove trailing whitespace on blank lines. 2012-12-09 20:43:54 +00:00
kiyohara
a661216555 #ifdef - #endif-ed. NMCA, NISA, NNPX, NIOAPIC, LAPIC, MPBIOS and MULTIPROCESSOR. 2012-12-08 12:36:30 +00:00
msaitoh
4ebf4680ff Add support 3400 series, 5 series, C216, 82801GH, 82801E and 6300ESB. 2012-12-06 12:50:09 +00:00
msaitoh
beb6fb7455 No functional change:
- Remove trailing white space.
- Sort entries.
- Remove duplicated entries.
2012-12-06 10:32:44 +00:00
jruoho
392bbef39c Disable C1E also on K8, if present. From Imre Vadasz <imre@vdsz.com>
in PR install/47224.
2012-12-06 04:43:29 +00:00
christos
0a1df22000 Intel Atom E600 PCI-LPC bridge, adds a watchdog + HPET support. Tested
on a Soekris net6501. (jmcneill)
2012-12-05 16:19:46 +00:00
jakllsch
3d61196b02 Whitespace. 2012-11-27 20:32:58 +00:00