]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoRemove mptable generation code from libvmmapi and move it to bhyve.
Peter Grehan [Fri, 26 Oct 2012 13:40:12 +0000 (13:40 +0000)]
Remove mptable generation code from libvmmapi and move it to bhyve.
Firmware tables require too much knowledge of system configuration,
and it's difficult to pass that information in general terms to a library.
The upcoming ACPI work exposed this - it will also livein bhyve.

Also, remove code specific to NetApp from the mptable name, and remove
the -n option from bhyve.

Reviewed by: neel
Obtained from: NetApp

11 years agoUnconditionally enable fpu emulation by setting CR0.TS in the host after the
Neel Natu [Fri, 26 Oct 2012 03:12:40 +0000 (03:12 +0000)]
Unconditionally enable fpu emulation by setting CR0.TS in the host after the
guest does a vm exit.

This allows us to trap any fpu access in the host context while the fpu still
has "dirty" state belonging to the guest.

Reported by: "s vas" on freebsd-virtualization@
Obtained from: NetApp

11 years agoIf the guest vcpu wants to idle then use that opportunity to relinquish the
Neel Natu [Thu, 25 Oct 2012 04:29:21 +0000 (04:29 +0000)]
If the guest vcpu wants to idle then use that opportunity to relinquish the
host cpu to the scheduler until the guest is ready to run again.

This implies that the host cpu utilization will now closely mirror the actual
load imposed by the guest vcpu.

Also, the vcpu mutex now needs to be of type MTX_SPIN since we need to acquire
it inside a critical section.

Obtained from: NetApp

11 years agoHide the monitor/mwait instruction capability from the guest until we know how
Neel Natu [Thu, 25 Oct 2012 04:08:26 +0000 (04:08 +0000)]
Hide the monitor/mwait instruction capability from the guest until we know how
to properly intercept it.

Obtained from: NetApp

11 years agoFix typo: host_rip -> host_rsp
Neel Natu [Thu, 25 Oct 2012 03:39:36 +0000 (03:39 +0000)]
Fix typo: host_rip -> host_rsp

Obtained from: NetApp

11 years agoMaintain state regarding NMI delivery to guest vcpu in VT-x independent manner.
Neel Natu [Wed, 24 Oct 2012 02:54:21 +0000 (02:54 +0000)]
Maintain state regarding NMI delivery to guest vcpu in VT-x independent manner.
Also add a stats counter to count the number of NMIs delivered per vcpu.

Obtained from: NetApp

11 years agoTest for AST pending with interrupts disabled right before entering the guest.
Neel Natu [Tue, 23 Oct 2012 02:20:42 +0000 (02:20 +0000)]
Test for AST pending with interrupts disabled right before entering the guest.

If an IPI was delivered to this cpu before interrupts were disabled
then return right away via vmx_setjmp() with a return value of VMX_RETURN_AST.

Obtained from: NetApp

11 years agoCalculate the number of host ticks until the next guest timer interrupt.
Neel Natu [Sat, 20 Oct 2012 08:23:05 +0000 (08:23 +0000)]
Calculate the number of host ticks until the next guest timer interrupt.

This information will be used in conjunction with guest "HLT exiting" to
yield the thread hosting the virtual cpu.

Obtained from: NetApp

11 years agoRework how guest MMIO regions are dealt with.
Peter Grehan [Fri, 19 Oct 2012 18:11:17 +0000 (18:11 +0000)]
Rework how guest MMIO regions are dealt with.

- New memory region interface. An RB tree holds the regions,
with a last-found per-vCPU cache to deal with the common case
of repeated guest accesses to MMIO registers in the same page.

- Support memory-mapped BARs in PCI emulation.

 mem.c/h - memory region interface

 instruction_emul.c/h - remove old region interface.
 Use gpa from EPT exit to avoid a tablewalk to
 determine operand address. Determine operand size
 and use when calling through to region handler.

 fbsdrun.c - call into region interface on paging
  exit. Distinguish between instruction emul error
  and region not found

 pci_emul.c/h - implement new BAR callback api.
 Split BAR alloc routine into routines that
 require/don't require the BAR phys address.

 ioapic.c
 pci_passthru.c
 pci_virtio_block.c
 pci_virtio_net.c
 pci_uart.c  - update to new BAR callback i/f

Reviewed by: neel
Obtained from: NetApp

11 years agoAdd the guest physical address and r/w/x bits to
Peter Grehan [Fri, 12 Oct 2012 23:12:19 +0000 (23:12 +0000)]
Add the guest physical address and r/w/x bits to
the paging exit in preparation for a rework of
bhyve MMIO handling.

Reviewed by: neel
Obtained from: NetApp

11 years agoDeal with transient EBUSY error return from vm_run() by retrying the operation.
Neel Natu [Fri, 12 Oct 2012 18:49:07 +0000 (18:49 +0000)]
Deal with transient EBUSY error return from vm_run() by retrying the operation.

11 years agoProvide per-vcpu locks instead of relying on a single big lock.
Neel Natu [Fri, 12 Oct 2012 18:32:44 +0000 (18:32 +0000)]
Provide per-vcpu locks instead of relying on a single big lock.

This also gets rid of all the witness.watch warnings related to calling
malloc(M_WAITOK) while holding a mutex.

Reviewed by: grehan

11 years agoOutput the value of all capabilities when the "--getcap" option is used without
Neel Natu [Fri, 12 Oct 2012 18:14:54 +0000 (18:14 +0000)]
Output the value of all capabilities when the "--getcap" option is used without
a "--capname=<capname>". Do the same for the "--get-all" option.

11 years agoAdd an api to map a vm capability type into a string to be used for display
Neel Natu [Fri, 12 Oct 2012 17:39:28 +0000 (17:39 +0000)]
Add an api to map a vm capability type into a string to be used for display
purposes.

11 years agoFix warnings generated by 'debug.witness.watch' during VM creation and
Neel Natu [Thu, 11 Oct 2012 19:39:54 +0000 (19:39 +0000)]
Fix warnings generated by 'debug.witness.watch' during VM creation and
destruction for calling malloc() with M_WAITOK while holding a mutex.

Do not allow vmm.ko to be unloaded until all virtual machines are destroyed.

11 years agoDeliver the MSI to the correct guest virtual cpu.
Neel Natu [Thu, 11 Oct 2012 19:28:07 +0000 (19:28 +0000)]
Deliver the MSI to the correct guest virtual cpu.

Prior to this change the MSI was being delivered unconditionally to vcpu 0
regardless of how the guest programmed the MSI delivery.

11 years agoGrab the softc from the ACPI host-pci bridge device instead of from the pci
Neel Natu [Wed, 10 Oct 2012 00:11:06 +0000 (00:11 +0000)]
Grab the softc from the ACPI host-pci bridge device instead of from the pci
endpoint device.

Reviewed by: jhb

11 years agoAllocate memory pages for the guest from the host's free page queue.
Neel Natu [Mon, 8 Oct 2012 23:41:26 +0000 (23:41 +0000)]
Allocate memory pages for the guest from the host's free page queue.

It is no longer necessary to hard-partition the memory between the host
and guests at boot time.

11 years agoClarify comment about default number of FICL dictionary cells.
Peter Grehan [Thu, 4 Oct 2012 03:59:45 +0000 (03:59 +0000)]
Clarify comment about default number of FICL dictionary cells.

Suggested by: peterj

11 years agoThe ioctl VM_GET_MEMORY_SEG is no longer able to return the host physical
Neel Natu [Thu, 4 Oct 2012 03:07:05 +0000 (03:07 +0000)]
The ioctl VM_GET_MEMORY_SEG is no longer able to return the host physical
address associated with the guest memory segment. This is because there is
no longer a 1:1 mapping between GPA and HPA.

As a result 'vmmctl' can only display the guest physical address and the
length of the lowmem and highmem segments.

11 years agoChange vm_malloc() to map pages in the guest physical address space in 4KB
Neel Natu [Thu, 4 Oct 2012 02:27:14 +0000 (02:27 +0000)]
Change vm_malloc() to map pages in the guest physical address space in 4KB
chunks. This breaks the assumption that the entire memory segment is
contiguously allocated in the host physical address space.

This also paves the way to satisfy the 4KB page allocations by requesting
free pages from the VM subsystem as opposed to hard-partitioning host memory
at boot time.

11 years agoAllow the number of FICL dictionary cells to be overridden.
Peter Grehan [Wed, 3 Oct 2012 04:22:39 +0000 (04:22 +0000)]
Allow the number of FICL dictionary cells to be overridden.
Loading a 7.3 ISO with userboot/amd64 takes up 10035 cells,
overflowing the long-standing default of 10000.

Bump userboot's value up to 15000 cells.

11 years agoRework the GPT/MBR/raw policy so that it actually works, and navigates
Peter Grehan [Wed, 3 Oct 2012 03:00:37 +0000 (03:00 +0000)]
Rework the GPT/MBR/raw policy so that it actually works, and navigates
around disk_open's current handling of falling back from GPT to MBR.

As in the previous commit, this should all be fixed in CURRENT.

11 years agoRestore the ability to boot partitioned disks. The previous submit
Peter Grehan [Wed, 3 Oct 2012 02:58:55 +0000 (02:58 +0000)]
Restore the ability to boot partitioned disks. The previous submit
broke that by forcing raw disks, due to the use of error returns
by userboot's initial disk opens.

11 years agoGet rid of assumptions in the hypervisor that the host physical memory
Neel Natu [Wed, 3 Oct 2012 01:18:51 +0000 (01:18 +0000)]
Get rid of assumptions in the hypervisor that the host physical memory
associated with guest physical memory is contiguous.

Add check to vm_gpa2hpa() that the range indicated by [gpa,gpa+len) is all
contained within a single 4KB page.

11 years agoGet rid of assumptions in the hypervisor that the host physical memory
Neel Natu [Wed, 3 Oct 2012 00:46:30 +0000 (00:46 +0000)]
Get rid of assumptions in the hypervisor that the host physical memory
associated with guest physical memory is contiguous.

Rewrite vm_gpa2hpa() to get the GPA to HPA mapping by querying the nested
page tables.

11 years agoFix the error return in disk_readslicetab() when an MBR/GPT partition
Peter Grehan [Tue, 2 Oct 2012 04:41:43 +0000 (04:41 +0000)]
Fix the error return in disk_readslicetab() when an MBR/GPT partition
wasn't found, and use that in userdisk_open() to allow raw disks
and ISO images to be read.

This is a temporary fix - disk.c has changed a lot in CURRENT so this
code may be reworked or made redundant on the next IFC. It is useful
to be able to boot from CD in the meantime.

11 years agoAdd cd9660 support to userboot to allow CD boot.
Peter Grehan [Tue, 2 Oct 2012 04:36:37 +0000 (04:36 +0000)]
Add cd9660 support to userboot to allow CD boot.

11 years agoGet rid of assumptions in the hypervisor that the host physical memory
Neel Natu [Sat, 29 Sep 2012 01:15:45 +0000 (01:15 +0000)]
Get rid of assumptions in the hypervisor that the host physical memory
associated with guest physical memory is contiguous.

In this case vm_malloc() was using vm_gpa2hpa() to indirectly infer whether
or not the address range had already been allocated.

Replace this instead with an explicit API 'vm_gpa_available()' that returns
TRUE if a page is available for allocation in guest physical address space.

11 years agoIntel VT-x provides the length of the instruction at the time of the nested
Neel Natu [Thu, 27 Sep 2012 00:27:58 +0000 (00:27 +0000)]
Intel VT-x provides the length of the instruction at the time of the nested
page table fault. Use this when fetching the instruction bytes from the guest
memory.

Also modify the lapic_mmio() API so that a decoded instruction is fed into it
instead of having it fetch the instruction bytes from the guest. This is
useful for hardware assists like SVM that provide the faulting instruction
as part of the vmexit.

11 years agoAdd an option "-a" to present the local apic in the XAPIC mode instead of the
Neel Natu [Wed, 26 Sep 2012 00:06:17 +0000 (00:06 +0000)]
Add an option "-a" to present the local apic in the XAPIC mode instead of the
default X2APIC mode to the guest.

11 years agoAdd support for trapping MMIO writes to local apic registers and emulating them.
Neel Natu [Tue, 25 Sep 2012 22:31:35 +0000 (22:31 +0000)]
Add support for trapping MMIO writes to local apic registers and emulating them.

The default behavior is still to present the local apic to the guest in the
x2apic mode.

11 years agoAdd ioctls to control the X2APIC capability exposed by the virtual machine to
Neel Natu [Tue, 25 Sep 2012 19:08:51 +0000 (19:08 +0000)]
Add ioctls to control the X2APIC capability exposed by the virtual machine to
the guest.

At the moment this simply sets the state in the 'vcpu' instance but there is
no code that acts upon these settings.

11 years agoAdd an explicit exit code 'SPINUP_AP' to tell the controlling process that an
Neel Natu [Tue, 25 Sep 2012 02:33:25 +0000 (02:33 +0000)]
Add an explicit exit code 'SPINUP_AP' to tell the controlling process that an
AP needs to be activated by spinning up an execution context for it.

The local apic emulation is now completely done in the hypervisor and it will
detect writes to the ICR_LO register that try to bring up the AP. In response
to such writes it will return to userspace with an exit code of SPINUP_AP.

Reviewed by: grehan

11 years agoStash the 'vm_exit' information in each 'struct vcpu'.
Neel Natu [Mon, 24 Sep 2012 19:32:24 +0000 (19:32 +0000)]
Stash the 'vm_exit' information in each 'struct vcpu'.

There is no functional change at this time but this paves the way for vm exit
handler functions to easily modify the exit reason going forward.

11 years agoRestructure the x2apic access code in preparation for supporting memory mapped
Neel Natu [Fri, 21 Sep 2012 03:09:23 +0000 (03:09 +0000)]
Restructure the x2apic access code in preparation for supporting memory mapped
access to the local apic.

The vlapic code is now aware of the mode that the guest is using to access the
local apic.

Reviewed by: grehan@

12 years agoAdd sysctls to display the total and free amount of hard-wired mem for VMs
Peter Grehan [Sun, 26 Aug 2012 01:41:41 +0000 (01:41 +0000)]
Add sysctls to display the total and free amount of hard-wired mem for VMs
   # sysctl hw.vmm
   hw.vmm.mem_free: 2145386496
   hw.vmm.mem_total: 2145386496

Submitted by: Takeshi HASEGAWA hasegaw at gmail com

12 years agoFix a bug in how a 64-bit bar in a pci passthru device would be presented to
Neel Natu [Mon, 6 Aug 2012 07:20:25 +0000 (07:20 +0000)]
Fix a bug in how a 64-bit bar in a pci passthru device would be presented to
the guest. Prior to the fix it was possible for such a bar to appear as a
32-bit bar as long as it was allocated from the region below 4GB.

This had the potential to confuse some drivers that were particular about
the size of the bars.

Obtained from: NetApp

12 years agoAdd support for emulating PCI multi-function devices.
Neel Natu [Mon, 6 Aug 2012 06:51:27 +0000 (06:51 +0000)]
Add support for emulating PCI multi-function devices.

These function number is specified by an optional [:<func>] after the slot
number: -s 1:0,virtio-net,tap0

Ditto for the mptable naming: -n 1:0,e0a

Obtained from: NetApp

12 years agoDevice model for ioapic emulation.
Neel Natu [Sun, 5 Aug 2012 00:00:52 +0000 (00:00 +0000)]
Device model for ioapic emulation.

With this change the uart emulation is entirely interrupt driven.

Obtained from: NetApp

12 years agoThe displacement field in the decoded instruction should be treated as a 8-bit
Neel Natu [Sat, 4 Aug 2012 23:51:21 +0000 (23:51 +0000)]
The displacement field in the decoded instruction should be treated as a 8-bit
or 32-bit signed integer.

Simplify the handling of indirect addressing with displacement by
unconditionally adding the 'instruction->disp' to the target address.
This is alright since 'instruction->disp' is non-zero only for the
addressing modes that specify a displacement.

Obtained from: NetApp

12 years agoAdd the "-I" option to control whether or not an ioapic is visible to the guest.
Neel Natu [Sat, 4 Aug 2012 22:48:04 +0000 (22:48 +0000)]
Add the "-I" option to control whether or not an ioapic is visible to the guest.

Obtained from: NetApp

12 years agoAllow the 'bhyve' process to control whether or not the virtual machine sees an
Neel Natu [Sat, 4 Aug 2012 22:46:29 +0000 (22:46 +0000)]
Allow the 'bhyve' process to control whether or not the virtual machine sees an
ioapic.

Obtained from: NetApp

12 years agoInclude 'device uart' in the guest kernel.
Neel Natu [Sat, 4 Aug 2012 04:30:26 +0000 (04:30 +0000)]
Include 'device uart' in the guest kernel.

12 years agoUse the correct variable to index into the 'lirq[]' array to check the legacy
Neel Natu [Sat, 4 Aug 2012 04:26:17 +0000 (04:26 +0000)]
Use the correct variable to index into the 'lirq[]' array to check the legacy
IRQ ownership.

12 years agoCheck that 'opts' is actually not NULL before dereferencing it. It is expected
Neel Natu [Sat, 4 Aug 2012 04:24:41 +0000 (04:24 +0000)]
Check that 'opts' is actually not NULL before dereferencing it. It is expected
that 'opts' will be NULL for the second serial port (-S <slot>,uart)

12 years agoAPI to map an apic id to the vcpu.
Neel Natu [Sat, 4 Aug 2012 02:38:05 +0000 (02:38 +0000)]
API to map an apic id to the vcpu.

At the moment this is a simple mapping because the numerical values are
identical.

12 years agoThere is no need to explicitly specify the CR4_VMXE bit when writing to guest
Neel Natu [Sat, 4 Aug 2012 02:14:27 +0000 (02:14 +0000)]
There is no need to explicitly specify the CR4_VMXE bit when writing to guest
CR4. This bit is specific to the Intel VTX and removing it makes the library
more portable to AMD/SVM.

In the Intel VTX implementation, the hypervisor will ensure that this bit is
always set. See vmx_fix_cr4() for details.

Suggested by: grehan

12 years agoForce certain bits in %cr4 to be hard-wired to '1' or '0' from a guest's
Neel Natu [Sat, 4 Aug 2012 02:06:55 +0000 (02:06 +0000)]
Force certain bits in %cr4 to be hard-wired to '1' or '0' from a guest's
perspective. If we don't do this some guest OSes (e.g. Linux) will reset
the CR4_VMXE bit in %cr4 with disastrous consequences.

Reported by: grehan

12 years agoBump up the heap size to 1MB. With a few kernel modules, libstand
Peter Grehan [Wed, 1 Aug 2012 05:53:20 +0000 (05:53 +0000)]
Bump up the heap size to 1MB. With a few kernel modules, libstand
zalloc and userboot seem to want to use ~600KB of heap space, which
results in a segfault when malloc fails in bhyveload.

Reported by:  sree dot openwrk at gmail dot com

12 years agoFix compilation error when compiling a kernel without KDTRACE_HOOKS
Neel Natu [Wed, 25 Jul 2012 01:05:49 +0000 (01:05 +0000)]
Fix compilation error when compiling a kernel without KDTRACE_HOOKS

12 years agoVerify that VMX operation has been enabled by BIOS before executing the
Neel Natu [Wed, 25 Jul 2012 00:21:16 +0000 (00:21 +0000)]
Verify that VMX operation has been enabled by BIOS before executing the
VMXON instruction.

Reported by "s vas" on freebsd-virtualization@

12 years agoAdd --get-all option to dump all readable parameters.
Peter Grehan [Thu, 12 Jul 2012 00:27:33 +0000 (00:27 +0000)]
Add --get-all option to dump all readable parameters.

Submitted by: Takuya Asada  syuu at dokukino dot com
Reviewed by: grehan, neel
Obtained from: GSoC 12 bhyve project

12 years agoBHyVe's vmm.ko can now be built with the in-tree binutils.
Peter Grehan [Wed, 11 Jul 2012 23:12:17 +0000 (23:12 +0000)]
BHyVe's vmm.ko can now be built with the in-tree binutils.

Many thanks to jhb@ for making this happen.

12 years agoIFC @ r238370
Peter Grehan [Wed, 11 Jul 2012 19:54:21 +0000 (19:54 +0000)]
IFC @ r238370

12 years agoat91pit->at91_pit for consistnecy with other drivers.
Warner Losh [Wed, 11 Jul 2012 17:11:54 +0000 (17:11 +0000)]
at91pit->at91_pit for consistnecy with other drivers.

12 years agoat91$DEV->at91_$DEV to match other Atmel drivers. Also, export
Warner Losh [Wed, 11 Jul 2012 17:11:07 +0000 (17:11 +0000)]
at91$DEV->at91_$DEV to match other Atmel drivers.  Also, export
at91_rst_cpu_reset.

12 years agoInitial commit of an I/O provider for DTrace on FreeBSD.
George V. Neville-Neil [Wed, 11 Jul 2012 16:27:02 +0000 (16:27 +0000)]
Initial commit of an I/O provider for DTrace on FreeBSD.

These probes are most useful when looking into the structures
they provide, which are listed in io.d.  For example:

dtrace -n 'io:genunix::start { printf("%d\n", args[0]->bio_bcount); }'

Note that the I/O systems in FreeBSD and Solaris/Illumos are sufficiently
different that there is not a 1:1 mapping from scripts that work
with one to the other.
MFC after: 1 month

12 years agoCast a bus address to a uintmax_t for a debug printf to fix the build on
John Baldwin [Wed, 11 Jul 2012 15:04:20 +0000 (15:04 +0000)]
Cast a bus address to a uintmax_t for a debug printf to fix the build on
arm.

12 years agoMap ATH_KTR_* to 0 when ATH_DEBUG is not defined. This effectively NOPs
John Baldwin [Wed, 11 Jul 2012 12:10:13 +0000 (12:10 +0000)]
Map ATH_KTR_* to 0 when ATH_DEBUG is not defined.  This effectively NOPs
out their use in that case.

12 years ago- fix description of SECURITY_FREEZE_LOCK (1)
Christian Brueffer [Wed, 11 Jul 2012 08:24:30 +0000 (08:24 +0000)]
- fix description of SECURITY_FREEZE_LOCK (1)
- add missing underscores to SECURITY_DISABLE_PASSWORD

PR: 169763 (1)
Submitted by: Steven Hartland <steven.hartland@multiplay.co.uk>
Reviewed by: mav
MFC after: 1 week

12 years agoMerge from r234532:
Hiroki Sato [Wed, 11 Jul 2012 02:57:32 +0000 (02:57 +0000)]
Merge from r234532:

- Fix an ifname matching issue which prevented "ifconfig wlan0 create" from
  working.
- Return non-zero status when unit < 0.

Spotted by: dhw

12 years agoVarious VirtIO improvements
Peter Grehan [Wed, 11 Jul 2012 02:57:19 +0000 (02:57 +0000)]
Various VirtIO improvements

      PCI:
        - Properly handle interrupt fallback from MSIX to MSI to legacy.
          The host may not have sufficient resources to support MSIX,
          so we must be able to fallback to legacy interrupts.
        - Add interface to get the (sub) vendor and device IDs.
        - Rename flags to VTPCI_FLAG_* like other VirtIO drivers.
      Block:
        - No longer allocate vtblk_requests from separate UMA zone.
          malloc(9) from M_DEVBUF is sufficient. Assert segment counts
          at allocation.
        - More verbose error and debug messages.
      Network:
        - Remove stray write once variable.
      Virtqueue:
        - Shuffle code around in preparation of converting the mb()s to
          the appropriate atomic(9) operations.
        - Only walk the descriptor chain when freeing if INVARIANTS is
          defined since the result is only KASSERT()ed.

Submitted by: Bryan Venteicher (bryanv@daemoninthecloset.org)

12 years agoDocument the object type movements, related to swp_pager_copy(),
Attilio Rao [Wed, 11 Jul 2012 01:04:59 +0000 (01:04 +0000)]
Document the object type movements, related to swp_pager_copy(),
in vm_object_collapse() and vm_object_split().

In collabouration with: alc
MFC after: 3 days

12 years agoRemove some more unused code.
Warner Losh [Tue, 10 Jul 2012 23:11:52 +0000 (23:11 +0000)]
Remove some more unused code.

12 years agoAvoid recursion on the pvh global lock in the aim oea pmap.
Alan Cox [Tue, 10 Jul 2012 22:10:21 +0000 (22:10 +0000)]
Avoid recursion on the pvh global lock in the aim oea pmap.

Correct the return type of the pmap_ts_referenced() implementations.

Reported by: jhibbits [1]
Tested by: andreast

12 years agoChange a duplicated check to clarify that we really want to set a
Christian Brueffer [Tue, 10 Jul 2012 21:02:59 +0000 (21:02 +0000)]
Change a duplicated check to clarify that we really want to set a
reasonable default timeout.

PR: 163135
Submitted by: Sascha Wildner <saw@online.de>
Suggested by: bp
Reviewed by: bp

12 years agoSimplify error case
Ed Maste [Tue, 10 Jul 2012 20:59:35 +0000 (20:59 +0000)]
Simplify error case

Submitted by: thompsa@

12 years agoGo ahead and disable the interrupts for the DBGU the boot loader may
Warner Losh [Tue, 10 Jul 2012 19:48:42 +0000 (19:48 +0000)]
Go ahead and disable the interrupts for the DBGU the boot loader may
have left enabled after we detect the CPU, and remove the multiplely
copied code from the SoC modules.

12 years agoFix build when ATH_DEBUG is not defined.
John Baldwin [Tue, 10 Jul 2012 18:57:05 +0000 (18:57 +0000)]
Fix build when ATH_DEBUG is not defined.

12 years agoCommit missing flags for the high/low priority (HP/LP) RX queues.
Adrian Chadd [Tue, 10 Jul 2012 18:30:20 +0000 (18:30 +0000)]
Commit missing flags for the high/low priority (HP/LP) RX queues.

Noticed by: everyone

12 years agoRemove a useless bit of indirection. On all Atmel ARM products, irq 1
Warner Losh [Tue, 10 Jul 2012 15:02:29 +0000 (15:02 +0000)]
Remove a useless bit of indirection.  On all Atmel ARM products, irq 1
is the system IRQ, so use the define for it and get on with life.

12 years agoRevert committal of local change accidentally swept up in r238329.
Warner Losh [Tue, 10 Jul 2012 14:21:25 +0000 (14:21 +0000)]
Revert committal of local change accidentally swept up in r238329.

12 years agoPlug potential mbuf leak when bridging fragments
Ed Maste [Tue, 10 Jul 2012 13:17:32 +0000 (13:17 +0000)]
Plug potential mbuf leak when bridging fragments

If an error occurs when transmitting one mbuf in a chain of fragments,
free the subsequent fragments instead of leaking them.

Sponsored by:   ADARA Networks

12 years agoMove the ffclock symbols from FBSD_1.2 to FBSD_1.3 where they should have been
Lawrence Stewart [Tue, 10 Jul 2012 08:31:28 +0000 (08:31 +0000)]
Move the ffclock symbols from FBSD_1.2 to FBSD_1.3 where they should have been
put initially. They were added to head during development of 10-CURRENT, not
9-CURRENT.

Submitted by: glebius
Reviewed by: kib

12 years agoAdd some debugging and comments about what's going on when reinitialising
Adrian Chadd [Tue, 10 Jul 2012 07:45:47 +0000 (07:45 +0000)]
Add some debugging and comments about what's going on when reinitialising
the FIFO.

I still see some corner cases where no RX occurs when it should be
occuring.  It's quite possible that there's a subtle race condition
somewhere; or maybe I'm not programming the RX queues right.

There's also no locking here yet, so any reset/configuration path
state change (ie, enabling/disabling receive from the ioctl, net80211
taskqueue, etc) could quite possibly confuse things.

12 years agoFlip on EDMA RX of both HP and LP queue frames.
Adrian Chadd [Tue, 10 Jul 2012 07:43:31 +0000 (07:43 +0000)]
Flip on EDMA RX of both HP and LP queue frames.

Yes, this is in the legacy interrupt path.  The NIC does support
MSI but I haven't yet sat down and written that code.

12 years agoPure style mischief. at91_$DEV_ rather than at91$DEV_ to match
Warner Losh [Tue, 10 Jul 2012 06:21:42 +0000 (06:21 +0000)]
Pure style mischief.  at91_$DEV_ rather than at91$DEV_ to match
others.

12 years agoMinor rework to eliminate at91rm9200reg.h dependency and possibly set the
Warner Losh [Tue, 10 Jul 2012 06:18:53 +0000 (06:18 +0000)]
Minor rework to eliminate at91rm9200reg.h dependency and possibly set the
stage for a detach routine (unlikely to be useful, but while I was here..)

12 years agoMigrate the ATH_KTR_* fields out to if_ath_debug.h .
Adrian Chadd [Tue, 10 Jul 2012 06:11:39 +0000 (06:11 +0000)]
Migrate the ATH_KTR_* fields out to if_ath_debug.h .

12 years agoPrint the TX buffer if this error condition is asserted.
Adrian Chadd [Tue, 10 Jul 2012 06:10:49 +0000 (06:10 +0000)]
Print the TX buffer if this error condition is asserted.

I need to figure out why this is occuring.  Hopefully I can get enough
descriptor dumps to figure it out.

12 years agoAdd/fix EDMA RX behaviour.
Adrian Chadd [Tue, 10 Jul 2012 06:05:42 +0000 (06:05 +0000)]
Add/fix EDMA RX behaviour.

* For now, kickpcu should hopefully just do nothing - the PCU doesn't need
  'kicking' for Osprey and later NICs. The PCU will just restart once
  the next FIFO entry is pushed in.

* Teach "proc" about "dosched", so it can be used to just flush the
  FIFO contents without adding new FIFO entries.

* .. and now, implement the RX "flush" routine.

* Re-initialise the FIFO contents if the FIFO is empty (the DP is NULL.)
  When PCU RX is disabled (ie, writing RX_D to the RX configuration
  register) then the FIFO will be completely emptied.  If the software FIFO
  is full, then no further descriptors are pushed into the FIFO and
  things stall.

This all requires much, much more thorough stress testing.

12 years agoAlways clear p_xthread if current thread no longer needs it, in theory, if
David Xu [Tue, 10 Jul 2012 05:45:13 +0000 (05:45 +0000)]
Always clear p_xthread if current thread no longer needs it, in theory, if
debugger exited without calling ptrace(PT_DETACH), there is a time window
that the p_xthread may be pointing to non-existing thread, in practical,
this is not a problem because child process soon will be killed by parent
process.

12 years agoRevert last change. It was accidental.
Warner Losh [Tue, 10 Jul 2012 05:39:06 +0000 (05:39 +0000)]
Revert last change.  It was accidental.

12 years agoCollapse all copies of at91_add_child into at91.c. They were
Warner Losh [Tue, 10 Jul 2012 04:17:49 +0000 (04:17 +0000)]
Collapse all copies of at91_add_child into at91.c.  They were
logically identical before today, and actually identical after today's
changes.

12 years agoReorder these so they match the capability enum order.
Adrian Chadd [Tue, 10 Jul 2012 03:48:07 +0000 (03:48 +0000)]
Reorder these so they match the capability enum order.

12 years agoMissed one of the special AT91SAM9xxx_BASE defines. This should be
Warner Losh [Tue, 10 Jul 2012 02:44:15 +0000 (02:44 +0000)]
Missed one of the special AT91SAM9xxx_BASE defines.  This should be
AT91_BASE.

12 years agoThe system IRQ is always IRQ 1. Make it so.
Warner Losh [Tue, 10 Jul 2012 02:39:03 +0000 (02:39 +0000)]
The system IRQ is always IRQ 1.  Make it so.

12 years agoEliminate the AT91XXXX_BASE for each SoC. AT91_BASE is the right way
Warner Losh [Tue, 10 Jul 2012 02:14:50 +0000 (02:14 +0000)]
Eliminate the AT91XXXX_BASE for each SoC.  AT91_BASE is the right way
to spell this since we only have one AT91_BASE for all Atmel arm9 SoCs.

12 years agoRemove some unused variables/externs that have been copied too many times...
Warner Losh [Tue, 10 Jul 2012 01:49:50 +0000 (01:49 +0000)]
Remove some unused variables/externs that have been copied too many times...

12 years agoExecuting CPUID with EAX set to 1 to actually get feature flags.
David Xu [Tue, 10 Jul 2012 01:47:11 +0000 (01:47 +0000)]
Executing CPUID with EAX set to 1 to actually get feature flags.
PR: 169730

12 years agoNot quite ready for this yet, so comment it out.
Warner Losh [Tue, 10 Jul 2012 01:32:52 +0000 (01:32 +0000)]
Not quite ready for this yet, so comment it out.

12 years agoThere's nothing AT91RM9200 specific about this file at all.
Warner Losh [Tue, 10 Jul 2012 01:13:00 +0000 (01:13 +0000)]
There's nothing AT91RM9200 specific about this file at all.

12 years agoRemove a check on MNTK_UPDATE that is not really necessary as it is
Attilio Rao [Tue, 10 Jul 2012 00:23:25 +0000 (00:23 +0000)]
Remove a check on MNTK_UPDATE that is not really necessary as it is
handled in a code snippet above.

12 years agoImplement EDMA RX for AR93xx and later chips.
Adrian Chadd [Tue, 10 Jul 2012 00:08:39 +0000 (00:08 +0000)]
Implement EDMA RX for AR93xx and later chips.

This is inspired by ath9k and the reference driver, but it's a new
implementation of the RX FIFO handling.

This has some issues - notably the FIFO needs to be reprogrammed when
the chip is reset.

12 years agoConvert sc_rxpending to a per-EDMA queue, and use that for the legacy code.
Adrian Chadd [Tue, 10 Jul 2012 00:02:19 +0000 (00:02 +0000)]
Convert sc_rxpending to a per-EDMA queue, and use that for the legacy code.

Prepare ath_rx_pkt() to handle multiple RX queues, and default the legacy
RX queue to use the HP queue.

12 years ago- Remove the unused and not completed write support for NTFS.
Attilio Rao [Tue, 10 Jul 2012 00:01:00 +0000 (00:01 +0000)]
- Remove the unused and not completed write support for NTFS.
- Fix a bug where vfs_mountedfrom() is called also when the filesystem
  is not mounted successfully.

Tested by: pho

12 years agoAdd some AR9300 HAL descriptor definition changes.
Adrian Chadd [Mon, 9 Jul 2012 23:58:22 +0000 (23:58 +0000)]
Add some AR9300 HAL descriptor definition changes.

* Add a couple of RX errors;
* Add the spectral scan PHY error code;
* extend the RX flags to be a 16 bit field, rather than an 8 bit field;
* Add a new RX flag.

Obtained from: Qualcomm Atheros

12 years agoFix a bug in code that calculates the number of the first interrupt
Navdeep Parhar [Mon, 9 Jul 2012 21:53:50 +0000 (21:53 +0000)]
Fix a bug in code that calculates the number of the first interrupt
vector for a port.  This affected the gigabit ports of T422 cards (the
ones with 2x10G ports and 2x1G ports).

MFC after: will check with re@

12 years agoAdd a clts() wrapper around the 'clts' instruction to <machine/cpufunc.h>
John Baldwin [Mon, 9 Jul 2012 20:55:39 +0000 (20:55 +0000)]
Add a clts() wrapper around the 'clts' instruction to <machine/cpufunc.h>
on x86 and use that to implement stop_emulating() in the fpu/npx code.
Reimplement start_emulating() in the non-XEN case by using load_cr0() and
rcr0() instead of the 'lmsw' and 'smsw' instructions.  Intel explicitly
discourages the use of 'lmsw' and 'smsw' on 80386 and later processors in
the description of these instructions in Volume 2 of the ADM.

Reviewed by: kib
MFC after: 1 month