Since the downstream port is not checked, two slots can be linked to
a single port. However, this can prevent the driver from detecting the
device properly.
It is necessary to ensure that a downstream port is not linked more than
once.
Links:
https://lore.kernel.org/qemu-devel/oszpr01mb6453bc61d
This is the semantic patch from commit 7b3e371526 "cxl/mailbox: make
range overlap check more readable"
Signed-off-by: Yao Xingtao
---
scripts/coccinelle/range.cocci | 49 ++
1 file changed, 49 insertions(+)
create mode 100644 scripts/coccinelle/range.cocci
diff
Since the downstream port is not checked, two slots can be linked to
a single port. However, this can prevent the driver from detecting the
device properly.
It is necessary to ensure that a downstream port is not linked more than
once.
Links:
https://lore.kernel.org/qemu-devel/oszpr01mb6453bc61d
The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast
the pointer of this type to uint64_t* is useless.
Signed-off-by: Yao Xingtao
---
hw/mips/loongson3_virt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_vi
Currently the pattern in scripts/coccinelle/typecast.cocci is used to
remove the useless type cast.
Use the following command to find out the use cases and remove the
useless type case:
$ spatch --macro-file scripts/cocci-macro-file.h \
--sp-file ./scripts/coccinelle/typecast.cocci \
The type of req->cmd is NvmeCmd, cast the pointer of this type to
NvmeCmd* is useless.
Signed-off-by: Yao Xingtao
---
hw/nvme/ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 5b1b0cabcfc3..221818f551cd 100644
--- a/hw/nvme/ctrl.c
++
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
hw/ssi/aspeed_smc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 49205ab76d38..cdca359e1
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
dump/dump.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dump/dump.c b/dump/dump.c
index 84064d890d2c..45e84428aea5 100644
---
use range_overlaps_range() instead of open-coding the overlap check to
improve the readability of the code.
Signed-off-by: Yao Xingtao
---
block/qcow2-cluster.c | 23 +--
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-clust
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
crypto/block-luks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 5b777c15d3cd..45347adeeb7
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
system/memory_mapping.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/system/memory_mapping.c b/system/memory_mapping.c
index 6f884c5b90c
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
hw/display/sm501.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 26dc8170d89b..c25
use range_overlaps_range() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
block/vhdx.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/block/vhdx.c b/block/vhdx.c
index 5aa1a1350626..c31661b946b6 10
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
target/sparc/ldst_helper.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index 2
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
tests/qtest/fuzz/generic_fuzz.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fu
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
hw/cxl/cxl-mailbox-utils.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
inde
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
hw/arm/boot.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index d480a7da02cf..a004a90e87be 100644
--- a/
use ranges_overlap() instead of open-coding the overlap check to improve
the readability of the code.
Signed-off-by: Yao Xingtao
---
hw/core/loader.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 31593a117171..dac0df561b16 100644
Just like range_overlaps_range(), use the returned bool value
to check whether 2 given ranges overlap.
Signed-off-by: Yao Xingtao
---
include/qemu/range.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/qemu/range.h b/include/qemu/range.h
index 4ce694a39831..d446a
Currently, some components still open-coding the range overlap check.
Sometimes this check may be fail because some patterns are missed.
To avoid the above problems and improve the readability of the code,
it is better to use the ranges_overlap() to do this check.
Yao Xingtao (13):
range: Make
When injecting a new poisoned region through qmp_cxl_inject_poison(),
the newly injected region should not overlap with existing poisoned
regions.
The current validation method does not consider the following
overlapping region:
+---+---+---+
| a | b(a) | a |
+---+---+---+
(a is a newly
When injecting a new poisoned region through qmp_cxl_inject_poison(),
the newly injected region should not overlap with existing poisoned
regions.
The current validation method does not consider the following
overlapping region:
┌───┬───┬───┐
│a │ b(a) │a │
└───┴───┴───┘
(a is a newly a
Since the downstream port is not checked, two slots can be linked to
a single port. However, this can prevent the driver from detecting the
device properly.
It is necessary to ensure that a downstream port is not linked more than
once.
Links:
https://lore.kernel.org/qemu-devel/oszpr01mb6453bc61d
Since the downstream port is not checked, two slots can be linked to
a single port. However, this can prevent the driver from detecting the
device properly.
It is necessary to ensure that a downstream port is not linked more than
once.
Links:
https://lore.kernel.org/qemu-devel/oszpr01mb6453bc61d
Since the kernel does not check the interleave capability, a
3-way, 6-way, 12-way or 16-way region can be create normally.
Applications can access the memory of 16-way region normally because
qemu can convert hpa to dpa correctly for the power of 2 interleave
ways, after kernel implementing the ch
Since the kernel does not check the interleave capability, a
3-way, 6-way, 12-way or 16-way region can be create normally.
Applications can access the memory of 16-way region normally because
qemu can convert hpa to dpa correctly for the power of 2 interleave
ways, after kernel implementing the ch
In 3, 6, 12 interleave ways, we could not access cxl memory properly,
and when the process is running on it, a 'segmentation fault' error will
occur.
According to the CXL specification '8.2.4.20.13 Decoder Protection',
there are two branches to convert HPA to DPA:
b1: Decoder[m].IW < 8 (for 1, 2,
1. The g_pattern_match_string() is deprecated when glib2 version >= 2.70.
Use g_pattern_spec_match_string() instead to avoid this problem.
2. The type of second parameter in g_ptr_array_add() is
'gpointer' {aka 'void *'}, but the type of reg->name is 'const char*'.
Cast the type of reg->n
1. The g_pattern_match_string() is deprecated when glib2 version >= 2.70.
Use g_pattern_spec_match_string() instead to avoid this problem.
2. The type of second parameter in g_ptr_array_add() is
'gpointer' {aka 'void *'}, but the type of reg->name is 'const char*'.
Cast the type of reg->n
1. The g_pattern_match_string() is deprecated when glib2 version >= 2.70.
Use g_pattern_spec_match_string() instead to avoid this problem.
2. The type of second parameter in g_ptr_array_add() is
'gpointer' {aka 'void *'}, but the type of reg->name is 'const char*'.
Cast the type of reg->n
30 matches
Mail list logo