[Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device

Mark Cave-Ayland posted 10 patches 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180203103727.26457-1-mark.cave-ayland@ilande.co.uk
Test checkpatch failed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppc passed
Test s390x passed
default-configs/ppc-softmmu.mak |   1 +
hw/misc/Makefile.objs           |   3 +
hw/misc/macio/cuda.c            | 623 ++++++++++------------------------------
hw/misc/macio/macio.c           |   2 +-
hw/misc/mos6522.c               | 505 ++++++++++++++++++++++++++++++++
hw/misc/trace-events            |   7 +
hw/ppc/mac.h                    |  89 +++---
include/hw/misc/mos6522.h       | 149 ++++++++++
8 files changed, 871 insertions(+), 508 deletions(-)
create mode 100644 hw/misc/mos6522.c
create mode 100644 include/hw/misc/mos6522.h
[Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device
Posted by Mark Cave-Ayland 6 years, 2 months ago
The Mac CUDA device (also known as via-cuda) consists of two parts: a 6522 VIA
acting as an interface chip and the CUDA device itself.

Currently there are at least 2 other upcoming Mac devices that include their
own 6522 VIA implementations: Ben's via-pmu device and Laurent's mac_via
device with their own hacks based upon the existing CUDA device. So rather than
keep duplicating this same functionality with slightly different hacks, let's
move the 6522 into its own separate device.

Patches 1 converts CUDA away from using old_mmio accesses, whilst patches 2-3
came about from studying Laurent and Ben's implementations (and appear to have
no ill effects in my testing so far).

Patches 4-8 do the majority of the work which is to isolate the hacks required
by MacOS into separate functions so that a separate 6522 device can operate in
a standard way, yet allow a CUDA implementation to hook into the right places.

Patch 9 introduces a new mos6522 device for the shared functionality with the
relevant hook points for delayed SR interrupt delivery and MacOS timer
calibration hacks implemented as device class methods.

Finally patch 10 switches CUDA over from using its own 6522 implementation over
to using an embedded mos6522 device.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (10):
  cuda: do not use old_mmio accesses
  cuda: don't allow writes to port output pins
  cuda: don't call cuda_update() when writing to ACR register
  cuda: introduce CUDAState parameter to get_counter()
  cuda: rename frequency property to tb_frequency
  cuda: minor cosmetic tidy-ups to get_next_irq_time()
  cuda: set timer 1 frequency property to CUDA_TIMER_FREQ
  cuda: factor out timebase-derived counter value and load time
  misc: introduce new mos6522 VIA device and enable it for ppc builds
  cuda: convert to use the shared mos6522 device

 default-configs/ppc-softmmu.mak |   1 +
 hw/misc/Makefile.objs           |   3 +
 hw/misc/macio/cuda.c            | 623 ++++++++++------------------------------
 hw/misc/macio/macio.c           |   2 +-
 hw/misc/mos6522.c               | 505 ++++++++++++++++++++++++++++++++
 hw/misc/trace-events            |   7 +
 hw/ppc/mac.h                    |  89 +++---
 include/hw/misc/mos6522.h       | 149 ++++++++++
 8 files changed, 871 insertions(+), 508 deletions(-)
 create mode 100644 hw/misc/mos6522.c
 create mode 100644 include/hw/misc/mos6522.h

-- 
2.11.0


Re: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device
Posted by no-reply@patchew.org 6 years, 2 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180203103727.26457-1-mark.cave-ayland@ilande.co.uk
Subject: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
58c3da1206 cuda: convert to use the shared mos6522 device
a110feb761 misc: introduce new mos6522 VIA device and enable it for ppc builds
00fdbc1124 cuda: factor out timebase-derived counter value and load time
8271348dd5 cuda: set timer 1 frequency property to CUDA_TIMER_FREQ
78543ffe92 cuda: minor cosmetic tidy-ups to get_next_irq_time()
edafc73786 cuda: rename frequency property to tb_frequency
57d4dd6fc8 cuda: introduce CUDAState parameter to get_counter()
61fb181587 cuda: don't call cuda_update() when writing to ACR register
994240a346 cuda: don't allow writes to port output pins
5cbba0de9b cuda: do not use old_mmio accesses

=== OUTPUT BEGIN ===
Checking PATCH 1/10: cuda: do not use old_mmio accesses...
Checking PATCH 2/10: cuda: don't allow writes to port output pins...
Checking PATCH 3/10: cuda: don't call cuda_update() when writing to ACR register...
Checking PATCH 4/10: cuda: introduce CUDAState parameter to get_counter()...
Checking PATCH 5/10: cuda: rename frequency property to tb_frequency...
Checking PATCH 6/10: cuda: minor cosmetic tidy-ups to get_next_irq_time()...
Checking PATCH 7/10: cuda: set timer 1 frequency property to CUDA_TIMER_FREQ...
Checking PATCH 8/10: cuda: factor out timebase-derived counter value and load time...
Checking PATCH 9/10: misc: introduce new mos6522 VIA device and enable it for ppc builds...
Checking PATCH 10/10: cuda: convert to use the shared mos6522 device...
ERROR: do not use C99 // comments
#31: FILE: hw/misc/macio/cuda.c:36:
+//#define DEBUG_CUDA_PACKET

total: 1 errors, 0 warnings, 897 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Re: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device
Posted by Mark Cave-Ayland 6 years, 2 months ago
On 03/02/18 11:11, no-reply@patchew.org wrote:

> Hi,
> 
> This series seems to have some coding style problems. See output below for
> more information:
> 
> Type: series
> Message-id: 20180203103727.26457-1-mark.cave-ayland@ilande.co.uk
> Subject: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> 
> BASE=base
> n=1
> total=$(git log --oneline $BASE.. | wc -l)
> failed=0
> 
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> 
> commits="$(git log --format=%H --reverse $BASE..)"
> for c in $commits; do
>      echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
>      if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
>          failed=1
>          echo
>      fi
>      n=$((n+1))
> done
> 
> exit $failed
> === TEST SCRIPT END ===
> 
> Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
> Switched to a new branch 'test'
> 58c3da1206 cuda: convert to use the shared mos6522 device
> a110feb761 misc: introduce new mos6522 VIA device and enable it for ppc builds
> 00fdbc1124 cuda: factor out timebase-derived counter value and load time
> 8271348dd5 cuda: set timer 1 frequency property to CUDA_TIMER_FREQ
> 78543ffe92 cuda: minor cosmetic tidy-ups to get_next_irq_time()
> edafc73786 cuda: rename frequency property to tb_frequency
> 57d4dd6fc8 cuda: introduce CUDAState parameter to get_counter()
> 61fb181587 cuda: don't call cuda_update() when writing to ACR register
> 994240a346 cuda: don't allow writes to port output pins
> 5cbba0de9b cuda: do not use old_mmio accesses
> 
> === OUTPUT BEGIN ===
> Checking PATCH 1/10: cuda: do not use old_mmio accesses...
> Checking PATCH 2/10: cuda: don't allow writes to port output pins...
> Checking PATCH 3/10: cuda: don't call cuda_update() when writing to ACR register...
> Checking PATCH 4/10: cuda: introduce CUDAState parameter to get_counter()...
> Checking PATCH 5/10: cuda: rename frequency property to tb_frequency...
> Checking PATCH 6/10: cuda: minor cosmetic tidy-ups to get_next_irq_time()...
> Checking PATCH 7/10: cuda: set timer 1 frequency property to CUDA_TIMER_FREQ...
> Checking PATCH 8/10: cuda: factor out timebase-derived counter value and load time...
> Checking PATCH 9/10: misc: introduce new mos6522 VIA device and enable it for ppc builds...
> Checking PATCH 10/10: cuda: convert to use the shared mos6522 device...
> ERROR: do not use C99 // comments
> #31: FILE: hw/misc/macio/cuda.c:36:
> +//#define DEBUG_CUDA_PACKET
> 
> total: 1 errors, 0 warnings, 897 lines checked
> 
> Your patch has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 
> === OUTPUT END ===

This is fine - it's old debug infrastructure in CUDA which is unrelated 
to this patchset.


ATB,

Mark.