Commit Graph

1054 Commits

Author SHA1 Message Date
jruoho
0f58ad7ae9 Use native functions instead of polluting the namespace with ACPICA-macros. 2010-02-28 13:56:49 +00:00
jym
42e5342a52 Fixes regarding paddr_t/pd_entry_t types in MD x86 code, exposed by PAE:
- NBPD_* macros are set to the types that better match their architecture
(UL for i386 and amd64, ULL for i386 PAE) - will revisit when paddr_t is
set to 64 bits for i386 non-PAE.

- type fixes in printf/printk messages (Use PRIxPADDR when printing paddr_t
values, instead of %lx - paddr_t/pd_entry_t being 64 bits with PAE)

- remove casts that are no more needed now that Xen2 support has been dropped

Some fixes are from jmorse@ patches for PAE.

Compile + tested for i386 GENERIC and XEN3 kernels. Only compile tested for
amd64.

Reviewed by bouyer@.

See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html
2010-02-26 19:25:07 +00:00
dyoung
8687bf03ba In the x86 pci(9) implementation, test for and call a
pci_chipset_tag_t's override functions.
2010-02-25 20:51:10 +00:00
dyoung
6bbebe48f4 Change the pci_attach_args definition to allow machine-dependent
code to override the default pci(9) behavior by creating a non-NULL
pci_attach_args_t (on x86, pci_attach_args_t is always NULL) containing
one or more non-NULL function pointers.
2010-02-25 20:48:34 +00:00
dyoung
c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
dyoung
7e2170d1cd KNF: change spaces to tabs. 2010-02-24 21:34:23 +00:00
dyoung
71e3c83259 Don't bother to #define PCI_PREFER_IOSPACE, nothing uses it. 2010-02-24 21:25:51 +00:00
dyoung
440f38e104 Change 'typedef void *pci_chipset_tag_t' to 'typedef struct
pci_chipset_tag *pci_chipset_tag_t' for an improvement in type safety.
(Back when I did the same for cardbus_chipset_tag_t, it helped to turn
up some bugs!)
2010-02-24 21:24:20 +00:00
dyoung
e43ae59b99 Rename to 'pc' all variables 'pci_chipset_tag'. 2010-02-24 21:22:01 +00:00
dyoung
a60f2abe1f PCI Configuration Mechanisms #1 and #2 are controlled by two to
three registers.  Let us think of the kernel operating the registers
in two steps:

1) Select: enable configuration cycles and select a range of
   configuration-space addresses.

2) Access: read or write a word in PCI configuration space.

To make the steps more explicit, extract some helper subroutines
from pci_conf_read(9) and pci_conf_write(9):

pci_conf_selector(tag, reg): from a pcitag_t and a register offset,
    create a word that enables configuration cycles and selects a
    configuration address range.

pci_conf_select(w): for `w' a word created by pci_conf_selector(),
    enable configuration cycles and select the address range indicated
    by `w'.

pci_conf_select(0): disable configuration cycles.

pci_conf_port(tag, reg): map a pcitag_t and a register offset to an I/O
    port where the configuration access should occur.

While I'm in here, change the panic(9) calls to panic("%s: ...",
__func__) instead of hard-coding a subroutine name.
2010-02-16 19:29:40 +00:00
jym
6d2adb482c - re-factor code in pmap_map_ptes() slightly, and make it PAE-ready for
native i386 by using PDP_SIZE

- introduce pmap_unmap_apdp(), used to clear the APDP entries in PD, and
replace the relevant code parts with this function.

Comes from Jeremy Morse's patch for i386 PAE support. Adjustments by me.
2010-02-16 00:48:17 +00:00
dyoung
07a5af08b1 Get rid of all PCI_CONF_MODE #ifdef'age except for the little bit
that initializes pci_mode, which I have moved to the top.

Make pci_mode private to pci_machdep.c.

Provide pci_mode_set() for pcibios.c to configure the PCI Configuration
Mechanism.  KASSERT() in pci_mode_set() that the mechanism is not
changing from anything but the "don't know" value, -1.
2010-02-16 00:03:47 +00:00
pgoyette
6ac583dc32 Adapt to changes in sysmon's limit structure. 2010-02-14 23:07:59 +00:00
jym
499833724f Starting with Xen 3 API, MMU_EXTENDED_COMMAND (tlb flush, cache flush, page
pinning/unpinning, set_ldt, invlpg) operations cannot be queued in the
xpq_queue[] any more, as they use their own specific hypercall, mmuext_op().

Their associated xpq_queue_*() functions already call xpq_flush_queue()
before issuing the mmuext_op() hypercall, which makes these xpq_flush_queue()
calls not necessary.

Rapidly discussed with bouyer@ in private mail. XEN3_DOM0/XEN3PAE_DOM0 tested
through a build.sh release, amd64 was only compile tested. No regression
expected.
2010-02-12 01:55:45 +00:00
jym
68ab1c6897 To properly account for the total number of pages allocated for PDP, use
PDP_SIZE, as PAE (i386) requires 4 pages instead of 1.
2010-02-10 00:39:30 +00:00
jym
7a73ba3497 Wrap a comment; add a space after a comma to another (align with next line) 2010-02-09 23:52:13 +00:00
jym
25df75469b Use roundup2() instead of hardcoding the operation. 2010-02-09 23:47:10 +00:00
jym
753d396585 Fix typos in comments. 2010-02-09 22:51:13 +00:00
mlelstv
9c35c3d3a7 Release buffer in case a receive failed. 2010-01-31 11:39:55 +00:00
hubertf
af120bb199 Replace more printfs with aprint_normal / aprint_verbose
Makes "boot -z" go mostly silent for me.
2010-01-31 00:43:37 +00:00
rmind
b6c2588582 x86_cpu_topology, not toplogy. 2010-01-18 16:40:17 +00:00
njoly
56cdb3bbf3 Use __arraycount instead of locally defined macro. 2010-01-13 15:31:47 +00:00
cegger
abd4f4b435 recognize SVM PauseFilter 2010-01-13 12:54:49 +00:00
jym
fefe0aff38 Simplify pmap_init_tmp_pgtbl() a bit.
The first level of the temporary page mappings are also done in the first
iteration of the loop below, so no need to do it before.

ok by joerg@ in private mail.
2010-01-10 12:10:23 +00:00
cegger
8ab319847f TOPLIMIT for i386 PAE is 64GB. 2010-01-09 22:54:00 +00:00
cegger
06f2c03231 add x2apic support.
patch presented on current-users@, port-i386@ and port-amd64@ on 2009-12-22

No comments.
2010-01-09 20:56:17 +00:00
cegger
07e7c0c3fa add LAPIC_MSR_ENABLE_x2 MSR. from murray@river-styx via port-amd64@
'...as documented in the Intel 64 and IA32 Architectures Software
   Developers Manual 3A, chapter 10.5.1.'
2010-01-09 20:50:11 +00:00
dyoung
3022acc4eb Expand PMF_FN_* macros. 2010-01-08 19:42:11 +00:00
dyoung
e94f23b742 Move all copies of ifattr_match() to sys/kern/subr_autoconf.c. 2010-01-08 00:09:44 +00:00
jruoho
50af5a5ff5 Put back the evaluation of the return value from mpacpi_get_bbn().
Break reported by njoly@. Thanks!
2010-01-05 17:23:18 +00:00
jruoho
5bb528f36b Use acpi_eval_set_integer() to simplify code. No functional change intended.
ok pgoyette@, jmcneill@
2010-01-05 13:57:18 +00:00
jruoho
6538aaf890 Fix several possible memory leaks in mpacpi_derive_bus().
ok pgoyette@, jmcneill@
2010-01-05 13:32:49 +00:00
mbalmer
2603a89351 One semicolon only (;; -> ;) 2010-01-05 13:20:29 +00:00
sborrill
e52d21a22a Interim workaround for modern Xeons that don't have the simplistic view of
bus speed and therefore do not support MSR_FSB_FREQ (e.g. X3400). In the
long-term, ACPI should be used for this (c.f. FreeBSD).
2009-12-03 14:47:15 +00:00
sborrill
b25ce49b1e CPU model and CPU extended model cannot simply be summed; the extended model
differentiates different CPUs within a given model type (i.e. model 0xe with
extended model 0x1 is NOT the same as a model 0xf).
Modern Xeons do not support MSR_IA32_EXT_CONFIG, so use model and extended
model correctly to avoid it
2009-12-03 14:44:12 +00:00
rmind
ce313d4fb1 Replace l_addr with uvm_lwp_getuarea() in various MD code, mostly cpu_lwp_fork(). 2009-11-29 04:15:42 +00:00
tron
8fe9393167 Fix build of kernels without PCI support like "GENERIC_TINY". 2009-11-25 19:46:19 +00:00
njoly
a323bb797a aprintify. 2009-11-25 15:06:26 +00:00
rmind
9303fb5a00 Remove IPL_LPT and IPL_IPI aliases, use the actual IPLs.
Fix some broken comments.
2009-11-25 14:28:49 +00:00
rmind
fc756ae2f7 Disable kstack red-zone for now, while we decide on a nice way to fix it. 2009-11-25 13:38:38 +00:00
bouyer
e0e426bb85 For amd64, introduce a third free list distinct from the default free list
for memory between 16M and 4G. On large memory machine, this avoids
the 32bit-accessible memory being eaten by various kernel early allocation,
causing 32bit bus_dma(9) memory allocation to fail at boot time.
Tested on a system with 48GB RAM; based on netbsd-5 patch proposed on
port-amd64 3 days ago.
2009-11-22 21:41:03 +00:00
rmind
3c2bd91e81 Use lwp_getpcb() on x86 MD code, clean from struct user usage. 2009-11-21 03:11:00 +00:00
cegger
e72026cf1f update comment: we use PMAP_NOCACHE for both pmap_enter and pmap_kenter_pa 2009-11-11 17:08:16 +00:00
yamt
be3e4126f3 x86_get_sdbase: copyout to a correct address. 2009-11-11 13:38:53 +00:00
cegger
962afef088 Implement pmap_kenter_pa(9) new flag argument in x86.
Make x86 bus_space(9) using it to eliminate an extra TLB flush.
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
Thanks to Martin Husemann for spotting copy&pasto errors in the original patch version.
2009-11-07 07:32:53 +00:00
cegger
9480c51b04 Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
2009-11-07 07:27:40 +00:00
dyoung
a43418e649 Use deviter(9) instead of accessing alldevs directly. 2009-11-06 23:10:22 +00:00
dsl
f73c380ff9 Don't call _bus_dmamem_free() when _bus_dmamem_alloc() fails.
Fixes PR/42208
2009-11-06 23:10:10 +00:00
toshii
c8d10319f7 Don't return an error if the _PIC method isn't found.
It's an optional method and not found in kvm/qemu.
2009-11-04 14:39:17 +00:00
dyoung
c64f34a1e5 Gracelessly bracket #include "opt_spldebug.h" with #ifdef i386.
Should fix the amd64 kernel-build failure that Andreas Wrede
reported.
2009-11-03 20:11:53 +00:00