lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100924170943.GB10777@lucy>
Date:	Fri, 24 Sep 2010 10:09:43 -0700
From:	Vernon Mauery <vernux@...ibm.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Randy Dunlap <rdunlap@...otime.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Keith Mannthey <kmannth@...ibm.com>
Subject: Re: [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v4

On 24-Sep-2010 07:14 AM, Vernon Mauery wrote:
>On Fri, Sep 24, 2010 at 6:12 AM, Arnd Bergmann <arnd@...db.de> wrote:
>> On Friday 24 September 2010, Vernon Mauery wrote:
[snip]
>>> +                     if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO)
>>> +                             iowrite8((u8)cmd_port_val, rtl_cmd_iomem_addr);
>>> +                     else
>>> +                             outb((u8)cmd_port_val, rtl_cmd_port_addr);
>>
>> ioread/iowrite already has the capability to use both mmio and pio
>> addresses. You can use ioport_map() to create an __iomem token that
>> corresponds to your rtl_cmd_port_addr and get rid of the rtl_cmd_type
>> variable.
>
>Thank you for that tip.  I will look into it and roll out another version.

I looked into this and tested it on some hardware, but it doesn't work.  
After more digging and poking, it looks like the reason is that the port 
IO address is not within the x86 standard port IO range.

I tried something like this:

			addr = ioread32(&rtl_table->cmd_port_address);
			plen = rtl_cmd_width/8;
			if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO)
				rtl_cmd_addr = ioremap(addr, plen);
			else
				rtl_cmd_addr = ioport_map(addr, plen);
			RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr);

It printed out that rtl_cmd_addr was 0, meaning the ioport_map failed.  
After more digging, it turns out that on at least one of the machines 
this code is targeted for, the port IO address (from the first line 
above) is 0x40000.  Even if this did get mapped, the IO_COND macro would 
target it for MMIO access instead of PIO access.  So I don't think I can 
use this method (even though it did make my code *a lot* nicer to read).

Any suggestions?

--Vernon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ