s390-tools/s390-tools-sles15sp2-06-zipl-Make-use-of-__packed-macro.patch
Mark Post 30232e2023 Accepting request 786614 from home:markkp:branches:Base:System
- Added the following patches for bsc#1166850
  zipl: fix secure boot config handling:
  * s390-tools-sles15sp2-01-zipl-Add-missing-options-to-help-output.patch
  * s390-tools-sles15sp2-02-zipl-allow-stand-alone-secure-option-on-command-l.patch
  * s390-tools-sles15sp2-03-zipl-correct-secure-boot-config-handling.patch
  * s390-tools-sles15sp2-04-zipl-fix-zipl.conf-man-page-example-for-secure-boot.patch
- Modified the spec file so that the kernel used for the SCSI dump
  tool is named zfcpdump-image instead of zfcpdump_part.image. This
  is to match the new version of zipl that expects this new file name.
  (bsc#1166851)
- Added the following patches to implement jsc#SLE-7471, Enhanced
  tooling for kvm guest images (bsc#1165549):
  * s390-tools-sles15sp2-01-zipl-fix-Wdiscarded-qualifiers.patch
  * s390-tools-sles15sp2-02-zipl-fix-Waddress-of-packed-member.patch
  * s390-tools-sles15sp2-03-zipl-remove-some-useless-__packed___-attributes.patch
  * s390-tools-sles15sp2-04-zipl-Fix-entry-point-for-stand-alone-kdump.patch
  * s390-tools-sles15sp2-05-zipl-Fix-dependency-generation-in-zipl-boot.patch
  * s390-tools-sles15sp2-06-zipl-Make-use-of-__packed-macro.patch
  * s390-tools-sles15sp2-07-zipl-define-__section-macro-and-make-use-of-it.patch
  * s390-tools-sles15sp2-08-zipl-Make-use-of-__noreturn-macro.patch
  * s390-tools-sles15sp2-09-zipl-Define-__noinline-macro-and-make-use-of-it.patch
  * s390-tools-sles15sp2-10-zipl-stage3-Mark-start_kernel-__noreturn.patch
  * s390-tools-sles15sp2-11-zipl-sclp-Remove-duplicate-macros.patch
  * s390-tools-sles15sp2-12-zipl-Make-address-size-mask-macros-UL.patch
  * s390-tools-sles15sp2-13-zipl-libc-Use-stdint.h-instead-of-self-defined-macro.patch
  * s390-tools-sles15sp2-14-zipl-Consolidate-IMAGE-macros.patch
  * s390-tools-sles15sp2-15-zipl-Consolidate-STAGE-2-3-macros.patch
  * s390-tools-sles15sp2-16-zipl-stfle-use-uint64_t-instead-of-u64.patch
  * s390-tools-sles15sp2-17-zipl-boot-fix-comment-in-stage3.lds.patch
  * s390-tools-sles15sp2-18-lib-zt_common-add-STATIC_ASSERT-macro.patch
  * s390-tools-sles15sp2-19-zipl-use-STATIC_ASSERT-macro-for-no-padding-verifica.patch
  * s390-tools-sles15sp2-20-Support-lib-zt_common.h-to-be-used-in-assembler-and-.patch
  * s390-tools-sles15sp2-21-zipl-move-IPL-related-definitions-into-separate-head.patch
  * s390-tools-sles15sp2-22-zipl-move-SIGP-related-functions-and-definitions-int.patch
  * s390-tools-sles15sp2-23-zipl-add-SIGP_SET_ARCHITECTURE-to-sigp.h-and-use-it.patch
  * s390-tools-sles15sp2-24-zipl-stage3-make-IPL_DEVICE-definition-consistent-wi.patch
  * s390-tools-sles15sp2-25-zipl-move-Linux-layout-definitions-into-separate-hea.patch
  * s390-tools-sles15sp2-26-zipl-tape0-use-constants-defined-in-linux_layout.h.patch
  * s390-tools-sles15sp2-27-zipl-use-STAGE3_ENTRY-for-STAGE3_LOAD_ADDRESS.patch
  * s390-tools-sles15sp2-28-zipl-move-loaders-layout-definitions-into-separate-h.patch
  * s390-tools-sles15sp2-29-zipl-s390.h-rename-inline-macro-into-__always_inline.patch
  * s390-tools-sles15sp2-30-zipl-move-__always_inline-barrier-__pa32-pa-to-zt_co.patch
  * s390-tools-sles15sp2-31-zipl-make-BLK_PWRT-unsigned-int.patch
  * s390-tools-sles15sp2-32-Consolidate-MIN-and-MAX-macros.patch
  * s390-tools-sles15sp2-33-zipl-remove-libc.h-include-in-s390.h.patch
  * s390-tools-sles15sp2-34-zipl-move-s390.h-to-include-boot-s390.h.patch
  * s390-tools-sles15sp2-35-zipl-libc-include-s390.h.patch
  * s390-tools-sles15sp2-36-include-boot-s390.h-move-panic-and-panic_notify-to-l.patch
  * s390-tools-sles15sp2-37-include-boot-s390.h-fixes-for-Werror-sign-conversion.patch
  * s390-tools-sles15sp2-38-zipl-refactor-all-EBCDIC-code-into-separate-files.patch
  * s390-tools-sles15sp2-39-zipl-sclp-add-macros-for-the-control-program-masks.patch
  * s390-tools-sles15sp2-40-zipl-sclp-add-sclp_print_ascii.patch
  * s390-tools-sles15sp2-41-zipl-libc-printf-print-on-linemode-and-ASCII-console.patch
  * s390-tools-sles15sp2-42-Consolidate-ALIGN-__ALIGN_MASK-ARRAY_SIZE-macros.patch
  * s390-tools-sles15sp2-43-genprotimg-boot-initial-bootloader-support.patch
  * s390-tools-sles15sp2-44-genprotimg-boot-use-C-pre-processor-for-linker-scrip.patch
  * s390-tools-sles15sp2-45-genprotimg-add-relocator-for-stage3b.patch
  * s390-tools-sles15sp2-46-README.md-remove-useless-empty-line.patch
  * s390-tools-sles15sp2-47-include-boot-s390.h-add-guard-for-struct-__vector128.patch
  * s390-tools-sles15sp2-48-genprotimg-introduce-new-tool-for-the-creation-of-PV.patch
- Added a BuildRequires for glib2-devel to support the new feature.
- Added a %dir entry for /usr/share/s390-tools/genprotimg

OBS-URL: https://build.opensuse.org/request/show/786614
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=92
2020-03-19 22:52:46 +00:00

350 lines
8.7 KiB
Diff

Subject: [PATCH] [FEAT VS1804] zipl: Make use of __packed macro
From: Marc Hartmayer <mhartmay@linux.ibm.com>
Summary: genprotimg: Introduce new tool for the creation of PV images
Description: genprotimg takes a kernel, host-key documents, optionally an
initrd, optionally a file with the kernel command line, and it
generates a single, loadable image file. The image consists of a
concatenation of a plain text boot loader, the encrypted
components for kernel, initrd, and cmdline, and the
integrity-protected PV header, containing metadata necessary for
running the guest in PV mode. It's possible to use this image file
as a kernel for zIPL or for a direct kernel boot using QEMU.
Upstream-ID: 0f7ed7d4fc86041a8646ce7abb615849e1298cca
Problem-ID: VS1804
Upstream-Description:
zipl: Make use of __packed macro
Make use of the pre-defined __packed macro throughout zipl. This
requires adding the global include dir to ALL_CFLAGS.
Signed-off-by: Philipp Rudo <prudo@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
---
zipl/boot/Makefile | 2 -
zipl/boot/s390.h | 2 -
zipl/include/boot.h | 52 +++++++++++++++++++++++++------------------------
zipl/include/bootmap.h | 4 ++-
zipl/src/bootmap.c | 5 ++--
zipl/src/install.c | 3 +-
6 files changed, 37 insertions(+), 31 deletions(-)
--- a/zipl/boot/Makefile
+++ b/zipl/boot/Makefile
@@ -2,7 +2,7 @@
include ../../common.mak
ALL_CFLAGS = $(NO_PIE_CFLAGS) -Os -g -I $(rootdir)/zipl/include \
- -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+ -I $(rootdir)/include -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
-fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \
-fno-delete-null-pointer-checks \
-fexec-charset=IBM1047 -m64 -mpacked-stack \
--- a/zipl/boot/s390.h
+++ b/zipl/boot/s390.h
@@ -11,7 +11,7 @@
#ifndef S390_H
#define S390_H
-#include "../../include/lib/zt_common.h"
+#include "lib/zt_common.h"
#include "libc.h"
#define __pa32(x) ((uint32_t)(unsigned long)(x))
--- a/zipl/include/boot.h
+++ b/zipl/include/boot.h
@@ -14,6 +14,8 @@
#include <sys/types.h>
+#include "lib/zt_common.h"
+
#include "disk.h"
#include "job.h"
#include "zipl.h"
@@ -51,7 +53,7 @@ struct scsi_dump_sb {
uint64_t csum_offset;
uint64_t csum_size;
uint64_t csum;
-} __attribute((packed));
+} __packed;
#define SCSI_DUMP_SB_MAGIC 0x5a46435044554d50ULL; /* ZFCPDUMP */
/* To avoid a csum entry of 0 a seed is used */
@@ -63,7 +65,7 @@ struct scsi_dump_sb {
struct scsi_dump_param {
uint64_t block;
uint64_t reserved;
-} __attribute((packed));
+} __packed;
/* ECKD dump parameter */
struct eckd_dump_param {
@@ -73,14 +75,14 @@ struct eckd_dump_param {
uint8_t num_heads;
uint8_t bpt;
char reserved[4];
-} __attribute((packed, may_alias));
+} __packed __may_alias;
/* FBA dump parameter */
struct fba_dump_param {
uint64_t start_blk;
uint64_t blockct;
-} __attribute((packed));
+} __packed;
struct boot_info_bp_dump {
union {
@@ -89,7 +91,7 @@ struct boot_info_bp_dump {
struct scsi_dump_param scsi;
} param;
uint8_t unused[16];
-} __attribute__ ((packed));
+} __packed;
/*
* Layout of block pointer for linear devices
@@ -101,7 +103,7 @@ struct linear_blockptr {
uint16_t size;
uint16_t blockct;
uint8_t reserved[4];
-} __attribute((packed));
+} __packed;
/*
* Layout of block pointer for cylinder/head/sector devices
@@ -115,7 +117,7 @@ struct eckd_blockptr {
uint16_t size;
uint8_t blockct;
uint8_t reserved[8];
-} __attribute((packed));
+} __packed;
struct boot_info_bp_ipl {
union {
@@ -123,7 +125,7 @@ struct boot_info_bp_ipl {
struct linear_blockptr lin;
} bm_ptr;
uint8_t unused[16];
-} __attribute__ ((packed));
+} __packed;
struct boot_info {
char magic[4];
@@ -135,7 +137,7 @@ struct boot_info {
struct boot_info_bp_dump dump;
struct boot_info_bp_ipl ipl;
} bp;
-} __attribute__ ((packed));
+} __packed;
struct boot_ccw0 {
uint8_t cmd;
@@ -144,21 +146,21 @@ struct boot_ccw0 {
uint8_t flags;
uint8_t pad;
uint16_t count;
-} __attribute__ ((packed));
+} __packed;
/* Boot data structures for FBA disks */
struct boot_fba_locread {
struct boot_ccw0 locate;
struct boot_ccw0 read;
-} __attribute__ ((packed));
+} __packed;
struct boot_fba_locdata {
uint8_t command;
uint8_t dummy;
uint16_t blockct;
uint32_t blocknr;
-} __attribute__ ((packed));
+} __packed;
struct boot_fba_stage0 {
uint64_t psw;
@@ -169,13 +171,13 @@ struct boot_fba_stage0 {
struct boot_fba_locdata locdata[2];
uint64_t reserved[4];
struct boot_info boot_info;
-} __attribute__ ((packed));
+} __packed;
struct boot_fba_stage1b {
struct boot_fba_locread locread[STAGE2_BLK_CNT_MAX];
struct boot_fba_locdata locdata[STAGE2_BLK_CNT_MAX];
uint8_t unused[448];
-} __attribute__ ((packed));
+} __packed;
/* Boot data structures for ECKD disks */
@@ -184,14 +186,14 @@ struct boot_eckd_ccw1 {
uint8_t flags;
uint16_t count;
uint32_t address;
-} __attribute__ ((packed));
+} __packed;
struct boot_eckd_ssrt {
struct boot_ccw0 seek;
struct boot_ccw0 search;
struct boot_ccw0 tic;
struct boot_ccw0 read;
-} __attribute__ ((packed));
+} __packed;
struct boot_eckd_seekarg {
uint16_t pad;
@@ -199,32 +201,32 @@ struct boot_eckd_seekarg {
uint16_t head;
uint8_t sec;
uint8_t pad2;
-} __attribute__ ((packed));
+} __packed;
struct boot_eckd_cdl_stage0 {
uint64_t psw;
struct boot_ccw0 read;
struct boot_ccw0 tic;
-} __attribute__ ((packed));
+} __packed;
struct boot_eckd_ldl_stage0 {
uint64_t psw;
struct boot_ccw0 read_r0;
struct boot_ccw0 read_r1;
-} __attribute__ ((packed));
+} __packed;
struct boot_eckd_stage1 {
struct boot_eckd_ssrt ssrt[2];
struct boot_ccw0 tic1b;
struct boot_eckd_seekarg seek[2];
struct boot_info boot_info;
-} __attribute__ ((packed));
+} __packed;
struct boot_eckd_stage1b {
struct boot_eckd_ssrt ssrt[STAGE2_BLK_CNT_MAX];
struct boot_eckd_seekarg seek[STAGE2_BLK_CNT_MAX];
uint8_t unused[64];
-} __attribute__ ((packed));
+} __packed;
/* Stage 2 boot menu parameter structure */
@@ -236,7 +238,7 @@ struct boot_stage2_params {
uint16_t banner;
uint16_t config[BOOT_MENU_ENTRIES + 1];
uint64_t config_kdump;
-} __attribute__ ((packed));
+} __packed;
/* Stage 3 bootloader parameter structure */
@@ -251,7 +253,7 @@ struct boot_stage3_params {
uint16_t reserved[3];
uint64_t image_len;
uint64_t image_addr;
-} __attribute__ ((packed));
+} __packed;
#define STAGE3_FLAG_SCSI 0x0001
#define STAGE3_FLAG_KDUMP 0x0002
@@ -275,7 +277,7 @@ struct mvdump_param {
uint8_t blocksize;
uint8_t bpt;
uint8_t num_heads;
-} __attribute__ ((packed));
+} __packed;
struct mvdump_parm_table {
uint64_t timestamp;
@@ -284,7 +286,7 @@ struct mvdump_parm_table {
uint8_t ssid[MAX_DUMP_VOLUMES];
unsigned char reserved[512 - sizeof(uint64_t) - sizeof(uint16_t) -
(MAX_DUMP_VOLUMES * (sizeof(struct mvdump_param) + 1))];
-} __attribute__ ((packed));
+} __packed;
void boot_get_dump_info(struct boot_info *boot_info, uint8_t dev_type,
void *param);
--- a/zipl/include/bootmap.h
+++ b/zipl/include/bootmap.h
@@ -12,6 +12,8 @@
#ifndef BOOTMAP_H
#define BOOTMAP_H
+#include "lib/zt_common.h"
+
#include "disk.h"
#include "job.h"
#include "zipl.h"
@@ -23,7 +25,7 @@ struct signature_header {
uint8_t format;
uint8_t reserved[3];
uint32_t length;
-} __attribute((packed));
+} __packed;
typedef union {
uint64_t load_address;
--- a/zipl/src/bootmap.c
+++ b/zipl/src/bootmap.c
@@ -18,6 +18,7 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include "lib/zt_common.h"
#include "lib/util_part.h"
#include "lib/util_path.h"
@@ -223,7 +224,7 @@ struct component_entry {
uint8_t data[23];
uint8_t type;
component_data compdat;
-} __attribute((packed));
+} __packed;
typedef enum {
component_execute = 0x01,
@@ -263,7 +264,7 @@ struct component_header {
uint8_t magic[4];
uint8_t type;
uint8_t reserved[27];
-} __attribute((packed));
+} __packed;
typedef enum {
component_header_ipl = 0x00,
--- a/zipl/src/install.c
+++ b/zipl/src/install.c
@@ -23,6 +23,7 @@
#include <syslog.h>
#include <unistd.h>
+#include "lib/zt_common.h"
#include "lib/util_sys.h"
#include "boot.h"
@@ -89,7 +90,7 @@ update_scsi_mbr(void* bootblock, disk_bl
uint8_t program_table_pointer[16];
uint8_t reserved2[0x50];
struct boot_info boot_info;
- } __attribute__ ((packed))* mbr;
+ } __packed* mbr;
struct scsi_dump_param param;
void* buffer;