From patchwork Tue Aug 7 14:52:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 1286081 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 272DA3FC23 for ; Tue, 7 Aug 2012 14:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755248Ab2HGOwv (ORCPT ); Tue, 7 Aug 2012 10:52:51 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:35775 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754996Ab2HGOws (ORCPT ); Tue, 7 Aug 2012 10:52:48 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Aug 2012 15:52:47 +0100 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 7 Aug 2012 15:52:44 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q77Eqh362396348; Tue, 7 Aug 2012 15:52:43 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q77EqcEl009957; Tue, 7 Aug 2012 08:52:42 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q77EqJMv008831; Tue, 7 Aug 2012 08:52:36 -0600 From: Cornelia Huck To: KVM , linux-s390 , qemu-devel Cc: Avi Kivity , Marcelo Tosatti , Anthony Liguori , Rusty Russell , Christian Borntraeger , Carsten Otte , Alexander Graf , Heiko Carstens , Martin Schwidefsky , Sebastian Ott Subject: [PATCH 5/7] s390: Make some css-related structures usable by non-cio code. Date: Tue, 7 Aug 2012 16:52:17 +0200 Message-Id: <1344351139-1793-6-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1344351139-1793-1-git-send-email-cornelia.huck@de.ibm.com> References: <1344351139-1793-1-git-send-email-cornelia.huck@de.ibm.com> x-cbid: 12080714-0542-0000-0000-000002AC9AA4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm will need to use some css-related structures (pmcw, schib, orb), so let's move the definitions from drivers/s390/cio/ to include/asm/. Signed-off-by: Cornelia Huck --- arch/s390/include/asm/orb.h | 69 +++++++++++++++++++++++++++++++++++++++++++ arch/s390/include/asm/schib.h | 52 ++++++++++++++++++++++++++++++++ drivers/s390/cio/cio.h | 46 +---------------------------- drivers/s390/cio/io_sch.h | 2 +- drivers/s390/cio/ioasm.h | 2 +- drivers/s390/cio/orb.h | 67 ----------------------------------------- 6 files changed, 124 insertions(+), 114 deletions(-) create mode 100644 arch/s390/include/asm/orb.h create mode 100644 arch/s390/include/asm/schib.h delete mode 100644 drivers/s390/cio/orb.h diff --git a/arch/s390/include/asm/orb.h b/arch/s390/include/asm/orb.h new file mode 100644 index 0000000..ca5d255 --- /dev/null +++ b/arch/s390/include/asm/orb.h @@ -0,0 +1,69 @@ +/* + * Orb related data structures. + * + * Copyright IBM Corp. 2007, 2011 + * + * Author(s): Cornelia Huck + * Peter Oberparleiter + * Sebastian Ott + */ + +#ifndef S390_ORB_H +#define S390_ORB_H + +#include + +/* + * Command-mode operation request block + */ +struct cmd_orb { + u32 intparm; /* interruption parameter */ + u32 key:4; /* flags, like key, suspend control, etc. */ + u32 spnd:1; /* suspend control */ + u32 res1:1; /* reserved */ + u32 mod:1; /* modification control */ + u32 sync:1; /* synchronize control */ + u32 fmt:1; /* format control */ + u32 pfch:1; /* prefetch control */ + u32 isic:1; /* initial-status-interruption control */ + u32 alcc:1; /* address-limit-checking control */ + u32 ssic:1; /* suppress-suspended-interr. control */ + u32 res2:1; /* reserved */ + u32 c64:1; /* IDAW/QDIO 64 bit control */ + u32 i2k:1; /* IDAW 2/4kB block size control */ + u32 lpm:8; /* logical path mask */ + u32 ils:1; /* incorrect length */ + u32 zero:6; /* reserved zeros */ + u32 orbx:1; /* ORB extension control */ + u32 cpa; /* channel program address */ +} __packed __aligned(4); + +/* + * Transport-mode operation request block + */ +struct tm_orb { + u32 intparm; + u32 key:4; + u32:9; + u32 b:1; + u32:2; + u32 lpm:8; + u32:7; + u32 x:1; + u32 tcw; + u32 prio:8; + u32:8; + u32 rsvpgm:8; + u32:8; + u32:32; + u32:32; + u32:32; + u32:32; +} __packed __aligned(4); + +union orb { + struct cmd_orb cmd; + struct tm_orb tm; +} __packed __aligned(4); + +#endif /* S390_ORB_H */ diff --git a/arch/s390/include/asm/schib.h b/arch/s390/include/asm/schib.h new file mode 100644 index 0000000..87d7403 --- /dev/null +++ b/arch/s390/include/asm/schib.h @@ -0,0 +1,52 @@ +#ifndef _ASM_S390_SCHIB_H_ +#define _ASM_S390_SCHIB_H_ + +#include + +#include +/* + * path management control word + */ +struct pmcw { + u32 intparm; /* interruption parameter */ + u32 qf:1; /* qdio facility */ + u32 w:1; + u32 isc:3; /* interruption sublass */ + u32 res5:3; /* reserved zeros */ + u32 ena:1; /* enabled */ + u32 lm:2; /* limit mode */ + u32 mme:2; /* measurement-mode enable */ + u32 mp:1; /* multipath mode */ + u32 tf:1; /* timing facility */ + u32 dnv:1; /* device number valid */ + u32 dev:16; /* device number */ + u8 lpm; /* logical path mask */ + u8 pnom; /* path not operational mask */ + u8 lpum; /* last path used mask */ + u8 pim; /* path installed mask */ + u16 mbi; /* measurement-block index */ + u8 pom; /* path operational mask */ + u8 pam; /* path available mask */ + u8 chpid[8]; /* CHPID 0-7 (if available) */ + u32 unused1:8; /* reserved zeros */ + u32 st:3; /* subchannel type */ + u32 unused2:18; /* reserved zeros */ + u32 mbfc:1; /* measurement block format control */ + u32 xmwme:1; /* extended measurement word mode enable */ + u32 csense:1; /* concurrent sense; can be enabled ...*/ + /* ... per MSCH, however, if facility */ + /* ... is not installed, this results */ + /* ... in an operand exception. */ +} __packed; + +/* + * subchannel information block + */ +struct schib { + struct pmcw pmcw; /* path management control word */ + union scsw scsw; /* subchannel status word */ + __u64 mba; /* measurement block address */ + __u8 mda[4]; /* model dependent area */ +} __packed __aligned(4); + +#endif /* _ASM_S390_SCHIB_H_ */ diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h index 4a1ff5c..b6daa85 100644 --- a/drivers/s390/cio/cio.h +++ b/drivers/s390/cio/cio.h @@ -7,44 +7,10 @@ #include #include #include +#include #include #include "chsc.h" -/* - * path management control word - */ -struct pmcw { - u32 intparm; /* interruption parameter */ - u32 qf : 1; /* qdio facility */ - u32 w : 1; - u32 isc : 3; /* interruption sublass */ - u32 res5 : 3; /* reserved zeros */ - u32 ena : 1; /* enabled */ - u32 lm : 2; /* limit mode */ - u32 mme : 2; /* measurement-mode enable */ - u32 mp : 1; /* multipath mode */ - u32 tf : 1; /* timing facility */ - u32 dnv : 1; /* device number valid */ - u32 dev : 16; /* device number */ - u8 lpm; /* logical path mask */ - u8 pnom; /* path not operational mask */ - u8 lpum; /* last path used mask */ - u8 pim; /* path installed mask */ - u16 mbi; /* measurement-block index */ - u8 pom; /* path operational mask */ - u8 pam; /* path available mask */ - u8 chpid[8]; /* CHPID 0-7 (if available) */ - u32 unused1 : 8; /* reserved zeros */ - u32 st : 3; /* subchannel type */ - u32 unused2 : 18; /* reserved zeros */ - u32 mbfc : 1; /* measurement block format control */ - u32 xmwme : 1; /* extended measurement word mode enable */ - u32 csense : 1; /* concurrent sense; can be enabled ...*/ - /* ... per MSCH, however, if facility */ - /* ... is not installed, this results */ - /* ... in an operand exception. */ -} __attribute__ ((packed)); - /* Target SCHIB configuration. */ struct schib_config { u64 mba; @@ -59,16 +25,6 @@ struct schib_config { } __attribute__ ((packed)); /* - * subchannel information block - */ -struct schib { - struct pmcw pmcw; /* path management control word */ - union scsw scsw; /* subchannel status word */ - __u64 mba; /* measurement block address */ - __u8 mda[4]; /* model dependent area */ -} __attribute__ ((packed,aligned(4))); - -/* * When rescheduled, todo's with higher values will overwrite those * with lower values. */ diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h index 76253df..39c4ef1 100644 --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h @@ -5,8 +5,8 @@ #include #include #include +#include #include "css.h" -#include "orb.h" struct io_subchannel_private { union orb orb; /* operation request block */ diff --git a/drivers/s390/cio/ioasm.h b/drivers/s390/cio/ioasm.h index 4d80fc6..e5aac8d 100644 --- a/drivers/s390/cio/ioasm.h +++ b/drivers/s390/cio/ioasm.h @@ -2,8 +2,8 @@ #define S390_CIO_IOASM_H #include +#include #include -#include "orb.h" #include "cio.h" /* diff --git a/drivers/s390/cio/orb.h b/drivers/s390/cio/orb.h deleted file mode 100644 index 45a9865..0000000 --- a/drivers/s390/cio/orb.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Orb related data structures. - * - * Copyright IBM Corp. 2007, 2011 - * - * Author(s): Cornelia Huck - * Peter Oberparleiter - * Sebastian Ott - */ - -#ifndef S390_ORB_H -#define S390_ORB_H - -/* - * Command-mode operation request block - */ -struct cmd_orb { - u32 intparm; /* interruption parameter */ - u32 key:4; /* flags, like key, suspend control, etc. */ - u32 spnd:1; /* suspend control */ - u32 res1:1; /* reserved */ - u32 mod:1; /* modification control */ - u32 sync:1; /* synchronize control */ - u32 fmt:1; /* format control */ - u32 pfch:1; /* prefetch control */ - u32 isic:1; /* initial-status-interruption control */ - u32 alcc:1; /* address-limit-checking control */ - u32 ssic:1; /* suppress-suspended-interr. control */ - u32 res2:1; /* reserved */ - u32 c64:1; /* IDAW/QDIO 64 bit control */ - u32 i2k:1; /* IDAW 2/4kB block size control */ - u32 lpm:8; /* logical path mask */ - u32 ils:1; /* incorrect length */ - u32 zero:6; /* reserved zeros */ - u32 orbx:1; /* ORB extension control */ - u32 cpa; /* channel program address */ -} __packed __aligned(4); - -/* - * Transport-mode operation request block - */ -struct tm_orb { - u32 intparm; - u32 key:4; - u32:9; - u32 b:1; - u32:2; - u32 lpm:8; - u32:7; - u32 x:1; - u32 tcw; - u32 prio:8; - u32:8; - u32 rsvpgm:8; - u32:8; - u32:32; - u32:32; - u32:32; - u32:32; -} __packed __aligned(4); - -union orb { - struct cmd_orb cmd; - struct tm_orb tm; -} __packed __aligned(4); - -#endif /* S390_ORB_H */