From b81986476c4f62dc1ff25cd92e3f325027c4b582 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 4 Dec 2023 02:13:52 -0800 Subject: [PATCH] MemMMap: use modified_pages.discard instead of remove since pages may not be modified --- src/openpower/decoder/isa/mem.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openpower/decoder/isa/mem.py b/src/openpower/decoder/isa/mem.py index ddb3b886..4947e9b1 100644 --- a/src/openpower/decoder/isa/mem.py +++ b/src/openpower/decoder/isa/mem.py @@ -651,7 +651,7 @@ class MemMMap(MemCommon): # mark pages as empty for page_idx in block.page_indexes: self.__page_flags.pop(page_idx) - self.modified_pages.remove(page_idx) + self.modified_pages.discard(page_idx) return retval def __mmap_emu_zero_block(self, block): @@ -716,13 +716,13 @@ class MemMMap(MemCommon): return None for page_idx in r: self.__page_flags.pop(page_idx) - self.modified_pages.remove(page_idx) + self.modified_pages.discard(page_idx) else: # expanding -- map pages at end, they're cleared already r = range(block.page_indexes.stop, new_block.page_indexes.stop) for page_idx in r: self.__page_flags[page_idx] = block.flags - self.modified_pages.remove(page_idx) # cleared page + self.modified_pages.discard(page_idx) # cleared page self.__mmap_emu_alloc_blocks.remove(block) self.__mmap_emu_alloc_blocks.add(new_block) return new_block -- 2.30.2