Re: [PATCH 2/3] target/hppa: mask offset bits in gva

2024-04-02 Thread Sven Schnelle
Richard Henderson writes: > On 4/1/24 20:01, Sven Schnelle wrote: >> Implement dr2 and the mfdiag/mtdiag instructions. dr2 contains a bit >> which enables/disables space id hashing. Seabios would then set >> this bit when booting. Linux would disable it again durin

Re: [PATCH 2/3] target/hppa: mask offset bits in gva

2024-04-02 Thread Sven Schnelle
Richard, Sven Schnelle writes: > Richard Henderson writes: > >> On 3/23/24 22:09, Sven Schnelle wrote: >>> The CPU seems to mask a few bits in the offset when running >>> under HP-UX. ISR/IOR register contents for an address in >>> the processor HPA (0x

Re: [PATCH] target/hppa: Fix IIAOQ, IIASQ for pa2.0

2024-04-01 Thread Sven Schnelle
Richard Henderson writes: > The contents of IIAOQ depend on PSW_W. > Follow the text in "Interruption Instruction Address Queues", > pages 2-13 through 2-15. > > Reported-by: Sven Schnelle > Fixes: b10700d826c ("target/hppa: Update IIAOQ, IIASQ for pa2.0&quo

Re: [PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode

2024-04-01 Thread Sven Schnelle
Richard Henderson writes: > On 4/1/24 10:39, Sven Schnelle wrote: >> Richard Henderson writes: >>>> For unknown reasons, Java 1.5 on 64-bit HP-UX 11.11 does signed >>>> computation of the new IAOQ value in the signal handler. In the >>>> current

Re: [PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode

2024-04-01 Thread Sven Schnelle
Sven Schnelle writes: > Sven Schnelle writes: > >> Richard Henderson writes: >> >>> On 4/1/24 04:52, Sven Schnelle wrote: >>>> For unknown reasons, Java 1.5 on 64-bit HP-UX 11.11 does signed >>>> computation of the new IAOQ value in the

Re: [PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode

2024-04-01 Thread Sven Schnelle
Sven Schnelle writes: > Richard Henderson writes: > >> On 4/1/24 04:52, Sven Schnelle wrote: >>> For unknown reasons, Java 1.5 on 64-bit HP-UX 11.11 does signed >>> computation of the new IAOQ value in the signal handler. In the >>> current code t

Re: [PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode

2024-04-01 Thread Sven Schnelle
Richard Henderson writes: > On 4/1/24 04:52, Sven Schnelle wrote: >> For unknown reasons, Java 1.5 on 64-bit HP-UX 11.11 does signed >> computation of the new IAOQ value in the signal handler. In the >> current code these bits are not masked when returning to narrow

[PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode

2024-04-01 Thread Sven Schnelle
For unknown reasons, Java 1.5 on 64-bit HP-UX 11.11 does signed computation of the new IAOQ value in the signal handler. In the current code these bits are not masked when returning to narrow mode, causing java to crash. Signed-off-by: Sven Schnelle --- target/hppa/sys_helper.c | 4 1 file

Re: [PATCH 2/3] target/hppa: mask offset bits in gva

2024-03-28 Thread Sven Schnelle
Richard Henderson writes: > On 3/23/24 22:09, Sven Schnelle wrote: >> The CPU seems to mask a few bits in the offset when running >> under HP-UX. ISR/IOR register contents for an address in >> the processor HPA (0xfffa) on my C8000 and J6750: >> running

Re: [PATCH for-9.0] target/hppa: Clear psw_n for BE on use_nullify_skip path

2024-03-26 Thread Sven Schnelle
Richard Henderson writes: > Along this path we have already skipped the insn to be > nullified, so the subsequent insn should be executed. > > Cc: qemu-sta...@nongnu.org > Reported-by: Sven Schnelle > Signed-off-by: Richard Henderson > --- > target/hppa/translate.c |

Re: target/hppa: be,n nullifying first insn at branch target?

2024-03-26 Thread Sven Schnelle
Richard Henderson writes: > On 3/25/24 09:33, Sven Schnelle wrote: >> diff --git a/target/hppa/translate.c b/target/hppa/translate.c >> index 7546a5f5a2..56c68a7cbe 100644 >> --- a/target/hppa/translate.c >> +++ b/target/hppa/translate.c >> @@ -3847,7 +3849,7 @@

target/hppa: be,n nullifying first insn at branch target?

2024-03-25 Thread Sven Schnelle
Hi Richard, one of the last issue i'm seeing with 64bit HP-UX 11.11 is a crash of ld64 while building (linking) the kernel. The program is killed due to a unaligned access. I've wrote a logfile, and it looks like be,n is nullifying the first instruction at the branch target: IN:

Re: [PATCH 2/3] target/hppa: mask offset bits in gva

2024-03-25 Thread Sven Schnelle
Richard Henderson writes: > On 3/24/24 08:41, Sven Schnelle wrote: >> 7f09e0: val=000fffb0301f r2=110e0f01 r1=01fff600 >> phys=fffb 4K aid=1 pl1=0, pl2=0 type=1 (DATA RW) >> 'val' is the value constructed from IOR/ISR, > > Is this byt

Re: [PATCH 2/3] target/hppa: mask offset bits in gva

2024-03-24 Thread Sven Schnelle
Hi Richard, Richard Henderson writes: > In particular Figure 2-14 for "data translation disabled" may be > instructive. Suppose the cpu does not implement all of the physical > address lines (true for all extant pa-risc cpus; qemu implements 40 > bits to match pa-8500 iirc). Suppose when

[PATCH 3/3] target/hppa: fix building gva for wide mode

2024-03-24 Thread Sven Schnelle
64 Bit hppa no longer has a fixed 32/32 bit split between space and offset. Instead it uses 42 bits for the offset. The lower 10 bits of the space are always zero, leaving 22 bits actually used. Simply or the values together to build the gva. Signed-off-by: Sven Schnelle --- target/hppa

[PATCH 0/3] few hppa fixes for 64bit mode

2024-03-24 Thread Sven Schnelle
Hi, in preparation of getting 64bit HP-UX running in qemu, here are a few fixes to make HP-UX progress a bit further. Sven Schnelle (3): target/hppa: use gva_offset_mask() everywhere target/hppa: mask offset bits in gva target/hppa: fix building gva for wide mode target/hppa/cpu.h

[PATCH 2/3] target/hppa: mask offset bits in gva

2024-03-24 Thread Sven Schnelle
found how this is switched (guess some diag in the firmware), but linux + seabios seems to handle that as well, so lets mask out the additional bits. Signed-off-by: Sven Schnelle --- target/hppa/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.h b/target

[PATCH 1/3] target/hppa: use gva_offset_mask() everywhere

2024-03-24 Thread Sven Schnelle
move it to cpu.h, so it can also be used in hppa_form_gva_psw() Signed-off-by: Sven Schnelle --- target/hppa/cpu.h | 10 -- target/hppa/translate.c | 12 +++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index

Re: [PATCH 1/3] target/hppa: add unit conditions for wide mode

2024-03-21 Thread Sven Schnelle
Richard Henderson writes: > On 3/21/24 08:42, Sven Schnelle wrote: >> Wide mode provides two more conditions, add them. >> Signed-off-by: Sven Schnelle >> --- >> target/hppa/translate.c | 25 +++-- >> 1 file changed, 23 insertions(+), 2 de

Re: [PATCH 2/3] target/hppa: sub: fix trap on overflow for narrow mode

2024-03-21 Thread Sven Schnelle
Richard Henderson writes: > On 3/21/24 08:42, Sven Schnelle wrote: >> Signed-off-by: Sven Schnelle >> --- >> target/hppa/translate.c | 3 +++ >> 1 file changed, 3 insertions(+) >> diff --git a/target/hppa/translate.c b/target/hppa/translate.c >&

[PATCH 3/3] target/hppa: add: fix trap on overflow for narrow mode

2024-03-21 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4d2b96f876..74a9ea0cd8 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1122,6 +1122,9 @@ static void

[PATCH 1/3] target/hppa: add unit conditions for wide mode

2024-03-21 Thread Sven Schnelle
Wide mode provides two more conditions, add them. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 8a87996fc1..f493e207e1 100644

[PATCH 2/3] target/hppa: sub: fix trap on overflow for narrow mode

2024-03-21 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f493e207e1..4d2b96f876 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1213,6 +1213,9 @@ static void

Re: [PULL 0/9] target/hppa fixes for 9.0

2024-03-21 Thread Sven Schnelle
Michael Tokarev writes: > 20.03.2024 03:32, Richard Henderson : > >> Richard Henderson (3): >>target/hppa: Fix assemble_16 insns for wide mode >>target/hppa: Fix assemble_11a insns for wide mode >>target/hppa: Fix assemble_12a insns for

Re: [RFC PATCH] target/hppa: Introduce and use IAQEntry

2024-03-19 Thread Sven Schnelle
Sven Schnelle writes: > Hi Richard, > > Richard Henderson writes: > >> Wrap offset and space into a single structure, with >> offset represented either as a constant or as variable. >> This enhances copy_iaoq_entry to copy the space, and at >> the same tim

Re: [RFC PATCH] target/hppa: Introduce and use IAQEntry

2024-03-19 Thread Sven Schnelle
Hi Richard, Richard Henderson writes: > Wrap offset and space into a single structure, with > offset represented either as a constant or as variable. > This enhances copy_iaoq_entry to copy the space, and at > the same time simplifying the code. > > Signed-off-by: Richard Henderson > --- > >

[PATCH v2 3/6] target/hppa: fix access_id check

2024-03-19 Thread Sven Schnelle
PA2.0 provides 8 instead of 4 PID registers. Signed-off-by: Sven Schnelle --- target/hppa/mem_helper.c | 59 +--- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 80f51e753f..f89ba91b20

[PATCH v2 4/6] target/hppa: exit tb on flush cache instructions

2024-03-19 Thread Sven Schnelle
When the guest modifies the tb it is currently executing from, it executes a fic instruction. Exit the tb on such instruction, otherwise we might execute stale code. Signed-off-by: Sven Schnelle --- target/hppa/insns.decode | 6 +++--- target/hppa/translate.c | 11 +++ 2 files changed

[PATCH v2 0/6] few fixes for hppa target

2024-03-19 Thread Sven Schnelle
Hi, here are a few fixes for the hppa target i made while debugging some wide mode issues. Changes in v2: - use Richards version for access id matching - add trans_fic() Sven Schnelle (6): target/hppa: ldcw,s uses static shift of 3 target/hppa: fix shrp for wide mode target/hppa: fix

[PATCH v2 1/6] target/hppa: ldcw,s uses static shift of 3

2024-03-19 Thread Sven Schnelle
Fixes: 96d6407f363 ("target-hppa: Implement loads and stores") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index

[PATCH v2 6/6] target/hppa: fix do_stdby_e()

2024-03-19 Thread Sven Schnelle
stdby,e,m was writing data from the wrong half of the register into memory for cases 0-3. Fixes: 25460fc5a71 ("target/hppa: Implement STDBY") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/op_helper.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH v2 2/6] target/hppa: fix shrp for wide mode

2024-03-19 Thread Sven Schnelle
Fixes: f7b775a9c075 ("target/hppa: Implement SHRPD") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson Reviewed-by: Helge Deller --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/transla

[PATCH v2 5/6] target/hppa: mask privilege bits in mfia

2024-03-19 Thread Sven Schnelle
mfia should return only the iaoq bits without privilege bits. Fixes: 98a9cb792c8 ("target-hppa: Implement system and memory-management insns") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson Reviewed-by: Helge Deller --- target/hppa/translate.c | 2 +- 1 file changed, 1

Re: [PATCH 3/7] target/hppa: fix access_id check

2024-03-19 Thread Sven Schnelle
Richard Henderson writes: > On 3/17/24 12:14, Sven Schnelle wrote: >> /* If bits [31:1] match, and bit 0 is set, suppress write. */ >> -int match = ent->access_id * 2 + 1; >> - >> -if (match == env->cr[CR_PID1] || match == env->

Re: [PATCH 5/7] target/hppa: copy new_spc to iasq_f on be,n instruction

2024-03-19 Thread Sven Schnelle
Richard Henderson writes: > On 3/17/24 12:14, Sven Schnelle wrote: >> Otherwise the first instruction at the new location gets executed from >> the old space. >> Signed-off-by: Sven Schnelle >> --- >> target/hppa/translate.c | 3 +++ >> 1 file changed,

Re: [PATCH 0/3] 64 Bit support for hppa gdbstub

2024-03-18 Thread Sven Schnelle
Richard Henderson writes: > On 3/17/24 20:32, Sven Schnelle wrote: >> Hi Richard, >> Sven Schnelle writes: >> >>> Hi List, >>> >>> this patchset allows to debug the hppa target when running in wide (64 bit) >>> mode. gdb needs a sma

Re: [PATCH 0/3] 64 Bit support for hppa gdbstub

2024-03-18 Thread Sven Schnelle
Hi Richard, Sven Schnelle writes: > Hi List, > > this patchset allows to debug the hppa target when running in wide (64 bit) > mode. gdb needs a small patch to switch to 64 bit mode. I pushed the > patch to > https://github.com/bminor/b

[PATCH 6/7] target/hppa: mask privilege bits in mfia

2024-03-17 Thread Sven Schnelle
mfia should return only the iaoq bits without privilege bits. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a09112e4ae..e47f8f9f47 100644 --- a/target/hppa

[PATCH 7/7] target/hppa: fix do_stdby_e()

2024-03-17 Thread Sven Schnelle
stdby,e,m was writing data from the wrong half of the register into memory for cases 0-3. Signed-off-by: Sven Schnelle --- target/hppa/op_helper.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 480fe80844

[PATCH 5/7] target/hppa: copy new_spc to iasq_f on be,n instruction

2024-03-17 Thread Sven Schnelle
Otherwise the first instruction at the new location gets executed from the old space. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 58d7ec1ade..a09112e4ae 100644

[PATCH 3/7] target/hppa: fix access_id check

2024-03-17 Thread Sven Schnelle
PA2.0 provides 8 instead of 4 PID registers. Signed-off-by: Sven Schnelle --- roms/SLOF| 2 +- target/hppa/mem_helper.c | 67 +++- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/roms/SLOF b/roms/SLOF index 3a259df244

[PATCH 0/7] few fixes for hppa target

2024-03-17 Thread Sven Schnelle
Hi, here are a few fixes for the hppa target i made while debugging some wide mode issues. Sven Schnelle (7): target/hppa: ldcw,s uses static shift of 3 target/hppa: fix shrp for wide mode target/hppa: fix access_id check target/hppa: exit tb on flush cache instructions target/hppa

[PATCH 4/7] target/hppa: exit tb on flush cache instructions

2024-03-17 Thread Sven Schnelle
When the guest modifies the tb it is currently executing from, it executes a fic instruction. Exit the tb on such instruction, otherwise we might execute stale code. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/hppa

[PATCH 2/7] target/hppa: fix shrp for wide mode

2024-03-17 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6a513d7d5c..8ba31567e8 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3462,7 +3462,7

[PATCH 1/7] target/hppa: ldcw,s uses static shift of 3

2024-03-17 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index eb2046c5ad..6a513d7d5c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3085,7 +3085,7

Re: [PATCH v3 01/12] util/log: convert debug_regions to GList

2024-03-04 Thread Sven Schnelle
Alex Bennée writes: >> So i wonder >> whether we should convert all of those functions to GArray? (if >> possible, i haven't checked) > > I think that would depend on access patterns and flexibility. For the > dfilter there is no particular need for sorting and the principle > operation is a

Re: [PATCH v3 01/12] util/log: convert debug_regions to GList

2024-03-04 Thread Sven Schnelle
Alex Bennée writes: > Sven Schnelle writes: > >> In preparation of making the parsing part of qemu_set_dfilter_ranges() >> available to other users, convert it to return a GList, so the result >> can be used with other functions taking a GList of struct Range. >

[PATCH v3] hw/scsi/lsi53c895a: add timer to scripts processing

2024-03-04 Thread Sven Schnelle
are usually very short. This keeps the time until the loop is exited short. Suggested-by: Peter Maydell Signed-off-by: Sven Schnelle Reviewed-by: Peter Maydell --- hw/scsi/lsi53c895a.c | 43 +-- hw/scsi/trace-events | 2 ++ 2 files changed, 35 insertions(+), 10

Re: [PATCH v2] hw/scsi/lsi53c895a: add timer to scripts processing

2024-03-04 Thread Sven Schnelle
Peter Maydell writes: > On Thu, 29 Feb 2024 at 20:44, Sven Schnelle wrote: >> >> HP-UX 10.20 seems to make the lsi53c895a spinning on a memory location >> under certain circumstances. As the SCSI controller and CPU are not >> running at the same time this loop wi

Re: [PATCH v3 01/12] util/log: convert debug_regions to GList

2024-03-04 Thread Sven Schnelle
Alex Bennée writes: > Sven Schnelle writes: > >> In preparation of making the parsing part of qemu_set_dfilter_ranges() >> available to other users, convert it to return a GList, so the result >> can be used with other functions taking a GList of struct Range. >

Re: lsi53c895a assert with AmigaOS

2024-03-03 Thread Sven Schnelle
BALATON Zoltan writes: > Hello, > > AmigaOS4 also has a driver for this card so I've tried to test it but > it trips an assert. Does anybody have an idea why and how it could be > fixed? Sven's recent patches don't seem to have an effect on this, it > still happens shortly after it tries to

Re: lsi53c895a assert with AmigaOS

2024-03-02 Thread Sven Schnelle
to verify whether it's correct or whether there are additional changes required. Here it is: >From 6a807653679fde5e3e09a7f27576c673f335fef6 Mon Sep 17 00:00:00 2001 From: Sven Schnelle Date: Sat, 3 Feb 2024 19:46:07 +0100 Subject: [PATCH] lsi53c895a: free pending requests on reset Signed-off

[PATCH] hw/scsi/lsi53c895a: stop script on phase mismatch

2024-03-02 Thread Sven Schnelle
. Signed-off-by: Sven Schnelle --- hw/scsi/lsi53c895a.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 4ff9470381..59b88aff3f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -573,8 +573,9

[PATCH] target/hppa: add assemble_16()

2024-03-02 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/insns.decode | 99 target/hppa/translate.c | 22 + 2 files changed, 72 insertions(+), 49 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index f5a3f02fd1..8f17e18cd0

[PATCH RFC] hppa: assemble_16() in wide mode

2024-03-02 Thread Sven Schnelle
Hi Richard, while looking into a HPPA tcg issue i noticed that the current tcg code doesn't do the special wide mode handling described in the Parisc 2.0 specification, Chapter E -> assemble_16(). In wide mode, assemble_16() adds two more bits to the immediate value/displacement of certain

[PATCH v3 03/12] util/range: move range_list_from_string() to range.c

2024-03-01 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- include/qemu/range.h | 7 util/log.c | 74 -- util/range.c | 76 3 files changed, 83 insertions(+), 74 deletions(-) diff --git a/include/qemu/range.h b

[PATCH v3 11/12] plugins/execlog: use range list api

2024-03-01 Thread Sven Schnelle
Instead of doing its own implementation, use the new range list API to parse and match address lists. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/contrib/plugins/execlog.c b/contrib

[PATCH v3 02/12] util/log: make qemu_set_dfilter_ranges() take a GList

2024-03-01 Thread Sven Schnelle
In preparation of making qemu_set_dfilter_ranges() available to other users, move the code to a new function range_list_from_string() which takes an additional GList argument. Signed-off-by: Sven Schnelle --- util/log.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions

[PATCH v3 06/12] util/range: split up range_list_from_string()

2024-03-01 Thread Sven Schnelle
Makes the code a bit easier to read and maintain. Signed-off-by: Sven Schnelle --- util/range.c | 119 ++- 1 file changed, 70 insertions(+), 49 deletions(-) diff --git a/util/range.c b/util/range.c index db535de9a7..8c463995e7 100644 --- a/util

[PATCH v3 10/12] plugins: add range list API

2024-03-01 Thread Sven Schnelle
Export range_list_from_string(), range_contains() and range_list_free() to allow plugins to parse filter ranges and match them to avoid reimplementing this functionality. Signed-off-by: Sven Schnelle --- include/qemu/qemu-plugin.h | 41 plugins/api.c

[PATCH v3 09/12] plugins: add API to print errors

2024-03-01 Thread Sven Schnelle
add qemu_plugin_error_print() which is a wrapper around error_report_err(). This will be used by qemu_plugin_parse_filter_ranges() to report parse failures. Signed-off-by: Sven Schnelle --- include/qemu/qemu-plugin.h | 12 plugins/api.c| 7 +++ plugins/qemu

[PATCH v3 04/12] util/range: add range_list_free()

2024-03-01 Thread Sven Schnelle
Introduce range_list_free(), which takes a GList of ranges and frees the list and each range. Signed-off-by: Sven Schnelle --- include/qemu/range.h | 5 + util/range.c | 5 + 2 files changed, 10 insertions(+) diff --git a/include/qemu/range.h b/include/qemu/range.h index

[PATCH v3 08/12] qemu/range: add range_list_contains() function

2024-03-01 Thread Sven Schnelle
Add a small inline function to match an address against a list of ranges. Signed-off-by: Sven Schnelle --- include/qemu/range.h | 12 util/log.c | 10 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/qemu/range.h b/include/qemu/range.h

[PATCH v3 12/12] plugins/execlog: add data address match

2024-03-01 Thread Sven Schnelle
Add a match similar to the afilter address match, but for data addresses. When an address is specified with '-dfilter=0x12345' only load/stores to/from address 0x12345 are printed. All other instructions are hidden. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 28

[PATCH v3 05/12] util/range: use append_new_range() in range_list_from_string()

2024-03-01 Thread Sven Schnelle
Use append_new_ranges() instead of manually allocating and filling the new range member. Signed-off-by: Sven Schnelle --- util/range.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/util/range.c b/util/range.c index 7234ab7a53..db535de9a7 100644 --- a/util/range.c

[PATCH v3 00/12] plugins/execlog: add data address match and address range support

2024-03-01 Thread Sven Schnelle
log instruction in the address range 0x1000 to 0x2000 and accessing data at address 0x388. Changes in v3: - extend plugin api to re-use the existing range parsing infrastructure - export error report api Changes in v2: - rebased on top of latest master Sven Schnelle (12): util/log: convert

[PATCH v3 01/12] util/log: convert debug_regions to GList

2024-03-01 Thread Sven Schnelle
In preparation of making the parsing part of qemu_set_dfilter_ranges() available to other users, convert it to return a GList, so the result can be used with other functions taking a GList of struct Range. Signed-off-by: Sven Schnelle --- util/log.c | 36 ++-- 1

[PATCH v3 07/12] util/range: make range_list_from_string() accept a single number

2024-03-01 Thread Sven Schnelle
To use range_list_from_string() as a replacement in the execlog plugin, make it accept single numbers instead of a range. This might also be useful for the already present debug_ranges filtering. Signed-off-by: Sven Schnelle --- util/range.c | 5 + 1 file changed, 5 insertions(+) diff

Re: [PATCH] hw/scsi/lsi53c895a: add timer to scripts processing

2024-02-29 Thread Sven Schnelle
BALATON Zoltan writes: > On Thu, 29 Feb 2024, Sven Schnelle wrote: >> BALATON Zoltan writes: >> Yes, i changed it to describe the new method: >> >>/* >> * Some windows drivers make the device spin waiting for a memory location >> * t

[PATCH v2] hw/scsi/lsi53c895a: add timer to scripts processing

2024-02-29 Thread Sven Schnelle
are usually very short. This keeps the time until the loop is exit short. Suggested-by: Peter Maydell Signed-off-by: Sven Schnelle --- Changes in v2: - update comment in lsi_execute_script() - reset waiting state and del timer in lsi_execute_script() to handle the case where script processing

Re: [PATCH] hw/scsi/lsi53c895a: add timer to scripts processing

2024-02-29 Thread Sven Schnelle
BALATON Zoltan writes: > On Thu, 29 Feb 2024, Sven Schnelle wrote: >> Some OS's like HP-UX 10.20 are spinn > > I guess the above line is left here by accident. Yes. >> HP-UX 10.20 seems to make the lsi53c895a spinning on a memory location >> under certain circumstan

Re: [PATCH 0/3] plugins/execlog: add data address match and address range support

2024-02-29 Thread Sven Schnelle
Hi Alex, Alex Bennée writes: > Sven Schnelle writes: > I think we've lost a patch in the re-posting. patchew hasn't seen it > either: > > https://patchew.org/QEMU/20240229150729.1620410-1-sv...@stackframe.org/ > >> plugins/execlog: add data address match >>

[PATCH] hw/scsi/lsi53c895a: add timer to scripts processing

2024-02-29 Thread Sven Schnelle
processor are usually very short. This keeps the time until the loop-exit short. Suggested-by: Peter Maydell Signed-off-by: Sven Schnelle --- hw/scsi/lsi53c895a.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi

Re: [PATCH 3/3] plugins/execlog: add address range matching

2024-02-29 Thread Sven Schnelle
Hi Alex, Alex Bennée writes: > Sven Schnelle writes: >> +static void parse_vaddr_match(GArray **matches, char *token) >> { >> -uint64_t v = g_ascii_strtoull(match, NULL, 16); >> +uint64_t low, high; >> +gchar *endp; >> >> -if (!

Re: [PATCH] hw/scsi/lsi53c895a: add hack to prevent scsi timeouts in HP-UX 10.20

2024-02-29 Thread Sven Schnelle
Peter Maydell writes: > On Thu, 29 Feb 2024 at 16:54, Sven Schnelle wrote: >> >> Peter Maydell writes: >> >> > On Wed, 28 Feb 2024 at 21:12, Sven Schnelle wrote: >> >> >> >> HP-UX 10.20 seems to make the lsi53c895a spinning on a memory l

Re: [PATCH] hw/scsi/lsi53c895a: add hack to prevent scsi timeouts in HP-UX 10.20

2024-02-29 Thread Sven Schnelle
Peter Maydell writes: > On Wed, 28 Feb 2024 at 21:12, Sven Schnelle wrote: >> >> HP-UX 10.20 seems to make the lsi53c895a spinning on a memory location >> under certain circumstances. As the SCSI controller and CPU are not >> running at the same time this loop wi

Re: [PATCH 0/4] plugins/execlog: add data address match and address range support

2024-02-29 Thread Sven Schnelle
Pierrick Bouvier writes: > Hi Sven, thanks for your series. > > Yesterday, series for new API to access registers from plugins was > merged. As part of it, execlog plugin was extended to support this > [1]. > This conflict with the changes presented here. > > Could you please rebase this series

[PATCH 3/3] plugins/execlog: add address range matching

2024-02-29 Thread Sven Schnelle
Allow to match memory ranges with the address matches. This allows to give a range of adresses like '-dfilter=0-0x400' which would only log memory accesses between 0 and 400. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 73 ++- 1 file changed

[PATCH 2/3] plugins/execlog: add data address match

2024-02-29 Thread Sven Schnelle
Add a match similar to the afilter address match, but for data addresses. When an address is specified with '-dfilter=0x12345' only load/stores to/from address 0x12345 are printed. All other instructions are hidden. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 32

[PATCH 0/3] plugins/execlog: add data address match and address range support

2024-02-29 Thread Sven Schnelle
log instruction in the address range 0x1000 to 0x2000 and accessing data at address 0x388. Changes in v2: - rebased on top of latest master Sven Schnelle (3): plugins/execlog: pass matches array to parse_vaddr_match plugins/execlog: add data address match plugins/execlog: add address range

[PATCH] hw/scsi/lsi53c895a: add hack to prevent scsi timeouts in HP-UX 10.20

2024-02-28 Thread Sven Schnelle
be enabled by adding -global lsi53c895a.hpux-spin-workaround=on to the qemu commandline. Signed-off-by: Sven Schnelle --- hw/scsi/lsi53c895a.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index d607a5f9fb

[PATCH 2/3] target/hppa: add 64 bit support to gdbstub

2024-02-28 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/gdbstub.c | 48 +-- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/target/hppa/gdbstub.c b/target/hppa/gdbstub.c index 48a514384f..a5b2c80c07 100644 --- a/target/hppa/gdbstub.c +++ b/target/hppa

[PATCH 3/3] target/hppa: mask CR_SAR register writes to 5/6 bit in gdbstub

2024-02-28 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/gdbstub.c b/target/hppa/gdbstub.c index a5b2c80c07..049b2d6381 100644 --- a/target/hppa/gdbstub.c +++ b/target/hppa/gdbstub.c @@ -184,7 +184,7 @@ int

[PATCH 0/3] 64 Bit support for hppa gdbstub

2024-02-28 Thread Sven Schnelle
to the appropriate mode when connecting to qemu/gdbstub. Sven Schnelle (3): Revert "target/hppa: Drop attempted gdbstub support for hppa64" target/hppa: add 64 bit support to gdbstub target/hppa: mask CR_SAR register writes to 5/6 bit in gdbstub target/hppa/gdbs

[PATCH 1/3] Revert "target/hppa: Drop attempted gdbstub support for hppa64"

2024-02-28 Thread Sven Schnelle
ng: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. startup () at src/parisc/head.S:144 144 rsm PSW_I, %r0 /* disable local irqs */ (gdb) Signed-off-by: Sven Schnelle --- t

[PATCH 0/4] plugins/execlog: add data address match and address range support

2024-02-28 Thread Sven Schnelle
log instruction in the address range 0x1000 to 0x2000 and accessing data at address 0x388. Sven Schnelle (4): plugins/execlog: add struct execlog_ctx plugins/execlog: pass matches array to parse_vaddr_match plugins/execlog: add data address match plugins/execlog: add address range matching

[PATCH 4/4] plugins/execlog: add address range matching

2024-02-28 Thread Sven Schnelle
Allow to match memory ranges with the address matches. This allows to give a range of adresses like '-dfilter=0-0x400' which would only log memory accesses between 0 and 400. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 65 +++ 1 file changed

[PATCH 3/4] plugins/execlog: add data address match

2024-02-28 Thread Sven Schnelle
Add a match similar to the afilter address match, but for data addresses. When an address is specified with '-dfilter=0x12345' only load/stores to/from address 0x12345 are printed. All other instructions are hidden. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 23

[PATCH 1/4] plugins/execlog: add struct execlog_ctx

2024-02-28 Thread Sven Schnelle
Add a context structure for future enhancements. No functional change intended. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index

[PATCH 2/4] plugins/execlog: pass matches array to parse_vaddr_match

2024-02-28 Thread Sven Schnelle
Pass the matches array to parse_vaddr_match(), so future address matches can reuse that function. Signed-off-by: Sven Schnelle --- contrib/plugins/execlog.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index

[PATCH] hw/net/tulip: add chip status register values

2024-02-05 Thread Sven Schnelle
the register to 0x3b40, which means: Link is up, Autonegotation complete, Full Duplex, 100MBit/s Link speed. Also clear the mask because this register is read only. Signed-off-by: Sven Schnelle --- hw/net/tulip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/tulip.c b/hw

Re: [PATCH] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter

2024-01-28 Thread Sven Schnelle
Thomas Huth writes: > On 28/01/2024 21.22, Sven Schnelle wrote: >> When the maximum count of SCRIPTS instructions is reached, the code >> stops execution and returns, but fails to decrement the reentrancy >> counter. This effectively renders the SCSI controller unusable >

[PATCH] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter

2024-01-28 Thread Sven Schnelle
10.20 which seems to trigger SCRIPTS loops. Fixes: b987718bbb ("hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330)") Signed-off-by: Sven Schnelle --- hw/scsi/lsi53c895a.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/ls

Re: [PATCH v2 0/4] target/s390x: Exit tb after executing ex_value

2022-07-02 Thread Sven Schnelle
Hi Richard, Richard Henderson writes: > Ok, version 1 didn't work, so once more with feeling. > Can you give it a try, Sven? This seems to work. Thanks a lot! Regards Sven

Re: [PATCH] target/s390x: Exit tb after executing ex_value

2022-06-30 Thread Sven Schnelle
Hi Richard, Richard Henderson writes: > When EXECUTE sets ex_value to interrupt the constructed instruction, > we implicitly disable interrupts so that the value is not corrupted. > Exit to the main loop after execution, so that we re-evaluate any > pending interrupts. > >

Re: qemu-system-s390x hang in tcg

2022-06-29 Thread Sven Schnelle
Alex Bennée writes: > Sven Schnelle writes: > >> Hi, >> >> David Hildenbrand writes: >> >>> On 04.05.22 09:37, Janosch Frank wrote: >>>> I had a short look yesterday and the boot usually hangs in the raid6 >>>> code. D

qemu-system-s390x hang in tcg (was: Re: [PATCH v8 23/70] mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap())

2022-06-29 Thread Sven Schnelle
Hi, David Hildenbrand writes: > On 04.05.22 09:37, Janosch Frank wrote: >> I had a short look yesterday and the boot usually hangs in the raid6 >> code. Disabling vector instructions didn't make a difference but a few >> interruptions via GDB solve the problem for some reason. >> >> CCing

Re: qemu-system-s390x hang in tcg

2022-06-29 Thread Sven Schnelle
Sven Schnelle writes: > Alex Bennée writes: > >> Sven Schnelle writes: >> >>> Hi, >>> >>> David Hildenbrand writes: >>> >>>> On 04.05.22 09:37, Janosch Frank wrote: >>>>> I had a short look yesterday and the

Re: [PATCH 0/3] artist: minor fixes and performance improvement

2022-05-06 Thread Sven Schnelle
t: remove unused ROP8OFF() macro > artist: only render dirty scanlines on the display surface > > hw/display/artist.c | 33 ++--- > 1 file changed, 14 insertions(+), 19 deletions(-) I reviewed and tested the patches with HP-UX 10.20 and HP-UX 11.11. Feel free to add my Reviewed-by: Sven Schnelle

Re: [PATCH 3/3] hw/display/artist: rewrite vram access mode handling

2022-01-25 Thread Sven Schnelle
Gerd Hoffmann writes: > Hi, > >> +static void artist_vram_write4(ARTISTState *s, struct vram_buffer *buf, >> + uint32_t offset, uint32_t data) > >> +static int get_vram_offset(ARTISTState *s, struct vram_buffer *buf, >> + int pos, int

  1   2   3   >