mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/cxl: Add get scan media capabilities cmd support
Use simple heuristics to determine the cost of scanning any given chunk, assuming cost is equal across the whole device, without differentiating between volatile or persistent partitions. This is aligned to the fact that these constraints are not enforced in respective poison query commands. Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Link: https://lore.kernel.org/r/20230908073152.4386-3-dave@stgolabs.net Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Message-Id: <20240705120643.959422-2-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
a207d5f87d
commit
d61cc5b6a8
3 changed files with 233 additions and 9 deletions
|
@ -397,6 +397,11 @@ static inline void __toggle_media(CXLDeviceState *cxl_dstate, int val)
|
|||
#define cxl_dev_enable_media(cxlds) \
|
||||
do { __toggle_media((cxlds), 0x1); } while (0)
|
||||
|
||||
static inline bool scan_media_running(CXLCCI *cci)
|
||||
{
|
||||
return !!cci->bg.runtime && cci->bg.opcode == 0x4304;
|
||||
}
|
||||
|
||||
static inline bool sanitize_running(CXLCCI *cci)
|
||||
{
|
||||
return !!cci->bg.runtime && cci->bg.opcode == 0x4400;
|
||||
|
@ -491,6 +496,9 @@ struct CXLType3Dev {
|
|||
unsigned int poison_list_cnt;
|
||||
bool poison_list_overflowed;
|
||||
uint64_t poison_list_overflow_ts;
|
||||
/* Poison Injection - backup */
|
||||
CXLPoisonList poison_list_bkp;
|
||||
CXLPoisonList scan_media_results;
|
||||
|
||||
struct dynamic_capacity {
|
||||
HostMemoryBackend *host_dc;
|
||||
|
@ -558,6 +566,7 @@ CXLRetCode cxl_event_clear_records(CXLDeviceState *cxlds,
|
|||
void cxl_event_irq_assert(CXLType3Dev *ct3d);
|
||||
|
||||
void cxl_set_poison_list_overflowed(CXLType3Dev *ct3d);
|
||||
void cxl_clear_poison_list_overflowed(CXLType3Dev *ct3d);
|
||||
|
||||
CXLDCRegion *cxl_find_dc_region(CXLType3Dev *ct3d, uint64_t dpa, uint64_t len);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue