Re: [Qemu-devel] [PATCH v14 0/5] vGICv3 support

2015-09-22 Thread Peter Maydell
On 17 September 2015 at 10:27, Peter Maydell  wrote:
> On 9 September 2015 at 08:49, Pavel Fedin  wrote:
>> This series introduces support for GICv3 by KVM. Software emulation is
>> currently not supported.
>>
>> v13 => v14
>>
>> - Rebased on the latest master, fixed conflicts in hw/arm/virt.c
>>
>
> You'll need to fix the acpi related bits Shannon has review comments
> on in patch 5, but otherwise this looks good to me.

Having discussed this with Shannon yesterday, the fixes required
are trivial. Shannon kindly sent me this tiny patch, so I'm just
going to squash that into your patch 5 and put the whole lot into
target-arm.next, rather than make you have to go through another
round.


 hw/arm/virt-acpi-build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 0dd7fce..59c84ff 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -454,8 +454,8 @@ build_madt(GArray *table_data, GArray *linker,
VirtGuestInfo *guest_info,

 gicr->type = ACPI_APIC_GENERIC_REDISTRIBUTOR;
 gicr->length = sizeof(*gicr);
-gicr->base_address = memmap[VIRT_GIC_REDIST].base;
-gicr->range_length = memmap[VIRT_GIC_REDIST].size;
+gicr->base_address = cpu_to_le64(memmap[VIRT_GIC_REDIST].base);
+gicr->range_length = cpu_to_le32(memmap[VIRT_GIC_REDIST].size);
 } else {
 for (i = 0; i < guest_info->smp_cpus; i++) {
 AcpiMadtGenericInterrupt *gicc = acpi_data_push(table_data,

thanks
-- PMM



Re: [Qemu-devel] [PATCH v14 0/5] vGICv3 support

2015-09-17 Thread Peter Maydell
On 9 September 2015 at 08:49, Pavel Fedin  wrote:
> This series introduces support for GICv3 by KVM. Software emulation is
> currently not supported.
>
> v13 => v14
>
> - Rebased on the latest master, fixed conflicts in hw/arm/virt.c
>

You'll need to fix the acpi related bits Shannon has review comments
on in patch 5, but otherwise this looks good to me.

I'm going to put patches 1..4 into target-arm.next since they've
all been reviewed, to save you having to send those out again
for v15.

thanks
-- PMM



[Qemu-devel] [PATCH v14 0/5] vGICv3 support

2015-09-09 Thread Pavel Fedin
This series introduces support for GICv3 by KVM. Software emulation is
currently not supported.

v13 => v14

- Rebased on the latest master, fixed conflicts in hw/arm/virt.c

v12 => v13
- Many stylistic fixes
- Fixed up ACPI data for virt machine
- Added gic-version=host value which probes for best possible vGIC version
- Reserved regions for memory-mapped CPU/vCPU/HYP interfaces
- Maximum number of CPUs for virt machine dropped to 123 (memory map
  limitation)

v11 => v12
- Do not set timer PPI CPU mask in device tree for GICv3
- Fixed small styling issues in hw/arm/virt.c
- Completely untied kvm_gic_access() from GIC and turned into
  kvm_device_access(). Attribute mapping is now handled in
  gicd/gicc wrapper macros.

v11 => v10
- Fixed minor issues with checkpatch and comments, reported by Eric Auger
- Make reusable kvm_gic_supports_attr(), moved to kvm-all.c and renamed
  as kvm_device_check_attr(). Useful for future live migration.

v9 => v10
- Renamed "gicversion" option to "gic-version" (was forgotten in v9)
- Data pointer in kvm_gic_access() is now void * because in case of
  vGICv3 this function is expected to operate on 64-bit registers too
  (GICD_IROUTER for instance)

v8 => v9
- Removed all limitations on CPU and IRQ number from the base class
- Added back missing properties, interface is now the same as in GICv2
- Refactored reusable parts of vGICv2 code, decreased number of changes
- Removed GIC type check from kvm_arch_irqchip_create(), no more need to
  specify GIC type early
- Fixed up all commit messages / logs
- Removed 'nvic' field assignment in virt machine (was forgotten in v8)
- CPU number limitation for 'virt' machine now comes from memory map
  (how many redistributors can be placed). With current layout it appears
  to be 126.

v7 => v8
- Removed all unused SW emulation code
- Removed unnecessary attributes from common class
- Set "unmigratable" flag for GICv3 device
- Removed unnecessary conditions from kvm_arm_gicv3_realize()
- Fixed GIC type setting in vexpress model, was done in wrong place
- Fixed condition style in hw/intc/Makefile.objs
- Cleaned up virt machine memory map

v6 => v7
- Wrap own GIC type definitions on top of KVM ones. Fixed build on
  non-ARM-Linux hosts

v5 => v6
- Fixed various checkpatch.pl style warnings
- Removed TODO in gicv3_init_irqs_and_mmio(), relevant memory API patch
  included
- gicv3_init_irqs_and_mmio() now takes 3 arguments instead of 4. It is more
  convenient to pass MMIO descriptors as array

v4 => v5
- Do not reintroduce several constants shared with GICv2, reuse them instead.
- Added gicv3_init_irqs_and_mmio() in base class, to be used by both software
  emulation and KVM code. Avoids code duplication.
- Do not add NULL msi-parent phandle to PCI device in the FDT
- Removed a couple of stale things from virt.c

v3 => v4
- Fixed stupid build breakage in patch 0002
- Rebased on top of current master, patch 0003 adjusted according to
  kvm_irqchip_create() changes
- Added assertion against uninitialized kernel_irqchip_type
- Removed kernel_irqchip_type initialization from models which do not
  use KVM vGIC

v2 => v3
- Removed some unrelated and unnecessary changes from virt machine,
  occasionally slipped in; some of them caused qemu to crash on ARM32.
- Fixed build for ARM32; vGICv3 code requires definitions which are
  present only in ARM64 kernel

v1 => v2
- Base class included, taken from the series by Shlomo Pongratz:
  http://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg01512.html
  The code is refactored as little as possible in order to simplify
  further addition of software emulation:
  - Minor fixes in code style and comments, according to old reviews
  - Removed REV_V3 definition because it's currently not used, and it does
not add any meaning to number 3.
  - Removed reserved regions for MBI and ITS (except for 'virt' machine
memory map). These should go to separate classes when implemented.
- Improved commit messages
- vGIC patches restructured
- Use 'gicversion' option instead of virt-v3 machine

Pavel Fedin (4):
  intc/gic: Extract some reusable vGIC code
  arm_kvm: Do not assume particular GIC type in
kvm_arch_irqchip_create()
  hw/intc: Initial implementation of vGICv3
  hw/arm/virt: Add gic-version option to virt machine

Shlomo Pongratz (1):
  hw/intc: Implement GIC-500 base class

 hw/arm/virt-acpi-build.c   |  54 --
 hw/arm/virt.c  | 124 --
 hw/intc/Makefile.objs  |   2 +
 hw/intc/arm_gic_kvm.c  |  98 
 hw/intc/arm_gicv3_common.c | 140 ++
 hw/intc/arm_gicv3_kvm.c| 149 +
 hw/intc/vgic_common.h  |  35 +
 include/hw/acpi/acpi-defs.h|   9 +++
 include/hw/arm/virt-acpi-build.h   |   1 +
 include/hw/arm/virt.h  |   4 +-
 include/hw/intc/arm_gicv3_common.h |  68 

Re: [Qemu-devel] [PATCH v14 0/5] vGICv3 support

2015-09-09 Thread Pavel Fedin
 Hello everybody! Just want to inform that i'm leaving for 2 weeks long 
vacation, so i won't respond
during this time.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia


> -Original Message-
> From: qemu-devel-bounces+p.fedin=samsung@nongnu.org [mailto:qemu-devel-
> bounces+p.fedin=samsung@nongnu.org] On Behalf Of Pavel Fedin
> Sent: Wednesday, September 09, 2015 10:49 AM
> To: qemu-devel@nongnu.org
> Cc: Peter Maydell; Shlomo Pongratz; Shlomo Pongratz
> Subject: [Qemu-devel] [PATCH v14 0/5] vGICv3 support
> 
> This series introduces support for GICv3 by KVM. Software emulation is
> currently not supported.
> 
> v13 => v14
> 
> - Rebased on the latest master, fixed conflicts in hw/arm/virt.c
> 
> v12 => v13
> - Many stylistic fixes
> - Fixed up ACPI data for virt machine
> - Added gic-version=host value which probes for best possible vGIC version
> - Reserved regions for memory-mapped CPU/vCPU/HYP interfaces
> - Maximum number of CPUs for virt machine dropped to 123 (memory map
>   limitation)
> 
> v11 => v12
> - Do not set timer PPI CPU mask in device tree for GICv3
> - Fixed small styling issues in hw/arm/virt.c
> - Completely untied kvm_gic_access() from GIC and turned into
>   kvm_device_access(). Attribute mapping is now handled in
>   gicd/gicc wrapper macros.
> 
> v11 => v10
> - Fixed minor issues with checkpatch and comments, reported by Eric Auger
> - Make reusable kvm_gic_supports_attr(), moved to kvm-all.c and renamed
>   as kvm_device_check_attr(). Useful for future live migration.
> 
> v9 => v10
> - Renamed "gicversion" option to "gic-version" (was forgotten in v9)
> - Data pointer in kvm_gic_access() is now void * because in case of
>   vGICv3 this function is expected to operate on 64-bit registers too
>   (GICD_IROUTER for instance)
> 
> v8 => v9
> - Removed all limitations on CPU and IRQ number from the base class
> - Added back missing properties, interface is now the same as in GICv2
> - Refactored reusable parts of vGICv2 code, decreased number of changes
> - Removed GIC type check from kvm_arch_irqchip_create(), no more need to
>   specify GIC type early
> - Fixed up all commit messages / logs
> - Removed 'nvic' field assignment in virt machine (was forgotten in v8)
> - CPU number limitation for 'virt' machine now comes from memory map
>   (how many redistributors can be placed). With current layout it appears
>   to be 126.
> 
> v7 => v8
> - Removed all unused SW emulation code
> - Removed unnecessary attributes from common class
> - Set "unmigratable" flag for GICv3 device
> - Removed unnecessary conditions from kvm_arm_gicv3_realize()
> - Fixed GIC type setting in vexpress model, was done in wrong place
> - Fixed condition style in hw/intc/Makefile.objs
> - Cleaned up virt machine memory map
> 
> v6 => v7
> - Wrap own GIC type definitions on top of KVM ones. Fixed build on
>   non-ARM-Linux hosts
> 
> v5 => v6
> - Fixed various checkpatch.pl style warnings
> - Removed TODO in gicv3_init_irqs_and_mmio(), relevant memory API patch
>   included
> - gicv3_init_irqs_and_mmio() now takes 3 arguments instead of 4. It is more
>   convenient to pass MMIO descriptors as array
> 
> v4 => v5
> - Do not reintroduce several constants shared with GICv2, reuse them instead.
> - Added gicv3_init_irqs_and_mmio() in base class, to be used by both software
>   emulation and KVM code. Avoids code duplication.
> - Do not add NULL msi-parent phandle to PCI device in the FDT
> - Removed a couple of stale things from virt.c
> 
> v3 => v4
> - Fixed stupid build breakage in patch 0002
> - Rebased on top of current master, patch 0003 adjusted according to
>   kvm_irqchip_create() changes
> - Added assertion against uninitialized kernel_irqchip_type
> - Removed kernel_irqchip_type initialization from models which do not
>   use KVM vGIC
> 
> v2 => v3
> - Removed some unrelated and unnecessary changes from virt machine,
>   occasionally slipped in; some of them caused qemu to crash on ARM32.
> - Fixed build for ARM32; vGICv3 code requires definitions which are
>   present only in ARM64 kernel
> 
> v1 => v2
> - Base class included, taken from the series by Shlomo Pongratz:
>   http://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg01512.html
>   The code is refactored as little as possible in order to simplify
>   further addition of software emulation:
>   - Minor fixes in code style and comments, according to old reviews
>   - Removed REV_V3 definition because it's currently not used, and it does
> not add any meaning to number 3.
>   - Removed reserved regions for MBI and I