pci: separate generic code from x64-specific code

this patch moves the common pci definitions and the prototypes for
the architecture-dependent pci functions from drivers/pci.hh to
arch/common/pci.hh, and puts (most of) the x64-specific PCI stuff
in arch/x64/pci.cc.
Prepare arch-pci.hh with some x64-specific definitions, and build
the new arch/x64/pci.o module.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
pci: remove use of processor in pci-function.hh

there is no need to get the processor namespace just by
including pci-function.hh, which can be processor independent.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
pci: enable bars issuing pci command

for architectures other than x64 we need to reprogram the
BAR registers as we have no magical good values already
programmed by the "firmware" (qemu...).
It is also possible that there will be the need to reprogram
them on x64 in the future.
Trying to do that without explicitly enabling the I/O space
and memory space using a PCI command leads, in the case of
QEMU, to the reprogramming to be silently ignored.

There is therefore some minor restructuring of the pci
device / function code to account for a slightly different
procedure for the BARs, where we now:

enable access to I/O and mem, then
for each bar
    we first read the bar size, then
    call some arch-dependent code to fix up the final BAR reg,
    so that archs have a chance to reprogram it, then
    we proceed to assign the final address to the bar.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
aarch64: mmu: extend device memory range

at some point we need to get rid of those hardcoded addresses,
but that requires some changes to propagate the property through
the MMU template code, which I still didn't manage to work
reliably.

Suppress the debug message which was emitted for each page
with memory attributes for device memory, since when adding the
full PCI space for mach-virt that was starting to pollute the
output too much (and it seems to be working fine anyway).

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>