All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
@ 2012-02-29  1:35 Alexey Korolev
  2012-03-21  5:26 ` Alexey Korolev
  2012-03-21 12:59 ` Michael S. Tsirkin
  0 siblings, 2 replies; 8+ messages in thread
From: Alexey Korolev @ 2012-02-29  1:35 UTC (permalink / raw)
  To: qemu-devel

Hi,

There is a typo in i440FX init code. This is causing problems when
somebody wants to access 64bit PCI range.


Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
---

 hw/piix_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 3ed3d90..aab8188 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
     b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
                            address_space_mem, address_space_io, ram_size,
                            pci_hole_start, pci_hole_size,
-                           pci_hole64_size, pci_hole64_size,
+                           pci_hole64_start, pci_hole64_size,
                            pci_memory, ram_memory);
     return b;
 }

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-02-29  1:35 [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code Alexey Korolev
@ 2012-03-21  5:26 ` Alexey Korolev
  2012-03-21 12:28   ` Markus Armbruster
  2012-03-21 12:32   ` Andreas Färber
  2012-03-21 12:59 ` Michael S. Tsirkin
  1 sibling, 2 replies; 8+ messages in thread
From: Alexey Korolev @ 2012-03-21  5:26 UTC (permalink / raw)
  To: qemu-devel

> Hi,
> 
> There is a typo in i440FX init code. This is causing problems when
> somebody wants to access 64bit PCI range.
> 
> 
> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
> ---
> 
>  hw/piix_pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> index 3ed3d90..aab8188 100644
> --- a/hw/piix_pci.c
> +++ b/hw/piix_pci.c
> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
>                             address_space_mem, address_space_io, ram_size,
>                             pci_hole_start, pci_hole_size,
> -                           pci_hole64_size, pci_hole64_size,
> +                           pci_hole64_start, pci_hole64_size,
>                             pci_memory, ram_memory);
>      return b;
>  }
> 
> 
> 
Hi there,

Any chance that someone could have a look and commit this?

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-03-21  5:26 ` Alexey Korolev
@ 2012-03-21 12:28   ` Markus Armbruster
  2012-03-21 12:35     ` Andreas Färber
  2012-03-21 12:32   ` Andreas Färber
  1 sibling, 1 reply; 8+ messages in thread
From: Markus Armbruster @ 2012-03-21 12:28 UTC (permalink / raw)
  To: alexey.korolev; +Cc: qemu-trivial, qemu-devel

Alexey Korolev <alexey.korolev@endace.com> writes:

>> Hi,
>> 
>> There is a typo in i440FX init code. This is causing problems when
>> somebody wants to access 64bit PCI range.
>> 
>> 
>> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
>> ---
>> 
>>  hw/piix_pci.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
>> index 3ed3d90..aab8188 100644
>> --- a/hw/piix_pci.c
>> +++ b/hw/piix_pci.c
>> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
>>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
>>                             address_space_mem, address_space_io, ram_size,
>>                             pci_hole_start, pci_hole_size,
>> -                           pci_hole64_size, pci_hole64_size,
>> +                           pci_hole64_start, pci_hole64_size,
>>                             pci_memory, ram_memory);
>>      return b;
>>  }
>> 
>> 
>> 
> Hi there,
>
> Any chance that someone could have a look and commit this?

Stefan, would you like to take this through your trivial queue?

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-03-21  5:26 ` Alexey Korolev
  2012-03-21 12:28   ` Markus Armbruster
@ 2012-03-21 12:32   ` Andreas Färber
  2012-03-21 13:07     ` Michael S. Tsirkin
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2012-03-21 12:32 UTC (permalink / raw)
  To: alexey.korolev; +Cc: qemu-devel, Michael S. Tsirkin

Hi,

Am 21.03.2012 06:26, schrieb Alexey Korolev:
>> Hi,
>>
>> There is a typo in i440FX init code. This is causing problems when
>> somebody wants to access 64bit PCI range.
>>
>>
>> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
>> ---
>>
>>  hw/piix_pci.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
>> index 3ed3d90..aab8188 100644
>> --- a/hw/piix_pci.c
>> +++ b/hw/piix_pci.c
>> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
>>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
>>                             address_space_mem, address_space_io, ram_size,
>>                             pci_hole_start, pci_hole_size,
>> -                           pci_hole64_size, pci_hole64_size,
>> +                           pci_hole64_start, pci_hole64_size,
>>                             pci_memory, ram_memory);
>>      return b;
>>  }
>>
>>
>>
> Hi there,
> 
> Any chance that someone could have a look and commit this?

A patch should never start with "Hi,", it should have a commit message
that can be applied unmodified to git, describing what area it touches,
what it changes and why. So, the the subject should start with, e.g.,
"i440fx: Fix start of 64-bit hole" and go on to explain where exactly
that is and what it affects (does this resolve some guest-visible bug?
when was it introduced? i.e., does it need to be backported?). Repeating
"typo" again and again is not helpful to understand the impact of a
commit when bisecting later on without seeing the code.

You forgot to cc the PCI maintainer.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-03-21 12:28   ` Markus Armbruster
@ 2012-03-21 12:35     ` Andreas Färber
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Färber @ 2012-03-21 12:35 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: alexey.korolev, qemu-trivial, qemu-devel, Michael S. Tsirkin

Am 21.03.2012 13:28, schrieb Markus Armbruster:
> Alexey Korolev <alexey.korolev@endace.com> writes:
> 
>>> Hi,
>>>
>>> There is a typo in i440FX init code. This is causing problems when
>>> somebody wants to access 64bit PCI range.
>>>
>>>
>>> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
>>> ---
>>>
>>>  hw/piix_pci.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
>>> index 3ed3d90..aab8188 100644
>>> --- a/hw/piix_pci.c
>>> +++ b/hw/piix_pci.c
>>> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
>>>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
>>>                             address_space_mem, address_space_io, ram_size,
>>>                             pci_hole_start, pci_hole_size,
>>> -                           pci_hole64_size, pci_hole64_size,
>>> +                           pci_hole64_start, pci_hole64_size,
>>>                             pci_memory, ram_memory);
>>>      return b;
>>>  }
>>>
>>>
>>>
>> Hi there,
>>
>> Any chance that someone could have a look and commit this?
> 
> Stefan, would you like to take this through your trivial queue?

Not without fixing up the commit message, please. CC'ing mst since this
is a PCI issue and not some random unmaintained area of code.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-02-29  1:35 [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code Alexey Korolev
  2012-03-21  5:26 ` Alexey Korolev
@ 2012-03-21 12:59 ` Michael S. Tsirkin
  2012-03-21 23:08   ` Alexey Korolev
  1 sibling, 1 reply; 8+ messages in thread
From: Michael S. Tsirkin @ 2012-03-21 12:59 UTC (permalink / raw)
  To: Alexey Korolev; +Cc: qemu-devel

On Wed, Feb 29, 2012 at 02:35:14PM +1300, Alexey Korolev wrote:
> Hi,
> 
> There is a typo in i440FX init code. This is causing problems when
> somebody wants to access 64bit PCI range.
> 
> 
> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>

I've fixed the commit message and applied.
How does one trigger the problem?
I'd like to know so I can test for it.

> ---
> 
>  hw/piix_pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> index 3ed3d90..aab8188 100644
> --- a/hw/piix_pci.c
> +++ b/hw/piix_pci.c
> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
>                             address_space_mem, address_space_io, ram_size,
>                             pci_hole_start, pci_hole_size,
> -                           pci_hole64_size, pci_hole64_size,
> +                           pci_hole64_start, pci_hole64_size,
>                             pci_memory, ram_memory);
>      return b;
>  }
> 
> 
> 
> 

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-03-21 12:32   ` Andreas Färber
@ 2012-03-21 13:07     ` Michael S. Tsirkin
  0 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2012-03-21 13:07 UTC (permalink / raw)
  To: Andreas Färber; +Cc: alexey.korolev, qemu-devel

On Wed, Mar 21, 2012 at 01:32:44PM +0100, Andreas Färber wrote:
> Hi,
> 
> Am 21.03.2012 06:26, schrieb Alexey Korolev:
> >> Hi,
> >>
> >> There is a typo in i440FX init code. This is causing problems when
> >> somebody wants to access 64bit PCI range.
> >>
> >>
> >> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
> >> ---
> >>
> >>  hw/piix_pci.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> >> index 3ed3d90..aab8188 100644
> >> --- a/hw/piix_pci.c
> >> +++ b/hw/piix_pci.c
> >> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
> >>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
> >>                             address_space_mem, address_space_io, ram_size,
> >>                             pci_hole_start, pci_hole_size,
> >> -                           pci_hole64_size, pci_hole64_size,
> >> +                           pci_hole64_start, pci_hole64_size,
> >>                             pci_memory, ram_memory);
> >>      return b;
> >>  }
> >>
> >>
> >>
> > Hi there,
> > 
> > Any chance that someone could have a look and commit this?
> 
> A patch should never start with "Hi,", it should have a commit message
> that can be applied unmodified to git, describing what area it touches,
> what it changes and why. So, the the subject should start with, e.g.,
> "i440fx: Fix start of 64-bit hole" and go on to explain where exactly
> that is and what it affects (does this resolve some guest-visible bug?
> when was it introduced? i.e., does it need to be backported?). Repeating
> "typo" again and again is not helpful to understand the impact of a
> commit when bisecting later on without seeing the code.
> 
> You forgot to cc the PCI maintainer.
> 
> Andreas

Yes I'd like to see an explanation on how to trigger a bug too.
OTOH the fix is clearly right, and it's not submitter's
work to dig through history to find where was the bug
added, that is too much to ask IMO.

> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code
  2012-03-21 12:59 ` Michael S. Tsirkin
@ 2012-03-21 23:08   ` Alexey Korolev
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Korolev @ 2012-03-21 23:08 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel


> On Wed, Feb 29, 2012 at 02:35:14PM +1300, Alexey Korolev wrote:
> I've fixed the commit message and applied. 
Thank you!
> How does one trigger the problem?
> I'd like to know so I can test for it.

The i440fx_init() function is called from pc_init code.
The call looks like that:
pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi,
                               system_memory, system_io, ram_size,
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l200>                              
below_4g_mem_size,
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l201>                              
0x100000000ULL - below_4g_mem_size,
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l202>                              
0x100000000ULL + above_4g_mem_size,
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l203>                              
(sizeof(target_phys_addr_t) == 4
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l204>                               
? 0
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l205>                               
: ((uint64_t)1 << 62)),
<http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=blob;f=hw/pc_piix.c;hb=a27726650ecc89b4a518a9a5d256de852894b3a2#l206>                              
pci_memory, ram_memory);

So we have

pci_hole64_size = 1 << 62

and because of typo  we also have 

pci_hole64_start = 1 << 62

The pci_hole64_start & pci_hole64_size are used to build memory regions access ranges.
Since 64bit PCI regions must be below 1<<40 and pci_hole64_start is 1 << 62, we have situations when all
64bit PCI regions are inaccessible.

For how to test it:
Convert device to use 64bit PCI BARs (ivshmem.c for example).
Apply patches for 64 bit support in seabios:
http://lists.nongnu.org/archive/html/qemu-devel/2012-03/msg00018.html.

Try to access the content of 64bit PCI memory. It will fail!


P/s:
IMHO it makes sence to update pc_iix.c code as well.
The pci_hole64_size value is incorrect anyway.


>> ---
>>
>>  hw/piix_pci.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
>> index 3ed3d90..aab8188 100644
>> --- a/hw/piix_pci.c
>> +++ b/hw/piix_pci.c
>> @@ -353,7 +353,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn,
>>      b = i440fx_common_init("i440FX", pi440fx_state, piix3_devfn, isa_bus, pic,
>>                             address_space_mem, address_space_io, ram_size,
>>                             pci_hole_start, pci_hole_size,
>> -                           pci_hole64_size, pci_hole64_size,
>> +                           pci_hole64_start, pci_hole64_size,
>>                             pci_memory, ram_memory);
>>      return b;
>>  }
>>
>>
>>
>>

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

end of thread, other threads:[~2012-03-21 23:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29  1:35 [Qemu-devel] [PATCH] Fix typo in i400FX chipset init code Alexey Korolev
2012-03-21  5:26 ` Alexey Korolev
2012-03-21 12:28   ` Markus Armbruster
2012-03-21 12:35     ` Andreas Färber
2012-03-21 12:32   ` Andreas Färber
2012-03-21 13:07     ` Michael S. Tsirkin
2012-03-21 12:59 ` Michael S. Tsirkin
2012-03-21 23:08   ` Alexey Korolev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.