Skip to contentSkip to conversation

memory: Replace open-coded memory_region_is_romd

PATCH In review Jan Kiszka 3 participants 5 messages May 6, 2013 – May 7, 2013

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 memory: Replace open-coded memory_region_is_romd

Improves readability.

---
 translate-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
translate-all.c +1 -1
index da93608..0d84b0d 100644
@@ -1359,7 +1359,7 @@ void tb_invalidate_phys_addr(hwaddr addr)
     section = phys_page_find(address_space_memory.dispatch,
                              addr >> TARGET_PAGE_BITS);
     if (!(memory_region_is_ram(section->mr)
-          || (section->mr->rom_device && section->mr->readable))) {
+          || memory_region_is_romd(section->mr))) {
         return;
     }
     ram_addr = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)
Signature · 1 line
1.7.3.4
#1 lore raw

Il 06/05/2013 18:07, Jan Kiszka ha scritto:

Quoted 13 lines

Improves readability.

---
 translate-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
translate-all.c +0 -0
index da93608..0d84b0d 100644

translate-all.c void tb_invalidate_phys_addr(hwaddr addr) · line 1365

Quoted 8 lines
translate-all.c +1 -1
@@ -1359,7 +1359,7 @@ void tb_invalidate_phys_addr(hwaddr addr)
     section = phys_page_find(address_space_memory.dispatch,
                              addr >> TARGET_PAGE_BITS);
     if (!(memory_region_is_ram(section->mr)
-          || (section->mr->rom_device && section->mr->readable))) {
+          || memory_region_is_romd(section->mr))) {
         return;
     }
     ram_addr = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)

Not trivial enough for qemu-trivial, let's open a memory branch for 1.6.

Any volunteers for co-maintaining it? :)

Paolo

Reviewed-by
#2 lore raw
Quoted 8 lines · Paolo Bonzini

Il 06/05/2013 18:07, Jan Kiszka ha scritto:

Quoted 7 lines

Improves readability.

---
 translate-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 6 lines
translate-all.c +0 -0
index da93608..0d84b0d 100644

translate-all.c void tb_invalidate_phys_addr(hwaddr addr) · line 1365

Quoted 8 lines
translate-all.c +1 -1
@@ -1359,7 +1359,7 @@ void tb_invalidate_phys_addr(hwaddr addr)
     section = phys_page_find(address_space_memory.dispatch,
                              addr >> TARGET_PAGE_BITS);
     if (!(memory_region_is_ram(section->mr)
-          || (section->mr->rom_device && section->mr->readable))) {
+          || memory_region_is_romd(section->mr))) {
         return;
     }
     ram_addr = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)

Not trivial enough for qemu-trivial, let's open a memory branch for 1.6.

Well, I wouldn't necessarily put it in 1.5 this close to hardfreeze, but it looks fine for qemu-trivial to me. In particular you can comprehend the patch and confirm its correctness without having to have any larger understanding of the memory system.

-- PMM

author
#3 lore raw
In reply to Paolo Bonzini
Quoted 8 lines · Paolo Bonzini

Il 06/05/2013 18:07, Jan Kiszka ha scritto:

Quoted 7 lines

Improves readability.

---
 translate-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 6 lines
translate-all.c +0 -0
index da93608..0d84b0d 100644

translate-all.c void tb_invalidate_phys_addr(hwaddr addr) · line 1365

Quoted 8 lines
translate-all.c +1 -1
@@ -1359,7 +1359,7 @@ void tb_invalidate_phys_addr(hwaddr addr)
     section = phys_page_find(address_space_memory.dispatch,
                              addr >> TARGET_PAGE_BITS);
     if (!(memory_region_is_ram(section->mr)
-          || (section->mr->rom_device && section->mr->readable))) {
+          || memory_region_is_romd(section->mr))) {
         return;
     }
     ram_addr = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)

Not trivial enough for qemu-trivial, let's open a memory branch for 1.6.

Great, thanks.

Quoted 2 lines

Any volunteers for co-maintaining it? :)

Raising my hand, but not without remarking that I have some bandwidth issue ATM. But I will try my best.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#4 lore raw

Il 07/05/2013 16:17, Jan Kiszka ha scritto:

Quoted 26 lines · Paolo Bonzini
Quoted 8 lines

Il 06/05/2013 18:07, Jan Kiszka ha scritto:

Quoted 7 lines

Improves readability.

---
 translate-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 6 lines
translate-all.c +0 -0
index da93608..0d84b0d 100644

translate-all.c void tb_invalidate_phys_addr(hwaddr addr) · line 1365

Quoted 8 lines
translate-all.c +1 -1
@@ -1359,7 +1359,7 @@ void tb_invalidate_phys_addr(hwaddr addr)
     section = phys_page_find(address_space_memory.dispatch,
                              addr >> TARGET_PAGE_BITS);
     if (!(memory_region_is_ram(section->mr)
-          || (section->mr->rom_device && section->mr->readable))) {
+          || memory_region_is_romd(section->mr))) {
         return;
     }
     ram_addr = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)

Not trivial enough for qemu-trivial, let's open a memory branch for 1.6.

Quoted 7 lines

Great, thanks.

Quoted 2 lines

Any volunteers for co-maintaining it? :)

Raising my hand, but not without remarking that I have some bandwidth issue ATM. But I will try my best.

Ok, the model we've been using for migration is that there is a pool of people that send pull requests without being official maintainers---the contract with Anthony is simply that patches are well reviewed.

For now I've repurposed my iommu branch as the WIP 1.6 memory branch; It can still be rebased, but the changes should be small at this point.
I will pass the ball after sending the first 1.6 pull request.

Paolo