Bug 452534

Summary: [RFE] Enable raw devices on s390x
Product: Red Hat Enterprise Linux 5 Reporter: Bryn M. Reeves <bmr>
Component: kernelAssignee: Jeff Moyer <jmoyer>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: cward, dzickus, hjia, jmoyer, rlerch, rwheeler, sghosh, swells, tao
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
This enables raw device support for IBM System z platforms.
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 08:48:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Kconfig patch for raw driver on s390x none

Description Bryn M. Reeves 2008-06-23 15:56:45 UTC
Description of problem:
Raw device support is not enabled on the s390 architecture (vanilla 2.6.18 s390x
driver config does not allow the driver to be enabled). Third party applications
may require access to devices using the old /dev/raw/rawN interface.

Version-Release number of selected component (if applicable):
2.6.18-*.el5

How reproducible:
100%

Steps to Reproduce:
1. Install an s390x system
2. # grep RAW_D /boot/config-*
  
Actual results:
<nothing>

Expected results:
CONFIG_RAW_DRIVER=y
CONFIG_MAX_RAW_DEVS=8192

Additional info:
There were previously problems with the raw I/O driver on s390 that were fixed
back in 2005:

commit 68f66feb300423bb9ee5daecb1951af394425a38
Author: Stephen Tweedie <sct>
Date:   Fri May 13 23:31:19 2005 -0400

    [PATCH] Fix root hole in raw device
    
    [Patch] Fix raw device ioctl pass-through
    
    Raw character devices are supposed to pass ioctls through to the block
    devices they are bound to.  Unfortunately, they are using the wrong
    function for this: ioctl_by_bdev(), instead of blkdev_ioctl().
    
    ioctl_by_bdev() performs a set_fs(KERNEL_DS) before calling the ioctl,
    redirecting the user-space buffer access to the kernel address space.
    This is, needless to say, a bad thing.
    
    This was noticed first on s390, where raw IO was non-functioning.  The
    s390 driver config does not actually allow raw IO to be enabled, which
    was the first part of the problem.  Secondly, the s390 kernel address
    space is distinct from user, causing legal raw ioctls to fail.  I've
    reproduced this on a kernel built with 4G:4G split on x86, which fails
    in the same way (-EFAULT if the address does not exist kernel-side;
    returns success without actually populating the user buffer if it does.)
    
    The patch below fixes both the config and address-space problems.  It's
    based closely on a patch by Jan Glauber <jang.com>, which has
    been tested on s390 at IBM.  I've tested it on x86 4G:4G (split address
    space) and x86_64 (common address space).
    
    Kernel-address-space access has been assigned CAN-2005-1264.
    
    Signed-off-by: Stephen Tweedie <sct>
    Signed-off-by: Dave Jones <davej>
    Signed-off-by: Greg Kroah-Hartman <gregkh>

The remaining pieces are just the Kconfig patch to add options to enable the
driver on s390x and a change to the s390 config in the kernel configuration files.

Comment 1 Bryn M. Reeves 2008-06-23 15:56:45 UTC
Created attachment 310038 [details]
Kconfig patch for raw driver on s390x

Comment 13 RHEL Program Management 2009-02-16 15:38:25 UTC
Updating PM score.

Comment 14 Jeff Moyer 2009-04-22 02:10:29 UTC
I'm having troubles reserving an s390 system, unfortunately.  However, it looks to me like raw devices are supported on s390 already.  If you have access to an s390 system, please check to see if /dev/rawctl exists, and whether the raw command works for binding devices.

Thanks!

Comment 15 Jeff Moyer 2009-04-22 11:34:25 UTC
I managed to reserve a system and rawctl is not available.

Comment 17 Jeff Moyer 2009-04-22 16:17:53 UTC
The attached patch applied with minimal offsets and worked as advertised.  I was not able to verify that I/O could be performed to a raw device because of the configuration of the system I was using.  Is there any chance we can get testing from the customer on this?  Simply performing some dd commands should be sufficient.

Thanks!

Comment 18 Don Zickus 2009-04-27 15:57:40 UTC
in kernel-2.6.18-141.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 20 Chris Ward 2009-07-03 18:03:56 UTC
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.

Comment 21 Shawn Wells 2009-07-08 22:06:14 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
This enables raw device support for IBM System z platforms.

Comment 25 errata-xmlrpc 2009-09-02 08:48:16 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-1243.html