1 | target-arm queue: this time around is all small fixes | 1 | arm pullreq for rc1. All minor bugfixes, except for the sve-default-vector-length |
---|---|---|---|
2 | and changes. | 2 | patches, which are somewhere between a bugfix and a new feature. |
3 | 3 | ||
4 | thanks | 4 | thanks |
5 | -- PMM | 5 | -- PMM |
6 | 6 | ||
7 | The following changes since commit fec105c2abda8567ec15230429c41429b5ee307c: | 7 | The following changes since commit c08ccd1b53f488ac86c1f65cf7623dc91acc249a: |
8 | 8 | ||
9 | Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190828-pull-request' into staging (2019-09-03 14:03:15 +0100) | 9 | Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210726' into staging (2021-07-27 08:35:01 +0100) |
10 | 10 | ||
11 | are available in the Git repository at: | 11 | are available in the Git repository at: |
12 | 12 | ||
13 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190903 | 13 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20210727 |
14 | 14 | ||
15 | for you to fetch changes up to 5e5584c89f36b302c666bc6db535fd3f7ff35ad2: | 15 | for you to fetch changes up to e229a179a503f2aee43a76888cf12fbdfe8a3749: |
16 | 16 | ||
17 | target/arm: Don't abort on M-profile exception return in linux-user mode (2019-09-03 16:20:35 +0100) | 17 | hw: aspeed_gpio: Fix memory size (2021-07-27 11:00:00 +0100) |
18 | 18 | ||
19 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
20 | target-arm queue: | 20 | target-arm queue: |
21 | * Revert and correctly fix refactoring of unallocated_encoding() | 21 | * hw/arm/smmuv3: Check 31st bit to see if CD is valid |
22 | * Take exceptions on ATS instructions when needed | 22 | * qemu-options.hx: Fix formatting of -machine memory-backend option |
23 | * aspeed/timer: Provide back-pressure information for short periods | 23 | * hw: aspeed_gpio: Fix memory size |
24 | * memory: Remove unused memory_region_iommu_replay_all() | 24 | * hw/arm/nseries: Display hexadecimal value with '0x' prefix |
25 | * hw/arm/smmuv3: Log a guest error when decoding an invalid STE | 25 | * Add sve-default-vector-length cpu property |
26 | * hw/arm/smmuv3: Remove spurious error messages on IOVA invalidations | 26 | * docs: Update path that mentions deprecated.rst |
27 | * target/arm: Fix SMMLS argument order | 27 | * hw/intc/armv7m_nvic: for v8.1M VECTPENDING hides S exceptions from NS |
28 | * hw/arm: Use ARM_CPU_TYPE_NAME() macro when appropriate | 28 | * hw/intc/armv7m_nvic: Correct size of ICSR.VECTPENDING |
29 | * hw/arm: Correct reference counting for creation of various objects | 29 | * hw/intc/armv7m_nvic: ISCR.ISRPENDING is set for non-enabled pending interrupts |
30 | * includes: remove stale [smp|max]_cpus externs | 30 | * target/arm: Report M-profile alignment faults correctly to the guest |
31 | * tcg/README: fix typo | 31 | * target/arm: Add missing 'return's after calling v7m_exception_taken() |
32 | * atomic_template: fix indentation in GEN_ATOMIC_HELPER | 32 | * target/arm: Enforce that M-profile SP low 2 bits are always zero |
33 | * include/exec/cpu-defs.h: fix typo | ||
34 | * target/arm: Free TCG temps in trans_VMOV_64_sp() | ||
35 | * target/arm: Don't abort on M-profile exception return in linux-user mode | ||
36 | 33 | ||
37 | ---------------------------------------------------------------- | 34 | ---------------------------------------------------------------- |
38 | Alex Bennée (2): | 35 | Joe Komlodi (1): |
39 | includes: remove stale [smp|max]_cpus externs | 36 | hw/arm/smmuv3: Check 31st bit to see if CD is valid |
40 | include/exec/cpu-defs.h: fix typo | ||
41 | 37 | ||
42 | Andrew Jeffery (1): | 38 | Joel Stanley (1): |
43 | aspeed/timer: Provide back-pressure information for short periods | 39 | hw: aspeed_gpio: Fix memory size |
44 | 40 | ||
45 | Emilio G. Cota (2): | 41 | Mao Zhongyi (1): |
46 | tcg/README: fix typo s/afterwise/afterwards/ | 42 | docs: Update path that mentions deprecated.rst |
47 | atomic_template: fix indentation in GEN_ATOMIC_HELPER | ||
48 | 43 | ||
49 | Eric Auger (3): | 44 | Peter Maydell (7): |
50 | memory: Remove unused memory_region_iommu_replay_all() | 45 | qemu-options.hx: Fix formatting of -machine memory-backend option |
51 | hw/arm/smmuv3: Log a guest error when decoding an invalid STE | 46 | target/arm: Enforce that M-profile SP low 2 bits are always zero |
52 | hw/arm/smmuv3: Remove spurious error messages on IOVA invalidations | 47 | target/arm: Add missing 'return's after calling v7m_exception_taken() |
48 | target/arm: Report M-profile alignment faults correctly to the guest | ||
49 | hw/intc/armv7m_nvic: ISCR.ISRPENDING is set for non-enabled pending interrupts | ||
50 | hw/intc/armv7m_nvic: Correct size of ICSR.VECTPENDING | ||
51 | hw/intc/armv7m_nvic: for v8.1M VECTPENDING hides S exceptions from NS | ||
53 | 52 | ||
54 | Peter Maydell (4): | 53 | Philippe Mathieu-Daudé (1): |
55 | target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions | 54 | hw/arm/nseries: Display hexadecimal value with '0x' prefix |
56 | target/arm: Take exceptions on ATS instructions when needed | ||
57 | target/arm: Free TCG temps in trans_VMOV_64_sp() | ||
58 | target/arm: Don't abort on M-profile exception return in linux-user mode | ||
59 | |||
60 | Philippe Mathieu-Daudé (6): | ||
61 | hw/arm: Use ARM_CPU_TYPE_NAME() macro when appropriate | ||
62 | hw/arm: Use object_initialize_child for correct reference counting | ||
63 | hw/arm: Use sysbus_init_child_obj for correct reference counting | ||
64 | hw/arm/fsl-imx: Add the cpu as child of the SoC object | ||
65 | hw/dma/xilinx_axi: Use object_initialize_child for correct ref. counting | ||
66 | hw/net/xilinx_axi: Use object_initialize_child for correct ref. counting | ||
67 | 55 | ||
68 | Richard Henderson (3): | 56 | Richard Henderson (3): |
69 | Revert "target/arm: Use unallocated_encoding for aarch32" | 57 | target/arm: Correctly bound length in sve_zcr_get_valid_len |
70 | target/arm: Factor out unallocated_encoding for aarch32 | 58 | target/arm: Export aarch64_sve_zcr_get_valid_len |
71 | target/arm: Fix SMMLS argument order | 59 | target/arm: Add sve-default-vector-length cpu property |
72 | 60 | ||
73 | accel/tcg/atomic_template.h | 2 +- | 61 | docs/system/arm/cpu-features.rst | 15 ++++++++++ |
74 | hw/arm/smmuv3-internal.h | 1 + | 62 | configure | 2 +- |
75 | include/exec/cpu-defs.h | 2 +- | 63 | hw/arm/smmuv3-internal.h | 2 +- |
76 | include/exec/memory.h | 10 ---- | 64 | target/arm/cpu.h | 5 ++++ |
77 | include/sysemu/sysemu.h | 2 - | 65 | target/arm/internals.h | 10 +++++++ |
78 | target/arm/cpu.h | 6 ++- | 66 | hw/arm/nseries.c | 2 +- |
79 | target/arm/translate-a64.h | 2 + | 67 | hw/gpio/aspeed_gpio.c | 3 +- |
80 | target/arm/translate.h | 2 - | 68 | hw/intc/armv7m_nvic.c | 40 +++++++++++++++++++-------- |
81 | hw/arm/allwinner-a10.c | 3 +- | 69 | target/arm/cpu.c | 14 ++++++++-- |
82 | hw/arm/cubieboard.c | 3 +- | 70 | target/arm/cpu64.c | 60 ++++++++++++++++++++++++++++++++++++++++ |
83 | hw/arm/digic.c | 3 +- | 71 | target/arm/gdbstub.c | 4 +++ |
84 | hw/arm/exynos4_boards.c | 4 +- | 72 | target/arm/helper.c | 8 ++++-- |
85 | hw/arm/fsl-imx25.c | 4 +- | 73 | target/arm/m_helper.c | 24 ++++++++++++---- |
86 | hw/arm/fsl-imx31.c | 4 +- | 74 | target/arm/translate.c | 3 ++ |
87 | hw/arm/fsl-imx6.c | 3 +- | 75 | target/i386/cpu.c | 2 +- |
88 | hw/arm/fsl-imx6ul.c | 2 +- | 76 | MAINTAINERS | 2 +- |
89 | hw/arm/mcimx7d-sabre.c | 9 ++-- | 77 | qemu-options.hx | 30 +++++++++++--------- |
90 | hw/arm/mps2-tz.c | 15 +++--- | 78 | 17 files changed, 183 insertions(+), 43 deletions(-) |
91 | hw/arm/musca.c | 9 ++-- | ||
92 | hw/arm/smmuv3.c | 18 ++++--- | ||
93 | hw/arm/xlnx-zynqmp.c | 8 +-- | ||
94 | hw/dma/xilinx_axidma.c | 16 +++--- | ||
95 | hw/net/xilinx_axienet.c | 17 +++---- | ||
96 | hw/timer/aspeed_timer.c | 17 ++++++- | ||
97 | memory.c | 9 ---- | ||
98 | target/arm/helper.c | 107 +++++++++++++++++++++++++++++++++++------ | ||
99 | target/arm/translate-a64.c | 13 +++++ | ||
100 | target/arm/translate-vfp.inc.c | 2 + | ||
101 | target/arm/translate.c | 50 +++++++++++++++++-- | ||
102 | tcg/README | 2 +- | ||
103 | 30 files changed, 244 insertions(+), 101 deletions(-) | ||
104 | 79 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | 1 | From: Joe Komlodi <joe.komlodi@xilinx.com> |
---|---|---|---|
2 | 2 | ||
3 | An IOVA/ASID invalidation is notified to all IOMMU Memory Regions | 3 | The bit to see if a CD is valid is the last bit of the first word of the CD. |
4 | through smmuv3_inv_notifiers_iova/smmuv3_notify_iova. | ||
5 | 4 | ||
6 | When the notification occurs it is possible that some of the | 5 | Signed-off-by: Joe Komlodi <joe.komlodi@xilinx.com> |
7 | PCIe devices associated to the notified regions do not have a | 6 | Message-id: 1626728232-134665-2-git-send-email-joe.komlodi@xilinx.com |
8 | valid stream table entry. In that case we output a LOG_GUEST_ERROR | ||
9 | message, for example: | ||
10 | |||
11 | invalid sid=<SID> (L1STD span=0) | ||
12 | "smmuv3_notify_iova error decoding the configuration for iommu mr=<MR> | ||
13 | |||
14 | This is unfortunate as the user gets the impression that there | ||
15 | are some translation decoding errors whereas there are not. | ||
16 | |||
17 | This patch adds a new field in SMMUEventInfo that tells whether | ||
18 | the detection of an invalid STE must lead to an error report. | ||
19 | invalid_ste_allowed is set before doing the invalidations and | ||
20 | kept unset on actual translation. | ||
21 | |||
22 | The other configuration decoding error messages are kept since if the | ||
23 | STE is valid then the rest of the config must be correct. | ||
24 | |||
25 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
26 | Message-id: 20190822172350.12008-6-eric.auger@redhat.com | ||
27 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
28 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
29 | --- | 9 | --- |
30 | hw/arm/smmuv3-internal.h | 1 + | 10 | hw/arm/smmuv3-internal.h | 2 +- |
31 | hw/arm/smmuv3.c | 19 +++++++++++-------- | 11 | 1 file changed, 1 insertion(+), 1 deletion(-) |
32 | 2 files changed, 12 insertions(+), 8 deletions(-) | ||
33 | 12 | ||
34 | diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h | 13 | diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h |
35 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
36 | --- a/hw/arm/smmuv3-internal.h | 15 | --- a/hw/arm/smmuv3-internal.h |
37 | +++ b/hw/arm/smmuv3-internal.h | 16 | +++ b/hw/arm/smmuv3-internal.h |
38 | @@ -XXX,XX +XXX,XX @@ typedef struct SMMUEventInfo { | 17 | @@ -XXX,XX +XXX,XX @@ static inline int pa_range(STE *ste) |
39 | uint32_t sid; | 18 | |
40 | bool recorded; | 19 | /* CD fields */ |
41 | bool record_trans_faults; | 20 | |
42 | + bool inval_ste_allowed; | 21 | -#define CD_VALID(x) extract32((x)->word[0], 30, 1) |
43 | union { | 22 | +#define CD_VALID(x) extract32((x)->word[0], 31, 1) |
44 | struct { | 23 | #define CD_ASID(x) extract32((x)->word[1], 16, 16) |
45 | uint32_t ssid; | 24 | #define CD_TTB(x, sel) \ |
46 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | 25 | ({ \ |
47 | index XXXXXXX..XXXXXXX 100644 | ||
48 | --- a/hw/arm/smmuv3.c | ||
49 | +++ b/hw/arm/smmuv3.c | ||
50 | @@ -XXX,XX +XXX,XX @@ static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg, | ||
51 | uint32_t config; | ||
52 | |||
53 | if (!STE_VALID(ste)) { | ||
54 | - qemu_log_mask(LOG_GUEST_ERROR, "invalid STE\n"); | ||
55 | + if (!event->inval_ste_allowed) { | ||
56 | + qemu_log_mask(LOG_GUEST_ERROR, "invalid STE\n"); | ||
57 | + } | ||
58 | goto bad_ste; | ||
59 | } | ||
60 | |||
61 | @@ -XXX,XX +XXX,XX @@ static int smmu_find_ste(SMMUv3State *s, uint32_t sid, STE *ste, | ||
62 | |||
63 | if (!span) { | ||
64 | /* l2ptr is not valid */ | ||
65 | - qemu_log_mask(LOG_GUEST_ERROR, | ||
66 | - "invalid sid=%d (L1STD span=0)\n", sid); | ||
67 | + if (!event->inval_ste_allowed) { | ||
68 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
69 | + "invalid sid=%d (L1STD span=0)\n", sid); | ||
70 | + } | ||
71 | event->type = SMMU_EVT_C_BAD_STREAMID; | ||
72 | return -EINVAL; | ||
73 | } | ||
74 | @@ -XXX,XX +XXX,XX @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, | ||
75 | SMMUDevice *sdev = container_of(mr, SMMUDevice, iommu); | ||
76 | SMMUv3State *s = sdev->smmu; | ||
77 | uint32_t sid = smmu_get_sid(sdev); | ||
78 | - SMMUEventInfo event = {.type = SMMU_EVT_NONE, .sid = sid}; | ||
79 | + SMMUEventInfo event = {.type = SMMU_EVT_NONE, | ||
80 | + .sid = sid, | ||
81 | + .inval_ste_allowed = false}; | ||
82 | SMMUPTWEventInfo ptw_info = {}; | ||
83 | SMMUTranslationStatus status; | ||
84 | SMMUState *bs = ARM_SMMU(s); | ||
85 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, | ||
86 | dma_addr_t iova) | ||
87 | { | ||
88 | SMMUDevice *sdev = container_of(mr, SMMUDevice, iommu); | ||
89 | - SMMUEventInfo event = {}; | ||
90 | + SMMUEventInfo event = {.inval_ste_allowed = true}; | ||
91 | SMMUTransTableInfo *tt; | ||
92 | SMMUTransCfg *cfg; | ||
93 | IOMMUTLBEntry entry; | ||
94 | |||
95 | cfg = smmuv3_get_config(sdev, &event); | ||
96 | if (!cfg) { | ||
97 | - qemu_log_mask(LOG_GUEST_ERROR, | ||
98 | - "%s error decoding the configuration for iommu mr=%s\n", | ||
99 | - __func__, mr->parent_obj.name); | ||
100 | return; | ||
101 | } | ||
102 | |||
103 | -- | 26 | -- |
104 | 2.20.1 | 27 | 2.20.1 |
105 | 28 | ||
106 | 29 | diff view generated by jsdifflib |
1 | An attempt to do an exception-return (branch to one of the magic | 1 | The documentation of the -machine memory-backend has some minor |
---|---|---|---|
2 | addresses) in linux-user mode for M-profile should behave like | 2 | formatting errors: |
3 | a normal branch, because linux-user mode is always going to be | 3 | * Misindentation of the initial line meant that the whole option |
4 | in 'handler' mode. This used to work, but we broke it when we added | 4 | section is incorrectly indented in the HTML output compared to |
5 | support for the M-profile security extension in commit d02a8698d7ae2bfed. | 5 | the other -machine options |
6 | * The examples weren't indented, which meant that they were formatted | ||
7 | as plain run-on text including outputting the "::" as text. | ||
8 | * The a) b) list has no rst-format markup so it is rendered as | ||
9 | a single run-on paragraph | ||
6 | 10 | ||
7 | In that commit we allowed even handler-mode calls to magic return | 11 | Fix the formatting. |
8 | values to be checked for and dealt with by causing an | ||
9 | EXCP_EXCEPTION_EXIT exception to be taken, because this is | ||
10 | needed for the FNC_RETURN return-from-non-secure-function-call | ||
11 | handling. For system mode we added a check in do_v7m_exception_exit() | ||
12 | to make any spurious calls from Handler mode behave correctly, but | ||
13 | forgot that linux-user mode would also be affected. | ||
14 | 12 | ||
15 | How an attempted return-from-non-secure-function-call in linux-user | 13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
16 | mode should be handled is not clear -- on real hardware it would | 14 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> |
17 | result in return to secure code (not to the Linux kernel) which | 15 | Message-id: 20210719105257.3599-1-peter.maydell@linaro.org |
18 | could then handle the error in any way it chose. For QEMU we take | 16 | --- |
19 | the simple approach of treating this erroneous return the same way | 17 | qemu-options.hx | 30 +++++++++++++++++------------- |
20 | it would be handled on a CPU without the security extensions -- | 18 | 1 file changed, 17 insertions(+), 13 deletions(-) |
21 | treat it as a normal branch. | ||
22 | 19 | ||
23 | The upshot of all this is that for linux-user mode we should never | 20 | diff --git a/qemu-options.hx b/qemu-options.hx |
24 | do any of the bx_excret magic, so the code change is simple. | ||
25 | |||
26 | This ought to be a weird corner case that only affects broken guest | ||
27 | code (because Linux user processes should never be attempting to do | ||
28 | exception returns or NS function returns), except that the code that | ||
29 | assigns addresses in RAM for the process and stack in our linux-user | ||
30 | code does not attempt to avoid this magic address range, so | ||
31 | legitimate code attempting to return to a trampoline routine on the | ||
32 | stack can fall into this case. This change fixes those programs, | ||
33 | but we should also look at restricting the range of memory we | ||
34 | use for M-profile linux-user guests to the area that would be | ||
35 | real RAM in hardware. | ||
36 | |||
37 | Cc: qemu-stable@nongnu.org | ||
38 | Reported-by: Christophe Lyon <christophe.lyon@linaro.org> | ||
39 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
40 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
41 | Message-id: 20190822131534.16602-1-peter.maydell@linaro.org | ||
42 | Fixes: https://bugs.launchpad.net/qemu/+bug/1840922 | ||
43 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
44 | --- | ||
45 | target/arm/translate.c | 21 ++++++++++++++++++++- | ||
46 | 1 file changed, 20 insertions(+), 1 deletion(-) | ||
47 | |||
48 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
49 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
50 | --- a/target/arm/translate.c | 22 | --- a/qemu-options.hx |
51 | +++ b/target/arm/translate.c | 23 | +++ b/qemu-options.hx |
52 | @@ -XXX,XX +XXX,XX @@ static inline void gen_bx(DisasContext *s, TCGv_i32 var) | 24 | @@ -XXX,XX +XXX,XX @@ SRST |
53 | store_cpu_field(var, thumb); | 25 | Enables or disables ACPI Heterogeneous Memory Attribute Table |
54 | } | 26 | (HMAT) support. The default is off. |
55 | 27 | ||
56 | -/* Set PC and Thumb state from var. var is marked as dead. | 28 | - ``memory-backend='id'`` |
57 | +/* | 29 | + ``memory-backend='id'`` |
58 | + * Set PC and Thumb state from var. var is marked as dead. | 30 | An alternative to legacy ``-mem-path`` and ``mem-prealloc`` options. |
59 | * For M-profile CPUs, include logic to detect exception-return | 31 | Allows to use a memory backend as main RAM. |
60 | * branches and handle them. This is needed for Thumb POP/LDM to PC, LDR to PC, | 32 | |
61 | * and BX reg, and no others, and happens only for code in Handler mode. | 33 | For example: |
62 | + * The Security Extension also requires us to check for the FNC_RETURN | 34 | :: |
63 | + * which signals a function return from non-secure state; this can happen | 35 | - -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on |
64 | + * in both Handler and Thread mode. | 36 | - -machine memory-backend=pc.ram |
65 | + * To avoid having to do multiple comparisons in inline generated code, | 37 | - -m 512M |
66 | + * we make the check we do here loose, so it will match for EXC_RETURN | 38 | + |
67 | + * in Thread mode. For system emulation do_v7m_exception_exit() checks | 39 | + -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on |
68 | + * for these spurious cases and returns without doing anything (giving | 40 | + -machine memory-backend=pc.ram |
69 | + * the same behaviour as for a branch to a non-magic address). | 41 | + -m 512M |
70 | + * | 42 | |
71 | + * In linux-user mode it is unclear what the right behaviour for an | 43 | Migration compatibility note: |
72 | + * attempted FNC_RETURN should be, because in real hardware this will go | 44 | - a) as backend id one shall use value of 'default-ram-id', advertised by |
73 | + * directly to Secure code (ie not the Linux kernel) which will then treat | 45 | - machine type (available via ``query-machines`` QMP command), if migration |
74 | + * the error in any way it chooses. For QEMU we opt to make the FNC_RETURN | 46 | - to/from old QEMU (<5.0) is expected. |
75 | + * attempt behave the way it would on a CPU without the security extension, | 47 | - b) for machine types 4.0 and older, user shall |
76 | + * which is to say "like a normal branch". That means we can simply treat | 48 | - use ``x-use-canonical-path-for-ramblock-id=off`` backend option |
77 | + * all branches as normal with no magic address behaviour. | 49 | - if migration to/from old QEMU (<5.0) is expected. |
78 | */ | 50 | + |
79 | static inline void gen_bx_excret(DisasContext *s, TCGv_i32 var) | 51 | + * as backend id one shall use value of 'default-ram-id', advertised by |
80 | { | 52 | + machine type (available via ``query-machines`` QMP command), if migration |
81 | @@ -XXX,XX +XXX,XX @@ static inline void gen_bx_excret(DisasContext *s, TCGv_i32 var) | 53 | + to/from old QEMU (<5.0) is expected. |
82 | * s->base.is_jmp that we need to do the rest of the work later. | 54 | + * for machine types 4.0 and older, user shall |
83 | */ | 55 | + use ``x-use-canonical-path-for-ramblock-id=off`` backend option |
84 | gen_bx(s, var); | 56 | + if migration to/from old QEMU (<5.0) is expected. |
85 | +#ifndef CONFIG_USER_ONLY | 57 | + |
86 | if (arm_dc_feature(s, ARM_FEATURE_M_SECURITY) || | 58 | For example: |
87 | (s->v7m_handler_mode && arm_dc_feature(s, ARM_FEATURE_M))) { | 59 | :: |
88 | s->base.is_jmp = DISAS_BX_EXCRET; | 60 | - -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off |
89 | } | 61 | - -machine memory-backend=pc.ram |
90 | +#endif | 62 | - -m 512M |
91 | } | 63 | + |
92 | 64 | + -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off | |
93 | static inline void gen_bx_excret_final_code(DisasContext *s) | 65 | + -machine memory-backend=pc.ram |
66 | + -m 512M | ||
67 | ERST | ||
68 | |||
69 | HXCOMM Deprecated by -machine | ||
94 | -- | 70 | -- |
95 | 2.20.1 | 71 | 2.20.1 |
96 | 72 | ||
97 | 73 | diff view generated by jsdifflib |
1 | Currently the only part of an ARMCPRegInfo which is allowed to cause | 1 | For M-profile, unlike A-profile, the low 2 bits of SP are defined to be |
---|---|---|---|
2 | a CPU exception is the access function, which returns a value indicating | 2 | RES0H, which is to say that they must be hardwired to zero so that |
3 | that some flavour of UNDEF should be generated. | 3 | guest attempts to write non-zero values to them are ignored. |
4 | 4 | ||
5 | For the ATS system instructions, we would like to conditionally | 5 | Implement this behaviour by masking out the low bits: |
6 | generate exceptions as part of the writefn, because some faults | 6 | * for writes to r13 by the gdbstub |
7 | during the page table walk (like external aborts) should cause | 7 | * for writes to any of the various flavours of SP via MSR |
8 | an exception to be raised rather than returning a value. | 8 | * for writes to r13 via store_reg() in generated code |
9 | 9 | ||
10 | There are several ways we could do this: | 10 | Note that all the direct uses of cpu_R[] in translate.c are in places |
11 | * plumb the GETPC() value from the top level set_cp_reg/get_cp_reg | 11 | where the register is definitely not r13 (usually because that has |
12 | helper functions through into the readfn and writefn hooks | 12 | been checked for as an UNDEFINED or UNPREDICTABLE case and handled as |
13 | * add extra readfn_with_ra/writefn_with_ra hooks that take the GETPC() | 13 | UNDEF). |
14 | value | ||
15 | * require the ATS instructions to provide a dummy accessfn, | ||
16 | which serves no purpose except to cause the code generation | ||
17 | to emit TCG ops to sync the CPU state | ||
18 | * add an ARM_CP_ flag to mark the ARMCPRegInfo as possibly | ||
19 | throwing an exception in its read/write hooks, and make the | ||
20 | codegen sync the CPU state before calling the hooks if the | ||
21 | flag is set | ||
22 | 14 | ||
23 | This patch opts for the last of these, as it is fairly simple | 15 | All the other writes to regs[13] in C code are either: |
24 | to implement and doesn't require invasive changes like updating | 16 | * A-profile only code |
25 | the readfn/writefn hook function prototype signature. | 17 | * writes of values we can guarantee to be aligned, such as |
18 | - writes of previous-SP-value plus or minus a 4-aligned constant | ||
19 | - writes of the value in an SP limit register (which we already | ||
20 | enforce to be aligned) | ||
26 | 21 | ||
27 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 22 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
28 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 23 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
29 | Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 24 | Message-id: 20210723162146.5167-2-peter.maydell@linaro.org |
30 | Message-id: 20190816125802.25877-2-peter.maydell@linaro.org | ||
31 | --- | 25 | --- |
32 | target/arm/cpu.h | 6 +++++- | 26 | target/arm/gdbstub.c | 4 ++++ |
33 | target/arm/translate-a64.c | 6 ++++++ | 27 | target/arm/m_helper.c | 14 ++++++++------ |
34 | target/arm/translate.c | 7 +++++++ | 28 | target/arm/translate.c | 3 +++ |
35 | 3 files changed, 18 insertions(+), 1 deletion(-) | 29 | 3 files changed, 15 insertions(+), 6 deletions(-) |
36 | 30 | ||
37 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 31 | diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c |
38 | index XXXXXXX..XXXXXXX 100644 | 32 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/target/arm/cpu.h | 33 | --- a/target/arm/gdbstub.c |
40 | +++ b/target/arm/cpu.h | 34 | +++ b/target/arm/gdbstub.c |
41 | @@ -XXX,XX +XXX,XX @@ static inline uint64_t cpreg_to_kvm_id(uint32_t cpregid) | 35 | @@ -XXX,XX +XXX,XX @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) |
42 | * IO indicates that this register does I/O and therefore its accesses | 36 | |
43 | * need to be surrounded by gen_io_start()/gen_io_end(). In particular, | 37 | if (n < 16) { |
44 | * registers which implement clocks or timers require this. | 38 | /* Core integer register. */ |
45 | + * RAISES_EXC is for when the read or write hook might raise an exception; | 39 | + if (n == 13 && arm_feature(env, ARM_FEATURE_M)) { |
46 | + * the generated code will synchronize the CPU state before calling the hook | 40 | + /* M profile SP low bits are always 0 */ |
47 | + * so that it is safe for the hook to call raise_exception(). | 41 | + tmp &= ~3; |
48 | */ | 42 | + } |
49 | #define ARM_CP_SPECIAL 0x0001 | 43 | env->regs[n] = tmp; |
50 | #define ARM_CP_CONST 0x0002 | 44 | return 4; |
51 | @@ -XXX,XX +XXX,XX @@ static inline uint64_t cpreg_to_kvm_id(uint32_t cpregid) | 45 | } |
52 | #define ARM_CP_FPU 0x1000 | 46 | diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c |
53 | #define ARM_CP_SVE 0x2000 | ||
54 | #define ARM_CP_NO_GDB 0x4000 | ||
55 | +#define ARM_CP_RAISES_EXC 0x8000 | ||
56 | /* Used only as a terminator for ARMCPRegInfo lists */ | ||
57 | #define ARM_CP_SENTINEL 0xffff | ||
58 | /* Mask of only the flag bits in a type field */ | ||
59 | -#define ARM_CP_FLAG_MASK 0x70ff | ||
60 | +#define ARM_CP_FLAG_MASK 0xf0ff | ||
61 | |||
62 | /* Valid values for ARMCPRegInfo state field, indicating which of | ||
63 | * the AArch32 and AArch64 execution states this register is visible in. | ||
64 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | ||
65 | index XXXXXXX..XXXXXXX 100644 | 47 | index XXXXXXX..XXXXXXX 100644 |
66 | --- a/target/arm/translate-a64.c | 48 | --- a/target/arm/m_helper.c |
67 | +++ b/target/arm/translate-a64.c | 49 | +++ b/target/arm/m_helper.c |
68 | @@ -XXX,XX +XXX,XX @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread, | 50 | @@ -XXX,XX +XXX,XX @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) |
69 | tcg_temp_free_ptr(tmpptr); | 51 | if (!env->v7m.secure) { |
70 | tcg_temp_free_i32(tcg_syn); | 52 | return; |
71 | tcg_temp_free_i32(tcg_isread); | 53 | } |
72 | + } else if (ri->type & ARM_CP_RAISES_EXC) { | 54 | - env->v7m.other_ss_msp = val; |
73 | + /* | 55 | + env->v7m.other_ss_msp = val & ~3; |
74 | + * The readfn or writefn might raise an exception; | 56 | return; |
75 | + * synchronize the CPU state in case it does. | 57 | case 0x89: /* PSP_NS */ |
76 | + */ | 58 | if (!env->v7m.secure) { |
77 | + gen_a64_set_pc_im(s->pc_curr); | 59 | return; |
78 | } | 60 | } |
79 | 61 | - env->v7m.other_ss_psp = val; | |
80 | /* Handle special cases first */ | 62 | + env->v7m.other_ss_psp = val & ~3; |
63 | return; | ||
64 | case 0x8a: /* MSPLIM_NS */ | ||
65 | if (!env->v7m.secure) { | ||
66 | @@ -XXX,XX +XXX,XX @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) | ||
67 | |||
68 | limit = is_psp ? env->v7m.psplim[false] : env->v7m.msplim[false]; | ||
69 | |||
70 | + val &= ~0x3; | ||
71 | + | ||
72 | if (val < limit) { | ||
73 | raise_exception_ra(env, EXCP_STKOF, 0, 1, GETPC()); | ||
74 | } | ||
75 | @@ -XXX,XX +XXX,XX @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) | ||
76 | break; | ||
77 | case 8: /* MSP */ | ||
78 | if (v7m_using_psp(env)) { | ||
79 | - env->v7m.other_sp = val; | ||
80 | + env->v7m.other_sp = val & ~3; | ||
81 | } else { | ||
82 | - env->regs[13] = val; | ||
83 | + env->regs[13] = val & ~3; | ||
84 | } | ||
85 | break; | ||
86 | case 9: /* PSP */ | ||
87 | if (v7m_using_psp(env)) { | ||
88 | - env->regs[13] = val; | ||
89 | + env->regs[13] = val & ~3; | ||
90 | } else { | ||
91 | - env->v7m.other_sp = val; | ||
92 | + env->v7m.other_sp = val & ~3; | ||
93 | } | ||
94 | break; | ||
95 | case 10: /* MSPLIM */ | ||
81 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 96 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
82 | index XXXXXXX..XXXXXXX 100644 | 97 | index XXXXXXX..XXXXXXX 100644 |
83 | --- a/target/arm/translate.c | 98 | --- a/target/arm/translate.c |
84 | +++ b/target/arm/translate.c | 99 | +++ b/target/arm/translate.c |
85 | @@ -XXX,XX +XXX,XX @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn) | 100 | @@ -XXX,XX +XXX,XX @@ void store_reg(DisasContext *s, int reg, TCGv_i32 var) |
86 | tcg_temp_free_ptr(tmpptr); | 101 | */ |
87 | tcg_temp_free_i32(tcg_syn); | 102 | tcg_gen_andi_i32(var, var, s->thumb ? ~1 : ~3); |
88 | tcg_temp_free_i32(tcg_isread); | 103 | s->base.is_jmp = DISAS_JUMP; |
89 | + } else if (ri->type & ARM_CP_RAISES_EXC) { | 104 | + } else if (reg == 13 && arm_dc_feature(s, ARM_FEATURE_M)) { |
90 | + /* | 105 | + /* For M-profile SP bits [1:0] are always zero */ |
91 | + * The readfn or writefn might raise an exception; | 106 | + tcg_gen_andi_i32(var, var, ~3); |
92 | + * synchronize the CPU state in case it does. | 107 | } |
93 | + */ | 108 | tcg_gen_mov_i32(cpu_R[reg], var); |
94 | + gen_set_condexec(s); | 109 | tcg_temp_free_i32(var); |
95 | + gen_set_pc_im(s, s->pc_curr); | ||
96 | } | ||
97 | |||
98 | /* Handle special cases first */ | ||
99 | -- | 110 | -- |
100 | 2.20.1 | 111 | 2.20.1 |
101 | 112 | ||
102 | 113 | diff view generated by jsdifflib |
1 | The function neon_store_reg32() doesn't free the TCG temp that it | 1 | In do_v7m_exception_exit(), we perform various checks as part of |
---|---|---|---|
2 | is passed, so the caller must do that. We got this right in most | 2 | performing the exception return. If one of these checks fails, the |
3 | places but forgot to free the TCG temps in trans_VMOV_64_sp(). | 3 | architecture requires that we take an appropriate exception on the |
4 | existing stackframe. We implement this by calling | ||
5 | v7m_exception_taken() to set up to take the new exception, and then | ||
6 | immediately returning from do_v7m_exception_exit() without proceeding | ||
7 | any further with the unstack-and-exception-return process. | ||
4 | 8 | ||
5 | Cc: qemu-stable@nongnu.org | 9 | In a couple of checks that are new in v8.1M, we forgot the "return" |
10 | statement, with the effect that if bad code in the guest tripped over | ||
11 | these checks we would set up to take a UsageFault exception but then | ||
12 | blunder on trying to also unstack and return from the original | ||
13 | exception, with the probable result that the guest would crash. | ||
14 | |||
15 | Add the missing return statements. | ||
16 | |||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 18 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 19 | Message-id: 20210723162146.5167-3-peter.maydell@linaro.org |
9 | Message-id: 20190827121931.26836-1-peter.maydell@linaro.org | ||
10 | --- | 20 | --- |
11 | target/arm/translate-vfp.inc.c | 2 ++ | 21 | target/arm/m_helper.c | 2 ++ |
12 | 1 file changed, 2 insertions(+) | 22 | 1 file changed, 2 insertions(+) |
13 | 23 | ||
14 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c | 24 | diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c |
15 | index XXXXXXX..XXXXXXX 100644 | 25 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-vfp.inc.c | 26 | --- a/target/arm/m_helper.c |
17 | +++ b/target/arm/translate-vfp.inc.c | 27 | +++ b/target/arm/m_helper.c |
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a) | 28 | @@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu) |
19 | /* gpreg to fpreg */ | 29 | qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on existing " |
20 | tmp = load_reg(s, a->rt); | 30 | "stackframe: NSACR prevents clearing FPU registers\n"); |
21 | neon_store_reg32(tmp, a->vm); | 31 | v7m_exception_taken(cpu, excret, true, false); |
22 | + tcg_temp_free_i32(tmp); | 32 | + return; |
23 | tmp = load_reg(s, a->rt2); | 33 | } else if (!cpacr_pass) { |
24 | neon_store_reg32(tmp, a->vm + 1); | 34 | armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE, |
25 | + tcg_temp_free_i32(tmp); | 35 | exc_secure); |
26 | } | 36 | @@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu) |
27 | 37 | qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on existing " | |
28 | return true; | 38 | "stackframe: CPACR prevents clearing FPU registers\n"); |
39 | v7m_exception_taken(cpu, excret, true, false); | ||
40 | + return; | ||
41 | } | ||
42 | } | ||
43 | /* Clear s0..s15, FPSCR and VPR */ | ||
29 | -- | 44 | -- |
30 | 2.20.1 | 45 | 2.20.1 |
31 | 46 | ||
32 | 47 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | For M-profile, we weren't reporting alignment faults triggered by the |
---|---|---|---|
2 | generic TCG code correctly to the guest. These get passed into | ||
3 | arm_v7m_cpu_do_interrupt() as an EXCP_DATA_ABORT with an A-profile | ||
4 | style exception.fsr value of 1. We didn't check for this, and so | ||
5 | they fell through into the default of "assume this is an MPU fault" | ||
6 | and were reported to the guest as a data access violation MPU fault. | ||
2 | 7 | ||
3 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 8 | Report these alignment faults as UsageFaults which set the UNALIGNED |
9 | bit in the UFSR. | ||
10 | |||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 12 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 13 | Message-id: 20210723162146.5167-4-peter.maydell@linaro.org |
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
7 | Message-id: 20190828165307.18321-10-alex.bennee@linaro.org | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | 14 | --- |
10 | include/exec/cpu-defs.h | 2 +- | 15 | target/arm/m_helper.c | 8 ++++++++ |
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 16 | 1 file changed, 8 insertions(+) |
12 | 17 | ||
13 | diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h | 18 | diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c |
14 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/include/exec/cpu-defs.h | 20 | --- a/target/arm/m_helper.c |
16 | +++ b/include/exec/cpu-defs.h | 21 | +++ b/target/arm/m_helper.c |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct CPUTLB { } CPUTLB; | 22 | @@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) |
18 | #endif /* !CONFIG_USER_ONLY && CONFIG_TCG */ | 23 | env->v7m.sfsr |= R_V7M_SFSR_LSERR_MASK; |
19 | 24 | break; | |
20 | /* | 25 | case EXCP_UNALIGNED: |
21 | - * This structure must be placed in ArchCPU immedately | 26 | + /* Unaligned faults reported by M-profile aware code */ |
22 | + * This structure must be placed in ArchCPU immediately | 27 | armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE, env->v7m.secure); |
23 | * before CPUArchState, as a field named "neg". | 28 | env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_UNALIGNED_MASK; |
24 | */ | 29 | break; |
25 | typedef struct CPUNegativeOffsetState { | 30 | @@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) |
31 | } | ||
32 | armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_BUS, false); | ||
33 | break; | ||
34 | + case 0x1: /* Alignment fault reported by generic code */ | ||
35 | + qemu_log_mask(CPU_LOG_INT, | ||
36 | + "...really UsageFault with UFSR.UNALIGNED\n"); | ||
37 | + env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_UNALIGNED_MASK; | ||
38 | + armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE, | ||
39 | + env->v7m.secure); | ||
40 | + break; | ||
41 | default: | ||
42 | /* | ||
43 | * All other FSR values are either MPU faults or "can't happen | ||
26 | -- | 44 | -- |
27 | 2.20.1 | 45 | 2.20.1 |
28 | 46 | ||
29 | 47 | diff view generated by jsdifflib |
1 | The translation table walk for an ATS instruction can result in | 1 | The ISCR.ISRPENDING bit is set when an external interrupt is pending. |
---|---|---|---|
2 | various faults. In general these are just reported back via the | 2 | This is true whether that external interrupt is enabled or not. |
3 | PAR_EL1 fault status fields, but in some cases the architecture | 3 | This means that we can't use 's->vectpending == 0' as a shortcut to |
4 | requires that the fault is turned into an exception: | 4 | "ISRPENDING is zero", because s->vectpending indicates only the |
5 | * synchronous stage 2 faults of any kind during AT S1E0* and | 5 | highest priority pending enabled interrupt. |
6 | AT S1E1* instructions executed from NS EL1 fault to EL2 or EL3 | ||
7 | * synchronous external aborts are taken as Data Abort exceptions | ||
8 | 6 | ||
9 | (This is documented in the v8A Arm ARM DDI0487A.e D5.2.11 and | 7 | Remove the incorrect optimization so that if there is no pending |
10 | G5.13.4.) | 8 | enabled interrupt we fall through to scanning through the whole |
9 | interrupt array. | ||
11 | 10 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 12 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
14 | Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 13 | Message-id: 20210723162146.5167-5-peter.maydell@linaro.org |
15 | Message-id: 20190816125802.25877-3-peter.maydell@linaro.org | ||
16 | --- | 14 | --- |
17 | target/arm/helper.c | 107 +++++++++++++++++++++++++++++++++++++------- | 15 | hw/intc/armv7m_nvic.c | 9 ++++----- |
18 | 1 file changed, 92 insertions(+), 15 deletions(-) | 16 | 1 file changed, 4 insertions(+), 5 deletions(-) |
19 | 17 | ||
20 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 18 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
21 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/target/arm/helper.c | 20 | --- a/hw/intc/armv7m_nvic.c |
23 | +++ b/target/arm/helper.c | 21 | +++ b/hw/intc/armv7m_nvic.c |
24 | @@ -XXX,XX +XXX,XX @@ static uint64_t do_ats_write(CPUARMState *env, uint64_t value, | 22 | @@ -XXX,XX +XXX,XX @@ static bool nvic_isrpending(NVICState *s) |
25 | ret = get_phys_addr(env, value, access_type, mmu_idx, &phys_addr, &attrs, | 23 | { |
26 | &prot, &page_size, &fi, &cacheattrs); | 24 | int irq; |
27 | 25 | ||
28 | + if (ret) { | 26 | - /* We can shortcut if the highest priority pending interrupt |
29 | + /* | 27 | - * happens to be external or if there is nothing pending. |
30 | + * Some kinds of translation fault must cause exceptions rather | 28 | + /* |
31 | + * than being reported in the PAR. | 29 | + * We can shortcut if the highest priority pending interrupt |
32 | + */ | 30 | + * happens to be external; if not we need to check the whole |
33 | + int current_el = arm_current_el(env); | 31 | + * vectors[] array. |
34 | + int target_el; | ||
35 | + uint32_t syn, fsr, fsc; | ||
36 | + bool take_exc = false; | ||
37 | + | ||
38 | + if (fi.s1ptw && current_el == 1 && !arm_is_secure(env) | ||
39 | + && (mmu_idx == ARMMMUIdx_S1NSE1 || mmu_idx == ARMMMUIdx_S1NSE0)) { | ||
40 | + /* | ||
41 | + * Synchronous stage 2 fault on an access made as part of the | ||
42 | + * translation table walk for AT S1E0* or AT S1E1* insn | ||
43 | + * executed from NS EL1. If this is a synchronous external abort | ||
44 | + * and SCR_EL3.EA == 1, then we take a synchronous external abort | ||
45 | + * to EL3. Otherwise the fault is taken as an exception to EL2, | ||
46 | + * and HPFAR_EL2 holds the faulting IPA. | ||
47 | + */ | ||
48 | + if (fi.type == ARMFault_SyncExternalOnWalk && | ||
49 | + (env->cp15.scr_el3 & SCR_EA)) { | ||
50 | + target_el = 3; | ||
51 | + } else { | ||
52 | + env->cp15.hpfar_el2 = extract64(fi.s2addr, 12, 47) << 4; | ||
53 | + target_el = 2; | ||
54 | + } | ||
55 | + take_exc = true; | ||
56 | + } else if (fi.type == ARMFault_SyncExternalOnWalk) { | ||
57 | + /* | ||
58 | + * Synchronous external aborts during a translation table walk | ||
59 | + * are taken as Data Abort exceptions. | ||
60 | + */ | ||
61 | + if (fi.stage2) { | ||
62 | + if (current_el == 3) { | ||
63 | + target_el = 3; | ||
64 | + } else { | ||
65 | + target_el = 2; | ||
66 | + } | ||
67 | + } else { | ||
68 | + target_el = exception_target_el(env); | ||
69 | + } | ||
70 | + take_exc = true; | ||
71 | + } | ||
72 | + | ||
73 | + if (take_exc) { | ||
74 | + /* Construct FSR and FSC using same logic as arm_deliver_fault() */ | ||
75 | + if (target_el == 2 || arm_el_is_aa64(env, target_el) || | ||
76 | + arm_s1_regime_using_lpae_format(env, mmu_idx)) { | ||
77 | + fsr = arm_fi_to_lfsc(&fi); | ||
78 | + fsc = extract32(fsr, 0, 6); | ||
79 | + } else { | ||
80 | + fsr = arm_fi_to_sfsc(&fi); | ||
81 | + fsc = 0x3f; | ||
82 | + } | ||
83 | + /* | ||
84 | + * Report exception with ESR indicating a fault due to a | ||
85 | + * translation table walk for a cache maintenance instruction. | ||
86 | + */ | ||
87 | + syn = syn_data_abort_no_iss(current_el == target_el, | ||
88 | + fi.ea, 1, fi.s1ptw, 1, fsc); | ||
89 | + env->exception.vaddress = value; | ||
90 | + env->exception.fsr = fsr; | ||
91 | + raise_exception(env, EXCP_DATA_ABORT, syn, target_el); | ||
92 | + } | ||
93 | + } | ||
94 | + | ||
95 | if (is_a64(env)) { | ||
96 | format64 = true; | ||
97 | } else if (arm_feature(env, ARM_FEATURE_LPAE)) { | ||
98 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo vapa_cp_reginfo[] = { | ||
99 | /* This underdecoding is safe because the reginfo is NO_RAW. */ | ||
100 | { .name = "ATS", .cp = 15, .crn = 7, .crm = 8, .opc1 = 0, .opc2 = CP_ANY, | ||
101 | .access = PL1_W, .accessfn = ats_access, | ||
102 | - .writefn = ats_write, .type = ARM_CP_NO_RAW }, | ||
103 | + .writefn = ats_write, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC }, | ||
104 | #endif | ||
105 | REGINFO_SENTINEL | ||
106 | }; | ||
107 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v8_cp_reginfo[] = { | ||
108 | /* 64 bit address translation operations */ | ||
109 | { .name = "AT_S1E1R", .state = ARM_CP_STATE_AA64, | ||
110 | .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 8, .opc2 = 0, | ||
111 | - .access = PL1_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
112 | + .access = PL1_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
113 | + .writefn = ats_write64 }, | ||
114 | { .name = "AT_S1E1W", .state = ARM_CP_STATE_AA64, | ||
115 | .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 8, .opc2 = 1, | ||
116 | - .access = PL1_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
117 | + .access = PL1_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
118 | + .writefn = ats_write64 }, | ||
119 | { .name = "AT_S1E0R", .state = ARM_CP_STATE_AA64, | ||
120 | .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 8, .opc2 = 2, | ||
121 | - .access = PL1_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
122 | + .access = PL1_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
123 | + .writefn = ats_write64 }, | ||
124 | { .name = "AT_S1E0W", .state = ARM_CP_STATE_AA64, | ||
125 | .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 8, .opc2 = 3, | ||
126 | - .access = PL1_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
127 | + .access = PL1_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
128 | + .writefn = ats_write64 }, | ||
129 | { .name = "AT_S12E1R", .state = ARM_CP_STATE_AA64, | ||
130 | .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 4, | ||
131 | - .access = PL2_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
132 | + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
133 | + .writefn = ats_write64 }, | ||
134 | { .name = "AT_S12E1W", .state = ARM_CP_STATE_AA64, | ||
135 | .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 5, | ||
136 | - .access = PL2_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
137 | + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
138 | + .writefn = ats_write64 }, | ||
139 | { .name = "AT_S12E0R", .state = ARM_CP_STATE_AA64, | ||
140 | .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 6, | ||
141 | - .access = PL2_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
142 | + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
143 | + .writefn = ats_write64 }, | ||
144 | { .name = "AT_S12E0W", .state = ARM_CP_STATE_AA64, | ||
145 | .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 7, | ||
146 | - .access = PL2_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
147 | + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
148 | + .writefn = ats_write64 }, | ||
149 | /* AT S1E2* are elsewhere as they UNDEF from EL3 if EL2 is not present */ | ||
150 | { .name = "AT_S1E3R", .state = ARM_CP_STATE_AA64, | ||
151 | .opc0 = 1, .opc1 = 6, .crn = 7, .crm = 8, .opc2 = 0, | ||
152 | - .access = PL3_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
153 | + .access = PL3_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
154 | + .writefn = ats_write64 }, | ||
155 | { .name = "AT_S1E3W", .state = ARM_CP_STATE_AA64, | ||
156 | .opc0 = 1, .opc1 = 6, .crn = 7, .crm = 8, .opc2 = 1, | ||
157 | - .access = PL3_W, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
158 | + .access = PL3_W, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, | ||
159 | + .writefn = ats_write64 }, | ||
160 | { .name = "PAR_EL1", .state = ARM_CP_STATE_AA64, | ||
161 | .type = ARM_CP_ALIAS, | ||
162 | .opc0 = 3, .opc1 = 0, .crn = 7, .crm = 4, .opc2 = 0, | ||
163 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo el2_cp_reginfo[] = { | ||
164 | { .name = "AT_S1E2R", .state = ARM_CP_STATE_AA64, | ||
165 | .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 0, | ||
166 | .access = PL2_W, .accessfn = at_s1e2_access, | ||
167 | - .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
168 | + .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, .writefn = ats_write64 }, | ||
169 | { .name = "AT_S1E2W", .state = ARM_CP_STATE_AA64, | ||
170 | .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 1, | ||
171 | .access = PL2_W, .accessfn = at_s1e2_access, | ||
172 | - .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, | ||
173 | + .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, .writefn = ats_write64 }, | ||
174 | /* The AArch32 ATS1H* operations are CONSTRAINED UNPREDICTABLE | ||
175 | * if EL2 is not implemented; we choose to UNDEF. Behaviour at EL3 | ||
176 | * with SCR.NS == 0 outside Monitor mode is UNPREDICTABLE; we choose | ||
177 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo el2_cp_reginfo[] = { | ||
178 | */ | 32 | */ |
179 | { .name = "ATS1HR", .cp = 15, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 0, | 33 | if (s->vectpending > NVIC_FIRST_IRQ) { |
180 | .access = PL2_W, | 34 | return true; |
181 | - .writefn = ats1h_write, .type = ARM_CP_NO_RAW }, | 35 | } |
182 | + .writefn = ats1h_write, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC }, | 36 | - if (s->vectpending == 0) { |
183 | { .name = "ATS1HW", .cp = 15, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 1, | 37 | - return false; |
184 | .access = PL2_W, | 38 | - } |
185 | - .writefn = ats1h_write, .type = ARM_CP_NO_RAW }, | 39 | |
186 | + .writefn = ats1h_write, .type = ARM_CP_NO_RAW | ARM_CP_RAISES_EXC }, | 40 | for (irq = NVIC_FIRST_IRQ; irq < s->num_irq; irq++) { |
187 | { .name = "CNTHCTL_EL2", .state = ARM_CP_STATE_BOTH, | 41 | if (s->vectors[irq].pending) { |
188 | .opc0 = 3, .opc1 = 4, .crn = 14, .crm = 1, .opc2 = 0, | ||
189 | /* ARMv7 requires bit 0 and 1 to reset to 1. ARMv8 defines the | ||
190 | -- | 42 | -- |
191 | 2.20.1 | 43 | 2.20.1 |
192 | 44 | ||
193 | 45 | diff view generated by jsdifflib |
1 | From: "Emilio G. Cota" <cota@braap.org> | 1 | The VECTPENDING field in the ICSR is 9 bits wide, in bits [20:12] of |
---|---|---|---|
2 | the register. We were incorrectly masking it to 8 bits, so it would | ||
3 | report the wrong value if the pending exception was greater than 256. | ||
4 | Fix the bug. | ||
2 | 5 | ||
3 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | Signed-off-by: Emilio G. Cota <cota@braap.org> | ||
5 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
6 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 8 | Message-id: 20210723162146.5167-6-peter.maydell@linaro.org |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Message-id: 20190828165307.18321-8-alex.bennee@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | 9 | --- |
11 | accel/tcg/atomic_template.h | 2 +- | 10 | hw/intc/armv7m_nvic.c | 2 +- |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+), 1 deletion(-) |
13 | 12 | ||
14 | diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h | 13 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
15 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/accel/tcg/atomic_template.h | 15 | --- a/hw/intc/armv7m_nvic.c |
17 | +++ b/accel/tcg/atomic_template.h | 16 | +++ b/hw/intc/armv7m_nvic.c |
18 | @@ -XXX,XX +XXX,XX @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, | 17 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) |
19 | 18 | /* VECTACTIVE */ | |
20 | #define GEN_ATOMIC_HELPER(X) \ | 19 | val = cpu->env.v7m.exception; |
21 | ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ | 20 | /* VECTPENDING */ |
22 | - ABI_TYPE val EXTRA_ARGS) \ | 21 | - val |= (s->vectpending & 0xff) << 12; |
23 | + ABI_TYPE val EXTRA_ARGS) \ | 22 | + val |= (s->vectpending & 0x1ff) << 12; |
24 | { \ | 23 | /* ISRPENDING - set if any external IRQ is pending */ |
25 | ATOMIC_MMU_DECLS; \ | 24 | if (nvic_isrpending(s)) { |
26 | DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; \ | 25 | val |= (1 << 22); |
27 | -- | 26 | -- |
28 | 2.20.1 | 27 | 2.20.1 |
29 | 28 | ||
30 | 29 | diff view generated by jsdifflib |
1 | From: Andrew Jeffery <andrew@aj.id.au> | 1 | In Arm v8.1M the VECTPENDING field in the ICSR has new behaviour: if |
---|---|---|---|
2 | the register is accessed NonSecure and the highest priority pending | ||
3 | enabled exception (that would be returned in the VECTPENDING field) | ||
4 | targets Secure, then the VECTPENDING field must read 1 rather than | ||
5 | the exception number of the pending exception. Implement this. | ||
2 | 6 | ||
3 | First up: This is not the way the hardware behaves. | 7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20210723162146.5167-7-peter.maydell@linaro.org | ||
10 | --- | ||
11 | hw/intc/armv7m_nvic.c | 31 ++++++++++++++++++++++++------- | ||
12 | 1 file changed, 24 insertions(+), 7 deletions(-) | ||
4 | 13 | ||
5 | However, it helps resolve real-world problems with short periods being | 14 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
6 | used under Linux. Commit 4451d3f59f2a ("clocksource/drivers/fttmr010: | ||
7 | Fix set_next_event handler") in Linux fixed the timer driver to | ||
8 | correctly schedule the next event for the Aspeed controller, and in | ||
9 | combination with 5daa8212c08e ("ARM: dts: aspeed: Describe random number | ||
10 | device") Linux will now set a timer with a period as low as 1us. | ||
11 | |||
12 | Configuring a qemu timer with such a short period results in spending | ||
13 | time handling the interrupt in the model rather than executing guest | ||
14 | code, leading to noticeable "sticky" behaviour in the guest. | ||
15 | |||
16 | The behaviour of Linux is correct with respect to the hardware, so we | ||
17 | need to improve our handling under emulation. The approach chosen is to | ||
18 | provide back-pressure information by calculating an acceptable minimum | ||
19 | number of ticks to be set on the model. Under Linux an additional read | ||
20 | is added in the timer configuration path to detect back-pressure, which | ||
21 | will never occur on hardware. However if back-pressure is observed, the | ||
22 | driver alerts the clock event subsystem, which then performs its own | ||
23 | next event dilation via a config option - d1748302f70b ("clockevents: | ||
24 | Make minimum delay adjustments configurable") | ||
25 | |||
26 | A minimum period of 5us was experimentally determined on a Lenovo | ||
27 | T480s, which I've increased to 20us for "safety". | ||
28 | |||
29 | Signed-off-by: Andrew Jeffery <andrew@aj.id.au> | ||
30 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
31 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
32 | Tested-by: Joel Stanley <joel@jms.id.au> | ||
33 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
34 | Message-id: 20190704055150.4899-1-clg@kaod.org | ||
35 | [clg: - changed the computation of min_ticks to be done each time the | ||
36 | timer value is reloaded. It removes the ordering issue of the | ||
37 | timer and scu reset handlers but is slightly slower ] | ||
38 | - introduced TIMER_MIN_NS | ||
39 | - introduced calculate_min_ticks() ] | ||
40 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
41 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
42 | --- | ||
43 | hw/timer/aspeed_timer.c | 17 ++++++++++++++++- | ||
44 | 1 file changed, 16 insertions(+), 1 deletion(-) | ||
45 | |||
46 | diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c | ||
47 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
48 | --- a/hw/timer/aspeed_timer.c | 16 | --- a/hw/intc/armv7m_nvic.c |
49 | +++ b/hw/timer/aspeed_timer.c | 17 | +++ b/hw/intc/armv7m_nvic.c |
50 | @@ -XXX,XX +XXX,XX @@ enum timer_ctrl_op { | 18 | @@ -XXX,XX +XXX,XX @@ void armv7m_nvic_acknowledge_irq(void *opaque) |
51 | op_pulse_enable | 19 | nvic_irq_update(s); |
52 | }; | ||
53 | |||
54 | +/* | ||
55 | + * Minimum value of the reload register to filter out short period | ||
56 | + * timers which have a noticeable impact in emulation. 5us should be | ||
57 | + * enough, use 20us for "safety". | ||
58 | + */ | ||
59 | +#define TIMER_MIN_NS (20 * SCALE_US) | ||
60 | + | ||
61 | /** | ||
62 | * Avoid mutual references between AspeedTimerCtrlState and AspeedTimer | ||
63 | * structs, as it's a waste of memory. The ptimer BH callback needs to know | ||
64 | @@ -XXX,XX +XXX,XX @@ static inline uint32_t calculate_ticks(struct AspeedTimer *t, uint64_t now_ns) | ||
65 | return t->reload - MIN(t->reload, ticks); | ||
66 | } | 20 | } |
67 | 21 | ||
68 | +static uint32_t calculate_min_ticks(AspeedTimer *t, uint32_t value) | 22 | +static bool vectpending_targets_secure(NVICState *s) |
69 | +{ | 23 | +{ |
70 | + uint32_t rate = calculate_rate(t); | 24 | + /* Return true if s->vectpending targets Secure state */ |
71 | + uint32_t min_ticks = muldiv64(TIMER_MIN_NS, rate, NANOSECONDS_PER_SECOND); | 25 | + if (s->vectpending_is_s_banked) { |
72 | + | 26 | + return true; |
73 | + return value < min_ticks ? min_ticks : value; | 27 | + } |
28 | + return !exc_is_banked(s->vectpending) && | ||
29 | + exc_targets_secure(s, s->vectpending); | ||
74 | +} | 30 | +} |
75 | + | 31 | + |
76 | static inline uint64_t calculate_time(struct AspeedTimer *t, uint32_t ticks) | 32 | void armv7m_nvic_get_pending_irq_info(void *opaque, |
33 | int *pirq, bool *ptargets_secure) | ||
77 | { | 34 | { |
78 | uint64_t delta_ns; | 35 | @@ -XXX,XX +XXX,XX @@ void armv7m_nvic_get_pending_irq_info(void *opaque, |
79 | @@ -XXX,XX +XXX,XX @@ static void aspeed_timer_set_value(AspeedTimerCtrlState *s, int timer, int reg, | 36 | |
80 | switch (reg) { | 37 | assert(pending > ARMV7M_EXCP_RESET && pending < s->num_irq); |
81 | case TIMER_REG_RELOAD: | 38 | |
82 | old_reload = t->reload; | 39 | - if (s->vectpending_is_s_banked) { |
83 | - t->reload = value; | 40 | - targets_secure = true; |
84 | + t->reload = calculate_min_ticks(t, value); | 41 | - } else { |
85 | 42 | - targets_secure = !exc_is_banked(pending) && | |
86 | /* If the reload value was not previously set, or zero, and | 43 | - exc_targets_secure(s, pending); |
87 | * the current value is valid, try to start the timer if it is | 44 | - } |
45 | + targets_secure = vectpending_targets_secure(s); | ||
46 | |||
47 | trace_nvic_get_pending_irq_info(pending, targets_secure); | ||
48 | |||
49 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) | ||
50 | /* VECTACTIVE */ | ||
51 | val = cpu->env.v7m.exception; | ||
52 | /* VECTPENDING */ | ||
53 | - val |= (s->vectpending & 0x1ff) << 12; | ||
54 | + if (s->vectpending) { | ||
55 | + /* | ||
56 | + * From v8.1M VECTPENDING must read as 1 if accessed as | ||
57 | + * NonSecure and the highest priority pending and enabled | ||
58 | + * exception targets Secure. | ||
59 | + */ | ||
60 | + int vp = s->vectpending; | ||
61 | + if (!attrs.secure && arm_feature(&cpu->env, ARM_FEATURE_V8_1M) && | ||
62 | + vectpending_targets_secure(s)) { | ||
63 | + vp = 1; | ||
64 | + } | ||
65 | + val |= (vp & 0x1ff) << 12; | ||
66 | + } | ||
67 | /* ISRPENDING - set if any external IRQ is pending */ | ||
68 | if (nvic_isrpending(s)) { | ||
69 | val |= (1 << 22); | ||
88 | -- | 70 | -- |
89 | 2.20.1 | 71 | 2.20.1 |
90 | 72 | ||
91 | 73 | diff view generated by jsdifflib |
1 | From: "Emilio G. Cota" <cota@braap.org> | 1 | From: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> |
---|---|---|---|
2 | 2 | ||
3 | Afterwise is "wise after the fact", as in "hindsight". | 3 | Missed in commit f3478392 "docs: Move deprecation, build |
4 | Here we meant "afterwards" (as in "subsequently"). Fix it. | 4 | and license info out of system/" |
5 | 5 | ||
6 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 6 | Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> |
7 | Signed-off-by: Emilio G. Cota <cota@braap.org> | 7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Message-id: 20210723065828.1336760-1-maozhongyi@cmss.chinamobile.com |
9 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
10 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
11 | Message-id: 20190828165307.18321-7-alex.bennee@linaro.org | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | --- | 10 | --- |
14 | tcg/README | 2 +- | 11 | configure | 2 +- |
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | 12 | target/i386/cpu.c | 2 +- |
13 | MAINTAINERS | 2 +- | ||
14 | 3 files changed, 3 insertions(+), 3 deletions(-) | ||
16 | 15 | ||
17 | diff --git a/tcg/README b/tcg/README | 16 | diff --git a/configure b/configure |
17 | index XXXXXXX..XXXXXXX 100755 | ||
18 | --- a/configure | ||
19 | +++ b/configure | ||
20 | @@ -XXX,XX +XXX,XX @@ fi | ||
21 | |||
22 | if test -n "${deprecated_features}"; then | ||
23 | echo "Warning, deprecated features enabled." | ||
24 | - echo "Please see docs/system/deprecated.rst" | ||
25 | + echo "Please see docs/about/deprecated.rst" | ||
26 | echo " features: ${deprecated_features}" | ||
27 | fi | ||
28 | |||
29 | diff --git a/target/i386/cpu.c b/target/i386/cpu.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | 30 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/tcg/README | 31 | --- a/target/i386/cpu.c |
20 | +++ b/tcg/README | 32 | +++ b/target/i386/cpu.c |
21 | @@ -XXX,XX +XXX,XX @@ This can be overridden using the following function modifiers: | 33 | @@ -XXX,XX +XXX,XX @@ static const X86CPUDefinition builtin_x86_defs[] = { |
22 | canonical locations before calling the helper. | 34 | * none", but this is just for compatibility while libvirt isn't |
23 | - TCG_CALL_NO_WRITE_GLOBALS means that the helper does not modify any globals. | 35 | * adapted to resolve CPU model versions before creating VMs. |
24 | They will only be saved to their canonical location before calling helpers, | 36 | * See "Runnability guarantee of CPU models" at |
25 | - but they won't be reloaded afterwise. | 37 | - * docs/system/deprecated.rst. |
26 | + but they won't be reloaded afterwards. | 38 | + * docs/about/deprecated.rst. |
27 | - TCG_CALL_NO_SIDE_EFFECTS means that the call to the function is removed if | 39 | */ |
28 | the return value is not used. | 40 | X86CPUVersion default_cpu_version = 1; |
29 | 41 | ||
42 | diff --git a/MAINTAINERS b/MAINTAINERS | ||
43 | index XXXXXXX..XXXXXXX 100644 | ||
44 | --- a/MAINTAINERS | ||
45 | +++ b/MAINTAINERS | ||
46 | @@ -XXX,XX +XXX,XX @@ F: contrib/gitdm/* | ||
47 | |||
48 | Incompatible changes | ||
49 | R: libvir-list@redhat.com | ||
50 | -F: docs/system/deprecated.rst | ||
51 | +F: docs/about/deprecated.rst | ||
52 | |||
53 | Build System | ||
54 | ------------ | ||
30 | -- | 55 | -- |
31 | 2.20.1 | 56 | 2.20.1 |
32 | 57 | ||
33 | 58 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The previous simplification got the order of operands to the | 3 | Currently, our only caller is sve_zcr_len_for_el, which has |
4 | subtraction wrong. Since the 64-bit product is the subtrahend, | 4 | already masked the length extracted from ZCR_ELx, so the |
5 | we must use a 64-bit subtract to properly compute the borrow | 5 | masking done here is a nop. But we will shortly have uses |
6 | from the low-part of the product. | 6 | from other locations, where the length will be unmasked. |
7 | 7 | ||
8 | Fixes: 5f8cd06ebcf5 ("target/arm: Simplify SMMLA, SMMLAR, SMMLS, SMMLSR") | 8 | Saturate the length to ARM_MAX_VQ instead of truncating to |
9 | Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> | 9 | the low 4 bits. |
10 | |||
10 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 11 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
11 | Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com> | ||
12 | Message-id: 20190829013258.16102-1-richard.henderson@linaro.org | ||
13 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Message-id: 20210723203344.968563-2-richard.henderson@linaro.org | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
15 | --- | 15 | --- |
16 | target/arm/translate.c | 20 ++++++++++++++++++-- | 16 | target/arm/helper.c | 4 +++- |
17 | 1 file changed, 18 insertions(+), 2 deletions(-) | 17 | 1 file changed, 3 insertions(+), 1 deletion(-) |
18 | 18 | ||
19 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 19 | diff --git a/target/arm/helper.c b/target/arm/helper.c |
20 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/target/arm/translate.c | 21 | --- a/target/arm/helper.c |
22 | +++ b/target/arm/translate.c | 22 | +++ b/target/arm/helper.c |
23 | @@ -XXX,XX +XXX,XX @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) | 23 | @@ -XXX,XX +XXX,XX @@ static uint32_t sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len) |
24 | if (rd != 15) { | 24 | { |
25 | tmp3 = load_reg(s, rd); | 25 | uint32_t end_len; |
26 | if (insn & (1 << 6)) { | 26 | |
27 | - tcg_gen_sub_i32(tmp, tmp, tmp3); | 27 | - end_len = start_len &= 0xf; |
28 | + /* | 28 | + start_len = MIN(start_len, ARM_MAX_VQ - 1); |
29 | + * For SMMLS, we need a 64-bit subtract. | 29 | + end_len = start_len; |
30 | + * Borrow caused by a non-zero multiplicand | 30 | + |
31 | + * lowpart, and the correct result lowpart | 31 | if (!test_bit(start_len, cpu->sve_vq_map)) { |
32 | + * for rounding. | 32 | end_len = find_last_bit(cpu->sve_vq_map, start_len); |
33 | + */ | 33 | assert(end_len < start_len); |
34 | + TCGv_i32 zero = tcg_const_i32(0); | ||
35 | + tcg_gen_sub2_i32(tmp2, tmp, zero, tmp3, | ||
36 | + tmp2, tmp); | ||
37 | + tcg_temp_free_i32(zero); | ||
38 | } else { | ||
39 | tcg_gen_add_i32(tmp, tmp, tmp3); | ||
40 | } | ||
41 | @@ -XXX,XX +XXX,XX @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) | ||
42 | if (insn & (1 << 20)) { | ||
43 | tcg_gen_add_i32(tmp, tmp, tmp3); | ||
44 | } else { | ||
45 | - tcg_gen_sub_i32(tmp, tmp, tmp3); | ||
46 | + /* | ||
47 | + * For SMMLS, we need a 64-bit subtract. | ||
48 | + * Borrow caused by a non-zero multiplicand lowpart, | ||
49 | + * and the correct result lowpart for rounding. | ||
50 | + */ | ||
51 | + TCGv_i32 zero = tcg_const_i32(0); | ||
52 | + tcg_gen_sub2_i32(tmp2, tmp, zero, tmp3, tmp2, tmp); | ||
53 | + tcg_temp_free_i32(zero); | ||
54 | } | ||
55 | tcg_temp_free_i32(tmp3); | ||
56 | } | ||
57 | -- | 34 | -- |
58 | 2.20.1 | 35 | 2.20.1 |
59 | 36 | ||
60 | 37 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Make this a static function private to translate.c. | 3 | Rename from sve_zcr_get_valid_len and make accessible |
4 | Thus we can use the same idiom between aarch64 and aarch32 | 4 | from outside of helper.c. |
5 | without actually sharing function implementations. | ||
6 | 5 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com> | 7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Message-id: 20190826151536.6771-3-richard.henderson@linaro.org | 8 | Message-id: 20210723203344.968563-3-richard.henderson@linaro.org |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 10 | --- |
12 | target/arm/translate-vfp.inc.c | 3 +-- | 11 | target/arm/internals.h | 10 ++++++++++ |
13 | target/arm/translate.c | 22 ++++++++++++---------- | 12 | target/arm/helper.c | 4 ++-- |
14 | 2 files changed, 13 insertions(+), 12 deletions(-) | 13 | 2 files changed, 12 insertions(+), 2 deletions(-) |
15 | 14 | ||
16 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c | 15 | diff --git a/target/arm/internals.h b/target/arm/internals.h |
17 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/translate-vfp.inc.c | 17 | --- a/target/arm/internals.h |
19 | +++ b/target/arm/translate-vfp.inc.c | 18 | +++ b/target/arm/internals.h |
20 | @@ -XXX,XX +XXX,XX @@ static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled) | 19 | @@ -XXX,XX +XXX,XX @@ void arm_translate_init(void); |
21 | 20 | void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); | |
22 | if (!s->vfp_enabled && !ignore_vfp_enabled) { | 21 | #endif /* CONFIG_TCG */ |
23 | assert(!arm_dc_feature(s, ARM_FEATURE_M)); | 22 | |
24 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | 23 | +/** |
25 | - default_exception_el(s)); | 24 | + * aarch64_sve_zcr_get_valid_len: |
26 | + unallocated_encoding(s); | 25 | + * @cpu: cpu context |
27 | return false; | 26 | + * @start_len: maximum len to consider |
27 | + * | ||
28 | + * Return the maximum supported sve vector length <= @start_len. | ||
29 | + * Note that both @start_len and the return value are in units | ||
30 | + * of ZCR_ELx.LEN, so the vector bit length is (x + 1) * 128. | ||
31 | + */ | ||
32 | +uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len); | ||
33 | |||
34 | enum arm_fprounding { | ||
35 | FPROUNDING_TIEEVEN, | ||
36 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/target/arm/helper.c | ||
39 | +++ b/target/arm/helper.c | ||
40 | @@ -XXX,XX +XXX,XX @@ int sve_exception_el(CPUARMState *env, int el) | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | -static uint32_t sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len) | ||
45 | +uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len) | ||
46 | { | ||
47 | uint32_t end_len; | ||
48 | |||
49 | @@ -XXX,XX +XXX,XX @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) | ||
50 | zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); | ||
28 | } | 51 | } |
29 | 52 | ||
30 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 53 | - return sve_zcr_get_valid_len(cpu, zcr_len); |
31 | index XXXXXXX..XXXXXXX 100644 | 54 | + return aarch64_sve_zcr_get_valid_len(cpu, zcr_len); |
32 | --- a/target/arm/translate.c | ||
33 | +++ b/target/arm/translate.c | ||
34 | @@ -XXX,XX +XXX,XX @@ static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn) | ||
35 | s->base.is_jmp = DISAS_NORETURN; | ||
36 | } | 55 | } |
37 | 56 | ||
38 | +static void unallocated_encoding(DisasContext *s) | 57 | static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri, |
39 | +{ | ||
40 | + /* Unallocated and reserved encodings are uncategorized */ | ||
41 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
42 | + default_exception_el(s)); | ||
43 | +} | ||
44 | + | ||
45 | /* Force a TB lookup after an instruction that changes the CPU state. */ | ||
46 | static inline void gen_lookup_tb(DisasContext *s) | ||
47 | { | ||
48 | @@ -XXX,XX +XXX,XX @@ static inline void gen_hlt(DisasContext *s, int imm) | ||
49 | return; | ||
50 | } | ||
51 | |||
52 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
53 | - default_exception_el(s)); | ||
54 | + unallocated_encoding(s); | ||
55 | } | ||
56 | |||
57 | static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, | ||
58 | @@ -XXX,XX +XXX,XX @@ static void gen_srs(DisasContext *s, | ||
59 | } | ||
60 | |||
61 | if (undef) { | ||
62 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
63 | - default_exception_el(s)); | ||
64 | + unallocated_encoding(s); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | @@ -XXX,XX +XXX,XX @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) | ||
69 | break; | ||
70 | default: | ||
71 | illegal_op: | ||
72 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
73 | - default_exception_el(s)); | ||
74 | + unallocated_encoding(s); | ||
75 | break; | ||
76 | } | ||
77 | } | ||
78 | @@ -XXX,XX +XXX,XX @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) | ||
79 | } | ||
80 | return; | ||
81 | illegal_op: | ||
82 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
83 | - default_exception_el(s)); | ||
84 | + unallocated_encoding(s); | ||
85 | } | ||
86 | |||
87 | static void disas_thumb_insn(DisasContext *s, uint32_t insn) | ||
88 | @@ -XXX,XX +XXX,XX @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) | ||
89 | return; | ||
90 | illegal_op: | ||
91 | undef: | ||
92 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
93 | - default_exception_el(s)); | ||
94 | + unallocated_encoding(s); | ||
95 | } | ||
96 | |||
97 | static bool insn_crosses_page(CPUARMState *env, DisasContext *s) | ||
98 | -- | 58 | -- |
99 | 2.20.1 | 59 | 2.20.1 |
100 | 60 | ||
101 | 61 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | This reverts commit 3cb36637157088892e9e33ddb1034bffd1251d3b. | 3 | Mirror the behavour of /proc/sys/abi/sve_default_vector_length |
4 | under the real linux kernel. We have no way of passing along | ||
5 | a real default across exec like the kernel can, but this is a | ||
6 | decent way of adjusting the startup vector length of a process. | ||
4 | 7 | ||
5 | Despite the fact that the text for the call to gen_exception_insn | 8 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/482 |
6 | is identical for aarch64 and aarch32, the implementation inside | ||
7 | gen_exception_insn is totally different. | ||
8 | |||
9 | This fixes exceptions raised from aarch64. | ||
10 | |||
11 | Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> | ||
12 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
13 | Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com> | 10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
14 | Message-id: 20190826151536.6771-2-richard.henderson@linaro.org | 11 | Message-id: 20210723203344.968563-4-richard.henderson@linaro.org |
12 | [PMM: tweaked docs formatting, document -1 special-case, | ||
13 | added fixup patch from RTH mentioning QEMU's maximum veclen.] | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
16 | --- | 15 | --- |
17 | target/arm/translate-a64.h | 2 ++ | 16 | docs/system/arm/cpu-features.rst | 15 ++++++++ |
18 | target/arm/translate.h | 2 -- | 17 | target/arm/cpu.h | 5 +++ |
19 | target/arm/translate-a64.c | 7 +++++++ | 18 | target/arm/cpu.c | 14 ++++++-- |
20 | target/arm/translate-vfp.inc.c | 3 ++- | 19 | target/arm/cpu64.c | 60 ++++++++++++++++++++++++++++++++ |
21 | target/arm/translate.c | 22 ++++++++++------------ | 20 | 4 files changed, 92 insertions(+), 2 deletions(-) |
22 | 5 files changed, 21 insertions(+), 15 deletions(-) | ||
23 | 21 | ||
24 | diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h | 22 | diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst |
25 | index XXXXXXX..XXXXXXX 100644 | 23 | index XXXXXXX..XXXXXXX 100644 |
26 | --- a/target/arm/translate-a64.h | 24 | --- a/docs/system/arm/cpu-features.rst |
27 | +++ b/target/arm/translate-a64.h | 25 | +++ b/docs/system/arm/cpu-features.rst |
28 | @@ -XXX,XX +XXX,XX @@ | 26 | @@ -XXX,XX +XXX,XX @@ verbose command lines. However, the recommended way to select vector |
29 | #ifndef TARGET_ARM_TRANSLATE_A64_H | 27 | lengths is to explicitly enable each desired length. Therefore only |
30 | #define TARGET_ARM_TRANSLATE_A64_H | 28 | example's (1), (4), and (6) exhibit recommended uses of the properties. |
31 | 29 | ||
32 | +void unallocated_encoding(DisasContext *s); | 30 | +SVE User-mode Default Vector Length Property |
31 | +-------------------------------------------- | ||
33 | + | 32 | + |
34 | #define unsupported_encoding(s, insn) \ | 33 | +For qemu-aarch64, the cpu property ``sve-default-vector-length=N`` is |
35 | do { \ | 34 | +defined to mirror the Linux kernel parameter file |
36 | qemu_log_mask(LOG_UNIMP, \ | 35 | +``/proc/sys/abi/sve_default_vector_length``. The default length, ``N``, |
37 | diff --git a/target/arm/translate.h b/target/arm/translate.h | 36 | +is in units of bytes and must be between 16 and 8192. |
37 | +If not specified, the default vector length is 64. | ||
38 | + | ||
39 | +If the default length is larger than the maximum vector length enabled, | ||
40 | +the actual vector length will be reduced. Note that the maximum vector | ||
41 | +length supported by QEMU is 256. | ||
42 | + | ||
43 | +If this property is set to ``-1`` then the default vector length | ||
44 | +is set to the maximum possible length. | ||
45 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
38 | index XXXXXXX..XXXXXXX 100644 | 46 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/target/arm/translate.h | 47 | --- a/target/arm/cpu.h |
40 | +++ b/target/arm/translate.h | 48 | +++ b/target/arm/cpu.h |
41 | @@ -XXX,XX +XXX,XX @@ typedef struct DisasCompare { | 49 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { |
42 | bool value_global; | 50 | /* Used to set the maximum vector length the cpu will support. */ |
43 | } DisasCompare; | 51 | uint32_t sve_max_vq; |
44 | 52 | ||
45 | -void unallocated_encoding(DisasContext *s); | 53 | +#ifdef CONFIG_USER_ONLY |
46 | - | 54 | + /* Used to set the default vector length at process start. */ |
47 | /* Share the TCG temporaries common between 32 and 64 bit modes. */ | 55 | + uint32_t sve_default_vq; |
48 | extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF; | 56 | +#endif |
49 | extern TCGv_i64 cpu_exclusive_addr; | 57 | + |
50 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 58 | /* |
59 | * In sve_vq_map each set bit is a supported vector length of | ||
60 | * (bit-number + 1) * 16 bytes, i.e. each bit number + 1 is the vector | ||
61 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
51 | index XXXXXXX..XXXXXXX 100644 | 62 | index XXXXXXX..XXXXXXX 100644 |
52 | --- a/target/arm/translate-a64.c | 63 | --- a/target/arm/cpu.c |
53 | +++ b/target/arm/translate-a64.c | 64 | +++ b/target/arm/cpu.c |
54 | @@ -XXX,XX +XXX,XX @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) | 65 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_reset(DeviceState *dev) |
55 | } | 66 | env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 16, 2, 3); |
67 | /* with reasonable vector length */ | ||
68 | if (cpu_isar_feature(aa64_sve, cpu)) { | ||
69 | - env->vfp.zcr_el[1] = MIN(cpu->sve_max_vq - 1, 3); | ||
70 | + env->vfp.zcr_el[1] = | ||
71 | + aarch64_sve_zcr_get_valid_len(cpu, cpu->sve_default_vq - 1); | ||
72 | } | ||
73 | /* | ||
74 | * Enable TBI0 but not TBI1. | ||
75 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_initfn(Object *obj) | ||
76 | QLIST_INIT(&cpu->pre_el_change_hooks); | ||
77 | QLIST_INIT(&cpu->el_change_hooks); | ||
78 | |||
79 | -#ifndef CONFIG_USER_ONLY | ||
80 | +#ifdef CONFIG_USER_ONLY | ||
81 | +# ifdef TARGET_AARCH64 | ||
82 | + /* | ||
83 | + * The linux kernel defaults to 512-bit vectors, when sve is supported. | ||
84 | + * See documentation for /proc/sys/abi/sve_default_vector_length, and | ||
85 | + * our corresponding sve-default-vector-length cpu property. | ||
86 | + */ | ||
87 | + cpu->sve_default_vq = 4; | ||
88 | +# endif | ||
89 | +#else | ||
90 | /* Our inbound IRQ and FIQ lines */ | ||
91 | if (kvm_enabled()) { | ||
92 | /* VIRQ and VFIQ are unused with KVM but we add them to maintain | ||
93 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | ||
94 | index XXXXXXX..XXXXXXX 100644 | ||
95 | --- a/target/arm/cpu64.c | ||
96 | +++ b/target/arm/cpu64.c | ||
97 | @@ -XXX,XX +XXX,XX @@ static void cpu_arm_set_sve(Object *obj, bool value, Error **errp) | ||
98 | cpu->isar.id_aa64pfr0 = t; | ||
56 | } | 99 | } |
57 | 100 | ||
58 | +void unallocated_encoding(DisasContext *s) | 101 | +#ifdef CONFIG_USER_ONLY |
102 | +/* Mirror linux /proc/sys/abi/sve_default_vector_length. */ | ||
103 | +static void cpu_arm_set_sve_default_vec_len(Object *obj, Visitor *v, | ||
104 | + const char *name, void *opaque, | ||
105 | + Error **errp) | ||
59 | +{ | 106 | +{ |
60 | + /* Unallocated and reserved encodings are uncategorized */ | 107 | + ARMCPU *cpu = ARM_CPU(obj); |
61 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | 108 | + int32_t default_len, default_vq, remainder; |
62 | + default_exception_el(s)); | 109 | + |
110 | + if (!visit_type_int32(v, name, &default_len, errp)) { | ||
111 | + return; | ||
112 | + } | ||
113 | + | ||
114 | + /* Undocumented, but the kernel allows -1 to indicate "maximum". */ | ||
115 | + if (default_len == -1) { | ||
116 | + cpu->sve_default_vq = ARM_MAX_VQ; | ||
117 | + return; | ||
118 | + } | ||
119 | + | ||
120 | + default_vq = default_len / 16; | ||
121 | + remainder = default_len % 16; | ||
122 | + | ||
123 | + /* | ||
124 | + * Note that the 512 max comes from include/uapi/asm/sve_context.h | ||
125 | + * and is the maximum architectural width of ZCR_ELx.LEN. | ||
126 | + */ | ||
127 | + if (remainder || default_vq < 1 || default_vq > 512) { | ||
128 | + error_setg(errp, "cannot set sve-default-vector-length"); | ||
129 | + if (remainder) { | ||
130 | + error_append_hint(errp, "Vector length not a multiple of 16\n"); | ||
131 | + } else if (default_vq < 1) { | ||
132 | + error_append_hint(errp, "Vector length smaller than 16\n"); | ||
133 | + } else { | ||
134 | + error_append_hint(errp, "Vector length larger than %d\n", | ||
135 | + 512 * 16); | ||
136 | + } | ||
137 | + return; | ||
138 | + } | ||
139 | + | ||
140 | + cpu->sve_default_vq = default_vq; | ||
63 | +} | 141 | +} |
64 | + | 142 | + |
65 | static void init_tmp_a64_array(DisasContext *s) | 143 | +static void cpu_arm_get_sve_default_vec_len(Object *obj, Visitor *v, |
144 | + const char *name, void *opaque, | ||
145 | + Error **errp) | ||
146 | +{ | ||
147 | + ARMCPU *cpu = ARM_CPU(obj); | ||
148 | + int32_t value = cpu->sve_default_vq * 16; | ||
149 | + | ||
150 | + visit_type_int32(v, name, &value, errp); | ||
151 | +} | ||
152 | +#endif | ||
153 | + | ||
154 | void aarch64_add_sve_properties(Object *obj) | ||
66 | { | 155 | { |
67 | #ifdef CONFIG_DEBUG_TCG | 156 | uint32_t vq; |
68 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c | 157 | @@ -XXX,XX +XXX,XX @@ void aarch64_add_sve_properties(Object *obj) |
69 | index XXXXXXX..XXXXXXX 100644 | 158 | object_property_add(obj, name, "bool", cpu_arm_get_sve_vq, |
70 | --- a/target/arm/translate-vfp.inc.c | 159 | cpu_arm_set_sve_vq, NULL, NULL); |
71 | +++ b/target/arm/translate-vfp.inc.c | ||
72 | @@ -XXX,XX +XXX,XX @@ static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled) | ||
73 | |||
74 | if (!s->vfp_enabled && !ignore_vfp_enabled) { | ||
75 | assert(!arm_dc_feature(s, ARM_FEATURE_M)); | ||
76 | - unallocated_encoding(s); | ||
77 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
78 | + default_exception_el(s)); | ||
79 | return false; | ||
80 | } | 160 | } |
81 | 161 | + | |
82 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 162 | +#ifdef CONFIG_USER_ONLY |
83 | index XXXXXXX..XXXXXXX 100644 | 163 | + /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ |
84 | --- a/target/arm/translate.c | 164 | + object_property_add(obj, "sve-default-vector-length", "int32", |
85 | +++ b/target/arm/translate.c | 165 | + cpu_arm_get_sve_default_vec_len, |
86 | @@ -XXX,XX +XXX,XX @@ static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn) | 166 | + cpu_arm_set_sve_default_vec_len, NULL, NULL); |
87 | s->base.is_jmp = DISAS_NORETURN; | 167 | +#endif |
88 | } | 168 | } |
89 | 169 | ||
90 | -void unallocated_encoding(DisasContext *s) | 170 | void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) |
91 | -{ | ||
92 | - /* Unallocated and reserved encodings are uncategorized */ | ||
93 | - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
94 | - default_exception_el(s)); | ||
95 | -} | ||
96 | - | ||
97 | /* Force a TB lookup after an instruction that changes the CPU state. */ | ||
98 | static inline void gen_lookup_tb(DisasContext *s) | ||
99 | { | ||
100 | @@ -XXX,XX +XXX,XX @@ static inline void gen_hlt(DisasContext *s, int imm) | ||
101 | return; | ||
102 | } | ||
103 | |||
104 | - unallocated_encoding(s); | ||
105 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
106 | + default_exception_el(s)); | ||
107 | } | ||
108 | |||
109 | static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, | ||
110 | @@ -XXX,XX +XXX,XX @@ static void gen_srs(DisasContext *s, | ||
111 | } | ||
112 | |||
113 | if (undef) { | ||
114 | - unallocated_encoding(s); | ||
115 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
116 | + default_exception_el(s)); | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | @@ -XXX,XX +XXX,XX @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) | ||
121 | break; | ||
122 | default: | ||
123 | illegal_op: | ||
124 | - unallocated_encoding(s); | ||
125 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
126 | + default_exception_el(s)); | ||
127 | break; | ||
128 | } | ||
129 | } | ||
130 | @@ -XXX,XX +XXX,XX @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) | ||
131 | } | ||
132 | return; | ||
133 | illegal_op: | ||
134 | - unallocated_encoding(s); | ||
135 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
136 | + default_exception_el(s)); | ||
137 | } | ||
138 | |||
139 | static void disas_thumb_insn(DisasContext *s, uint32_t insn) | ||
140 | @@ -XXX,XX +XXX,XX @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) | ||
141 | return; | ||
142 | illegal_op: | ||
143 | undef: | ||
144 | - unallocated_encoding(s); | ||
145 | + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), | ||
146 | + default_exception_el(s)); | ||
147 | } | ||
148 | |||
149 | static bool insn_crosses_page(CPUARMState *env, DisasContext *s) | ||
150 | -- | 171 | -- |
151 | 2.20.1 | 172 | 2.20.1 |
152 | 173 | ||
153 | 174 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Eric Auger <eric.auger@redhat.com> | ||
2 | 1 | ||
3 | memory_region_iommu_replay_all is not used. Remove it. | ||
4 | |||
5 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
6 | Reported-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Reviewed-by: Peter Xu <peterx@redhat.com> | ||
9 | Message-id: 20190822172350.12008-2-eric.auger@redhat.com | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | include/exec/memory.h | 10 ---------- | ||
13 | memory.c | 9 --------- | ||
14 | 2 files changed, 19 deletions(-) | ||
15 | |||
16 | diff --git a/include/exec/memory.h b/include/exec/memory.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/include/exec/memory.h | ||
19 | +++ b/include/exec/memory.h | ||
20 | @@ -XXX,XX +XXX,XX @@ void memory_region_register_iommu_notifier(MemoryRegion *mr, | ||
21 | */ | ||
22 | void memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n); | ||
23 | |||
24 | -/** | ||
25 | - * memory_region_iommu_replay_all: replay existing IOMMU translations | ||
26 | - * to all the notifiers registered. | ||
27 | - * | ||
28 | - * Note: this is not related to record-and-replay functionality. | ||
29 | - * | ||
30 | - * @iommu_mr: the memory region to observe | ||
31 | - */ | ||
32 | -void memory_region_iommu_replay_all(IOMMUMemoryRegion *iommu_mr); | ||
33 | - | ||
34 | /** | ||
35 | * memory_region_unregister_iommu_notifier: unregister a notifier for | ||
36 | * changes to IOMMU translation entries. | ||
37 | diff --git a/memory.c b/memory.c | ||
38 | index XXXXXXX..XXXXXXX 100644 | ||
39 | --- a/memory.c | ||
40 | +++ b/memory.c | ||
41 | @@ -XXX,XX +XXX,XX @@ void memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n) | ||
42 | } | ||
43 | } | ||
44 | |||
45 | -void memory_region_iommu_replay_all(IOMMUMemoryRegion *iommu_mr) | ||
46 | -{ | ||
47 | - IOMMUNotifier *notifier; | ||
48 | - | ||
49 | - IOMMU_NOTIFIER_FOREACH(notifier, iommu_mr) { | ||
50 | - memory_region_iommu_replay(iommu_mr, notifier); | ||
51 | - } | ||
52 | -} | ||
53 | - | ||
54 | void memory_region_unregister_iommu_notifier(MemoryRegion *mr, | ||
55 | IOMMUNotifier *n) | ||
56 | { | ||
57 | -- | ||
58 | 2.20.1 | ||
59 | |||
60 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | Log a guest error when encountering an invalid STE. | 3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
4 | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | |
5 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 5 | Message-id: 20210726150953.1218690-1-f4bug@amsat.org |
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
7 | Message-id: 20190822172350.12008-5-eric.auger@redhat.com | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 7 | --- |
10 | hw/arm/smmuv3.c | 1 + | 8 | hw/arm/nseries.c | 2 +- |
11 | 1 file changed, 1 insertion(+) | 9 | 1 file changed, 1 insertion(+), 1 deletion(-) |
12 | 10 | ||
13 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | 11 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c |
14 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/smmuv3.c | 13 | --- a/hw/arm/nseries.c |
16 | +++ b/hw/arm/smmuv3.c | 14 | +++ b/hw/arm/nseries.c |
17 | @@ -XXX,XX +XXX,XX @@ static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg, | 15 | @@ -XXX,XX +XXX,XX @@ static uint32_t mipid_txrx(void *opaque, uint32_t cmd, int len) |
18 | uint32_t config; | 16 | default: |
19 | 17 | bad_cmd: | |
20 | if (!STE_VALID(ste)) { | 18 | qemu_log_mask(LOG_GUEST_ERROR, |
21 | + qemu_log_mask(LOG_GUEST_ERROR, "invalid STE\n"); | 19 | - "%s: unknown command %02x\n", __func__, s->cmd); |
22 | goto bad_ste; | 20 | + "%s: unknown command 0x%02x\n", __func__, s->cmd); |
21 | break; | ||
23 | } | 22 | } |
24 | 23 | ||
25 | -- | 24 | -- |
26 | 2.20.1 | 25 | 2.20.1 |
27 | 26 | ||
28 | 27 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Joel Stanley <joel@jms.id.au> |
---|---|---|---|
2 | 2 | ||
3 | Commit ba1ba5cca introduce the ARM_CPU_TYPE_NAME() macro. | 3 | The macro used to calculate the maximum memory size of the MMIO region |
4 | Unify the code base by use it in all places. | 4 | had a mistake, causing all GPIO models to create a mapping of 0x9D8. |
5 | The intent was to have it be 0x9D8 - 0x800. | ||
5 | 6 | ||
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 7 | This extra size doesn't matter on ast2400 and ast2500, which have a 4KB |
7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | region set aside for the GPIO controller. |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 9 | |
9 | Message-id: 20190823143249.8096-2-philmd@redhat.com | 10 | On the ast2600 the 3.3V and 1.8V GPIO controllers are 2KB apart, so the |
11 | regions would overlap. Worse was the 1.8V controller would map over the | ||
12 | top of the following peripheral, which happens to be the RTC. | ||
13 | |||
14 | The mmio region used by each device is a maximum of 2KB, so avoid the | ||
15 | calculations and hard code this as the maximum. | ||
16 | |||
17 | Fixes: 36d737ee82b2 ("hw/gpio: Add in AST2600 specific implementation") | ||
18 | Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
19 | Reviewed-by: Rashmica Gupta <rashmica.g@gmail.com> | ||
20 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
21 | Message-id: 20210713065854.134634-2-joel@jms.id.au | ||
22 | [PMM: fix autocorrect error in commit message] | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 23 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 24 | --- |
12 | hw/arm/allwinner-a10.c | 3 ++- | 25 | hw/gpio/aspeed_gpio.c | 3 +-- |
13 | hw/arm/cubieboard.c | 3 ++- | 26 | 1 file changed, 1 insertion(+), 2 deletions(-) |
14 | hw/arm/digic.c | 3 ++- | ||
15 | hw/arm/fsl-imx25.c | 2 +- | ||
16 | hw/arm/fsl-imx31.c | 2 +- | ||
17 | hw/arm/fsl-imx6.c | 3 ++- | ||
18 | hw/arm/fsl-imx6ul.c | 2 +- | ||
19 | hw/arm/xlnx-zynqmp.c | 8 ++++---- | ||
20 | 8 files changed, 15 insertions(+), 11 deletions(-) | ||
21 | 27 | ||
22 | diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c | 28 | diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c |
23 | index XXXXXXX..XXXXXXX 100644 | 29 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/hw/arm/allwinner-a10.c | 30 | --- a/hw/gpio/aspeed_gpio.c |
25 | +++ b/hw/arm/allwinner-a10.c | 31 | +++ b/hw/gpio/aspeed_gpio.c |
26 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_init(Object *obj) | 32 | @@ -XXX,XX +XXX,XX @@ |
27 | AwA10State *s = AW_A10(obj); | 33 | #define GPIO_1_8V_MEM_SIZE 0x9D8 |
28 | 34 | #define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ | |
29 | object_initialize_child(obj, "cpu", &s->cpu, sizeof(s->cpu), | 35 | GPIO_1_8V_REG_OFFSET) >> 2) |
30 | - "cortex-a8-" TYPE_ARM_CPU, &error_abort, NULL); | 36 | -#define GPIO_MAX_MEM_SIZE MAX(GPIO_3_6V_MEM_SIZE, GPIO_1_8V_MEM_SIZE) |
31 | + ARM_CPU_TYPE_NAME("cortex-a8"), | 37 | |
32 | + &error_abort, NULL); | 38 | static int aspeed_evaluate_irq(GPIOSets *regs, int gpio_prev_high, int gpio) |
33 | |||
34 | sysbus_init_child_obj(obj, "intc", &s->intc, sizeof(s->intc), | ||
35 | TYPE_AW_A10_PIC); | ||
36 | diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/hw/arm/cubieboard.c | ||
39 | +++ b/hw/arm/cubieboard.c | ||
40 | @@ -XXX,XX +XXX,XX @@ static void cubieboard_init(MachineState *machine) | ||
41 | |||
42 | static void cubieboard_machine_init(MachineClass *mc) | ||
43 | { | 39 | { |
44 | - mc->desc = "cubietech cubieboard"; | 40 | @@ -XXX,XX +XXX,XX @@ static void aspeed_gpio_realize(DeviceState *dev, Error **errp) |
45 | + mc->desc = "cubietech cubieboard (Cortex-A9)"; | ||
46 | + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a9"); | ||
47 | mc->init = cubieboard_init; | ||
48 | mc->block_default_type = IF_IDE; | ||
49 | mc->units_per_default_bus = 1; | ||
50 | diff --git a/hw/arm/digic.c b/hw/arm/digic.c | ||
51 | index XXXXXXX..XXXXXXX 100644 | ||
52 | --- a/hw/arm/digic.c | ||
53 | +++ b/hw/arm/digic.c | ||
54 | @@ -XXX,XX +XXX,XX @@ static void digic_init(Object *obj) | ||
55 | int i; | ||
56 | |||
57 | object_initialize_child(obj, "cpu", &s->cpu, sizeof(s->cpu), | ||
58 | - "arm946-" TYPE_ARM_CPU, &error_abort, NULL); | ||
59 | + ARM_CPU_TYPE_NAME("arm946"), | ||
60 | + &error_abort, NULL); | ||
61 | |||
62 | for (i = 0; i < DIGIC4_NB_TIMERS; i++) { | ||
63 | #define DIGIC_TIMER_NAME_MLEN 11 | ||
64 | diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c | ||
65 | index XXXXXXX..XXXXXXX 100644 | ||
66 | --- a/hw/arm/fsl-imx25.c | ||
67 | +++ b/hw/arm/fsl-imx25.c | ||
68 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx25_init(Object *obj) | ||
69 | FslIMX25State *s = FSL_IMX25(obj); | ||
70 | int i; | ||
71 | |||
72 | - object_initialize(&s->cpu, sizeof(s->cpu), "arm926-" TYPE_ARM_CPU); | ||
73 | + object_initialize(&s->cpu, sizeof(s->cpu), ARM_CPU_TYPE_NAME("arm926")); | ||
74 | |||
75 | sysbus_init_child_obj(obj, "avic", &s->avic, sizeof(s->avic), | ||
76 | TYPE_IMX_AVIC); | ||
77 | diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c | ||
78 | index XXXXXXX..XXXXXXX 100644 | ||
79 | --- a/hw/arm/fsl-imx31.c | ||
80 | +++ b/hw/arm/fsl-imx31.c | ||
81 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx31_init(Object *obj) | ||
82 | FslIMX31State *s = FSL_IMX31(obj); | ||
83 | int i; | ||
84 | |||
85 | - object_initialize(&s->cpu, sizeof(s->cpu), "arm1136-" TYPE_ARM_CPU); | ||
86 | + object_initialize(&s->cpu, sizeof(s->cpu), ARM_CPU_TYPE_NAME("arm1136")); | ||
87 | |||
88 | sysbus_init_child_obj(obj, "avic", &s->avic, sizeof(s->avic), | ||
89 | TYPE_IMX_AVIC); | ||
90 | diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c | ||
91 | index XXXXXXX..XXXXXXX 100644 | ||
92 | --- a/hw/arm/fsl-imx6.c | ||
93 | +++ b/hw/arm/fsl-imx6.c | ||
94 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6_init(Object *obj) | ||
95 | for (i = 0; i < MIN(ms->smp.cpus, FSL_IMX6_NUM_CPUS); i++) { | ||
96 | snprintf(name, NAME_SIZE, "cpu%d", i); | ||
97 | object_initialize_child(obj, name, &s->cpu[i], sizeof(s->cpu[i]), | ||
98 | - "cortex-a9-" TYPE_ARM_CPU, &error_abort, NULL); | ||
99 | + ARM_CPU_TYPE_NAME("cortex-a9"), | ||
100 | + &error_abort, NULL); | ||
101 | } | 41 | } |
102 | 42 | ||
103 | sysbus_init_child_obj(obj, "a9mpcore", &s->a9mpcore, sizeof(s->a9mpcore), | 43 | memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_gpio_ops, s, |
104 | diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c | 44 | - TYPE_ASPEED_GPIO, GPIO_MAX_MEM_SIZE); |
105 | index XXXXXXX..XXXXXXX 100644 | 45 | + TYPE_ASPEED_GPIO, 0x800); |
106 | --- a/hw/arm/fsl-imx6ul.c | 46 | |
107 | +++ b/hw/arm/fsl-imx6ul.c | 47 | sysbus_init_mmio(sbd, &s->iomem); |
108 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj) | 48 | } |
109 | int i; | ||
110 | |||
111 | object_initialize_child(obj, "cpu0", &s->cpu, sizeof(s->cpu), | ||
112 | - "cortex-a7-" TYPE_ARM_CPU, &error_abort, NULL); | ||
113 | + ARM_CPU_TYPE_NAME("cortex-a7"), &error_abort, NULL); | ||
114 | |||
115 | /* | ||
116 | * A7MPCORE | ||
117 | diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c | ||
118 | index XXXXXXX..XXXXXXX 100644 | ||
119 | --- a/hw/arm/xlnx-zynqmp.c | ||
120 | +++ b/hw/arm/xlnx-zynqmp.c | ||
121 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s, | ||
122 | |||
123 | object_initialize_child(OBJECT(&s->rpu_cluster), "rpu-cpu[*]", | ||
124 | &s->rpu_cpu[i], sizeof(s->rpu_cpu[i]), | ||
125 | - "cortex-r5f-" TYPE_ARM_CPU, &error_abort, | ||
126 | - NULL); | ||
127 | + ARM_CPU_TYPE_NAME("cortex-r5f"), | ||
128 | + &error_abort, NULL); | ||
129 | |||
130 | name = object_get_canonical_path_component(OBJECT(&s->rpu_cpu[i])); | ||
131 | if (strcmp(name, boot_cpu)) { | ||
132 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_init(Object *obj) | ||
133 | for (i = 0; i < num_apus; i++) { | ||
134 | object_initialize_child(OBJECT(&s->apu_cluster), "apu-cpu[*]", | ||
135 | &s->apu_cpu[i], sizeof(s->apu_cpu[i]), | ||
136 | - "cortex-a53-" TYPE_ARM_CPU, &error_abort, | ||
137 | - NULL); | ||
138 | + ARM_CPU_TYPE_NAME("cortex-a53"), | ||
139 | + &error_abort, NULL); | ||
140 | } | ||
141 | |||
142 | sysbus_init_child_obj(obj, "gic", &s->gic, sizeof(s->gic), | ||
143 | -- | 49 | -- |
144 | 2.20.1 | 50 | 2.20.1 |
145 | 51 | ||
146 | 52 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
2 | 1 | ||
3 | As explained in commit aff39be0ed97: | ||
4 | |||
5 | Both functions, object_initialize() and object_property_add_child() | ||
6 | increase the reference counter of the new object, so one of the | ||
7 | references has to be dropped afterwards to get the reference | ||
8 | counting right. Otherwise the child object will not be properly | ||
9 | cleaned up when the parent gets destroyed. | ||
10 | Thus let's use now object_initialize_child() instead to get the | ||
11 | reference counting here right. | ||
12 | |||
13 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
17 | Message-id: 20190823143249.8096-3-philmd@redhat.com | ||
18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
19 | --- | ||
20 | hw/arm/mcimx7d-sabre.c | 9 ++++----- | ||
21 | hw/arm/mps2-tz.c | 15 +++++++-------- | ||
22 | hw/arm/musca.c | 9 +++++---- | ||
23 | 3 files changed, 16 insertions(+), 17 deletions(-) | ||
24 | |||
25 | diff --git a/hw/arm/mcimx7d-sabre.c b/hw/arm/mcimx7d-sabre.c | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/hw/arm/mcimx7d-sabre.c | ||
28 | +++ b/hw/arm/mcimx7d-sabre.c | ||
29 | @@ -XXX,XX +XXX,XX @@ static void mcimx7d_sabre_init(MachineState *machine) | ||
30 | { | ||
31 | static struct arm_boot_info boot_info; | ||
32 | MCIMX7Sabre *s = g_new0(MCIMX7Sabre, 1); | ||
33 | - Object *soc; | ||
34 | int i; | ||
35 | |||
36 | if (machine->ram_size > FSL_IMX7_MMDC_SIZE) { | ||
37 | @@ -XXX,XX +XXX,XX @@ static void mcimx7d_sabre_init(MachineState *machine) | ||
38 | .nb_cpus = machine->smp.cpus, | ||
39 | }; | ||
40 | |||
41 | - object_initialize(&s->soc, sizeof(s->soc), TYPE_FSL_IMX7); | ||
42 | - soc = OBJECT(&s->soc); | ||
43 | - object_property_add_child(OBJECT(machine), "soc", soc, &error_fatal); | ||
44 | - object_property_set_bool(soc, true, "realized", &error_fatal); | ||
45 | + object_initialize_child(OBJECT(machine), "soc", | ||
46 | + &s->soc, sizeof(s->soc), | ||
47 | + TYPE_FSL_IMX7, &error_fatal, NULL); | ||
48 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal); | ||
49 | |||
50 | memory_region_allocate_system_memory(&s->ram, NULL, "mcimx7d-sabre.ram", | ||
51 | machine->ram_size); | ||
52 | diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c | ||
53 | index XXXXXXX..XXXXXXX 100644 | ||
54 | --- a/hw/arm/mps2-tz.c | ||
55 | +++ b/hw/arm/mps2-tz.c | ||
56 | @@ -XXX,XX +XXX,XX @@ static void mps2tz_common_init(MachineState *machine) | ||
57 | /* The sec_resp_cfg output from the IoTKit must be split into multiple | ||
58 | * lines, one for each of the PPCs we create here, plus one per MSC. | ||
59 | */ | ||
60 | - object_initialize(&mms->sec_resp_splitter, sizeof(mms->sec_resp_splitter), | ||
61 | - TYPE_SPLIT_IRQ); | ||
62 | - object_property_add_child(OBJECT(machine), "sec-resp-splitter", | ||
63 | - OBJECT(&mms->sec_resp_splitter), &error_abort); | ||
64 | + object_initialize_child(OBJECT(machine), "sec-resp-splitter", | ||
65 | + &mms->sec_resp_splitter, | ||
66 | + sizeof(mms->sec_resp_splitter), | ||
67 | + TYPE_SPLIT_IRQ, &error_abort, NULL); | ||
68 | object_property_set_int(OBJECT(&mms->sec_resp_splitter), | ||
69 | ARRAY_SIZE(mms->ppc) + ARRAY_SIZE(mms->msc), | ||
70 | "num-lines", &error_fatal); | ||
71 | @@ -XXX,XX +XXX,XX @@ static void mps2tz_common_init(MachineState *machine) | ||
72 | * Tx, Rx and "combined" IRQs are sent to the NVIC separately. | ||
73 | * Create the OR gate for this. | ||
74 | */ | ||
75 | - object_initialize(&mms->uart_irq_orgate, sizeof(mms->uart_irq_orgate), | ||
76 | - TYPE_OR_IRQ); | ||
77 | - object_property_add_child(OBJECT(mms), "uart-irq-orgate", | ||
78 | - OBJECT(&mms->uart_irq_orgate), &error_abort); | ||
79 | + object_initialize_child(OBJECT(mms), "uart-irq-orgate", | ||
80 | + &mms->uart_irq_orgate, sizeof(mms->uart_irq_orgate), | ||
81 | + TYPE_OR_IRQ, &error_abort, NULL); | ||
82 | object_property_set_int(OBJECT(&mms->uart_irq_orgate), 10, "num-lines", | ||
83 | &error_fatal); | ||
84 | object_property_set_bool(OBJECT(&mms->uart_irq_orgate), true, | ||
85 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c | ||
86 | index XXXXXXX..XXXXXXX 100644 | ||
87 | --- a/hw/arm/musca.c | ||
88 | +++ b/hw/arm/musca.c | ||
89 | @@ -XXX,XX +XXX,XX @@ static void musca_init(MachineState *machine) | ||
90 | * The sec_resp_cfg output from the SSE-200 must be split into multiple | ||
91 | * lines, one for each of the PPCs we create here. | ||
92 | */ | ||
93 | - object_initialize(&mms->sec_resp_splitter, sizeof(mms->sec_resp_splitter), | ||
94 | - TYPE_SPLIT_IRQ); | ||
95 | - object_property_add_child(OBJECT(machine), "sec-resp-splitter", | ||
96 | - OBJECT(&mms->sec_resp_splitter), &error_fatal); | ||
97 | + object_initialize_child(OBJECT(machine), "sec-resp-splitter", | ||
98 | + &mms->sec_resp_splitter, | ||
99 | + sizeof(mms->sec_resp_splitter), | ||
100 | + TYPE_SPLIT_IRQ, &error_fatal, NULL); | ||
101 | + | ||
102 | object_property_set_int(OBJECT(&mms->sec_resp_splitter), | ||
103 | ARRAY_SIZE(mms->ppc), "num-lines", &error_fatal); | ||
104 | object_property_set_bool(OBJECT(&mms->sec_resp_splitter), true, | ||
105 | -- | ||
106 | 2.20.1 | ||
107 | |||
108 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
2 | 1 | ||
3 | Both object_initialize() and qdev_set_parent_bus() increase the | ||
4 | reference counter of the new object, so one of the references has | ||
5 | to be dropped afterwards to get the reference counting right. | ||
6 | In machine model code this refcount leak is not particularly | ||
7 | problematic because (unlike devices) machines will never be | ||
8 | created on demand via QMP, and they are never destroyed. | ||
9 | But in any case let's use the new sysbus_init_child_obj() instead | ||
10 | to get the reference counting here right. | ||
11 | |||
12 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
14 | Message-id: 20190823143249.8096-4-philmd@redhat.com | ||
15 | [PMM: rewrote commit message] | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | --- | ||
18 | hw/arm/exynos4_boards.c | 4 ++-- | ||
19 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/hw/arm/exynos4_boards.c | ||
24 | +++ b/hw/arm/exynos4_boards.c | ||
25 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
26 | exynos4_boards_init_ram(s, get_system_memory(), | ||
27 | exynos4_board_ram_size[board_type]); | ||
28 | |||
29 | - object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
30 | - qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | ||
31 | + sysbus_init_child_obj(OBJECT(machine), "soc", | ||
32 | + &s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
33 | object_property_set_bool(OBJECT(&s->soc), true, "realized", | ||
34 | &error_fatal); | ||
35 | |||
36 | -- | ||
37 | 2.20.1 | ||
38 | |||
39 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
2 | 1 | ||
3 | Child properties form the composition tree. All objects need to be | ||
4 | a child of another object. Objects can only be a child of one object. | ||
5 | |||
6 | Respect this with the i.MX SoC, to get a cleaner composition tree. | ||
7 | |||
8 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Message-id: 20190823143249.8096-5-philmd@redhat.com | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | hw/arm/fsl-imx25.c | 4 +++- | ||
14 | hw/arm/fsl-imx31.c | 4 +++- | ||
15 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/arm/fsl-imx25.c | ||
20 | +++ b/hw/arm/fsl-imx25.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx25_init(Object *obj) | ||
22 | FslIMX25State *s = FSL_IMX25(obj); | ||
23 | int i; | ||
24 | |||
25 | - object_initialize(&s->cpu, sizeof(s->cpu), ARM_CPU_TYPE_NAME("arm926")); | ||
26 | + object_initialize_child(obj, "cpu", &s->cpu, sizeof(s->cpu), | ||
27 | + ARM_CPU_TYPE_NAME("arm926"), | ||
28 | + &error_abort, NULL); | ||
29 | |||
30 | sysbus_init_child_obj(obj, "avic", &s->avic, sizeof(s->avic), | ||
31 | TYPE_IMX_AVIC); | ||
32 | diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/hw/arm/fsl-imx31.c | ||
35 | +++ b/hw/arm/fsl-imx31.c | ||
36 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx31_init(Object *obj) | ||
37 | FslIMX31State *s = FSL_IMX31(obj); | ||
38 | int i; | ||
39 | |||
40 | - object_initialize(&s->cpu, sizeof(s->cpu), ARM_CPU_TYPE_NAME("arm1136")); | ||
41 | + object_initialize_child(obj, "cpu", &s->cpu, sizeof(s->cpu), | ||
42 | + ARM_CPU_TYPE_NAME("arm1136"), | ||
43 | + &error_abort, NULL); | ||
44 | |||
45 | sysbus_init_child_obj(obj, "avic", &s->avic, sizeof(s->avic), | ||
46 | TYPE_IMX_AVIC); | ||
47 | -- | ||
48 | 2.20.1 | ||
49 | |||
50 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
2 | 1 | ||
3 | As explained in commit aff39be0ed97: | ||
4 | |||
5 | Both functions, object_initialize() and object_property_add_child() | ||
6 | increase the reference counter of the new object, so one of the | ||
7 | references has to be dropped afterwards to get the reference | ||
8 | counting right. Otherwise the child object will not be properly | ||
9 | cleaned up when the parent gets destroyed. | ||
10 | Thus let's use now object_initialize_child() instead to get the | ||
11 | reference counting here right. | ||
12 | |||
13 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
14 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
17 | Message-id: 20190823143249.8096-6-philmd@redhat.com | ||
18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
19 | --- | ||
20 | hw/dma/xilinx_axidma.c | 16 ++++++++-------- | ||
21 | 1 file changed, 8 insertions(+), 8 deletions(-) | ||
22 | |||
23 | diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | ||
25 | --- a/hw/dma/xilinx_axidma.c | ||
26 | +++ b/hw/dma/xilinx_axidma.c | ||
27 | @@ -XXX,XX +XXX,XX @@ static void xilinx_axidma_init(Object *obj) | ||
28 | XilinxAXIDMA *s = XILINX_AXI_DMA(obj); | ||
29 | SysBusDevice *sbd = SYS_BUS_DEVICE(obj); | ||
30 | |||
31 | - object_initialize(&s->rx_data_dev, sizeof(s->rx_data_dev), | ||
32 | - TYPE_XILINX_AXI_DMA_DATA_STREAM); | ||
33 | - object_initialize(&s->rx_control_dev, sizeof(s->rx_control_dev), | ||
34 | - TYPE_XILINX_AXI_DMA_CONTROL_STREAM); | ||
35 | - object_property_add_child(OBJECT(s), "axistream-connected-target", | ||
36 | - (Object *)&s->rx_data_dev, &error_abort); | ||
37 | - object_property_add_child(OBJECT(s), "axistream-control-connected-target", | ||
38 | - (Object *)&s->rx_control_dev, &error_abort); | ||
39 | + object_initialize_child(OBJECT(s), "axistream-connected-target", | ||
40 | + &s->rx_data_dev, sizeof(s->rx_data_dev), | ||
41 | + TYPE_XILINX_AXI_DMA_DATA_STREAM, &error_abort, | ||
42 | + NULL); | ||
43 | + object_initialize_child(OBJECT(s), "axistream-control-connected-target", | ||
44 | + &s->rx_control_dev, sizeof(s->rx_control_dev), | ||
45 | + TYPE_XILINX_AXI_DMA_CONTROL_STREAM, &error_abort, | ||
46 | + NULL); | ||
47 | |||
48 | sysbus_init_irq(sbd, &s->streams[0].irq); | ||
49 | sysbus_init_irq(sbd, &s->streams[1].irq); | ||
50 | -- | ||
51 | 2.20.1 | ||
52 | |||
53 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
2 | 1 | ||
3 | As explained in commit aff39be0ed97: | ||
4 | |||
5 | Both functions, object_initialize() and object_property_add_child() | ||
6 | increase the reference counter of the new object, so one of the | ||
7 | references has to be dropped afterwards to get the reference | ||
8 | counting right. Otherwise the child object will not be properly | ||
9 | cleaned up when the parent gets destroyed. | ||
10 | Thus let's use now object_initialize_child() instead to get the | ||
11 | reference counting here right. | ||
12 | |||
13 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
14 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
17 | Message-id: 20190823143249.8096-7-philmd@redhat.com | ||
18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
19 | --- | ||
20 | hw/net/xilinx_axienet.c | 17 ++++++++--------- | ||
21 | 1 file changed, 8 insertions(+), 9 deletions(-) | ||
22 | |||
23 | diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | ||
25 | --- a/hw/net/xilinx_axienet.c | ||
26 | +++ b/hw/net/xilinx_axienet.c | ||
27 | @@ -XXX,XX +XXX,XX @@ static void xilinx_enet_init(Object *obj) | ||
28 | XilinxAXIEnet *s = XILINX_AXI_ENET(obj); | ||
29 | SysBusDevice *sbd = SYS_BUS_DEVICE(obj); | ||
30 | |||
31 | - object_initialize(&s->rx_data_dev, sizeof(s->rx_data_dev), | ||
32 | - TYPE_XILINX_AXI_ENET_DATA_STREAM); | ||
33 | - object_initialize(&s->rx_control_dev, sizeof(s->rx_control_dev), | ||
34 | - TYPE_XILINX_AXI_ENET_CONTROL_STREAM); | ||
35 | - object_property_add_child(OBJECT(s), "axistream-connected-target", | ||
36 | - (Object *)&s->rx_data_dev, &error_abort); | ||
37 | - object_property_add_child(OBJECT(s), "axistream-control-connected-target", | ||
38 | - (Object *)&s->rx_control_dev, &error_abort); | ||
39 | - | ||
40 | + object_initialize_child(OBJECT(s), "axistream-connected-target", | ||
41 | + &s->rx_data_dev, sizeof(s->rx_data_dev), | ||
42 | + TYPE_XILINX_AXI_ENET_DATA_STREAM, &error_abort, | ||
43 | + NULL); | ||
44 | + object_initialize_child(OBJECT(s), "axistream-control-connected-target", | ||
45 | + &s->rx_control_dev, sizeof(s->rx_control_dev), | ||
46 | + TYPE_XILINX_AXI_ENET_CONTROL_STREAM, &error_abort, | ||
47 | + NULL); | ||
48 | sysbus_init_irq(sbd, &s->irq); | ||
49 | |||
50 | memory_region_init_io(&s->iomem, OBJECT(s), &enet_ops, s, "enet", 0x40000); | ||
51 | -- | ||
52 | 2.20.1 | ||
53 | |||
54 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Alex Bennée <alex.bennee@linaro.org> | ||
2 | 1 | ||
3 | Commit a5e0b3311 removed these in favour of querying machine | ||
4 | properties. Remove the extern declarations as well. | ||
5 | |||
6 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20190828165307.18321-6-alex.bennee@linaro.org | ||
10 | Cc: Like Xu <like.xu@linux.intel.com> | ||
11 | Message-Id: <20190711130546.18578-1-alex.bennee@linaro.org> | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | --- | ||
14 | include/sysemu/sysemu.h | 2 -- | ||
15 | 1 file changed, 2 deletions(-) | ||
16 | |||
17 | diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/include/sysemu/sysemu.h | ||
20 | +++ b/include/sysemu/sysemu.h | ||
21 | @@ -XXX,XX +XXX,XX @@ extern const char *keyboard_layout; | ||
22 | extern int win2k_install_hack; | ||
23 | extern int alt_grab; | ||
24 | extern int ctrl_grab; | ||
25 | -extern int smp_cpus; | ||
26 | -extern unsigned int max_cpus; | ||
27 | extern int cursor_hide; | ||
28 | extern int graphic_rotate; | ||
29 | extern int no_quit; | ||
30 | -- | ||
31 | 2.20.1 | ||
32 | |||
33 | diff view generated by jsdifflib |