genprotimg: rename PV_CFLAG_NO_DECRYPTION to PV_PCF_NO_DECRYPTION

The new name reflects that it's a plaintext control flag. While at it, use a
left shift operation to calculate the value.

Acked-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2021-06-24 16:03:55 +00:00
committed by Jan Höppner
parent 8f32a60c22
commit 27120f2824
3 changed files with 4 additions and 4 deletions

View File

@@ -24,8 +24,8 @@
#define PV_MAGIC_NUMBER 0x49424d5365634578ULL
#define PV_VERSION_1 0x00000100U
/* prevent Ultravisor decryption during unpack operation */
#define PV_CFLAG_NO_DECRYPTION 0x10000000ULL
/* Plaintext control flags */
#define PV_PCF_NO_DECRYPTION (1ULL << 28) /* prevent Ultravisor decryption during unpack operation */
/* maxima for the PV version 1 */
#define PV_V1_IPIB_MAX_SIZE PAGE_SIZE

View File

@@ -41,7 +41,7 @@ uint32_t pv_hdr_size(const PvHdr *hdr)
gboolean pv_hdr_uses_encryption(const PvHdr *hdr)
{
return !(GUINT64_FROM_BE(hdr->head.pcf) & PV_CFLAG_NO_DECRYPTION);
return !(GUINT64_FROM_BE(hdr->head.pcf) & PV_PCF_NO_DECRYPTION);
}
uint64_t pv_hdr_enc_size(const PvHdr *hdr)

View File

@@ -61,7 +61,7 @@ static gint pv_img_prepare_component(const PvImage *img, PvComponent *comp,
void *opaque = NULL;
gint rc;
if (img->pcf & PV_CFLAG_NO_DECRYPTION) {
if (img->pcf & PV_PCF_NO_DECRYPTION) {
/* we only need to align the components */
func = pv_component_align;
opaque = NULL;