* [PATCH 0/2] hw/ppc/ppc440_uc: Maintain and remove dead code @ 2023-10-11 12:43 Philippe Mathieu-Daudé 2023-10-11 12:43 ` [PATCH 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board Philippe Mathieu-Daudé 2023-10-11 12:43 ` [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() Philippe Mathieu-Daudé 0 siblings, 2 replies; 7+ messages in thread From: Philippe Mathieu-Daudé @ 2023-10-11 12:43 UTC (permalink / raw) To: qemu-devel Cc: BALATON Zoltan, qemu-ppc, qemu-trivial, Markus Armbruster, Philippe Mathieu-Daudé - Cover ppc440_uc in MAINTAINERS - Remove dead code Philippe Mathieu-Daudé (2): MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() MAINTAINERS | 1 + hw/ppc/ppc440_uc.c | 40 ---------------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) -- 2.41.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board 2023-10-11 12:43 [PATCH 0/2] hw/ppc/ppc440_uc: Maintain and remove dead code Philippe Mathieu-Daudé @ 2023-10-11 12:43 ` Philippe Mathieu-Daudé 2023-10-11 13:30 ` BALATON Zoltan 2023-10-11 12:43 ` [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() Philippe Mathieu-Daudé 1 sibling, 1 reply; 7+ messages in thread From: Philippe Mathieu-Daudé @ 2023-10-11 12:43 UTC (permalink / raw) To: qemu-devel Cc: BALATON Zoltan, qemu-ppc, qemu-trivial, Markus Armbruster, Philippe Mathieu-Daudé hw/ppc/ppc440_uc.c implements the TYPE_PPC460EX_PCIE_HOST device, which is used by the aCube Sam460ex board. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9e7dec4a58..8c07d07927 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1482,6 +1482,7 @@ M: BALATON Zoltan <balaton@eik.bme.hu> L: qemu-ppc@nongnu.org S: Maintained F: hw/ppc/sam460ex.c +F: hw/ppc/ppc440_uc.c F: hw/ppc/ppc440_pcix.c F: hw/display/sm501* F: hw/ide/sii3112.c -- 2.41.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board 2023-10-11 12:43 ` [PATCH 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board Philippe Mathieu-Daudé @ 2023-10-11 13:30 ` BALATON Zoltan 0 siblings, 0 replies; 7+ messages in thread From: BALATON Zoltan @ 2023-10-11 13:30 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, qemu-ppc, qemu-trivial, Markus Armbruster [-- Attachment #1: Type: text/plain, Size: 726 bytes --] On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: > hw/ppc/ppc440_uc.c implements the TYPE_PPC460EX_PCIE_HOST > device, which is used by the aCube Sam460ex board. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> I guess there's nobody else to take these so Acked-by: BALATON Zoltan <balaton@eik.bme.hu> > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 9e7dec4a58..8c07d07927 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1482,6 +1482,7 @@ M: BALATON Zoltan <balaton@eik.bme.hu> > L: qemu-ppc@nongnu.org > S: Maintained > F: hw/ppc/sam460ex.c > +F: hw/ppc/ppc440_uc.c > F: hw/ppc/ppc440_pcix.c > F: hw/display/sm501* > F: hw/ide/sii3112.c > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() 2023-10-11 12:43 [PATCH 0/2] hw/ppc/ppc440_uc: Maintain and remove dead code Philippe Mathieu-Daudé 2023-10-11 12:43 ` [PATCH 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board Philippe Mathieu-Daudé @ 2023-10-11 12:43 ` Philippe Mathieu-Daudé 2023-10-11 13:31 ` BALATON Zoltan 1 sibling, 1 reply; 7+ messages in thread From: Philippe Mathieu-Daudé @ 2023-10-11 12:43 UTC (permalink / raw) To: qemu-devel Cc: BALATON Zoltan, qemu-ppc, qemu-trivial, Markus Armbruster, Philippe Mathieu-Daudé Apparently l2sram_update_mappings() bit-rotted over time, when defining MAP_L2SRAM we get: hw/ppc/ppc440_uc.c:83:17: error: no member named 'isarc' in 'struct ppc4xx_l2sram_t' if (l2sram->isarc != isarc || ~~~~~~ ^ hw/ppc/ppc440_uc.c:84:18: error: no member named 'isacntl' in 'struct ppc4xx_l2sram_t' (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { ~~~~~~ ^ hw/ppc/ppc440_uc.c:85:21: error: no member named 'isacntl' in 'struct ppc4xx_l2sram_t' if (l2sram->isacntl & 0x80000000) { ~~~~~~ ^ hw/ppc/ppc440_uc.c:88:50: error: no member named 'isarc_ram' in 'struct ppc4xx_l2sram_t' &l2sram->isarc_ram); ~~~~~~ ^ hw/ppc/ppc440_uc.c:93:50: error: no member named 'isarc_ram' in 'struct ppc4xx_l2sram_t' &l2sram->isarc_ram); ~~~~~~ ^ hw/ppc/ppc440_uc.c:96:17: error: no member named 'dsarc' in 'struct ppc4xx_l2sram_t' if (l2sram->dsarc != dsarc || ~~~~~~ ^ hw/ppc/ppc440_uc.c:97:18: error: no member named 'dsacntl' in 'struct ppc4xx_l2sram_t' (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { ~~~~~~ ^ hw/ppc/ppc440_uc.c:98:21: error: no member named 'dsacntl' in 'struct ppc4xx_l2sram_t' if (l2sram->dsacntl & 0x80000000) { ~~~~~~ ^ hw/ppc/ppc440_uc.c:100:52: error: no member named 'dsarc' in 'struct ppc4xx_l2sram_t' if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { ~~~~~~ ^ hw/ppc/ppc440_uc.c:103:54: error: no member named 'dsarc_ram' in 'struct ppc4xx_l2sram_t' &l2sram->dsarc_ram); ~~~~~~ ^ hw/ppc/ppc440_uc.c:111:54: error: no member named 'dsarc_ram' in 'struct ppc4xx_l2sram_t' &l2sram->dsarc_ram); ~~~~~~ ^ Remove that dead code. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/ppc/ppc440_uc.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 4181c843a8..643a79e330 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -73,46 +73,6 @@ typedef struct ppc4xx_l2sram_t { uint32_t isram0[11]; } ppc4xx_l2sram_t; -#ifdef MAP_L2SRAM -static void l2sram_update_mappings(ppc4xx_l2sram_t *l2sram, - uint32_t isarc, uint32_t isacntl, - uint32_t dsarc, uint32_t dsacntl) -{ - if (l2sram->isarc != isarc || - (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { - if (l2sram->isacntl & 0x80000000) { - /* Unmap previously assigned memory region */ - memory_region_del_subregion(get_system_memory(), - &l2sram->isarc_ram); - } - if (isacntl & 0x80000000) { - /* Map new instruction memory region */ - memory_region_add_subregion(get_system_memory(), isarc, - &l2sram->isarc_ram); - } - } - if (l2sram->dsarc != dsarc || - (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { - if (l2sram->dsacntl & 0x80000000) { - /* Beware not to unmap the region we just mapped */ - if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { - /* Unmap previously assigned memory region */ - memory_region_del_subregion(get_system_memory(), - &l2sram->dsarc_ram); - } - } - if (dsacntl & 0x80000000) { - /* Beware not to remap the region we just mapped */ - if (!(isacntl & 0x80000000) || dsarc != isarc) { - /* Map new data memory region */ - memory_region_add_subregion(get_system_memory(), dsarc, - &l2sram->dsarc_ram); - } - } - } -} -#endif - static uint32_t dcr_read_l2sram(void *opaque, int dcrn) { ppc4xx_l2sram_t *l2sram = opaque; -- 2.41.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() 2023-10-11 12:43 ` [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() Philippe Mathieu-Daudé @ 2023-10-11 13:31 ` BALATON Zoltan 2023-10-11 13:41 ` Philippe Mathieu-Daudé 0 siblings, 1 reply; 7+ messages in thread From: BALATON Zoltan @ 2023-10-11 13:31 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, qemu-ppc, qemu-trivial, Markus Armbruster [-- Attachment #1: Type: text/plain, Size: 4701 bytes --] On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: > Apparently l2sram_update_mappings() bit-rotted over time, > when defining MAP_L2SRAM we get: > > hw/ppc/ppc440_uc.c:83:17: error: no member named 'isarc' in 'struct ppc4xx_l2sram_t' > if (l2sram->isarc != isarc || > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:84:18: error: no member named 'isacntl' in 'struct ppc4xx_l2sram_t' > (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:85:21: error: no member named 'isacntl' in 'struct ppc4xx_l2sram_t' > if (l2sram->isacntl & 0x80000000) { > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:88:50: error: no member named 'isarc_ram' in 'struct ppc4xx_l2sram_t' > &l2sram->isarc_ram); > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:93:50: error: no member named 'isarc_ram' in 'struct ppc4xx_l2sram_t' > &l2sram->isarc_ram); > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:96:17: error: no member named 'dsarc' in 'struct ppc4xx_l2sram_t' > if (l2sram->dsarc != dsarc || > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:97:18: error: no member named 'dsacntl' in 'struct ppc4xx_l2sram_t' > (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:98:21: error: no member named 'dsacntl' in 'struct ppc4xx_l2sram_t' > if (l2sram->dsacntl & 0x80000000) { > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:100:52: error: no member named 'dsarc' in 'struct ppc4xx_l2sram_t' > if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:103:54: error: no member named 'dsarc_ram' in 'struct ppc4xx_l2sram_t' > &l2sram->dsarc_ram); > ~~~~~~ ^ > hw/ppc/ppc440_uc.c:111:54: error: no member named 'dsarc_ram' in 'struct ppc4xx_l2sram_t' > &l2sram->dsarc_ram); > ~~~~~~ ^ > > Remove that dead code. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > hw/ppc/ppc440_uc.c | 40 ---------------------------------------- > 1 file changed, 40 deletions(-) > > diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c > index 4181c843a8..643a79e330 100644 > --- a/hw/ppc/ppc440_uc.c > +++ b/hw/ppc/ppc440_uc.c > @@ -73,46 +73,6 @@ typedef struct ppc4xx_l2sram_t { > uint32_t isram0[11]; > } ppc4xx_l2sram_t; > > -#ifdef MAP_L2SRAM > -static void l2sram_update_mappings(ppc4xx_l2sram_t *l2sram, > - uint32_t isarc, uint32_t isacntl, > - uint32_t dsarc, uint32_t dsacntl) If you remove this then nobody will remember this could be modelled or may be fixed so maybe leave it as a reminder for now. Regards, BALATON Zoltan > -{ > - if (l2sram->isarc != isarc || > - (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { > - if (l2sram->isacntl & 0x80000000) { > - /* Unmap previously assigned memory region */ > - memory_region_del_subregion(get_system_memory(), > - &l2sram->isarc_ram); > - } > - if (isacntl & 0x80000000) { > - /* Map new instruction memory region */ > - memory_region_add_subregion(get_system_memory(), isarc, > - &l2sram->isarc_ram); > - } > - } > - if (l2sram->dsarc != dsarc || > - (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { > - if (l2sram->dsacntl & 0x80000000) { > - /* Beware not to unmap the region we just mapped */ > - if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { > - /* Unmap previously assigned memory region */ > - memory_region_del_subregion(get_system_memory(), > - &l2sram->dsarc_ram); > - } > - } > - if (dsacntl & 0x80000000) { > - /* Beware not to remap the region we just mapped */ > - if (!(isacntl & 0x80000000) || dsarc != isarc) { > - /* Map new data memory region */ > - memory_region_add_subregion(get_system_memory(), dsarc, > - &l2sram->dsarc_ram); > - } > - } > - } > -} > -#endif > - > static uint32_t dcr_read_l2sram(void *opaque, int dcrn) > { > ppc4xx_l2sram_t *l2sram = opaque; > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() 2023-10-11 13:31 ` BALATON Zoltan @ 2023-10-11 13:41 ` Philippe Mathieu-Daudé 2023-10-11 13:49 ` BALATON Zoltan 0 siblings, 1 reply; 7+ messages in thread From: Philippe Mathieu-Daudé @ 2023-10-11 13:41 UTC (permalink / raw) To: BALATON Zoltan Cc: qemu-devel, qemu-ppc, qemu-trivial, Markus Armbruster, Thomas Huth Hi Zoltan, On 11/10/23 15:31, BALATON Zoltan wrote: > On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: >> Apparently l2sram_update_mappings() bit-rotted over time, >> when defining MAP_L2SRAM we get: >> >> hw/ppc/ppc440_uc.c:83:17: error: no member named 'isarc' in 'struct >> ppc4xx_l2sram_t' >> if (l2sram->isarc != isarc || >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:84:18: error: no member named 'isacntl' in 'struct >> ppc4xx_l2sram_t' >> (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:85:21: error: no member named 'isacntl' in 'struct >> ppc4xx_l2sram_t' >> if (l2sram->isacntl & 0x80000000) { >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:88:50: error: no member named 'isarc_ram' in >> 'struct ppc4xx_l2sram_t' >> &l2sram->isarc_ram); >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:93:50: error: no member named 'isarc_ram' in >> 'struct ppc4xx_l2sram_t' >> &l2sram->isarc_ram); >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:96:17: error: no member named 'dsarc' in 'struct >> ppc4xx_l2sram_t' >> if (l2sram->dsarc != dsarc || >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:97:18: error: no member named 'dsacntl' in 'struct >> ppc4xx_l2sram_t' >> (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:98:21: error: no member named 'dsacntl' in 'struct >> ppc4xx_l2sram_t' >> if (l2sram->dsacntl & 0x80000000) { >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:100:52: error: no member named 'dsarc' in 'struct >> ppc4xx_l2sram_t' >> if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:103:54: error: no member named 'dsarc_ram' in >> 'struct ppc4xx_l2sram_t' >> &l2sram->dsarc_ram); >> ~~~~~~ ^ >> hw/ppc/ppc440_uc.c:111:54: error: no member named 'dsarc_ram' in >> 'struct ppc4xx_l2sram_t' >> &l2sram->dsarc_ram); >> ~~~~~~ ^ >> >> Remove that dead code. I missed to remove: -- >8 -- diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 3a66b0c7f7..1312aa2080 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -154,7 +154,6 @@ static void dcr_write_l2sram(void *opaque, int dcrn, uint32_t val) /*l2sram->isram1[dcrn - DCR_L2CACHE_BASE] = val;*/ break; } - /*l2sram_update_mappings(l2sram, isarc, isacntl, dsarc, dsacntl);*/ } static void l2sram_reset(void *opaque) @@ -164,7 +163,6 @@ static void l2sram_reset(void *opaque) memset(l2sram->l2cache, 0, sizeof(l2sram->l2cache)); l2sram->l2cache[DCR_L2CACHE_STAT - DCR_L2CACHE_BASE] = 0x80000000; memset(l2sram->isram0, 0, sizeof(l2sram->isram0)); - /*l2sram_update_mappings(l2sram, isarc, isacntl, dsarc, dsacntl);*/ } --- >> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> >> --- >> hw/ppc/ppc440_uc.c | 40 ---------------------------------------- >> 1 file changed, 40 deletions(-) >> >> diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c >> index 4181c843a8..643a79e330 100644 >> --- a/hw/ppc/ppc440_uc.c >> +++ b/hw/ppc/ppc440_uc.c >> @@ -73,46 +73,6 @@ typedef struct ppc4xx_l2sram_t { >> uint32_t isram0[11]; >> } ppc4xx_l2sram_t; >> >> -#ifdef MAP_L2SRAM >> -static void l2sram_update_mappings(ppc4xx_l2sram_t *l2sram, >> - uint32_t isarc, uint32_t isacntl, >> - uint32_t dsarc, uint32_t dsacntl) > > If you remove this then nobody will remember this could be modelled or > may be fixed so maybe leave it as a reminder for now. We can keep this code if someone fix it and enable it (convert the definition to a static boolean). Some APIs are being modified, we can not test modifications in such dead code. Even converting to a comment doesn't seem useful. Maybe you can add a comment "If you are interested in ..., see l2sram_update_mappings() draft implementation in https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg04261.html"? > Regards, > BALATON Zoltan ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() 2023-10-11 13:41 ` Philippe Mathieu-Daudé @ 2023-10-11 13:49 ` BALATON Zoltan 0 siblings, 0 replies; 7+ messages in thread From: BALATON Zoltan @ 2023-10-11 13:49 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, qemu-ppc, qemu-trivial, Markus Armbruster, Thomas Huth [-- Attachment #1: Type: text/plain, Size: 5508 bytes --] On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: > Hi Zoltan, > > On 11/10/23 15:31, BALATON Zoltan wrote: >> On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: >>> Apparently l2sram_update_mappings() bit-rotted over time, >>> when defining MAP_L2SRAM we get: >>> >>> hw/ppc/ppc440_uc.c:83:17: error: no member named 'isarc' in 'struct >>> ppc4xx_l2sram_t' >>> if (l2sram->isarc != isarc || >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:84:18: error: no member named 'isacntl' in 'struct >>> ppc4xx_l2sram_t' >>> (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:85:21: error: no member named 'isacntl' in 'struct >>> ppc4xx_l2sram_t' >>> if (l2sram->isacntl & 0x80000000) { >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:88:50: error: no member named 'isarc_ram' in 'struct >>> ppc4xx_l2sram_t' >>> &l2sram->isarc_ram); >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:93:50: error: no member named 'isarc_ram' in 'struct >>> ppc4xx_l2sram_t' >>> &l2sram->isarc_ram); >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:96:17: error: no member named 'dsarc' in 'struct >>> ppc4xx_l2sram_t' >>> if (l2sram->dsarc != dsarc || >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:97:18: error: no member named 'dsacntl' in 'struct >>> ppc4xx_l2sram_t' >>> (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:98:21: error: no member named 'dsacntl' in 'struct >>> ppc4xx_l2sram_t' >>> if (l2sram->dsacntl & 0x80000000) { >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:100:52: error: no member named 'dsarc' in 'struct >>> ppc4xx_l2sram_t' >>> if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:103:54: error: no member named 'dsarc_ram' in 'struct >>> ppc4xx_l2sram_t' >>> &l2sram->dsarc_ram); >>> ~~~~~~ ^ >>> hw/ppc/ppc440_uc.c:111:54: error: no member named 'dsarc_ram' in 'struct >>> ppc4xx_l2sram_t' >>> &l2sram->dsarc_ram); >>> ~~~~~~ ^ >>> >>> Remove that dead code. > > I missed to remove: > > -- >8 -- > diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c > index 3a66b0c7f7..1312aa2080 100644 > --- a/hw/ppc/ppc440_uc.c > +++ b/hw/ppc/ppc440_uc.c > @@ -154,7 +154,6 @@ static void dcr_write_l2sram(void *opaque, int dcrn, > uint32_t val) > /*l2sram->isram1[dcrn - DCR_L2CACHE_BASE] = val;*/ > break; > } > - /*l2sram_update_mappings(l2sram, isarc, isacntl, dsarc, dsacntl);*/ > } Well, all of this func does nothing and just here so accessing these DCRs won't crash but it already has a FIXME comment at the beginning noting that, so in that case it's probably OK to remove the unfinished func as we still have a reminder here. So then: Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Regards, BALATON Zoltan > static void l2sram_reset(void *opaque) > @@ -164,7 +163,6 @@ static void l2sram_reset(void *opaque) > memset(l2sram->l2cache, 0, sizeof(l2sram->l2cache)); > l2sram->l2cache[DCR_L2CACHE_STAT - DCR_L2CACHE_BASE] = 0x80000000; > memset(l2sram->isram0, 0, sizeof(l2sram->isram0)); > - /*l2sram_update_mappings(l2sram, isarc, isacntl, dsarc, dsacntl);*/ > } > --- > >>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> >>> --- >>> hw/ppc/ppc440_uc.c | 40 ---------------------------------------- >>> 1 file changed, 40 deletions(-) >>> >>> diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c >>> index 4181c843a8..643a79e330 100644 >>> --- a/hw/ppc/ppc440_uc.c >>> +++ b/hw/ppc/ppc440_uc.c >>> @@ -73,46 +73,6 @@ typedef struct ppc4xx_l2sram_t { >>> uint32_t isram0[11]; >>> } ppc4xx_l2sram_t; >>> >>> -#ifdef MAP_L2SRAM >>> -static void l2sram_update_mappings(ppc4xx_l2sram_t *l2sram, >>> - uint32_t isarc, uint32_t isacntl, >>> - uint32_t dsarc, uint32_t dsacntl) >> >> If you remove this then nobody will remember this could be modelled or may >> be fixed so maybe leave it as a reminder for now. > > We can keep this code if someone fix it and enable it (convert the > definition to a static boolean). Some APIs are being modified, we can > not test modifications in such dead code. Even converting to a comment > doesn't seem useful. > > Maybe you can add a comment "If you are interested in ..., see > l2sram_update_mappings() draft implementation in > https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg04261.html"? > >> Regards, >> BALATON Zoltan > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-10-11 13:50 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-10-11 12:43 [PATCH 0/2] hw/ppc/ppc440_uc: Maintain and remove dead code Philippe Mathieu-Daudé 2023-10-11 12:43 ` [PATCH 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board Philippe Mathieu-Daudé 2023-10-11 13:30 ` BALATON Zoltan 2023-10-11 12:43 ` [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() Philippe Mathieu-Daudé 2023-10-11 13:31 ` BALATON Zoltan 2023-10-11 13:41 ` Philippe Mathieu-Daudé 2023-10-11 13:49 ` BALATON Zoltan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).