Skip to contentSkip to conversation

RFC: Use CONFIG_HAS_IOPORT around vcpu->pio_data

PATCH In review Hollis Blanchard 4 participants 8 messages Dec 3, 2007 – Dec 4, 2007 2 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RFC: Use CONFIG_HAS_IOPORT around vcpu->pio_data

---
pio_data is obviously arch-specific, but we might be able to get by with an ifdef in kvm_vcpu_nopage() rather than needing an arch hook. Thoughts?

1 file changed, 2 insertions(+)

drivers/kvm/kvm_main.c | 2 ++

drivers/kvm/kvm_main.c +2 -0
@@ -674,8 +674,10 @@ static struct page *kvm_vcpu_nopage(stru
 	pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
 	if (pgoff == 0)
 		page = virt_to_page(vcpu->run);
+#ifdef CONFIG_HAS_IOPORT
 	else if (pgoff == KVM_PIO_PAGE_OFFSET)
 		page = virt_to_page(vcpu->pio_data);
+#endif /* CONFIG_HAS_IOPORT */
 	else
 		return NOPAGE_SIGBUS;
 	get_page(page);

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

#1 lore raw

Actually, (now that I try to build with it :) this doesn't work for PowerPC, which defines (or rather, doesn't not define) CONFIG_HAS_IOPORT.

So I guess a callout to arch code will do. I'll send a patch sometime.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
Quoted 25 lines · Hollis Blanchard

---
pio_data is obviously arch-specific, but we might be able to get by with an ifdef in kvm_vcpu_nopage() rather than needing an arch hook. Thoughts?

1 file changed, 2 insertions(+)

drivers/kvm/kvm_main.c | 2 ++

drivers/kvm/kvm_main.c +2 -1
@@ -674,8 +674,10 @@ static struct page *kvm_vcpu_nopage(stru
 	pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
 	if (pgoff == 0)
 		page = virt_to_page(vcpu->run);
+#ifdef CONFIG_HAS_IOPORT
 	else if (pgoff == KVM_PIO_PAGE_OFFSET)
 		page = virt_to_page(vcpu->pio_data);
+#endif /* CONFIG_HAS_IOPORT */
 	else
 		return NOPAGE_SIGBUS;
 	get_page(page);
 
-------------------------------------------------------------------------
Quoted 8 lines

SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

#2 lore raw

Re: [kvm-ppc-devel] [PATCH] RFC: Use CONFIG_HAS_IOPORTaround vcpu->pio_data

Quoted 3 lines · Hollis Blanchard

Actually, (now that I try to build with it :) this doesn't work for PowerPC, which defines (or rather, doesn't not define) CONFIG_HAS_IOPORT.

You mean ppc has ioport , but you don't use current kvm io infrastructure to handle it ?
Xiantao

Quoted 6 lines · Hollis Blanchard
Quoted 5 lines

pio_data is obviously arch-specific, but we might be able to get by with an ifdef in kvm_vcpu_nopage() rather than needing an arch hook. Thoughts?

Quoted 8 lines

drivers/kvm/kvm_main.c --- static struct page *kvm_vcpu_nopage(stru · line 674

Quoted 8 lines
1 file changed, 2 insertions(+)

drivers/kvm/kvm_main.c | 2 ++

drivers/kvm/kvm_main.c --- renamed from drivers/kvm/kvm_main.c +0 -0

a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c

drivers/kvm/kvm_main.c --- renamed from drivers/kvm/kvm_main.c +0 -0
@@ -674,8 +674,10 @@ static struct page *kvm_vcpu_nopage(stru
 	pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) +

vma->vm_pgoff;

Quoted 10 lines

drivers/kvm/kvm_main.c --- static struct page *kvm_vcpu_nopage(stru · line 683

Quoted 10 lines
drivers/kvm/kvm_main.c --- renamed from drivers/kvm/kvm_main.c +2 -0
 		if (pgoff == 0) page = virt_to_page(vcpu->run);
+#ifdef CONFIG_HAS_IOPORT
 	else if (pgoff == KVM_PIO_PAGE_OFFSET)
 		page = virt_to_page(vcpu->pio_data);
+#endif /* CONFIG_HAS_IOPORT */
 	else
 		return NOPAGE_SIGBUS;
 	get_page(page);
 

------------------------------------------------------------------------
-

Quoted 11 lines
Quoted 8 lines

SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

------------------------------------------------------------------------
-

Quoted 8 lines

SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
kvm-ppc-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

A message that is not in the archive (sent off-list or not yet received): 42DFA526FC41B1429CE7279EF83C6BDCA39EA6-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org

#4 lore raw

Re: [kvm-ppc-devel] [PATCH] RFC: Use CONFIG_HAS_IOPORTaround vcpu->pio_data

Quoted 7 lines · Xiantao
Quoted 3 lines · Hollis Blanchard

Actually, (now that I try to build with it :) this doesn't work for PowerPC, which defines (or rather, doesn't not define) CONFIG_HAS_IOPORT.

You mean ppc has ioport , but you don't use current kvm io infrastructure to handle it ?

It's a matter of perspective. :)

The PowerPC architecture has no "IO" instructions; therefore all IO accesses are MMIO.

However, you can place devices with IO ports in a PowerPC system. In this case, the bridges are configured to translate MMIO accesses coming from the processor into IO port accesses on the bus. It is quite common to find standard x86 ISA devices, such as a SuperIO chip, in PowerPC systems.

In Linux, CONFIG_HAS_IOPORT doesn't really mean "does the architecture use IO ports," which is what I thought it meant. Instead, it means "should we track IO resources as well as MMIO resources," and that's true on PowerPC because we need manage the ISA bus as mentioned above. (The only current user of the symbol is lib/devres.c.)

In summary, it's an inappropriate ifdef for this situation.

Signature · 9 lines
Hollis Blanchard
IBM Linux Technology Center


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
#5 lore raw

Re: [kvm-ppc-devel] [PATCH] RFC: UseCONFIG_HAS_IOPORTaround vcpu->pio_data

Quoted 9 lines · Hollis Blanchard
Quoted 7 lines · Xiantao
Quoted 3 lines · Hollis Blanchard

Actually, (now that I try to build with it :) this doesn't work for PowerPC, which defines (or rather, doesn't not define) CONFIG_HAS_IOPORT.

You mean ppc has ioport , but you don't use current kvm io infrastructure to handle it ?

Quoted 8 lines

It's a matter of perspective. :)

The PowerPC architecture has no "IO" instructions; therefore all IO accesses are MMIO.
However, you can place devices with IO ports in a PowerPC system. In this case, the bridges are configured to translate MMIO accesses coming from the processor into IO port accesses on the bus. It is quite common to find standard x86 ISA devices, such as a SuperIO

Thank you for your elaboration.
So, bridge emulation in qemu will take over the responsibility of the translation for ppc?

Quoted 7 lines

In Linux, CONFIG_HAS_IOPORT doesn't really mean "does the architecture use IO ports," which is what I thought it meant. Instead, it means "should we track IO resources as well as MMIO resources," and that's true on PowerPC because we need manage the ISA bus as mentioned above. (The only current user of the symbol is lib/devres.c.)

In summary, it's an inappropriate ifdef for this situation.

Agree.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

A message that is not in the archive (sent off-list or not yet received): 42DFA526FC41B1429CE7279EF83C6BDCA39EC1-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org

#7 lore raw

Re: [kvm-ppc-devel] [PATCH] RFC: UseCONFIG_HAS_IOPORTaround vcpu->pio_data

Quoted 21 lines · Xiantao
Quoted 3 lines · Hollis Blanchard
Quoted 2 lines · Xiantao
Quoted 1 line · Hollis Blanchard

Actually, (now that I try to build with it :) this doesn't work

for

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

PowerPC, which defines (or rather, doesn't not define) CONFIG_HAS_IOPORT.

You mean ppc has ioport , but you don't use current kvm io infrastructure to handle it ?

Quoted 8 lines

It's a matter of perspective. :)

The PowerPC architecture has no "IO" instructions; therefore all IO accesses are MMIO.
However, you can place devices with IO ports in a PowerPC system. In this case, the bridges are configured to translate MMIO accesses coming from the processor into IO port accesses on the bus. It is quite common to find standard x86 ISA devices, such as a SuperIO

Quoted 3 lines

Thank you for your elaboration.
So, bridge emulation in qemu will take over the responsibility of the translation for ppc?

Yup.

Signature · 9 lines
Hollis Blanchard
IBM Linux Technology Center


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
#8 lore raw

Re: [kvm-ppc-devel] [PATCH] RFC:Use CONFIG_HAS_IOPORTaround vcpu->pio_data

In reply to Hollis Blanchard
Quoted 12 lines

It's a matter of perspective. :)

The PowerPC architecture has no "IO" instructions; therefore all IO accesses are MMIO.

However, you can place devices with IO ports in a PowerPC system. In this case, the bridges are configured to translate MMIO accesses coming from the processor into IO port accesses on the bus. It is quite common to find standard x86 ISA devices, such as a SuperIO chip, in PowerPC systems.

That is exactly what IA64 architecture takes.
I guess PIO is X86 historic issue when there as only 16 bits bus 20 years ago.
And it is probably due to 8085 which is for embedded system. All other archs may support PIO due to plenty of X86 devices, but do emulating PIO
in chipset/bridge like PPC/IA64.

Of course except S390 which is really different and doesn't want to take "open" devices:(

Eddie.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

#9 lore raw
In reply to Hollis Blanchard
Quoted 7 lines · Hollis Blanchard

Actually, (now that I try to build with it :) this doesn't work for PowerPC, which defines (or rather, doesn't not define) CONFIG_HAS_IOPORT.

So I guess a callout to arch code will do. I'll send a patch sometime.

We can also have a CONFIG_KVM_HAS_PIO and define/not define it as appropriate.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4