... | ... | ||
---|---|---|---|
24 | - rewrite devend_memop | 24 | - rewrite devend_memop |
25 | - remove useless exec-all.h in concerned patch | 25 | - remove useless exec-all.h in concerned patch |
26 | - extract devend_big_endian function to reuse in system/memory.c | 26 | - extract devend_big_endian function to reuse in system/memory.c |
27 | - rewrite changes to system/memory.c | 27 | - rewrite changes to system/memory.c |
28 | 28 | ||
29 | Pierrick Bouvier (16): | 29 | v3: |
30 | - move devend functions to memory_internal.h | ||
31 | - completed description for commits removing cpu.h dependency | ||
32 | |||
33 | v4: | ||
34 | - rebase on top of master | ||
35 | * missing include in 'codebase: prepare to remove cpu.h from exec/exec-all.h' | ||
36 | * meson build conflict | ||
37 | |||
38 | v5: | ||
39 | - remove extra xen stub xen_invalidate_map_cache() | ||
40 | - edit xen stubs commit message | ||
41 | |||
42 | Pierrick Bouvier (17): | ||
30 | exec/tswap: target code can use TARGET_BIG_ENDIAN instead of | 43 | exec/tswap: target code can use TARGET_BIG_ENDIAN instead of |
31 | target_words_bigendian() | 44 | target_words_bigendian() |
32 | exec/tswap: implement {ld,st}.*_p as functions instead of macros | 45 | exec/tswap: implement {ld,st}.*_p as functions instead of macros |
33 | exec/memory_ldst: extract memory_ldst declarations from cpu-all.h | 46 | exec/memory_ldst: extract memory_ldst declarations from cpu-all.h |
34 | exec/memory_ldst_phys: extract memory_ldst_phys declarations from | 47 | exec/memory_ldst_phys: extract memory_ldst_phys declarations from |
... | ... | ||
42 | common code | 55 | common code |
43 | exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled | 56 | exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled |
44 | hw/xen: add stubs for various functions | 57 | hw/xen: add stubs for various functions |
45 | system/physmem: compilation unit is now common to all targets | 58 | system/physmem: compilation unit is now common to all targets |
46 | include/exec/memory: extract devend_big_endian from devend_memop | 59 | include/exec/memory: extract devend_big_endian from devend_memop |
60 | include/exec/memory: move devend functions to memory-internal.h | ||
47 | system/memory: make compilation unit common | 61 | system/memory: make compilation unit common |
48 | system/ioport: make compilation unit common | 62 | system/ioport: make compilation unit common |
49 | 63 | ||
50 | include/exec/cpu-all.h | 66 ----------------------- | 64 | include/exec/cpu-all.h | 66 ----------------------- |
51 | include/exec/exec-all.h | 1 - | 65 | include/exec/exec-all.h | 1 - |
52 | include/exec/memory-internal.h | 2 - | 66 | include/exec/memory-internal.h | 21 +++++++- |
53 | include/exec/memory.h | 34 +++++++----- | 67 | include/exec/memory.h | 30 ++++------- |
54 | include/exec/ram_addr.h | 11 ++-- | 68 | include/exec/ram_addr.h | 11 ++-- |
55 | include/exec/tswap.h | 81 +++++++++++++++++++++++++++-- | 69 | include/exec/tswap.h | 81 +++++++++++++++++++++++++++-- |
56 | include/system/kvm.h | 6 +-- | 70 | include/system/kvm.h | 6 +-- |
57 | include/tcg/tcg-op.h | 1 + | 71 | include/tcg/tcg-op.h | 1 + |
58 | target/ppc/helper_regs.h | 2 + | 72 | target/ppc/helper_regs.h | 2 + |
59 | include/exec/memory_ldst.h.inc | 4 -- | 73 | include/exec/memory_ldst.h.inc | 4 -- |
60 | include/exec/memory_ldst_phys.h.inc | 5 +- | 74 | include/exec/memory_ldst_phys.h.inc | 5 +- |
61 | cpu-target.c | 1 + | 75 | cpu-target.c | 1 + |
62 | hw/ppc/spapr_nested.c | 1 + | 76 | hw/ppc/spapr_nested.c | 1 + |
63 | hw/sh4/sh7750.c | 1 + | 77 | hw/sh4/sh7750.c | 1 + |
64 | hw/xen/xen_stubs.c | 56 ++++++++++++++++++++ | 78 | hw/xen/xen_stubs.c | 51 ++++++++++++++++++ |
65 | page-vary-target.c | 2 +- | 79 | page-vary-target.c | 2 +- |
66 | system/ioport.c | 1 - | 80 | system/ioport.c | 1 - |
67 | system/memory.c | 17 ++---- | 81 | system/memory.c | 17 ++---- |
82 | target/ppc/tcg-excp_helper.c | 1 + | ||
68 | target/riscv/bitmanip_helper.c | 2 +- | 83 | target/riscv/bitmanip_helper.c | 2 +- |
69 | hw/xen/meson.build | 3 ++ | 84 | hw/xen/meson.build | 3 ++ |
70 | system/meson.build | 6 +-- | 85 | system/meson.build | 6 +-- |
71 | 21 files changed, 184 insertions(+), 119 deletions(-) | 86 | 22 files changed, 188 insertions(+), 126 deletions(-) |
72 | create mode 100644 hw/xen/xen_stubs.c | 87 | create mode 100644 hw/xen/xen_stubs.c |
73 | 88 | ||
74 | -- | 89 | -- |
75 | 2.39.5 | 90 | 2.39.5 | diff view generated by jsdifflib |
1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
3 | --- | 3 | --- |
4 | include/exec/tswap.h | 11 ++++++----- | 4 | include/exec/tswap.h | 11 ++++++----- |
5 | cpu-target.c | 1 + | 5 | cpu-target.c | 1 + |
6 | 2 files changed, 7 insertions(+), 5 deletions(-) | 6 | 2 files changed, 7 insertions(+), 5 deletions(-) |
7 | 7 | ||
8 | diff --git a/include/exec/tswap.h b/include/exec/tswap.h | 8 | diff --git a/include/exec/tswap.h b/include/exec/tswap.h |
9 | index XXXXXXX..XXXXXXX 100644 | 9 | index XXXXXXX..XXXXXXX 100644 |
10 | --- a/include/exec/tswap.h | 10 | --- a/include/exec/tswap.h |
11 | +++ b/include/exec/tswap.h | 11 | +++ b/include/exec/tswap.h |
12 | @@ -XXX,XX +XXX,XX @@ | 12 | @@ -XXX,XX +XXX,XX @@ |
13 | /** | 13 | /** |
14 | * target_words_bigendian: | 14 | * target_words_bigendian: |
15 | * Returns true if the (default) endianness of the target is big endian, | 15 | * Returns true if the (default) endianness of the target is big endian, |
16 | - * false otherwise. Note that in target-specific code, you can use | 16 | - * false otherwise. Note that in target-specific code, you can use |
17 | - * TARGET_BIG_ENDIAN directly instead. On the other hand, common | 17 | - * TARGET_BIG_ENDIAN directly instead. On the other hand, common |
18 | - * code should normally never need to know about the endianness of the | 18 | - * code should normally never need to know about the endianness of the |
19 | - * target, so please do *not* use this function unless you know very well | 19 | - * target, so please do *not* use this function unless you know very well |
20 | - * what you are doing! | 20 | - * what you are doing! |
21 | + * false otherwise. Common code should normally never need to know about the | 21 | + * false otherwise. Common code should normally never need to know about the |
22 | + * endianness of the target, so please do *not* use this function unless you | 22 | + * endianness of the target, so please do *not* use this function unless you |
23 | + * know very well what you are doing! | 23 | + * know very well what you are doing! |
24 | */ | 24 | */ |
25 | bool target_words_bigendian(void); | 25 | bool target_words_bigendian(void); |
26 | +#ifdef COMPILING_PER_TARGET | 26 | +#ifdef COMPILING_PER_TARGET |
27 | +#define target_words_bigendian() TARGET_BIG_ENDIAN | 27 | +#define target_words_bigendian() TARGET_BIG_ENDIAN |
28 | +#endif | 28 | +#endif |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * If we're in target-specific code, we can hard-code the swapping | 31 | * If we're in target-specific code, we can hard-code the swapping |
32 | diff --git a/cpu-target.c b/cpu-target.c | 32 | diff --git a/cpu-target.c b/cpu-target.c |
33 | index XXXXXXX..XXXXXXX 100644 | 33 | index XXXXXXX..XXXXXXX 100644 |
34 | --- a/cpu-target.c | 34 | --- a/cpu-target.c |
35 | +++ b/cpu-target.c | 35 | +++ b/cpu-target.c |
36 | @@ -XXX,XX +XXX,XX @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) | 36 | @@ -XXX,XX +XXX,XX @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) |
37 | abort(); | 37 | abort(); |
38 | } | 38 | } |
39 | 39 | ||
40 | +#undef target_words_bigendian | 40 | +#undef target_words_bigendian |
41 | bool target_words_bigendian(void) | 41 | bool target_words_bigendian(void) |
42 | { | 42 | { |
43 | return TARGET_BIG_ENDIAN; | 43 | return TARGET_BIG_ENDIAN; |
44 | -- | 44 | -- |
45 | 2.39.5 | 45 | 2.39.5 | diff view generated by jsdifflib |
1 | Defining functions allows to use them from common code, by not depending | 1 | Defining functions allows to use them from common code, by not depending |
---|---|---|---|
2 | on TARGET_BIG_ENDIAN. | 2 | on TARGET_BIG_ENDIAN. |
3 | Remove previous macros from exec/cpu-all.h. | 3 | Remove previous macros from exec/cpu-all.h. |
4 | By moving them out of cpu-all.h, we'll be able to break dependency on | 4 | By moving them out of cpu-all.h, we'll be able to break dependency on |
5 | cpu.h for memory related functions coming in next commits. | 5 | cpu.h for memory related functions coming in next commits. |
6 | 6 | ||
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 8 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
8 | --- | 9 | --- |
9 | include/exec/cpu-all.h | 25 --------------- | 10 | include/exec/cpu-all.h | 25 --------------- |
10 | include/exec/tswap.h | 70 ++++++++++++++++++++++++++++++++++++++++++ | 11 | include/exec/tswap.h | 70 ++++++++++++++++++++++++++++++++++++++++++ |
11 | 2 files changed, 70 insertions(+), 25 deletions(-) | 12 | 2 files changed, 70 insertions(+), 25 deletions(-) |
... | ... | diff view generated by jsdifflib |
1 | They are now accessible through exec/memory.h instead, and we make sure | 1 | They are now accessible through exec/memory.h instead, and we make sure |
---|---|---|---|
2 | all variants are available for common or target dependent code. | 2 | all variants are available for common or target dependent code. |
3 | 3 | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 5 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
5 | --- | 6 | --- |
6 | include/exec/cpu-all.h | 12 ------------ | 7 | include/exec/cpu-all.h | 12 ------------ |
7 | include/exec/memory_ldst.h.inc | 4 ---- | 8 | include/exec/memory_ldst.h.inc | 4 ---- |
8 | 2 files changed, 16 deletions(-) | 9 | 2 files changed, 16 deletions(-) |
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
3 | 3 | ||
4 | Move stl_phys_notdirty function as well. | 4 | Move stl_phys_notdirty function as well. |
5 | Cached endianness agnostic version rely on st/ld*_p, which is available | 5 | Cached endianness agnostic version rely on st/ld*_p, which is available |
6 | through tswap.h. | 6 | through tswap.h. |
7 | 7 | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 9 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
9 | --- | 10 | --- |
10 | include/exec/cpu-all.h | 29 ----------------------------- | 11 | include/exec/cpu-all.h | 29 ----------------------------- |
11 | include/exec/memory.h | 10 ++++++++++ | 12 | include/exec/memory.h | 10 ++++++++++ |
12 | include/exec/memory_ldst_phys.h.inc | 5 +---- | 13 | include/exec/memory_ldst_phys.h.inc | 5 +---- |
... | ... | diff view generated by jsdifflib |
1 | Will allow to make system/memory.c common later. | 1 | Will allow to make system/memory.c common later. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
3 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 4 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
4 | --- | 5 | --- |
5 | include/exec/memory.h | 16 ++++------------ | 6 | include/exec/memory.h | 16 ++++------------ |
6 | 1 file changed, 4 insertions(+), 12 deletions(-) | 7 | 1 file changed, 4 insertions(+), 12 deletions(-) |
7 | 8 | ||
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
4 | include/tcg/tcg-op.h | 1 + | 4 | include/tcg/tcg-op.h | 1 + |
5 | target/ppc/helper_regs.h | 2 ++ | 5 | target/ppc/helper_regs.h | 2 ++ |
6 | hw/ppc/spapr_nested.c | 1 + | 6 | hw/ppc/spapr_nested.c | 1 + |
7 | hw/sh4/sh7750.c | 1 + | 7 | hw/sh4/sh7750.c | 1 + |
8 | page-vary-target.c | 2 +- | 8 | page-vary-target.c | 2 +- |
9 | target/ppc/tcg-excp_helper.c | 1 + | ||
9 | target/riscv/bitmanip_helper.c | 2 +- | 10 | target/riscv/bitmanip_helper.c | 2 +- |
10 | 6 files changed, 7 insertions(+), 2 deletions(-) | 11 | 7 files changed, 8 insertions(+), 2 deletions(-) |
11 | 12 | ||
12 | diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h | 13 | diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h |
13 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/include/tcg/tcg-op.h | 15 | --- a/include/tcg/tcg-op.h |
15 | +++ b/include/tcg/tcg-op.h | 16 | +++ b/include/tcg/tcg-op.h |
... | ... | ||
69 | -#include "exec/exec-all.h" | 70 | -#include "exec/exec-all.h" |
70 | +#include "exec/target_page.h" | 71 | +#include "exec/target_page.h" |
71 | 72 | ||
72 | bool set_preferred_target_page_bits(int bits) | 73 | bool set_preferred_target_page_bits(int bits) |
73 | { | 74 | { |
75 | diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c | ||
76 | index XXXXXXX..XXXXXXX 100644 | ||
77 | --- a/target/ppc/tcg-excp_helper.c | ||
78 | +++ b/target/ppc/tcg-excp_helper.c | ||
79 | @@ -XXX,XX +XXX,XX @@ | ||
80 | #include "qemu/osdep.h" | ||
81 | #include "qemu/main-loop.h" | ||
82 | #include "qemu/log.h" | ||
83 | +#include "target/ppc/cpu.h" | ||
84 | #include "exec/cpu_ldst.h" | ||
85 | #include "exec/exec-all.h" | ||
86 | #include "exec/helper-proto.h" | ||
74 | diff --git a/target/riscv/bitmanip_helper.c b/target/riscv/bitmanip_helper.c | 87 | diff --git a/target/riscv/bitmanip_helper.c b/target/riscv/bitmanip_helper.c |
75 | index XXXXXXX..XXXXXXX 100644 | 88 | index XXXXXXX..XXXXXXX 100644 |
76 | --- a/target/riscv/bitmanip_helper.c | 89 | --- a/target/riscv/bitmanip_helper.c |
77 | +++ b/target/riscv/bitmanip_helper.c | 90 | +++ b/target/riscv/bitmanip_helper.c |
78 | @@ -XXX,XX +XXX,XX @@ | 91 | @@ -XXX,XX +XXX,XX @@ |
... | ... | diff view generated by jsdifflib |
1 | Previous commit changed files relying transitively on it. | ||
---|---|---|---|
2 | |||
1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 4 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
3 | --- | 5 | --- |
4 | include/exec/exec-all.h | 1 - | 6 | include/exec/exec-all.h | 1 - |
5 | 1 file changed, 1 deletion(-) | 7 | 1 file changed, 1 deletion(-) |
... | ... | diff view generated by jsdifflib |
1 | Needed so compilation units including it can be common. | ||
---|---|---|---|
2 | |||
1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 4 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
3 | --- | 5 | --- |
4 | include/exec/memory-internal.h | 2 -- | 6 | include/exec/memory-internal.h | 2 -- |
5 | 1 file changed, 2 deletions(-) | 7 | 1 file changed, 2 deletions(-) |
... | ... | diff view generated by jsdifflib |
1 | Needed so compilation units including it can be common. | ||
---|---|---|---|
2 | |||
1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 4 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
3 | --- | 5 | --- |
4 | include/exec/ram_addr.h | 3 ++- | 6 | include/exec/ram_addr.h | 3 ++- |
5 | 1 file changed, 2 insertions(+), 1 deletion(-) | 7 | 1 file changed, 2 insertions(+), 1 deletion(-) |
... | ... | diff view generated by jsdifflib |
1 | This function is used by system/physmem.c will be turn into common code | 1 | This function is used by system/physmem.c will be turn into common code |
---|---|---|---|
2 | in next commit. | 2 | in next commit. |
3 | 3 | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 5 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
6 | --- | 6 | --- |
7 | include/system/kvm.h | 6 +++--- | 7 | include/system/kvm.h | 6 +++--- |
8 | 1 file changed, 3 insertions(+), 3 deletions(-) | 8 | 1 file changed, 3 insertions(+), 3 deletions(-) |
9 | 9 | ||
10 | diff --git a/include/system/kvm.h b/include/system/kvm.h | 10 | diff --git a/include/system/kvm.h b/include/system/kvm.h |
11 | index XXXXXXX..XXXXXXX 100644 | 11 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/include/system/kvm.h | 12 | --- a/include/system/kvm.h |
13 | +++ b/include/system/kvm.h | 13 | +++ b/include/system/kvm.h |
14 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_supports_user_irq(void); | 14 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_supports_user_irq(void); |
15 | int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr); | 15 | int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr); |
16 | int kvm_on_sigbus(int code, void *addr); | 16 | int kvm_on_sigbus(int code, void *addr); |
17 | 17 | ||
18 | -#ifdef COMPILING_PER_TARGET | 18 | -#ifdef COMPILING_PER_TARGET |
19 | -#include "cpu.h" | 19 | -#include "cpu.h" |
20 | - | 20 | - |
21 | void kvm_flush_coalesced_mmio_buffer(void); | 21 | void kvm_flush_coalesced_mmio_buffer(void); |
22 | 22 | ||
23 | +#ifdef COMPILING_PER_TARGET | 23 | +#ifdef COMPILING_PER_TARGET |
24 | +#include "cpu.h" | 24 | +#include "cpu.h" |
25 | + | 25 | + |
26 | /** | 26 | /** |
27 | * kvm_update_guest_debug(): ensure KVM debug structures updated | 27 | * kvm_update_guest_debug(): ensure KVM debug structures updated |
28 | * @cs: the CPUState for this cpu | 28 | * @cs: the CPUState for this cpu |
29 | -- | 29 | -- |
30 | 2.39.5 | 30 | 2.39.5 | diff view generated by jsdifflib |
1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
3 | --- | 3 | --- |
4 | include/exec/ram_addr.h | 8 ++++++-- | 4 | include/exec/ram_addr.h | 8 ++++++-- |
5 | 1 file changed, 6 insertions(+), 2 deletions(-) | 5 | 1 file changed, 6 insertions(+), 2 deletions(-) |
6 | 6 | ||
7 | diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h | 7 | diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h |
8 | index XXXXXXX..XXXXXXX 100644 | 8 | index XXXXXXX..XXXXXXX 100644 |
9 | --- a/include/exec/ram_addr.h | 9 | --- a/include/exec/ram_addr.h |
10 | +++ b/include/exec/ram_addr.h | 10 | +++ b/include/exec/ram_addr.h |
11 | @@ -XXX,XX +XXX,XX @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, | 11 | @@ -XXX,XX +XXX,XX @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, |
12 | } | 12 | } |
13 | } | 13 | } |
14 | 14 | ||
15 | - xen_hvm_modified_memory(start, length); | 15 | - xen_hvm_modified_memory(start, length); |
16 | + if (xen_enabled()) { | 16 | + if (xen_enabled()) { |
17 | + xen_hvm_modified_memory(start, length); | 17 | + xen_hvm_modified_memory(start, length); |
18 | + } | 18 | + } |
19 | } | 19 | } |
20 | 20 | ||
21 | #if !defined(_WIN32) | 21 | #if !defined(_WIN32) |
22 | @@ -XXX,XX +XXX,XX @@ uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, | 22 | @@ -XXX,XX +XXX,XX @@ uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, |
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | - xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); | 26 | - xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); |
27 | + if (xen_enabled()) { | 27 | + if (xen_enabled()) { |
28 | + xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); | 28 | + xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); |
29 | + } | 29 | + } |
30 | } else { | 30 | } else { |
31 | uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE; | 31 | uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE; |
32 | 32 | ||
33 | -- | 33 | -- |
34 | 2.39.5 | 34 | 2.39.5 | diff view generated by jsdifflib |
1 | Those functions are used by system/physmem.c, and are called only if | 1 | Those symbols are used by system/physmem.c, and are called only if |
---|---|---|---|
2 | xen is enabled (which happens only if CONFIG_XEN is not set). | 2 | xen_enabled() (which happens only if CONFIG_XEN is set and xen is |
3 | available). | ||
3 | 4 | ||
4 | So we can crash in case those are called. | 5 | So we can crash the stubs in case those are called, as they are linked |
6 | only when CONFIG_XEN is not set. | ||
5 | 7 | ||
6 | Acked-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Acked-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Acked-by: Anthony PERARD <anthony.perard@vates.tech> | ||
7 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 10 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
8 | --- | 11 | --- |
9 | hw/xen/xen_stubs.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ | 12 | hw/xen/xen_stubs.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ |
10 | hw/xen/meson.build | 3 +++ | 13 | hw/xen/meson.build | 3 +++ |
11 | 2 files changed, 59 insertions(+) | 14 | 2 files changed, 54 insertions(+) |
12 | create mode 100644 hw/xen/xen_stubs.c | 15 | create mode 100644 hw/xen/xen_stubs.c |
13 | 16 | ||
14 | diff --git a/hw/xen/xen_stubs.c b/hw/xen/xen_stubs.c | 17 | diff --git a/hw/xen/xen_stubs.c b/hw/xen/xen_stubs.c |
15 | new file mode 100644 | 18 | new file mode 100644 |
16 | index XXXXXXX..XXXXXXX | 19 | index XXXXXXX..XXXXXXX |
... | ... | ||
51 | +void xen_invalidate_map_cache_entry(uint8_t *buffer) | 54 | +void xen_invalidate_map_cache_entry(uint8_t *buffer) |
52 | +{ | 55 | +{ |
53 | + g_assert_not_reached(); | 56 | + g_assert_not_reached(); |
54 | +} | 57 | +} |
55 | + | 58 | + |
56 | +void xen_invalidate_map_cache(void) | ||
57 | +{ | ||
58 | + g_assert_not_reached(); | ||
59 | +} | ||
60 | + | ||
61 | +ram_addr_t xen_ram_addr_from_mapcache(void *ptr) | 59 | +ram_addr_t xen_ram_addr_from_mapcache(void *ptr) |
62 | +{ | 60 | +{ |
63 | + g_assert_not_reached(); | 61 | + g_assert_not_reached(); |
64 | +} | 62 | +} |
65 | + | 63 | + |
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
7 | diff --git a/system/meson.build b/system/meson.build | 7 | diff --git a/system/meson.build b/system/meson.build |
8 | index XXXXXXX..XXXXXXX 100644 | 8 | index XXXXXXX..XXXXXXX 100644 |
9 | --- a/system/meson.build | 9 | --- a/system/meson.build |
10 | +++ b/system/meson.build | 10 | +++ b/system/meson.build |
11 | @@ -XXX,XX +XXX,XX @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( | 11 | @@ -XXX,XX +XXX,XX @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( |
12 | 'arch_init.c', | ||
13 | 'ioport.c', | 12 | 'ioport.c', |
13 | 'globals-target.c', | ||
14 | 'memory.c', | 14 | 'memory.c', |
15 | - 'physmem.c', | 15 | - 'physmem.c', |
16 | )]) | 16 | )]) |
17 | 17 | ||
18 | system_ss.add(files( | 18 | system_ss.add(files( |
... | ... | diff view generated by jsdifflib |
1 | we'll use it in system/memory.c. | 1 | we'll use it in system/memory.c. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
3 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 4 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
4 | --- | 5 | --- |
5 | include/exec/memory.h | 18 ++++++++++++------ | 6 | include/exec/memory.h | 18 ++++++++++++------ |
6 | 1 file changed, 12 insertions(+), 6 deletions(-) | 7 | 1 file changed, 12 insertions(+), 6 deletions(-) |
7 | 8 | ||
... | ... | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Only system/physmem.c and system/memory.c use those functions, so we can | ||
2 | move then to internal header. | ||
1 | 3 | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | ||
6 | --- | ||
7 | include/exec/memory-internal.h | 19 +++++++++++++++++++ | ||
8 | include/exec/memory.h | 18 ------------------ | ||
9 | 2 files changed, 19 insertions(+), 18 deletions(-) | ||
10 | |||
11 | diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/include/exec/memory-internal.h | ||
14 | +++ b/include/exec/memory-internal.h | ||
15 | @@ -XXX,XX +XXX,XX @@ void address_space_dispatch_free(AddressSpaceDispatch *d); | ||
16 | |||
17 | void mtree_print_dispatch(struct AddressSpaceDispatch *d, | ||
18 | MemoryRegion *root); | ||
19 | + | ||
20 | +/* returns true if end is big endian. */ | ||
21 | +static inline bool devend_big_endian(enum device_endian end) | ||
22 | +{ | ||
23 | + QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN && | ||
24 | + DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN); | ||
25 | + | ||
26 | + if (end == DEVICE_NATIVE_ENDIAN) { | ||
27 | + return target_words_bigendian(); | ||
28 | + } | ||
29 | + return end == DEVICE_BIG_ENDIAN; | ||
30 | +} | ||
31 | + | ||
32 | +/* enum device_endian to MemOp. */ | ||
33 | +static inline MemOp devend_memop(enum device_endian end) | ||
34 | +{ | ||
35 | + return devend_big_endian(end) ? MO_BE : MO_LE; | ||
36 | +} | ||
37 | + | ||
38 | #endif | ||
39 | #endif | ||
40 | diff --git a/include/exec/memory.h b/include/exec/memory.h | ||
41 | index XXXXXXX..XXXXXXX 100644 | ||
42 | --- a/include/exec/memory.h | ||
43 | +++ b/include/exec/memory.h | ||
44 | @@ -XXX,XX +XXX,XX @@ address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, | ||
45 | MemTxResult address_space_set(AddressSpace *as, hwaddr addr, | ||
46 | uint8_t c, hwaddr len, MemTxAttrs attrs); | ||
47 | |||
48 | -/* returns true if end is big endian. */ | ||
49 | -static inline bool devend_big_endian(enum device_endian end) | ||
50 | -{ | ||
51 | - QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN && | ||
52 | - DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN); | ||
53 | - | ||
54 | - if (end == DEVICE_NATIVE_ENDIAN) { | ||
55 | - return target_words_bigendian(); | ||
56 | - } | ||
57 | - return end == DEVICE_BIG_ENDIAN; | ||
58 | -} | ||
59 | - | ||
60 | -/* enum device_endian to MemOp. */ | ||
61 | -static inline MemOp devend_memop(enum device_endian end) | ||
62 | -{ | ||
63 | - return devend_big_endian(end) ? MO_BE : MO_LE; | ||
64 | -} | ||
65 | - | ||
66 | /* | ||
67 | * Inhibit technologies that require discarding of pages in RAM blocks, e.g., | ||
68 | * to manage the actual amount of memory consumed by the VM (then, the memory | ||
69 | -- | ||
70 | 2.39.5 | diff view generated by jsdifflib |
1 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
---|---|---|---|
1 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> | 2 | Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> |
2 | --- | 3 | --- |
3 | system/memory.c | 17 +++++------------ | 4 | system/memory.c | 17 +++++------------ |
4 | system/meson.build | 2 +- | 5 | system/meson.build | 2 +- |
5 | 2 files changed, 6 insertions(+), 13 deletions(-) | 6 | 2 files changed, 6 insertions(+), 13 deletions(-) |
... | ... | ||
55 | for (i = 0; i < mr->ioeventfd_nb; ++i) { | 56 | for (i = 0; i < mr->ioeventfd_nb; ++i) { |
56 | diff --git a/system/meson.build b/system/meson.build | 57 | diff --git a/system/meson.build b/system/meson.build |
57 | index XXXXXXX..XXXXXXX 100644 | 58 | index XXXXXXX..XXXXXXX 100644 |
58 | --- a/system/meson.build | 59 | --- a/system/meson.build |
59 | +++ b/system/meson.build | 60 | +++ b/system/meson.build |
60 | @@ -XXX,XX +XXX,XX @@ | 61 | @@ -XXX,XX +XXX,XX @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( |
61 | specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( | ||
62 | 'arch_init.c', | 62 | 'arch_init.c', |
63 | 'ioport.c', | 63 | 'ioport.c', |
64 | 'globals-target.c', | ||
64 | - 'memory.c', | 65 | - 'memory.c', |
65 | )]) | 66 | )]) |
66 | 67 | ||
67 | system_ss.add(files( | 68 | system_ss.add(files( |
68 | @@ -XXX,XX +XXX,XX @@ system_ss.add(files( | 69 | @@ -XXX,XX +XXX,XX @@ system_ss.add(files( |
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
23 | +++ b/system/meson.build | 23 | +++ b/system/meson.build |
24 | @@ -XXX,XX +XXX,XX @@ | 24 | @@ -XXX,XX +XXX,XX @@ |
25 | specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( | 25 | specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( |
26 | 'arch_init.c', | 26 | 'arch_init.c', |
27 | - 'ioport.c', | 27 | - 'ioport.c', |
28 | 'globals-target.c', | ||
28 | )]) | 29 | )]) |
29 | 30 | ||
30 | system_ss.add(files( | ||
31 | @@ -XXX,XX +XXX,XX @@ system_ss.add(files( | 31 | @@ -XXX,XX +XXX,XX @@ system_ss.add(files( |
32 | 'dirtylimit.c', | 32 | 'dirtylimit.c', |
33 | 'dma-helpers.c', | 33 | 'dma-helpers.c', |
34 | 'globals.c', | 34 | 'globals.c', |
35 | + 'ioport.c', | 35 | + 'ioport.c', |
36 | 'memory_mapping.c', | 36 | 'memory_mapping.c', |
37 | 'memory.c', | 37 | 'memory.c', |
38 | 'physmem.c', | 38 | 'physmem.c', |
39 | -- | 39 | -- |
40 | 2.39.5 | 40 | 2.39.5 | diff view generated by jsdifflib |