LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] iSCSI/iBFT: use proper address translation
@ 2009-10-01  8:01 Jan Beulich
  2009-10-01 13:35 ` Peter Jones
  2009-10-01 21:46 ` Jeremy Fitzhardinge
  0 siblings, 2 replies; 8+ messages in thread
From: Jan Beulich @ 2009-10-01  8:01 UTC (permalink / raw
  To: ketuzsezr, pjones; +Cc: Jeremy Fitzhardinge, Martin Wilck, linux-kernel

In virtual environments (namely, Xen Dom0) virt <-> phys and
virt <-> isa-bus translations cannot be freely interchanged. When
looking at memory below 1M, the latter translations should always
be used.

iscsi_ibft_find.c part from: Martin Wilck <martin.wilck@ts.fujitsu.com>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>

---
 drivers/firmware/iscsi_ibft.c      |    2 +-
 drivers/firmware/iscsi_ibft_find.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.32-rc1/drivers/firmware/iscsi_ibft.c	2009-06-10 05:05:27.000000000 +0200
+++ 2.6.32-rc1-ibft-addr-xlat/drivers/firmware/iscsi_ibft.c	2009-09-24 12:14:48.000000000 +0200
@@ -939,7 +939,7 @@ static int __init ibft_init(void)
 
 	if (ibft_addr) {
 		printk(KERN_INFO "iBFT detected at 0x%llx.\n",
-		       (u64)virt_to_phys((void *)ibft_addr));
+		       (u64)isa_virt_to_bus(ibft_addr));
 
 		rc = ibft_check_device();
 		if (rc)
--- linux-2.6.32-rc1/drivers/firmware/iscsi_ibft_find.c	2008-10-10 00:13:53.000000000 +0200
+++ 2.6.32-rc1-ibft-addr-xlat/drivers/firmware/iscsi_ibft_find.c	2009-09-24 09:52:18.000000000 +0200
@@ -65,10 +65,10 @@ void __init reserve_ibft_region(void)
 		 * so skip that area */
 		if (pos == VGA_MEM)
 			pos += VGA_SIZE;
-		virt = phys_to_virt(pos);
+		virt = isa_bus_to_virt(pos);
 		if (memcmp(virt, IBFT_SIGN, IBFT_SIGN_LEN) == 0) {
 			unsigned long *addr =
-			    (unsigned long *)phys_to_virt(pos + 4);
+			    (unsigned long *)isa_bus_to_virt(pos + 4);
 			len = *addr;
 			/* if the length of the table extends past 1M,
 			 * the table cannot be valid. */




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-01  8:01 [PATCH] iSCSI/iBFT: use proper address translation Jan Beulich
@ 2009-10-01 13:35 ` Peter Jones
  2009-10-01 21:46 ` Jeremy Fitzhardinge
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Jones @ 2009-10-01 13:35 UTC (permalink / raw
  To: Jan Beulich; +Cc: ketuzsezr, Jeremy Fitzhardinge, Martin Wilck, linux-kernel

On 10/01/2009 04:01 AM, Jan Beulich wrote:
> In virtual environments (namely, Xen Dom0) virt <-> phys and
> virt <-> isa-bus translations cannot be freely interchanged. When
> looking at memory below 1M, the latter translations should always
> be used.
> 
> iscsi_ibft_find.c part from: Martin Wilck <martin.wilck@ts.fujitsu.com>.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>

Looks good to me.

Signed-off-by: Peter Jones <pjones@redhat.com>

> 
> ---
>  drivers/firmware/iscsi_ibft.c      |    2 +-
>  drivers/firmware/iscsi_ibft_find.c |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> --- linux-2.6.32-rc1/drivers/firmware/iscsi_ibft.c	2009-06-10 05:05:27.000000000 +0200
> +++ 2.6.32-rc1-ibft-addr-xlat/drivers/firmware/iscsi_ibft.c	2009-09-24 12:14:48.000000000 +0200
> @@ -939,7 +939,7 @@ static int __init ibft_init(void)
>  
>  	if (ibft_addr) {
>  		printk(KERN_INFO "iBFT detected at 0x%llx.\n",
> -		       (u64)virt_to_phys((void *)ibft_addr));
> +		       (u64)isa_virt_to_bus(ibft_addr));
>  
>  		rc = ibft_check_device();
>  		if (rc)
> --- linux-2.6.32-rc1/drivers/firmware/iscsi_ibft_find.c	2008-10-10 00:13:53.000000000 +0200
> +++ 2.6.32-rc1-ibft-addr-xlat/drivers/firmware/iscsi_ibft_find.c	2009-09-24 09:52:18.000000000 +0200
> @@ -65,10 +65,10 @@ void __init reserve_ibft_region(void)
>  		 * so skip that area */
>  		if (pos == VGA_MEM)
>  			pos += VGA_SIZE;
> -		virt = phys_to_virt(pos);
> +		virt = isa_bus_to_virt(pos);
>  		if (memcmp(virt, IBFT_SIGN, IBFT_SIGN_LEN) == 0) {
>  			unsigned long *addr =
> -			    (unsigned long *)phys_to_virt(pos + 4);
> +			    (unsigned long *)isa_bus_to_virt(pos + 4);
>  			len = *addr;
>  			/* if the length of the table extends past 1M,
>  			 * the table cannot be valid. */
> 
> 
> 


-- 
        Peter

When privacy is outlawed only outlaws will have privacy.
		-- Zimmermann

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-01  8:01 [PATCH] iSCSI/iBFT: use proper address translation Jan Beulich
  2009-10-01 13:35 ` Peter Jones
@ 2009-10-01 21:46 ` Jeremy Fitzhardinge
  2009-10-02  1:28   ` Konrad Rzeszutek
  2009-10-02  7:23   ` Jan Beulich
  1 sibling, 2 replies; 8+ messages in thread
From: Jeremy Fitzhardinge @ 2009-10-01 21:46 UTC (permalink / raw
  To: Jan Beulich
  Cc: ketuzsezr@darnok.org, pjones@redhat.com, Martin Wilck,
	linux-kernel@vger.kernel.org

On 10/01/09 01:01, Jan Beulich wrote:
> In virtual environments (namely, Xen Dom0) virt <-> phys and
> virt <-> isa-bus translations cannot be freely interchanged. When
> looking at memory below 1M, the latter translations should always
> be used.
>   

Do you have a different definition for isa_virt_to_bus in your kernel? 
As far as I can see it is defined to be the same as virt_to_phys.  Also,
the ISA memory is identity mapped into the domain's physical mapping
space, so it should be directly accessible without any problems.

    J

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-01 21:46 ` Jeremy Fitzhardinge
@ 2009-10-02  1:28   ` Konrad Rzeszutek
  2009-10-02  7:25     ` Jan Beulich
  2009-10-02  7:23   ` Jan Beulich
  1 sibling, 1 reply; 8+ messages in thread
From: Konrad Rzeszutek @ 2009-10-02  1:28 UTC (permalink / raw
  To: Jeremy Fitzhardinge
  Cc: Jan Beulich, ketuzsezr@darnok.org, pjones@redhat.com,
	Martin Wilck, linux-kernel@vger.kernel.org, alex.zeffertt

On Thu, Oct 01, 2009 at 02:46:52PM -0700, Jeremy Fitzhardinge wrote:
> On 10/01/09 01:01, Jan Beulich wrote:
> > In virtual environments (namely, Xen Dom0) virt <-> phys and
> > virt <-> isa-bus translations cannot be freely interchanged. When
> > looking at memory below 1M, the latter translations should always
> > be used.
> >   
> 
> Do you have a different definition for isa_virt_to_bus in your kernel? 
> As far as I can see it is defined to be the same as virt_to_phys.  Also,
> the ISA memory is identity mapped into the domain's physical mapping
> space, so it should be directly accessible without any problems.

The issue as I've come to understand is that the virt_to_phys on
memory below the 1MB does not work. Alex suggested another fix which
ioremap's the iBFT region, but I think this patch by Martin does the same job.

Either way, it looks good to me.

Signed-off-by: Konrad Rzeszutek Wilk <ketuzsezs@darnok.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-01 21:46 ` Jeremy Fitzhardinge
  2009-10-02  1:28   ` Konrad Rzeszutek
@ 2009-10-02  7:23   ` Jan Beulich
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Beulich @ 2009-10-02  7:23 UTC (permalink / raw
  To: Jeremy Fitzhardinge
  Cc: ketuzsezr@darnok.org, Martin Wilck, pjones@redhat.com,
	linux-kernel@vger.kernel.org

>>> Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com> 01.10.09 23:46 >>>
>On 10/01/09 01:01, Jan Beulich wrote:
>> In virtual environments (namely, Xen Dom0) virt <-> phys and
>> virt <-> isa-bus translations cannot be freely interchanged. When
>> looking at memory below 1M, the latter translations should always
>> be used.
>>   
>
>Do you have a different definition for isa_virt_to_bus in your kernel? 
>As far as I can see it is defined to be the same as virt_to_phys.  Also,
>the ISA memory is identity mapped into the domain's physical mapping
>space, so it should be directly accessible without any problems.

I wasn't sure if this is an issue in the pv-ops kernel, so I copied you just
in case. Yes, we do have a different virt<->isa_bus translation, but
the point of the patch really is that virt<->phys translations are
incorrectly being used here regardless of the underlying environment.

Jan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-02  1:28   ` Konrad Rzeszutek
@ 2009-10-02  7:25     ` Jan Beulich
  2009-10-02 14:32       ` Peter Jones
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2009-10-02  7:25 UTC (permalink / raw
  To: Konrad Rzeszutek, pjones
  Cc: Jeremy Fitzhardinge, ketuzsezr@darnok.org, alex.zeffertt,
	Martin Wilck, linux-kernel@vger.kernel.org

>>> Konrad Rzeszutek <konrad@darnok.org> 02.10.09 03:28 >>>
>The issue as I've come to understand is that the virt_to_phys on
>memory below the 1MB does not work. Alex suggested another fix which
>ioremap's the iBFT region, but I think this patch by Martin does the same job.
>
>Either way, it looks good to me.
>
>Signed-off-by: Konrad Rzeszutek Wilk <ketuzsezs@darnok.org>

With both ofyou having signed off on it - who's going to push this to
Linus? I'm specifically asking in case I'm expected to.

Jan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-02  7:25     ` Jan Beulich
@ 2009-10-02 14:32       ` Peter Jones
  2009-10-02 14:58         ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Jones @ 2009-10-02 14:32 UTC (permalink / raw
  To: Jan Beulich
  Cc: Konrad Rzeszutek, Jeremy Fitzhardinge, ketuzsezr@darnok.org,
	alex.zeffertt, Martin Wilck, linux-kernel@vger.kernel.org

On 10/02/2009 03:25 AM, Jan Beulich wrote:
>>>> Konrad Rzeszutek<konrad@darnok.org>  02.10.09 03:28>>>
>> The issue as I've come to understand is that the virt_to_phys on
>> memory below the 1MB does not work. Alex suggested another fix which
>> ioremap's the iBFT region, but I think this patch by Martin does the same job.
>>
>> Either way, it looks good to me.
>>
>> Signed-off-by: Konrad Rzeszutek Wilk<ketuzsezs@darnok.org>
>
> With both ofyou having signed off on it - who's going to push this to
> Linus? I'm specifically asking in case I'm expected to.

Not sure how that's supposed to work, but I'm cool with you doing it ;)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iSCSI/iBFT: use proper address translation
  2009-10-02 14:32       ` Peter Jones
@ 2009-10-02 14:58         ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2009-10-02 14:58 UTC (permalink / raw
  To: Peter Jones
  Cc: Jan Beulich, Jeremy Fitzhardinge, ketuzsezr@darnok.org,
	alex.zeffertt, Martin Wilck, linux-kernel@vger.kernel.org

On Fri, Oct 02, 2009 at 10:32:03AM -0400, Peter Jones wrote:
> On 10/02/2009 03:25 AM, Jan Beulich wrote:
> >>>>Konrad Rzeszutek<konrad@darnok.org>  02.10.09 03:28>>>
> >>The issue as I've come to understand is that the virt_to_phys on
> >>memory below the 1MB does not work. Alex suggested another fix which
> >>ioremap's the iBFT region, but I think this patch by Martin does the same 
> >>job.
> >>
> >>Either way, it looks good to me.
> >>
> >>Signed-off-by: Konrad Rzeszutek Wilk<ketuzsezs@darnok.org>
> >
> >With both ofyou having signed off on it - who's going to push this to
> >Linus? I'm specifically asking in case I'm expected to.
> 
> Not sure how that's supposed to work, but I'm cool with you doing it ;)

Yeah me too :-)

P.S.
In the past I pushed it off to Greg KH and/or Mike Christie.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-10-02 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01  8:01 [PATCH] iSCSI/iBFT: use proper address translation Jan Beulich
2009-10-01 13:35 ` Peter Jones
2009-10-01 21:46 ` Jeremy Fitzhardinge
2009-10-02  1:28   ` Konrad Rzeszutek
2009-10-02  7:25     ` Jan Beulich
2009-10-02 14:32       ` Peter Jones
2009-10-02 14:58         ` Konrad Rzeszutek Wilk
2009-10-02  7:23   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).