Re: [PATCH-for-10.1 3/3] hw/arm/virt: Warn when HVF doesn't report IPA bit length

2025-07-17 Thread Mads Ynddal
> This happens with nested macOS guest. I took another look at the stack trace in the issue. Everything should be fine then. > Maybe we are missing an earlier check whether HVF is usable or not, but > we shouldn't brutally abort(). I agree. I think with this patchset you're doing it practicall

Re: [PATCH-for-10.1 1/3] accel/hvf: Display executable bit as 'X'

2025-07-17 Thread Mads Ynddal
on(+), 1 deletion(-) Reviewed-by: Mads Ynddal

Re: [PATCH-for-10.1 3/3] hw/arm/virt: Warn when HVF doesn't report IPA bit length

2025-07-17 Thread Mads Ynddal
_ipa_size and hv_vm_config_get_default_ipa_size fail if HVF is not available, but assuming so, it looks fine to me. Reviewed-by: Mads Ynddal

Re: [PATCH-for-10.1 2/3] accel/hvf: Do not abort in hvf_arm_get_*_ipa_bit_size()

2025-07-17 Thread Mads Ynddal
> On 16 Jul 2025, at 19.28, Philippe Mathieu-Daudé wrote: > > Do not abort in hvf_arm_get_default_ipa_bit_size() > and hvf_arm_get_max_ipa_bit_size() when the IPA can > not be fetched. Return 0 (and document it). > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/arm/hvf_arm.h | 11

Re: [PATCH-for-10.1 v5 7/7] accel/hvf: Implement get_vcpu_stats()

2025-07-15 Thread Mads Ynddal
> On 15 Jul 2025, at 12.40, Philippe Mathieu-Daudé wrote: > > Co-developed-by: Mads Ynddal > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Richard Henderson > --- > Mads, I welcome your Signed-off-by tag on top :) > --- > accel/hvf/hvf-accel-ops.c | 24 +

Re: [PATCH] hvf: arm: Remove $pc from trace_hvf_data_abort()

2025-07-14 Thread Mads Ynddal
> And it doesn't seem to make much sense to log PC in every Dabort handler, > let's just remove it from this trace event. > > Signed-off-by: Zenghui Yu I agree. Unless cpu_synchronize_state(cpu) is called, the value in env->pc is stale. Reviewed-by: Mads Ynddal

Re: [PATCH v4 27/65] accel/hvf: Implement get_vcpu_stats()

2025-07-04 Thread Mads Ynddal
> On 2 Jul 2025, at 20.52, Philippe Mathieu-Daudé wrote: > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Richard Henderson > --- > accel/hvf/hvf-accel-ops.c | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-o

Re: [PATCH v4 33/65] accel/hvf: Replace @dirty field by generic CPUState::vcpu_dirty field

2025-07-04 Thread Mads Ynddal
accel/hvf/hvf-accel-ops.c | 10 +- > target/arm/hvf/hvf.c | 4 ++-- > target/i386/hvf/hvf.c | 4 ++-- > target/i386/hvf/x86hvf.c | 2 +- > 5 files changed, 10 insertions(+), 11 deletions(-) > Reviewed-by: Mads Ynddal

Re: [PATCH v4 56/65] accel: Expose and register generic_handle_interrupt()

2025-07-04 Thread Mads Ynddal
+ > accel/qtest/qtest.c | 1 + > accel/xen/xen-all.c | 1 + > system/cpus.c | 9 +++-- > target/i386/nvmm/nvmm-accel-ops.c | 1 + > target/i386/whpx/whpx-accel-ops.c | 1 + > 8 files changed, 12 insertions(+), 6 deletions(-) > Reviewed-by: Mads Ynddal

Re: [PATCH v4 58/65] accel: Always register AccelOpsClass::get_elapsed_ticks() handler

2025-07-04 Thread Mads Ynddal
cg-accel-ops.c | 3 +++ > accel/xen/xen-all.c | 2 ++ > system/cpus.c | 6 ++ > target/i386/nvmm/nvmm-accel-ops.c | 3 +++ > target/i386/whpx/whpx-accel-ops.c | 3 +++ > 9 files changed, 21 insertions(+), 4 deletions(-) > Reviewed-by: Mads Ynddal

Re: [PATCH v4 59/65] accel: Always register AccelOpsClass::get_virtual_clock() handler

2025-07-04 Thread Mads Ynddal
-all.c | 1 + > system/cpus.c | 7 --- > target/i386/nvmm/nvmm-accel-ops.c | 1 + > target/i386/whpx/whpx-accel-ops.c | 1 + > 8 files changed, 13 insertions(+), 3 deletions(-) Reviewed-by: Mads Ynddal

Re: [PATCH v4 28/65] accel/hvf: Report missing com.apple.security.hypervisor entitlement

2025-07-04 Thread Mads Ynddal
ment? > > Suggested-by: Shatyuka > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2800 > Signed-off-by: Philippe Mathieu-Daudé > Acked-by: Richard Henderson > --- > accel/hvf/hvf-accel-ops.c | 5 +++++ > 1 file changed, 5 insertions(+) > Reviewed-by: Mads Ynddal

Re: [PATCH v4 51/65] accel/kvm: Convert to AccelOpsClass::cpu_thread_routine

2025-07-04 Thread Mads Ynddal
; accel/kvm/kvm-accel-ops.c | 12 +--- > 1 file changed, 1 insertion(+), 11 deletions(-) > Reviewed-by: Mads Ynddal

Re: [PATCH v4 50/65] accel/hvf: Convert to AccelOpsClass::cpu_thread_routine

2025-07-04 Thread Mads Ynddal
; accel/hvf/hvf-accel-ops.c | 18 +- > 1 file changed, 1 insertion(+), 17 deletions(-) > Reviewed-by: Mads Ynddal

Re: [PATCH v4 47/65] accel: Introduce AccelOpsClass::cpu_thread_routine handler

2025-07-04 Thread Mads Ynddal
--- > include/system/accel-ops.h | 5 - > accel/accel-common.c | 16 +++- > system/cpus.c | 2 +- > 3 files changed, 20 insertions(+), 3 deletions(-) > Reviewed-by: Mads Ynddal

Re: [PATCH v2 06/12] python: upgrade to python3.9+ syntax

2025-06-17 Thread Mads Ynddal
oduced by tracetool.read_events > @@ -332,7 +330,7 @@ def run(analyzer): > except (AssertionError, ValueError): > raise SimpleException(f'usage: {sys.argv[0]} [--no-header] > \n') > > -with open(trace_event_path, 'r') as events_fobj, open(trace_file_path, > 'rb') as log_fobj: > +with open(trace_event_path) as events_fobj, open(trace_file_path, 'rb') > as log_fobj: > process(events_fobj, log_fobj, analyzer, read_header=not no_header) > > if __name__ == '__main__': I'm not really a fan of the implicit default arguments, but I guess the rest is fine. If this is the way everyone else wants to go, I won't stand in the way. — Mads Ynddal

[PATCH] MAINTAINERS: add myself as reviewer for Apple Silicon HVF

2025-06-17 Thread Mads Ynddal
changes that might affect the Apple Silicon HVF code, which will be my primary focus. Signed-off-by: Mads Ynddal --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 28b3dd2684..2b9be05aaf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -509,6 +

Re: [PATCH] accel/hvf: Include missing 'hw/core/cpu.h' header

2025-05-08 Thread Mads Ynddal
uot;system/hvf.h" >-> "target/arm/cpu.h" > -> "target/arm/cpu-qom.h" > -> "hw/core/cpu.h" > > "system/hvf.h" however doesn't need "target/arm/cpu.h" and we > want to remove it there. In order to

Re: [PATCH 0/2] Fix GDB support for macOS hvf

2025-04-14 Thread Mads Ynddal
r if Apple changed the > behavior of the function in a release of macOS. > > Mads Ynddal (2): > hvf: avoid repeatedly setting trap debug for each cpu > hvf: only update sysreg from owning thread > > accel/hvf/hvf-all.c | 7 ++- > target/arm/hvf/hvf.c | 27 +++

[PATCH 2/2] hvf: only update sysreg from owning thread

2025-04-05 Thread Mads Ynddal
From: Mads Ynddal hv_vcpu_set_sys_reg should only be called from the owning thread of the vCPU, so to avoid crashes, the call to hvf_update_guest_debug is dispatched to the individual threads. Tested-by: Daniel Gomez Signed-off-by: Mads Ynddal --- accel/hvf/hvf-all.c | 7 ++- 1 file

[PATCH 0/2] Fix GDB support for macOS hvf

2025-04-05 Thread Mads Ynddal
From: Mads Ynddal In (recent versions of?) macOS, calls to hv_vcpu_set_sys_reg were failing if they were issued outside of the specific thread that owns the vCPU. This caused a crash when attaching a debugger through the GDB stub. This GDB stub has worked before, so it is unclear if Apple

[PATCH 1/2] hvf: avoid repeatedly setting trap debug for each cpu

2025-04-02 Thread Mads Ynddal
From: Mads Ynddal hvf_arch_set_traps is already called from a context of a specific CPUState, so we don't need to do a nested CPU_FOREACH. It also results in an error from hv_vcpu_set_sys_reg, as it may only be called from the thread owning the vCPU. Tested-by: Daniel Gomez Signed-o

Re: [PATCH 0/5] trace: Remove and forbid newline characters in event format

2024-06-07 Thread Mads Ynddal
| 4 ++-- > hw/usb/trace-events | 6 +++--- > hw/vfio/trace-events | 4 ++-- > scripts/tracetool/__init__.py | 2 ++ > 6 files changed, 14 insertions(+), 10 deletions(-) > > -- > 2.41.0 > Acked-by: Mads Ynddal

Re: [RFC 0/6] scripts: Rewrite simpletrace printer in Rust

2024-05-29 Thread Mads Ynddal
tively slow, that we cannot make the TCG analysis? I'm not saying it can't be true, but it'd be nice to see it demonstrated before making decisions. Because, as you point out, there's a lot of downsides to having two versions. So the benefits have to clearly outweigh the additional work. I have a lot of other questions, but let's maybe start with the core idea first. — Mads Ynddal

Re: [RFC 0/6] scripts: Rewrite simpletrace printer in Rust

2024-05-27 Thread Mads Ynddal
security of the Python version. We're not doing anything obviously exploitable. — Mads Ynddal

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-12 Thread Mads Ynddal
> Why are the timestamps non-monotonic? > > In a situation like that maybe not only the negative timestamps are > useless but even some positive timestamps are incorrect. I think it's > worth understanding the nature of the instability before merging a > fix. I agree with Stefan on this. We'll

Re: [PATCH v4 12/14] simpletrace: added simplified Analyzer2 class

2023-09-26 Thread Mads Ynddal
>> +class Formatter2(Analyzer2): > > Was this class part of the benchmark? It appears to be unused. > >> +def __init__(self): >> +self.last_timestamp_ns = None >> + >> +def catchall(self, *rec_args, event, timestamp_ns, pid, event_id): >> +if self.las

[PATCH v5 05/14] simpletrace: update code for Python 3.11

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requirement of at least Python version 3.6. Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Signed-o

[PATCH v5 06/14] simpletrace: improved error handling on struct unpack

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out. Review

[PATCH v5 12/14] simpletrace: added simplified Analyzer2 class

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's argu

[PATCH v5 10/14] simpletrace: move logic of process into internal function

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process into _process. Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 26 ++ 1

[PATCH v5 08/14] simpletrace: made Analyzer into context-manager

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method

[PATCH v5 01/14] simpletrace: add __all__ to define public interface

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain. Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a

[PATCH v5 09/14] simpletrace: refactor to separate responsibilities

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal Moved event_mapping and event_id_to_name down one level in the function call-stack to keep variable instantiation and usage closer (`process` and `run` has no use of the variables; `read_trace_records` does). Instead of passing event_mapping and event_id_to_name to the bottom

[PATCH v5 03/14] simpletrace: improve parsing of sys.argv; fix files never closed.

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for. The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same

[PATCH v5 11/14] simpletrace: move event processing to Analyzer class

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process function. This allows for new types of Analyzer-based subclasses without changing the core code. Note, that the fn_cache is important for

[PATCH v5 13/14] MAINTAINERS: add maintainer of simpletrace.py

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal In my work to refactor simpletrace.py, I noticed that there's no maintainer of it, and has the status of "odd fixes". I'm using it from time to time, so I'd like to maintain the script. I've added myself as reviewer under "Tracing" to

[PATCH v5 14/14] scripts/analyse-locks-simpletrace.py: changed iteritems() to items()

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal Python 3 removed `dict.iteritems()` in favor of `dict.items()`. This means the script currently doesn't work on Python 3. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 2 +- 1

[PATCH v5 00/14] simpletrace: refactor and general improvements

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal I wanted to use simpletrace.py for an internal project, so I tried to update and polish the code. Some of the commits resolve specific issues, while some are more subjective. I've tried to divide it into commits so we can discuss the individual changes, and I'm rea

[PATCH v5 02/14] simpletrace: annotate magic constants from QEMU code

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal It wasn't clear where the constants and structs came from, so I added comments to help. Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/simpletrace.py b/sc

[PATCH v5 07/14] simpletrace: define exception and add handling

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Mads Ynddal --- scripts

[PATCH v5 04/14] simpletrace: changed naming of edict and idtoname to improve readability

2023-09-26 Thread Mads Ynddal
From: Mads Ynddal Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code. Signed-off-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --- scripts/simpletrace.py

Re: [PATCH v4 13/14] MAINTAINERS: add maintainer of simpletrace.py

2023-09-26 Thread Mads Ynddal
e qemu.git maintainer yourself > (requires publishing a GPG key and signing pull request tags). > > Please let me know which option you prefer. For future patches, I would like to send pull requests myself with a GPG key to get the practice. I can have Klaus Jensen sign my key to get started. — Mads Ynddal

Re: [PATCH v4 12/14] simpletrace: added simplified Analyzer2 class

2023-09-06 Thread Mads Ynddal
> AFAIK, we don't consider simpletrace.py python code to be a > supported public API, just a command line tool. > > IOW, we can change the python code at will, as long as the > command line doesn't alter its behaviour. Thus I don't see > a need to add new classes, just change the existing ones.

Re: [PATCH v4 12/14] simpletrace: added simplified Analyzer2 class

2023-09-05 Thread Mads Ynddal
> On 23 Aug 2023, at 10.54, Mads Ynddal wrote: > > From: Mads Ynddal > > By moving the dynamic argument construction to keyword-arguments, > we can remove all of the specialized handling, and streamline it. > If a tracing method wants to access these, they can define th

Re: [PATCH v4 00/14] simpletrace: refactor and general improvements

2023-09-05 Thread Mads Ynddal
> On 23 Aug 2023, at 10.54, Mads Ynddal wrote: > > From: Mads Ynddal > > I wanted to use simpletrace.py for an internal project, so I tried to update > and polish the code. Some of the commits resolve specific issues, while some > are more subjective. > > I

[PATCH v4 12/14] simpletrace: added simplified Analyzer2 class

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's argu

[PATCH v4 06/14] simpletrace: improved error handling on struct unpack

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out. Signed-o

[PATCH v4 01/14] simpletrace: add __all__ to define public interface

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/simpletrace.py b

[PATCH v4 14/14] scripts/analyse-locks-simpletrace.py: changed iteritems() to items()

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal Python 3 removed `dict.iteritems()` in favor of `dict.items()`. This means the script curerntly doesn't work on Python 3. Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/an

[PATCH v4 02/14] simpletrace: annotate magic constants from QEMU code

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal It wasn't clear where the constants and structs came from, so I added comments to help. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py index b221d9a241..5c230

[PATCH v4 13/14] MAINTAINERS: add maintainer of simpletrace.py

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal In my work to refactor simpletrace.py, I noticed that there's no maintainer of it, and has the status of "odd fixes". I'm using it from time to time, so I'd like to maintain the script. I've added myself as reviewer under "Tracing" to

[PATCH v4 10/14] simpletrace: move logic of process into internal function

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process into _process. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 26 ++ 1 file changed, 18 insertions

[PATCH v4 11/14] simpletrace: move event processing to Analyzer class

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process function. This allows for new types of Analyzer-based subclasses without changing the core code. Note, that the fn_cache is important for

[PATCH v4 04/14] simpletrace: changed naming of edict and idtoname to improve readability

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code. Signed-off-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --- scripts/simpletrace.py

[PATCH v4 00/14] simpletrace: refactor and general improvements

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal I wanted to use simpletrace.py for an internal project, so I tried to update and polish the code. Some of the commits resolve specific issues, while some are more subjective. I've tried to divide it into commits so we can discuss the individual changes, and I'm rea

[PATCH v4 07/14] simpletrace: define exception and add handling

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr. Signed-off-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daudé --- scripts/simpletrace.py | 22

[PATCH v4 03/14] simpletrace: improve parsing of sys.argv; fix files never closed.

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for. The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same

[PATCH v4 08/14] simpletrace: made Analyzer into context-manager

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method

[PATCH v4 05/14] simpletrace: update code for Python 3.11

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requirement of at least Python version 3.6. Signed-off-by: Mads Ynddal Reviewed-by: Stefan Hajnoczi --- sc

[PATCH v4 09/14] simpletrace: refactor to separate responsibilities

2023-08-23 Thread Mads Ynddal
From: Mads Ynddal Moved event_mapping and event_id_to_name down one level in the function call-stack to keep variable instantiation and usage closer (`process` and `run` has no use of the variables; `read_trace_records` does). Instead of passing event_mapping and event_id_to_name to the bottom

Re: [PATCH 00/12] Introduce new vmapple machine type

2023-06-20 Thread Mads Ynddal
> On 15 Jun 2023, at 00.40, Alexander Graf wrote: > > This patch set introduces a new ARM and HVF specific machine type > called "vmapple". It mimicks the device model that Apple's proprietary > Virtualization.Framework exposes, but implements it in QEMU. > > With this new machine type, you ca

Re: [PATCH] target/arm: Restructure has_vfp_d32 test

2023-06-19 Thread Mads Ynddal
for Apple M1 cpus. > > We already have a check for ARMv8-A never setting vfp-d32 true, > so restructure the code so that AArch64 avoids the test entirely. > > Reported-by: Mads Ynddal > Signed-off-by: Richard Henderson > --- > target/arm/cpu.c | 28 +++---

Re: [PATCH v2 12/12] target/arm: Allow users to set the number of VFP registers

2023-06-19 Thread Mads Ynddal
trm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp flagm2 frint CPU implementer : 0x00 CPU architecture: 8 CPU variant : 0x0 CPU part : 0x000 CPU revision : 0 — Mads Ynddal

Re: [PATCH v2 12/12] target/arm: Allow users to set the number of VFP registers

2023-06-19 Thread Mads Ynddal
; \ -serial "mon:stdio" qemu-system-aarch64: ARM CPUs must have both VFP-D32 and Neon or neither If you fix/work on this issue in a separate thread/patch, you can add reported-by, so I'll automatically follow and help test it: Reported-by: Mads Ynddal — Mads Ynddal > On

Re: [PATCH v3 12/14] simpletrace: added simplified Analyzer2 class

2023-06-09 Thread Mads Ynddal
> On 8 Jun 2023, at 14.41, Mads Ynddal wrote: > > From: Mads Ynddal > > By moving the dynamic argument construction to keyword-arguments, > we can remove all of the specialized handling, and streamline it. > If a tracing method wants to access these, they can define th

[PATCH v3 12/14] simpletrace: added simplified Analyzer2 class

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's argu

[PATCH v3 07/14] simpletrace: define exception and add handling

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr. Signed-off-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daudé --- scripts/simpletrace.py | 22

[PATCH v3 11/14] simpletrace: move event processing to Analyzer class

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process function. This allows for new types of Analyzer-based subclasses without changing the core code. Note, that the fn_cache is important for

[PATCH v3 05/14] simpletrace: update code for Python 3.11

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requirement of at least Python version 3.6. Signed-off-by: Mads Ynddal Reviewed-by: Stefan Hajnoczi --- sc

[PATCH v3 08/14] simpletrace: made Analyzer into context-manager

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method

[PATCH v3 14/14] scripts/analyse-locks-simpletrace.py: changed iteritems() to items()

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal Python 3 removed `dict.iteritems()` in favor of `dict.items()`. This means the script curerntly doesn't work on Python 3. Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/an

[PATCH v3 06/14] simpletrace: improved error handling on struct unpack

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out. Signed-o

[PATCH v3 10/14] simpletrace: move logic of process into internal function

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process into _process. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 26 ++ 1 file changed, 18 insertions

[PATCH v3 04/14] simpletrace: changed naming of edict and idtoname to improve readability

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code. Signed-off-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --- scripts/simpletrace.py

[PATCH v3 01/14] simpletrace: add __all__ to define public interface

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/simpletrace.py b

[PATCH v3 02/14] simpletrace: annotate magic constants from QEMU code

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal It wasn't clear where the constants and structs came from, so I added comments to help. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py index b221d9a241..5c230

[PATCH v3 09/14] simpletrace: refactor to separate responsibilities

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal Moved event_mapping and event_id_to_name down one level in the function call-stack to keep variable instantiation and usage closer (`process` and `run` has no use of the variables; `read_trace_records` does). Instead of passing event_mapping and event_id_to_name to the bottom

[PATCH v3 13/14] MAINTAINERS: add maintainer of simpletrace.py

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal In my work to refactor simpletrace.py, I noticed that there's no maintainer of it, and has the status of "odd fixes". I'm using it from time to time, so I'd like to maintain the script. I've added myself as reviewer under "Tracing" to

[PATCH v3 00/14] simpletrace: refactor and general improvements

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal I wanted to use simpletrace.py for an internal project, so I tried to update and polish the code. Some of the commits resolve specific issues, while some are more subjective. I've tried to divide it into commits so we can discuss the individual changes, and I'm rea

[PATCH v3 03/14] simpletrace: improve parsing of sys.argv; fix files never closed.

2023-06-08 Thread Mads Ynddal
From: Mads Ynddal The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for. The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same

Re: [PATCH v2 06/12] simpletrace: Simplify construction of tracing methods

2023-05-15 Thread Mads Ynddal
> > This is nice but breaking existing analysis scripts should be avoided. > > I suggest preserving the Analyzer class the way it is and adding a new > Analyzer2 class that follows the new method signature for trace event > methods. You're right. This has too large effects on the API. I could

Re: [PATCH v2 05/12] simpletrace: Changed Analyzer class to become context-manager

2023-05-15 Thread Mads Ynddal
> > Bearing in mind compatibility with existing simpletrace analysis > scripts, how about the following default method implementations? > > def __enter__(self): > self.begin() > > def __exit__(self, exc_type, exc_val, exc_tb): > if exc_type is None: > self.end() > ret

Re: [PATCH v2 02/12] simpletrace: Annotate magic constants from QEMU code

2023-05-14 Thread Mads Ynddal
> > From my reply to v1 of this patch series: > > This is fragile since this information will be outdated if the C source > code changes (e.g. renaming files or variables). > > Instead I would add the following comment: > > # This is the binary format that the QEMU "simple" trace backend > #

Re: [PATCH v2 04/12] simpletrace: update code for Python 3.11

2023-05-14 Thread Mads Ynddal
> On 9 May 2023, at 16.38, Stefan Hajnoczi wrote: > > On Tue, May 02, 2023 at 11:23:31AM +0200, Mads Ynddal wrote: >> From: Mads Ynddal >> >> The call to `getargspec` was deprecated and in Python 3.11 it has been >> removed in favor of `getfullargspec`. &g

Re: [PATCH v2 00/12] simpletrace: refactor and general improvements

2023-05-08 Thread Mads Ynddal
> > I was curious how Mads is using simpletrace for an internal (to > Samsung?) project. > I was just tracing the NVMe emulation to get some metrics. The code is all upstream or a part of this patchset. The rest is tracing configs.

Re: [PATCH v2 01/12] simpletrace: Improve parsing of sys.argv; fix files never closed.

2023-05-08 Thread Mads Ynddal
> simpletrace.py is both a command-line tool and a Python module. The > Python module has a public API that people's scripts may rely on. Let's > avoid breaking API changes unless necessary so that existing scripts > that import simpletrace continue to work. > > It's not very clear what is a publi

Re: [PATCH v2 00/12] simpletrace: refactor and general improvements

2023-05-08 Thread Mads Ynddal
> A question for you: do you think it's possible to move simpletrace into > qemu/python/utils? This requires cleaning up the code to some fairly pedantic > standards, but helps protect it against rot as we change target python > versions. > > No problem if that's too much to ask. just want t

[PATCH v2 10/12] MAINTAINERS: add maintainer of simpletrace.py

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal In my work to refactor simpletrace.py, I noticed that there's no maintainer of it, and has the status of "odd fixes". I'm using it from time to time, so I'd like to maintain the script. I've added myself as reviewer under "Tracing" to

[PATCH v2 12/12] scripts/analyse-locks-simpletrace.py: reflect changes to process in simpletrace.py

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal The signature of `process` in simpletrace.py has changed to not take filepaths as the two first arguments, but rather a file-like object. We change the code here to reflect that. Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 3 ++- 1 file changed, 2

[PATCH v2 11/12] scripts/analyse-locks-simpletrace.py: changed iteritems() to items()

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Python 3 removed `dict.iteritems()` in favor of `dict.items()`. This means the script curerntly doesn't work on Python 3. Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/an

[PATCH v2 02/12] simpletrace: Annotate magic constants from QEMU code

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal It wasn't clear where the constants and structs came from, so I added comments to help. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/simpletrace.py b/scripts/simpletra

[PATCH v2 08/12] simpletrace: define exception and add handling

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 22

[PATCH v2 03/12] simpletrace: changed naming of edict and idtoname to improve readability

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 34 +---

[PATCH v2 06/12] simpletrace: Simplify construction of tracing methods

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's argu

[PATCH v2 01/12] simpletrace: Improve parsing of sys.argv; fix files never closed.

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for. The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same

[PATCH v2 09/12] simpletrace: Refactor to separate responsibilities

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal NOTE: `process` changes function signature Moved event_mapping and event_id_to_name down one level in the function call-stack to keep variable instantiation and usage closer (`process` and `run` has no use of the variables; `read_trace_records` does). Instead of passing

[PATCH v2 04/12] simpletrace: update code for Python 3.11

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simpletrace.py b/scripts

[PATCH v2 05/12] simpletrace: Changed Analyzer class to become context-manager

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method

[PATCH v2 07/12] simpletrace: Improved error handling on struct unpack

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out. Signed-o

  1   2   >