From patchwork Tue Sep 4 15:13:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 1403011 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 4A70F4025E for ; Tue, 4 Sep 2012 15:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932535Ab2IDPP3 (ORCPT ); Tue, 4 Sep 2012 11:15:29 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:59142 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757152Ab2IDPNj (ORCPT ); Tue, 4 Sep 2012 11:13:39 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Sep 2012 16:13:37 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 4 Sep 2012 16:13:35 +0100 Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q84FDSUh17498302; Tue, 4 Sep 2012 15:13:28 GMT Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q84FDX5I021238; Tue, 4 Sep 2012 09:13:35 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q84FDVoH021024; Tue, 4 Sep 2012 09:13:33 -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 v2 5/7] s390: Make some css-related structures usable by non-cio code. Date: Tue, 4 Sep 2012 17:13:28 +0200 Message-Id: <1346771610-52423-6-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1346771610-52423-1-git-send-email-cornelia.huck@de.ibm.com> References: <1346771610-52423-1-git-send-email-cornelia.huck@de.ibm.com> x-cbid: 12090415-2966-0000-0000-0000052F5387 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 */