Ignore:
Timestamp:
Jan 5, 2013, 4:19:48 PM (13 years ago)
Author:
rousseau
Message:

Possibly fixed VirtualBox trap #8/reset problem (TRAC ticket #15)

Depending on kernel (W4/SMP) and ACPI (enabled or not), massive copying of
files produced a trap #8 or reset when using OS2AHCI in VirtualBox.

Causes & Fixes

o Interrupts were not disabled before doing DevHelp_EOI().

Since the AHCI controller in VirtualBox is a software implementation,
it cannot process requests as fast as a true hardware controller.
This caused stacked interrupts to a level that exhausted the interrupt
stack, resulting in a trap #8 on W4 or a reset on SMP with ACPI.
Interrupts are now disabled before doing the EOI.
The "Physycal Device Driver Reference" mentions this in:
?:\IBMDDK\DOCS\PDDREF.INF->Device Helper (DevHlp) Services)->EOI
and cross-referencing with DANIS506 shows she does the same in:
s506m.c (state machine) around line 244.

To investigate

o SMP safety

The disable() function in lib.c (around line 793) mentions that SMP systems
should use spinlocks. Possibly because a CLI is only executed on the
current CPU and a new interrupt could come from another CPU where
interrupts are still enabled. However, doing the EOI before unlocking did
not solve the VBox issue, possibly because spin_unlock() enables
interrupts again. So, at least in the case of VBox, the interrupt handler
has to return with interrupts disabled.
This will only be an issue in VBox if it realy can receive interrupts from
multiple CPU's in it's software implementation.

o Real hardware

As far as I can tell this patch has no influence on performance when
using real hardware. Also, since real hardware can handle requests in a
much shorter timespan, the likeliness of stacked interrupts occuring is
much less.

Performance measurements in VirtualBox

VirtualBox is a virtual machine and therefore subjected to any system load
on the host OS. Even comparing DANIS506 with OS2AHCI makes no real sense
since with DANI the SATA-contoller will run in ATA-compatibility and with
OS2AHCI it will run in AHCI-mode. Also, I have experienced that when my CPU
get's hot, the duty-cycle throttling goes active, reducing performance and
thus impacting any benchmarks in VBox. (or real hardware)
The only way to compare DANIS506 with OS2AHCI is on real hardware, on the
same controller, with the same disks and doing the same tests.
And most importantly, with the same CPU core-temperature.

Note

Diff's may show changed lines that are actually the same.
That's because my editor is configured to strip trailing white space.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/wmakefile

    r144 r145  
    7474
    7575
     76
     77
     78#
     79# Specify Linker
     80# Note: Using ALP with Wlink produces an oversized image, possibly due to
     81#       the location of BSS segments. Putting the BSS segments after the CODE
     82#       segments in init.asm and/or segment ordering in the Wlink response file
     83#       seems not to work when using ALP.
     84#
     85
    7686#LINKER=ibm
    7787LINKER=watcom
    7888
     89#
     90# Specify Assembler
     91# Note: This will only be of influence on assembling .asm files.
     92#       C inline _asm statements will use Wasm.
     93#
    7994
    8095#AS         = $(DDK)\tools\alp.exe
    8196#AS         = jwasm -Cp
    8297AS         = wasm
     98
     99
    83100CC         = wcc
    84101LD         = $(DDK)\base\tools\link.exe
Note: See TracChangeset for help on using the changeset viewer.