2015-06-26 18:54:51 +03:00
|
|
|
/*
|
|
|
|
* s390 storage key device
|
|
|
|
*
|
|
|
|
* Copyright 2015 IBM Corp.
|
|
|
|
* Author(s): Jason J. Herne <jjherne@linux.vnet.ibm.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or (at
|
|
|
|
* your option) any later version. See the COPYING file in the top-level
|
|
|
|
* directory.
|
|
|
|
*/
|
|
|
|
|
2016-06-29 14:47:03 +03:00
|
|
|
#ifndef S390_STORAGE_KEYS_H
|
|
|
|
#define S390_STORAGE_KEYS_H
|
2015-06-26 18:54:51 +03:00
|
|
|
|
2019-08-12 08:23:51 +03:00
|
|
|
#include "hw/qdev-core.h"
|
2015-06-26 21:07:21 +03:00
|
|
|
#include "monitor/monitor.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2015-06-26 18:54:51 +03:00
|
|
|
|
|
|
|
#define TYPE_S390_SKEYS "s390-skeys"
|
2020-09-16 21:25:18 +03:00
|
|
|
OBJECT_DECLARE_TYPE(S390SKeysState, S390SKeysClass, S390_SKEYS)
|
2015-06-26 18:54:51 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct S390SKeysState {
|
2015-06-26 18:54:51 +03:00
|
|
|
DeviceState parent_obj;
|
2015-07-09 20:56:44 +03:00
|
|
|
bool migration_enabled;
|
2015-06-26 18:54:51 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2015-06-26 18:54:51 +03:00
|
|
|
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct S390SKeysClass {
|
2015-06-26 18:54:51 +03:00
|
|
|
DeviceClass parent_class;
|
|
|
|
int (*skeys_enabled)(S390SKeysState *ks);
|
|
|
|
int (*get_skeys)(S390SKeysState *ks, uint64_t start_gfn, uint64_t count,
|
|
|
|
uint8_t *keys);
|
|
|
|
int (*set_skeys)(S390SKeysState *ks, uint64_t start_gfn, uint64_t count,
|
|
|
|
uint8_t *keys);
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2015-06-26 18:54:51 +03:00
|
|
|
|
|
|
|
#define TYPE_KVM_S390_SKEYS "s390-skeys-kvm"
|
|
|
|
#define TYPE_QEMU_S390_SKEYS "s390-skeys-qemu"
|
2020-09-03 23:43:22 +03:00
|
|
|
typedef struct QEMUS390SKeysState QEMUS390SKeysState;
|
2020-09-01 00:07:33 +03:00
|
|
|
DECLARE_INSTANCE_CHECKER(QEMUS390SKeysState, QEMU_S390_SKEYS,
|
|
|
|
TYPE_QEMU_S390_SKEYS)
|
2015-06-26 18:54:51 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct QEMUS390SKeysState {
|
2015-06-26 18:54:51 +03:00
|
|
|
S390SKeysState parent_obj;
|
|
|
|
uint8_t *keydata;
|
|
|
|
uint32_t key_count;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2015-06-26 18:54:51 +03:00
|
|
|
|
|
|
|
void s390_skeys_init(void);
|
|
|
|
|
|
|
|
S390SKeysState *s390_get_skeys_device(void);
|
|
|
|
|
2015-06-26 21:07:21 +03:00
|
|
|
void hmp_dump_skeys(Monitor *mon, const QDict *qdict);
|
2015-06-26 21:10:16 +03:00
|
|
|
void hmp_info_skeys(Monitor *mon, const QDict *qdict);
|
|
|
|
|
2016-06-29 14:47:03 +03:00
|
|
|
#endif /* S390_STORAGE_KEYS_H */
|