[PATCH] aspeed/sdmc: Check RAM size value at realize time

2024-06-24 Thread Cédric Le Goater
The RAM size of the SDMC device is validated for the SoC and set when the Aspeed machines are initialized and then later used by several SoC implementations. However, the SDMC model never checks that the RAM size has been actually set before being used. Do that at realize. Signed-off-by: Cédric Le

Re: [PATCH] aspeed: Deprecate the tacoma-bmc machine

2024-06-24 Thread Philippe Mathieu-Daudé
On 25/6/24 08:09, Cédric Le Goater wrote: The tacoma-bmc machine was a board including an AST2600 SoC based BMC and a witherspoon like OpenPOWER system. It was used for bring up of the AST2600 SoC in labs. It can be easily replaced by the rainier-bmc machine which is part of a real product offeri

RE: [PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread Jamin Lin
Hi Cedric, > -Original Message- > From: Cédric Le Goater > Sent: Tuesday, June 25, 2024 2:38 PM > To: Jamin Lin ; cmd > ; Peter Maydell > ; Steven Lee ; Troy > Lee ; Andrew Jeffery ; > Joel Stanley ; open list:ASPEED BMCs > ; open list:All patches CC here > > Cc: Cédric Le Goater > Subj

Re: [PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread Cédric Le Goater
On 6/25/24 8:15 AM, Jamin Lin wrote: Hi cmd, Cedric and Peter, -Original Message- From: cmd Sent: Tuesday, June 25, 2024 2:07 PM To: Cédric Le Goater ; Jamin Lin ; Peter Maydell ; Steven Lee ; Troy Lee ; Andrew Jeffery ; Joel Stanley ; open list:ASPEED BMCs ; open list:All patches CC h

Re: [PATCH v1] memory tier: consolidate the initialization of memory tiers

2024-06-24 Thread horen . chuang
June 21, 2024 at 6:34 PM, "Andrew Morton" wrote: Hi Andrew, Thanks for the feedback. I will send a v2 with the patch description written in a cover letter. > > On Fri, 21 Jun 2024 04:48:30 + "Ho-Ren (Jack) Chuang" > wrote: > > > > > If we simply move the set_node_memory_tier() from mem

Re: [PATCH 1/1] include/qemu: Provide a C++ compatible version of typeof_strip_qual

2024-06-24 Thread Philippe Mathieu-Daudé
On 25/6/24 08:05, Paolo Bonzini wrote: Il mar 25 giu 2024, 04:32 Roman Kiryanov > ha scritto: Hi Philippe, thank you for looking. On Mon, Jun 24, 2024 at 7:27 PM Philippe Mathieu-Daudé mailto:phi...@linaro.org>> wrote: > In particular this patch seems

RE: [PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread Jamin Lin
Hi cmd, Cedric and Peter, > -Original Message- > From: cmd > Sent: Tuesday, June 25, 2024 2:07 PM > To: Cédric Le Goater ; Jamin Lin ; > Peter Maydell ; Steven Lee > ; Troy Lee ; Andrew > Jeffery ; Joel Stanley ; open > list:ASPEED BMCs ; open list:All patches CC here > > Cc: Cédric Le G

Re: [PATCH 02/11] hw/sd/sdcard: Convert SWITCH_FUNCTION to generic_read_byte (CMD6)

2024-06-24 Thread Philippe Mathieu-Daudé
On 25/6/24 08:10, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 89006ba1b6..0011aa86da 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1220,10 +1220,

[PATCH 01/11] hw/sd/sdcard: Introduce sd_cmd_to_sendingdata and sd_generic_read_byte

2024-06-24 Thread Philippe Mathieu-Daudé
All commands switching from TRANSFER state to (sending)DATA do the same: send stream of data on the DAT lines. Instead of duplicating the same code many times, introduce 2 helpers: - sd_cmd_to_sendingdata() on the I/O line setup the data to be transferred, - sd_generic_read_byte() on the DAT line

[PATCH 09/11] hw/sd/sdcard: Convert SD_STATUS to generic_read_byte (ACMD13)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index bf78f06b5c..2f00184bb3 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1681,10 +1681,9 @@ static sd_rsp_type_t sd_app_command(SDStat

[PATCH 10/11] hw/sd/sdcard: Convert SEND_NUM_WR_BLOCKS to generic_read_byte (ACMD22)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 2f00184bb3..023fcc63ac 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1693,11 +1693,9 @@ static sd_rsp_type_t sd_app_command(SDSta

[PATCH 06/11] hw/sd/sdcard: Convert SEND_TUNING_BLOCK to generic_read_byte (CMD19)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 48 +++- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 6af7b3f034..3d341495e9 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -562,6 +562,21 @@ static voi

[PATCH 04/11] hw/sd/sdcard: Duplicate READ_SINGLE_BLOCK / READ_MULTIPLE_BLOCK cases

2024-06-24 Thread Philippe Mathieu-Daudé
In order to modify the READ_SINGLE_BLOCK case in the next commit, duplicate it first. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 346bd657a7..9aaa78a334 100644 --- a/hw/sd/sd.c +++ b/hw

[PATCH 11/11] hw/sd/sdcard: Convert SEND_SCR to generic_read_byte (ACMD51)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 023fcc63ac..af3a46373f 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1763,10 +1763,7 @@ static sd_rsp_type_t sd_app_command(SDState

[PATCH 08/11] hw/sd/sdcard: Convert GEN_CMD to generic_read_byte (CMD56)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 6e6b37bd2d..bf78f06b5c 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1626,10 +1626,12 @@ static sd_rsp_type_t sd_normal_comman

[PATCH 07/11] hw/sd/sdcard: Convert SEND_WRITE_PROT to generic_read_byte (CMD30)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 3d341495e9..6e6b37bd2d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1180,6 +1180,7 @@ static sd_rsp_type_t sd_normal_command(SD

[PATCH 03/11] hw/sd/sdcard: Convert SEND_CSD/SEND_CID to generic_read_byte (CMD9 & 10)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 0011aa86da..346bd657a7 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1290,11 +1290,8 @@ static sd_rsp_type_t sd_normal_co

[PATCH 05/11] hw/sd/sdcard: Convert READ_SINGLE_BLOCK to generic_read_byte (CMD17)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 9aaa78a334..6af7b3f034 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1383,11 +1383,8 @@ static sd_rsp_type_t sd_normal_command(

[PATCH 02/11] hw/sd/sdcard: Convert SWITCH_FUNCTION to generic_read_byte (CMD6)

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 89006ba1b6..0011aa86da 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1220,10 +1220,7 @@ static sd_rsp_type_t sd_normal_command(SDState

[PATCH 00/11] hw/sd/sd: Introduce sd_cmd_to_sendingdata() and sd_generic_read_byte()

2024-06-24 Thread Philippe Mathieu-Daudé
Consolitate reading bytes on the DAT lines by introducing a pair of helpers to reuse in all commands sending data. Based-on: <20240625055354.23273-1-phi...@linaro.org> Philippe Mathieu-Daudé (11): hw/sd/sdcard: Introduce sd_cmd_to_sendingdata and sd_generic_read_byte hw/sd/sdcard: Convert SWI

[PATCH] aspeed: Deprecate the tacoma-bmc machine

2024-06-24 Thread Cédric Le Goater
The tacoma-bmc machine was a board including an AST2600 SoC based BMC and a witherspoon like OpenPOWER system. It was used for bring up of the AST2600 SoC in labs. It can be easily replaced by the rainier-bmc machine which is part of a real product offering. Signed-off-by: Cédric Le Goater --- d

Re: [PATCH 1/1] include/qemu: Provide a C++ compatible version of typeof_strip_qual

2024-06-24 Thread Thomas Huth
On 25/06/2024 04.32, Roman Kiryanov wrote: Hi Philippe, thank you for looking. On Mon, Jun 24, 2024 at 7:27 PM Philippe Mathieu-Daudé wrote: In particular this patch seems contained well enough to be carried in forks were C++ _is_ used. Will you agree to take #ifdef __cplusplus and #error t

Re: [PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread cmd
On 25/06/2024 08:03, Cédric Le Goater wrote: On 6/25/24 8:00 AM, cmd wrote: Hi On 25/06/2024 03:50, Jamin Lin via wrote: Coverity reports a possible DIVIDE_BY_ZERO issue regarding the "ram_size" object property. This can not happen because RAM has predefined valid sizes per SoC. Nevertheless

Re: [PATCH v1 1/2] aspeed/soc: fix coverity issue

2024-06-24 Thread Cédric Le Goater
Hello On 6/25/24 3:55 AM, Jamin Lin wrote: Hi Cedric, -Original Message- From: Cédric Le Goater Sent: Monday, June 24, 2024 9:58 PM To: Peter Maydell ; Jamin Lin Cc: Steven Lee ; Troy Lee ; Andrew Jeffery ; Joel Stanley ; open list:ASPEED BMCs ; open list:All patches CC here ; Troy Le

Re: [PATCH 1/1] include/qemu: Provide a C++ compatible version of typeof_strip_qual

2024-06-24 Thread Paolo Bonzini
Il mar 25 giu 2024, 04:32 Roman Kiryanov ha scritto: > Hi Philippe, thank you for looking. > > On Mon, Jun 24, 2024 at 7:27 PM Philippe Mathieu-Daudé > wrote: > > In particular this patch seems contained well enough > > to be carried in forks were C++ _is_ used. > > Will you agree to take #ifdef

Re: [PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread Cédric Le Goater
On 6/25/24 8:00 AM, cmd wrote: Hi On 25/06/2024 03:50, Jamin Lin via wrote: Coverity reports a possible DIVIDE_BY_ZERO issue regarding the "ram_size" object property. This can not happen because RAM has predefined valid sizes per SoC. Nevertheless, add a test to close the issue. Fixes: Coverit

Re: [PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread cmd
Hi On 25/06/2024 03:50, Jamin Lin via wrote: Coverity reports a possible DIVIDE_BY_ZERO issue regarding the "ram_size" object property. This can not happen because RAM has predefined valid sizes per SoC. Nevertheless, add a test to close the issue. Fixes: Coverity CID 1547113 Signed-off-by: Jam

[PATCH v2 10/12] hw/sd/sdcard: Simplify sd_inactive_state handling

2024-06-24 Thread Philippe Mathieu-Daudé
Card entering sd_inactive_state powers off, and won't respond anymore. Handle that once when entering sd_do_command(). Remove condition always true in sd_cmd_GO_IDLE_STATE(). Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-)

[PATCH v2 09/12] hw/sd/sdcard: Assign SDCardStates enum values

2024-06-24 Thread Philippe Mathieu-Daudé
SDCardStates enum values are specified, so assign them correspondingly. It will be useful later when we add states from later specs, which might not be continuous. See CURRENT_STATE bits in section 4.10.1 "Card Status". Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 20 ++---

[PATCH v2 08/12] hw/sd/sdcard: Use READY_FOR_DATA definition instead of magic value

2024-06-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 0742ba8b38..8816bd6671 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -557,7 +557,7 @@ FIELD(CSR, OUT_OF_RANGE, 31, 1) static void

[PATCH v2 06/12] hw/sd/sdcard: Send WRITE_PROT bits MSB first (CMD30)

2024-06-24 Thread Philippe Mathieu-Daudé
Per sections 3.6.1 (SD Bus Protocol) and 7.3.2 (Responses): In the CMD line the Most Significant Bit is transmitted first. Use the stl_be_p() helper to store the value in big-endian. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- RFC because I'm surprised this has been

[PATCH v2 04/12] hw/sd/sdcard: Trace block offset in READ/WRITE data accesses

2024-06-24 Thread Philippe Mathieu-Daudé
Useful to detect out of bound accesses. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 4 ++-- hw/sd/trace-events | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 14bfcc5d6b..e4587a0a37 100644 ---

[PATCH v2 12/12] hw/sd/sdcard: Add direct reference to SDProto in SDState

2024-06-24 Thread Philippe Mathieu-Daudé
Keep direct reference to SDProto in SDState, remove then unnecessary sd_proto(). Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 3b885ba8a0..6685fba4bb 1

[PATCH v2 07/12] hw/sd/sdcard: Send NUM_WR_BLOCKS bits MSB first (ACMD22)

2024-06-24 Thread Philippe Mathieu-Daudé
Per sections 3.6.1 (SD Bus Protocol), 4.3.4 "Data Write" and 7.3.2 (Responses): In the CMD line the Most Significant Bit is transmitted first. Use the stl_be_p() helper to store the value in big-endian. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- RFC because I'm sur

[PATCH v2 01/12] tests/qtest: Disable npcm7xx_sdhci tests using hardcoded RCA

2024-06-24 Thread Philippe Mathieu-Daudé
Disable tests using 0x4567 hardcoded RCA otherwise when using random RCA we get: ERROR:../../tests/qtest/npcm7xx_sdhci-test.c:69:write_sdread: assertion failed: (ret == len) not ok /arm/npcm7xx_sdhci/read_sd - ERROR:../../tests/qtest/npcm7xx_sdhci-test.c:69:write_sdread: assertion failed: (

[PATCH v2 11/12] hw/sd/sdcard: Restrict SWITCH_FUNCTION to sd_transfer_state (CMD6)

2024-06-24 Thread Philippe Mathieu-Daudé
SWITCH_FUNCTION is only allowed in TRANSFER state (See 4.8 "Card State Transition Table). Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index fce99d655d..3b885ba8a0 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@

[PATCH v2 03/12] hw/sd/sdcard: Track last command used to help logging

2024-06-24 Thread Philippe Mathieu-Daudé
The command is selected on the I/O lines, and further processing might be done on the DAT lines via the sd_read_byte() and sd_write_byte() handlers. Since these methods can't distinct between normal and APP commands, keep the name of the current command in the SDState and use it in the DAT handlers

[PATCH v2 02/12] hw/sd/sdcard: Generate random RCA value

2024-06-24 Thread Philippe Mathieu-Daudé
Rather than using the obscure 0x4567 magic value, use a real random one. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a48010cfc1..ec58c5e2a6 100644 --- a

[PATCH v2 05/12] hw/sd/sdcard: Do not store vendor data on block drive (CMD56)

2024-06-24 Thread Philippe Mathieu-Daudé
"General command" (GEN_CMD, CMD56) is described as: GEN_CMD is the same as the single block read or write commands (CMD24 or CMD17). The difference is that [...] the data block is not a memory payload data but has a vendor specific format and meaning. Thus this block must not be stored ov

[PATCH v2 00/12] hw/sd/sdcard: Accumulation of cleanups and fixes

2024-06-24 Thread Philippe Mathieu-Daudé
Since v1: - various patches merged, few more added Various SD card cleanups and fixes accumulated over the years. Various have been useful to help integrating eMMC support (which will come later). Philippe Mathieu-Daudé (12): tests/qtest: Disable npcm7xx_sdhci tests using hardcoded RCA hw/sd/

[PATCH 07/13] target/arm: Convert BFDOT to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 2 ++ target/arm/tcg/translate-a64.c | 20 +--- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 8a0251f83c..6819fd2587 100644 --- a/ta

[PATCH 06/13] target/arm: Convert SUDOT, USDOT to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 3 +++ target/arm/tcg/translate-a64.c | 35 -- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 7411d4ba97..8a0251f83c

Re: [PATCH V13 1/8] accel/kvm: Extract common KVM vCPU {creation,parking} code

2024-06-24 Thread Harsh Prateek Bora
+qemu-devel, qemu-ppc Ping! On 6/17/24 15:18, Harsh Prateek Bora wrote: + MST, Igor - to help with early review/merge. TIA. On 6/14/24 16:06, Salil Mehta wrote: Hello   From: Harsh Prateek Bora   Sent: Friday, June 14, 2024 6:24 AM   Hi Paolo, Nick,   Can this patch 1/8 be merged earlier

[PATCH 12/13] target/arm: Convert FCMLA to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 5 + target/arm/tcg/translate-a64.c | 241 ++--- 2 files changed, 76 insertions(+), 170 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f330919851..4b2a6ba302

[PATCH 05/13] target/arm: Convert SDOT, UDOT to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 7 + target/arm/tcg/translate-a64.c | 54 ++ 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 613cc9365c..7411d4ba

[PATCH 04/13] target/arm: Convert SQRDMLAH, SQRDMLSH to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/helper.h| 10 ++ target/arm/tcg/a64.decode | 16 +++ target/arm/tcg/translate-a64.c | 206 + target/arm/tcg/vec_helper.c| 72 4 files changed, 180 insertions(+), 124 deletions(-)

[PATCH 02/13] target/arm: Fix SQDMULH (by element) with Q=0

2024-06-24 Thread Richard Henderson
The inner loop, bounded by eltspersegment, must not be larger than the outer loop, bounded by elements. Cc: qemu-sta...@nongnu.org Signed-off-by: Richard Henderson --- target/arm/tcg/vec_helper.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/target

[PATCH 10/13] target/arm: Add data argument to do_fp3_vector

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 52 +- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 2697c4b305..57cdde008e 100644 --- a/target/arm/tcg/tra

[PATCH 13/13] target/arm: Delete dead code from disas_simd_indexed

2024-06-24 Thread Richard Henderson
The last insns in this block, MLA and MLS, were converted with f80701cb44d, and this code should have been removed then. Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 93 -- 1 file changed, 93 deletions(-) diff --git a/target/arm/tcg/trans

[PATCH 03/13] target/arm: Fix FJCVTZS vs flush-to-zero

2024-06-24 Thread Richard Henderson
Input denormals cause the Javascript inexact bit (output to Z) to be set. Cc: qemu-sta...@nongnu.org Fixes: 6c1f6f2733a ("target/arm: Implement ARMv8.3-JSConv") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2375 Signed-off-by: Richard Henderson --- target/arm/vfp_helper.c | 1

[PATCH 09/13] target/arm: Convert BFMMLA, SMMLA, UMMLA, USMMLA to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 4 target/arm/tcg/translate-a64.c | 36 -- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 15344a73de..b2c7e3696

[PATCH 11/13] target/arm: Convert FCADD to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 3 +++ target/arm/tcg/translate-a64.c | 33 ++--- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index b2c7e36969..f330919851

[PATCH 08/13] target/arm: Convert BFMLALB, BFMLALT to decodetree

2024-06-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 2 + target/arm/tcg/translate-a64.c | 77 +- 2 files changed, 31 insertions(+), 48 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 6819fd2587..15344a73de 1

[PATCH 01/13] target/arm: Fix VCMLA Dd, Dn, Dm[idx]

2024-06-24 Thread Richard Henderson
The inner loop, bounded by eltspersegment, must not be larger than the outer loop, bounded by elements. Cc: qemu-sta...@nongnu.org Fixes: 18fc2405781 ("target/arm: Implement SVE fp complex multiply add (indexed)") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2376 Signed-off-by: Richard

[PATCH 00/13] target/arm: AdvSIMD conversion, part 2

2024-06-24 Thread Richard Henderson
Convert another hand-full of instructions, plus fixes for two issues that are related. r~ Richard Henderson (13): target/arm: Fix VCMLA Dd, Dn, Dm[idx] target/arm: Fix SQDMULH (by element) with Q=0 target/arm: Fix FJCVTZS vs flush-to-zero target/arm: Convert SQRDMLAH, SQRDMLSH to decode

Re: [PATCH v4 5/5] blockdev: mirror: check for target's cluster size when using bitmap

2024-06-24 Thread Vladimir Sementsov-Ogievskiy
On 21.05.24 15:20, Fiona Ebner wrote: When using mirror with a bitmap and the target does not do COW and is is a diff image, i.e. one that should only contain the delta and was not synced to previously, a too large cluster size for the target can be problematic. In particular, when the mirror sen

Re: [PATCH v4 4/5] iotests: add test for bitmap mirror

2024-06-24 Thread Vladimir Sementsov-Ogievskiy
On 21.05.24 15:20, Fiona Ebner wrote: From: Fabian Grünbichler heavily based on/practically forked off iotest 257 for bitmap backups, but: really, heavily. Making a duplication is always bad idea. Could we instead just add test-cases to 257? - no writes to filter node 'mirror-top' between

Re: [PATCH v4 3/5] mirror: allow specifying working bitmap

2024-06-24 Thread Vladimir Sementsov-Ogievskiy
On 21.05.24 15:20, Fiona Ebner wrote: From: John Snow for the mirror job. The bitmap's granularity is used as the job's granularity. The new @bitmap parameter is marked unstable in the QAPI and can currently only be used for @sync=full mode. Clusters initially dirty in the bitmap as well as n

Re: [PULL 00/19] SD/MMC patches for 2024-06-24

2024-06-24 Thread Richard Henderson
repository at: https://github.com/philmd/qemu.git tags/sdmmc-20240624 for you to fetch changes up to 76ae9a231487a2b127c90bcb657fd42a1f6c06f8: hw/sd/sdcard: Add comments around registers and commands (2024-06-24 15:08:40 +0200) -

[v2 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load

2024-06-24 Thread Shiyuan Gao via
SHPC driver will be loaded fail in i440fx machine, the dmesg shows that OS cannot get control of SHPC hotplug and hotplug device to the PCI bridge will fail when we use SHPC Native type: [3.336059] shpchp :00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_) [3.337408] s

Re: [PATCH 1/1] include/qemu: Provide a C++ compatible version of typeof_strip_qual

2024-06-24 Thread Roman Kiryanov
Hi Philippe, thank you for looking. On Mon, Jun 24, 2024 at 7:27 PM Philippe Mathieu-Daudé wrote: > In particular this patch seems contained well enough > to be carried in forks were C++ _is_ used. Will you agree to take #ifdef __cplusplus and #error to the QEMU side in atomic.h and we will kee

Re: [PATCH 1/1] include/qemu: Provide a C++ compatible version of typeof_strip_qual

2024-06-24 Thread Philippe Mathieu-Daudé
Hi Felix, On 24/6/24 22:56, Felix Wu wrote: From: Roman Kiryanov to use the QEMU headers with a C++ compiler. Signed-off-by: Felix Wu Signed-off-by: Roman Kiryanov --- include/qemu/atomic.h | 8 include/qemu/atomic.hpp | 38 ++ 2 files cha

Re: [PATCH 1/2] qom: Rename Object::class into Object::klass

2024-06-24 Thread Philippe Mathieu-Daudé
Hi Felix, On 24/6/24 22:43, Felix Wu wrote: From: Roman Kiryanov 'class' is a C++ keyword and it prevents from using the QEMU headers with a C++ compiler. Google-Bug-Id: 331190993 I asked Roman twice about this tag meaning: https://lore.kernel.org/qemu-devel/e865d8e3-e768-4b1f-86d3-aeabe8f1

Re: [PATCH v2] scsi-disk: Fix crash for VM configured with USB CDROM after live migration

2024-06-24 Thread Yong Huang
On Mon, Jun 24, 2024 at 6:06 PM Thomas Huth wrote: > On 10/06/2024 19.02, Paolo Bonzini wrote: > > From: Hyman Huang > > > > For VMs configured with the USB CDROM device: > > > > -drive > file=/path/to/local/file,id=drive-usb-disk0,media=cdrom,readonly=on... > > -device usb-storage,drive=drive-u

RE: [PATCH v1 1/2] aspeed/soc: fix coverity issue

2024-06-24 Thread Jamin Lin
Hi Cedric, > -Original Message- > From: Cédric Le Goater > Sent: Monday, June 24, 2024 9:58 PM > To: Peter Maydell ; Jamin Lin > > Cc: Steven Lee ; Troy Lee > ; Andrew Jeffery ; Joel > Stanley ; open list:ASPEED BMCs ; > open list:All patches CC here ; Troy Lee > ; Yunlin Tang > Subject:

[PATCH v2 2/2] aspeed/sdmc: Remove extra R_MAIN_STATUS case

2024-06-24 Thread Jamin Lin via
Coverity reports that the newly added 'case R_MAIN_STATUS' is DEADCODE because it can not be reached. This is because R_MAIN_STATUS is handled before in the "Unprotected registers" switch statement. Remove it. Fixes: Coverity CID 1547112 Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater [ c

[PATCH v2 0/2] Fix coverity issues for AST2700

2024-06-24 Thread Jamin Lin via
change from v1: aspeed/soc: coverity defect: DIVIDE_BY_ZERO aspeed/sdmc: coverity defect: Control flow issues (DEADCODE) change from v2: add more commit log from reviewer, Cédric. Jamin Lin (2): aspeed/soc: Fix possible divide by zero aspeed/sdmc: Remove extra R_MAIN_STATUS case hw/arm/aspe

[PATCH v2 1/2] aspeed/soc: Fix possible divide by zero

2024-06-24 Thread Jamin Lin via
Coverity reports a possible DIVIDE_BY_ZERO issue regarding the "ram_size" object property. This can not happen because RAM has predefined valid sizes per SoC. Nevertheless, add a test to close the issue. Fixes: Coverity CID 1547113 Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater [ clg: Re

Re: [PATCH v2] target/riscv: fix instructions count handling in icount mode

2024-06-24 Thread Alistair Francis
On Tue, Jun 18, 2024 at 9:28 PM Clément Léger wrote: > > When icount is enabled, rather than returning the virtual CPU time, we > should return the instruction count itself. Add an instructions bool > parameter to get_ticks() to correctly return icount_get_raw() when > icount_enabled() == 1 and in

Re: [PATCH] i386: revert defaults to 'legacy-vm-type=true' for SEV(-ES) guests

2024-06-24 Thread Michael Roth via
On Fri, Jun 14, 2024 at 11:39:24AM +0100, Daniel P. Berrangé wrote: > The KVM_SEV_INIT2 ioctl was only introduced in Linux 6.10, which will > only have been released for a bit over a month when QEMU 9.1 is > released. > > The SEV(-ES) support in QEMU has been present since 2.12 dating back > to 20

Re: [PULL 00/12] maintainer updates (plugins, gdbstub)

2024-06-24 Thread Richard Henderson
On 6/24/24 03:18, Alex Bennée wrote: The following changes since commit c9ba79baca7c673098361e3a687f72d458e0d18a: Merge tag 'pull-target-arm-20240622' ofhttps://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-06-22 09:56:49 -0700) are available in the Git repository at: htt

Help improve 32-bit testing

2024-06-24 Thread Richard Henderson
Hiya, I've just discovered a 32-bit build issue that is probably 3 weeks old. While we still support 32-bit builds at all, I would request that we improve our cross-i686 testing. For instance: we have cross-i686-user and cross-i686-tci. There is some system build testing in the tci job, but

Re: [PULL 30/45] i386/sev: Add handling to encrypt/finalize guest launch data

2024-06-24 Thread Richard Henderson
On 6/3/24 23:43, Paolo Bonzini wrote: From: Brijesh Singh Process any queued up launch data and encrypt/measure it into the SNP guest instance prior to initial guest launch. This also updates the KVM_SEV_SNP_LAUNCH_UPDATE call to handle partial update responses. Signed-off-by: Brijesh Singh

[PULL 23/42] virtio-iommu: Remove the implementation of iommu_set_iova_range

2024-06-24 Thread Cédric Le Goater
From: Eric Auger Now that we use PCIIOMMUOps to convey information about usable IOVA ranges we do not to implement the iommu_set_iova_ranges IOMMU MR callback. Signed-off-by: Eric Auger Reviewed-by: Zhenzhong Duan Reviewed-by: Michael S. Tsirkin --- hw/virtio/virtio-iommu.c | 67

[PULL 12/42] hw/pci: Introduce helper function pci_device_get_iommu_bus_devfn()

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan Extract out pci_device_get_iommu_bus_devfn() from pci_device_iommu_address_space() to facilitate implementation of pci_device_[set|unset]_iommu_device() in following patch. No functional change intended. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Nicolin C

[PULL 28/42] vfio/common: Move dirty tracking ranges update to helper

2024-06-24 Thread Cédric Le Goater
From: Joao Martins Separate the changes that update the ranges from the listener, to make it reusable in preparation to expand its use to vIOMMU support. Signed-off-by: Joao Martins Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger [ clg: - Rebased on upstream

[PULL 20/42] HostIOMMUDevice: Introduce get_iova_ranges callback

2024-06-24 Thread Cédric Le Goater
From: Eric Auger Introduce a new HostIOMMUDevice callback that allows to retrieve the usable IOVA ranges. Implement this callback in the legacy VFIO and IOMMUFD VFIO host iommu devices. This relies on the VFIODevice agent's base container iova_ranges resource. Signed-off-by: Eric Auger Reviewe

[PULL 04/42] backends/iommufd: Introduce TYPE_HOST_IOMMU_DEVICE_IOMMUFD[_VFIO] devices

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan TYPE_HOST_IOMMU_DEVICE_IOMMUFD represents a host IOMMU device under iommufd backend. It is abstract, because it is going to be derived into VFIO or VDPA type'd device. It will have its own .get_cap() implementation. TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO is a sub-class of TYPE

[PULL 10/42] backends/iommufd: Implement HostIOMMUDeviceClass::get_cap() handler

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Reviewed-by: Michael S. Tsirkin --- backends/iommufd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/backends/iommufd.c b/backends/iommufd.c index c7e969d

[PULL 21/42] HostIOMMUDevice: Store the aliased bus and devfn

2024-06-24 Thread Cédric Le Goater
From: Eric Auger Store the aliased bus and devfn in the HostIOMMUDevice. This will be useful to handle info that are iommu group specific and not device specific (such as reserved iova ranges). Signed-off-by: Eric Auger Reviewed-by: Zhenzhong Duan Reviewed-by: Michael S. Tsirkin --- include/

[PULL 34/42] vfio/container: Introduce vfio_create_container()

2024-06-24 Thread Cédric Le Goater
This routine allocates the QEMU struct type representing the VFIO container. It is minimal currently and future changes will do more initialization. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 19 +

[PULL 01/42] backends: Introduce HostIOMMUDevice abstract

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan A HostIOMMUDevice is an abstraction for an assigned device that is protected by a physical IOMMU (aka host IOMMU). The userspace interaction with this physical IOMMU can be done either through the VFIO IOMMU type 1 legacy backend or the new iommufd backend. The assigned devic

[PULL 27/42] vfio: Remove unused declarations from vfio-common.h

2024-06-24 Thread Cédric Le Goater
These were forgotten in the recent cleanups. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 1 file changed, 4 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-

[PULL 33/42] vfio/container: Introduce vfio_get_iommu_class_name()

2024-06-24 Thread Cédric Le Goater
Rework vfio_get_iommu_class() to return a literal class name instead of a class object. We will need this name to instantiate the object later on. Since the default case asserts, remove the error report as QEMU will simply abort before. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-

[PULL 30/42] vfio/container: Introduce vfio_address_space_insert()

2024-06-24 Thread Cédric Le Goater
It prepares ground for a future change initializing the 'space' pointer of VFIOContainerBase. The goal is to replace vfio_container_init() by an .instance_init() handler when VFIOContainerBase is QOMified. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by:

[PULL 22/42] virtio-iommu: Compute host reserved regions

2024-06-24 Thread Cédric Le Goater
From: Eric Auger Compute the host reserved regions in virtio_iommu_set_iommu_device(). The usable IOVA regions are retrieved from the HostIOMMUDevice. The virtio_iommu_set_host_iova_ranges() helper turns usable regions into complementary reserved regions while testing the inclusion into existing

[PULL 14/42] vfio/pci: Pass HostIOMMUDevice to vIOMMU

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan With HostIOMMUDevice passed, vIOMMU can check compatibility with host IOMMU, call into IOMMUFD specific methods, etc. Originally-by: Yi Liu Signed-off-by: Nicolin Chen Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Reviewed-by: Michael S. Ts

[PULL 32/42] vfio/container: Modify vfio_get_iommu_type() to use a container fd

2024-06-24 Thread Cédric Le Goater
The 'container' pointer has no other use than its 'fd' attribute. Simplify the prototype to ease future changes. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 6 +++--- 1 file changed, 3 insertions(+), 3 del

[PULL 38/42] vfio/container: Introduce an instance_init() handler

2024-06-24 Thread Cédric Le Goater
This allows us to move the initialization code from vfio_container_init(), which we will soon remove. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/container-base.c | 19 +-- 1 file changed, 13 insertions(

[PULL 26/42] vfio: Make vfio_devices_dma_logging_start() return bool

2024-06-24 Thread Cédric Le Goater
Since vfio_devices_dma_logging_start() takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. It will simplify potential changes coming after. vfio_container_set_dirty_page_tracking() could be modified in the same way but the errno value can be sa

[PULL 18/42] HostIOMMUDevice: Store the VFIO/VDPA agent

2024-06-24 Thread Cédric Le Goater
From: Eric Auger Store the agent device (VFIO or VDPA) in the host IOMMU device. This will allow easy access to some of its resources. Signed-off-by: Eric Auger Reviewed-by: Zhenzhong Duan Reviewed-by: Michael S. Tsirkin --- include/sysemu/host_iommu_device.h | 1 + hw/vfio/container.c

[PULL 37/42] vfio/container: Switch to QOM

2024-06-24 Thread Cédric Le Goater
Instead of allocating the container struct, create a QOM object of the appropriate type. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 6 +++--- hw/vfio/iommufd.c | 4 ++-- 2 files changed, 5 insertions(+)

[PULL 40/42] vfio/container: Remove vfio_container_init()

2024-06-24 Thread Cédric Le Goater
It's now empty. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 2 -- hw/vfio/container-base.c | 5 - hw/vfio/container.c | 3 --- hw/vfio/iommufd.c

[PULL 31/42] vfio/container: Simplify vfio_container_init()

2024-06-24 Thread Cédric Le Goater
Assign the base container VFIOAddressSpace 'space' pointer in vfio_address_space_insert(). The ultimate goal is to remove vfio_container_init() and instead rely on an .instance_init() handler to perfom the initialization of VFIOContainerBase. To be noted that vfio_connect_container() will assign t

[PULL 41/42] vfio/container: Introduce vfio_iommu_legacy_instance_init()

2024-06-24 Thread Cédric Le Goater
Just as we did for the VFIOContainerBase object, introduce an instance_init() handler for the legacy VFIOContainer object and do the specific initialization there. Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/container.c

[PULL 29/42] vfio/common: Extract vIOMMU code from vfio_sync_dirty_bitmap()

2024-06-24 Thread Cédric Le Goater
From: Avihai Horon Extract vIOMMU code from vfio_sync_dirty_bitmap() to a new function and restructure the code. This is done in preparation for optimizing vIOMMU device dirty page tracking. No functional changes intended. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins [ clg: - Rebas

[PULL 15/42] intel_iommu: Extract out vtd_cap_init() to initialize cap/ecap

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan Extract cap/ecap initialization in vtd_cap_init() to make code cleaner. No functional change intended. Reviewed-by: Eric Auger Signed-off-by: Zhenzhong Duan Reviewed-by: Michael S. Tsirkin --- hw/i386/intel_iommu.c | 93 --- 1 fil

[PULL 25/42] memory: Remove IOMMU MR iommu_set_iova_range API

2024-06-24 Thread Cédric Le Goater
From: Eric Auger Since the host IOVA ranges are now passed through the PCIIOMMUOps set_host_resv_regions and we have removed the only implementation of iommu_set_iova_range() in the virtio-iommu and the only call site in vfio/common, let's retire the IOMMU MR API and its memory wrapper. Signed-o

[PULL 07/42] backends/iommufd: Introduce helper function iommufd_backend_get_device_info()

2024-06-24 Thread Cédric Le Goater
From: Zhenzhong Duan Introduce a helper function iommufd_backend_get_device_info() to get host IOMMU related information through iommufd uAPI. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Reviewed-by: Michael S. Tsirkin --- include/sysem

[PULL 13/42] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-06-24 Thread Cédric Le Goater
From: Yi Liu pci_device_[set|unset]_iommu_device() call pci_device_get_iommu_bus_devfn() to get iommu_bus->iommu_ops and call [set|unset]_iommu_device callback to set/unset HostIOMMUDevice for a given PCI device. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Nicolin Chen Signed-o

  1   2   3   4   >