|
@@ -42,7 +42,8 @@ static inline long clear_bmap_size(uint64_t pages, uint8_t shift)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * clear_bmap_set: set clear bitmap for the page range
|
|
|
|
|
|
+ * clear_bmap_set: set clear bitmap for the page range. Must be with
|
|
|
|
+ * bitmap_mutex held.
|
|
*
|
|
*
|
|
* @rb: the ramblock to operate on
|
|
* @rb: the ramblock to operate on
|
|
* @start: the start page number
|
|
* @start: the start page number
|
|
@@ -55,12 +56,12 @@ static inline void clear_bmap_set(RAMBlock *rb, uint64_t start,
|
|
{
|
|
{
|
|
uint8_t shift = rb->clear_bmap_shift;
|
|
uint8_t shift = rb->clear_bmap_shift;
|
|
|
|
|
|
- bitmap_set_atomic(rb->clear_bmap, start >> shift,
|
|
|
|
- clear_bmap_size(npages, shift));
|
|
|
|
|
|
+ bitmap_set(rb->clear_bmap, start >> shift, clear_bmap_size(npages, shift));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * clear_bmap_test_and_clear: test clear bitmap for the page, clear if set
|
|
|
|
|
|
+ * clear_bmap_test_and_clear: test clear bitmap for the page, clear if set.
|
|
|
|
+ * Must be with bitmap_mutex held.
|
|
*
|
|
*
|
|
* @rb: the ramblock to operate on
|
|
* @rb: the ramblock to operate on
|
|
* @page: the page number to check
|
|
* @page: the page number to check
|
|
@@ -71,7 +72,7 @@ static inline bool clear_bmap_test_and_clear(RAMBlock *rb, uint64_t page)
|
|
{
|
|
{
|
|
uint8_t shift = rb->clear_bmap_shift;
|
|
uint8_t shift = rb->clear_bmap_shift;
|
|
|
|
|
|
- return bitmap_test_and_clear_atomic(rb->clear_bmap, page >> shift, 1);
|
|
|
|
|
|
+ return bitmap_test_and_clear(rb->clear_bmap, page >> shift, 1);
|
|
}
|
|
}
|
|
|
|
|
|
static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset)
|
|
static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset)
|