On Mon, Mar 06 2017 at 5:33:30 pm GMT, Mark Rutland
wrote:
> On Mon, Mar 06, 2017 at 07:08:03AM -0800, Christoffer Dall wrote:
>> On Mon, Feb 20, 2017 at 12:30:11PM +, Mark Rutland wrote:
>> > static exit_handle_fn arm_exit_handlers[] = {
>> > + [0 ... HSR_EC_MAX] = kvm_handle_unknown
From: Linu Cherian
Return KVM_USER_MEM_SLOTS for userspace capability query on
NR_MEMSLOTS.
Signed-off-by: Linu Cherian
---
arch/arm/kvm/arm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 9d74464..b64b47f 100644
--- a/arch/arm/kvm/arm.c
+
From: Linu Cherian
Signed-off-by: Linu Cherian
---
arch/arm/include/asm/kvm_host.h | 1 -
arch/arm64/include/asm/kvm_host.h | 1 -
2 files changed, 2 deletions(-)
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index d5423ab..b9b39f0 100644
--- a/arch/arm/inclu
From: Linu Cherian
Having only 32 memslots is a real constraint for the maximum
number of PCI devices that can be assigned to a single guest.
Assuming each PCI device/virtual function having two memory BAR
regions, we could assign only 15 devices/virtual functions to a
guest.
Hence increase KVM_
From: Linu Cherian
Signed-off-by: Linu Cherian
---
Documentation/virtual/kvm/api.txt | 4
1 file changed, 4 insertions(+)
diff --git a/Documentation/virtual/kvm/api.txt
b/Documentation/virtual/kvm/api.txt
index 03145b7..7b82f1c 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documen
From: Linu Cherian
v2 -> v3:
- Added documentation for KVM_CAP_NR_MEMSLOTS
- Removed KVM_PRIVATE_MEM_SLOTS which is unused
- KVM_USER_MEM_SLOTS changed to 512 from 508
v1 -> v2:
- Enabling KVM_CAP_NR_MEMSLOTS for arm/arm64 moved to separate patch.
- Updated commit message so that what is repor
On Mon, 2017-03-06 at 13:45 -0700, Tyler Baicar wrote:
> UEFI spec allows for non-standard section in Common Platform Error
> Record. This is defined in section N.2.3 of UEFI version 2.5.
>
> Currently if the CPER section's type (UUID) does not match with
> one of the section types that the kernel
Currently external aborts are unsupported by the guest abort
handling. Add handling for SEAs so that the host kernel reports
SEAs which occur in the guest kernel.
Signed-off-by: Tyler Baicar
---
arch/arm/include/asm/kvm_arm.h | 10 ++
arch/arm/include/asm/system_misc.h | 5 +
UEFI spec allows for non-standard section in Common Platform Error
Record. This is defined in section N.2.3 of UEFI version 2.5.
Currently if the CPER section's type (UUID) does not match with
any section type that the kernel knows how to parse, trace event
is not generated for such section. And t
Currently there are trace events for the various RAS
errors with the exception of ARM processor type errors.
Add a new trace event for such errors so that the user
will know when they occur. These trace events are
consistent with the ARM processor error section type
defined in UEFI 2.6 spec section
From: "Jonathan (Zhixiong) Zhang"
Even if an error status block's severity is fatal, the kernel does not
honor the severity level and panic.
With the firmware first model, the platform could inform the OS about a
fatal hardware error through the non-NMI GHES notification type. The OS
should pani
UEFI spec allows for non-standard section in Common Platform Error
Record. This is defined in section N.2.3 of UEFI version 2.5.
Currently if the CPER section's type (UUID) does not match with
one of the section types that the kernel knows how to parse, the
section is skipped. Therefore, user is n
ARM APEI extension proposal added SEA (Synchronous External Abort)
notification type for ARMv8.
Add a new GHES error source handling function for SEA. If an error
source's notification type is SEA, then this function can be registered
into the SEA exception handler. That way GHES will parse and rep
Currently when a RAS error is reported it is not timestamped.
The ACPI 6.1 spec adds the timestamp field to the generic error
data entry v3 structure. The timestamp of when the firmware
generated the error is now being reported.
Signed-off-by: Tyler Baicar
CC: Jonathan (Zhixiong) Zhang
Reviewed-
Add support for ARM Common Platform Error Record (CPER).
UEFI 2.6 specification adds support for ARM specific
processor error information to be reported as part of the
CPER records. This provides more detail on for processor error logs.
Signed-off-by: Tyler Baicar
CC: Jonathan (Zhixiong) Zhang
R
SEA exceptions are often caused by an uncorrected hardware
error, and are handled when data abort and instruction abort
exception classes have specific values for their Fault Status
Code.
When SEA occurs, before killing the process, report the error
in the kernel logs.
Update fault_info[] with spec
When a memory error, CPU error, PCIe error, or other type of hardware error
that's covered by RAS occurs, firmware should populate the shared GHES memory
location with the proper GHES structures to notify the OS of the error.
For example, platforms that implement firmware first handling may impleme
A RAS (Reliability, Availability, Serviceability) controller
may be a separate processor running in parallel with OS
execution, and may generate error records for consumption by
the OS. If the RAS controller produces multiple error records,
then they may be overwritten before the OS has consumed th
Hi Christoffer,
thanks for submitting this patch.
On Mon, Mar 6, 2017 at 8:42 AM, Christoffer Dall
wrote:
> From: Jintack Lim
>
> Currently, if a vcpu thread tries to change the active state of an
> interrupt which is already on the same vcpu's AP list,
"it'll loop forever" is remove accidenta
On Mon, Mar 06, 2017 at 07:08:03AM -0800, Christoffer Dall wrote:
> On Mon, Feb 20, 2017 at 12:30:11PM +, Mark Rutland wrote:
> > static exit_handle_fn arm_exit_handlers[] = {
> > + [0 ... HSR_EC_MAX] = kvm_handle_unknown_ec,
>
> Cool stuff, didn't know you could do this in C.
Strictl
From: Christoffer Dall
We found a deadlock when changing the active state of an interrupt while
the interrupt is queued on the LR of the running VCPU.
Defend KVM against this bug in the future now when we've introduced a
fix.
Signed-off-by: Christoffer Dall
---
Sending with the right subject p
On Mon, Feb 20, 2017 at 12:30:11PM +, Mark Rutland wrote:
> Currently we BUG() if we see a HSR.EC value we don't recognise. As
> configurable disables/enables are added to the architecture (controlled
> by RES1/RES0 bits respectively), with associated synchronous exceptions,
> it may be possibl
On Mon, Feb 20, 2017 at 12:30:12PM +, Mark Rutland wrote:
> Currently we BUG() if we see an ESR_EL2.EC value we don't recognise. As
> configurable disables/enables are added to the architecture (controlled
> by RES1/RES0 bits respectively), with associated synchronous exceptions,
> it may be po
On Mon, Mar 06 2017 at 1:42:37 pm GMT, Christoffer Dall
wrote:
> From: Jintack Lim
>
> Currently, if a vcpu thread tries to change the active state of an
> interrupt which is already on the same vcpu's AP list, Since the VGIC
> mmio handler is called after a vcpu has already synced back the LR
Nobody is using __hyp_get_vectors anymore, so let's remove both
implementations (hyp-stub and KVM).
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/virt.h | 10 --
arch/arm/kernel/hyp-stub.S | 13 +
arch/arm/kvm/init.S | 7 +--
arch/arm/kvm/interrupts.S |
In order to help people understanding the hyp-stub API that exists
between the host kernel and the hypervisor mode (whether a hypervisor
has been installed or not), let's document said API.
As as with any form of documentation, I expect it to become obsolete
and completely misleading within 20 min
Nobody is using __hyp_get_vectors anymore, so let's remove both
implementations (hyp-stub and KVM).
Signed-off-by: Marc Zyngier
---
arch/arm64/include/asm/virt.h | 12
arch/arm64/kernel/hyp-stub.S | 15 +--
arch/arm64/kvm/hyp-init.S | 7 +--
arch/arm64/kvm/hyp.
We are now able to use the hyp stub to reset HYP mode. Time to
kiss __kvm_hyp_reset goodbye, and use __hyp_reset_vectors.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_asm.h | 2 --
arch/arm/include/asm/kvm_host.h | 2 +-
arch/arm/kvm/init.S | 2 --
3 files changed, 1 ins
__cpu_reset_hyp_mode doesn't need to be passed any argument now,
as the hyp-stub implementations are self-contained, and is now
reduced to just calling __hyp_reset_vectors(). Let's drop the
wrapper and use the stub hypercall directly.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_host
With __cpu_reset_hyp_mode having become fairly dumb, there is no
need for kvm_get_idmap_start anymore.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_mmu.h | 1 -
arch/arm/kvm/mmu.c | 5 -
arch/arm64/include/asm/kvm_mmu.h | 1 -
3 files changed, 7 deletions(-)
diff
Another missing stub hypercall is HVC_SOFT_RESTART. It turns out
that it is pretty easy to implement in terms of HVC_RESET_VECTORS
(since it needs to turn the MMU off).
Signed-off-by: Marc Zyngier
---
arch/arm/kvm/init.S | 14 ++
1 file changed, 14 insertions(+)
diff --git a/arch/ar
When the compressed image needs to be relocated to avoid being
overwritten by the decompression process, we need to relocate
the hyp vectors as well so that we can find them once the
decompression has taken effect.
For that, we perform the following calculation:
u32 v = __hyp_get_vectors()
Instead of trying to compare the value given by __hyp_get_vectors(),
which doesn't offer any real guarantee to be the stub's address, use
HVC_RESET_VECTORS to make sure we're in a sane state to reinstall
KVM across PM events.
Signed-off-by: Marc Zyngier
---
arch/arm/kvm/arm.c | 24 +-
It is not really obvious why the restart address should be in r3
when communicated to the hyp-stub. r1 should be perfectly adequate,
and consistent with the rest of the code.
Signed-off-by: Marc Zyngier
---
arch/arm/kernel/hyp-stub.S | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
di
We now have a full hyp-stub implementation in the KVM init code,
but the main KVM code only supports HVC_GET_VECTORS, which is not
enough.
Instead of reinventing the wheel, let's reuse the init implementation
by branching to the idmap page when called with a hyp-stub hypercall.
Signed-off-by: Mar
In order to restore HYP mode to its original condition, KVM currently
implements __kvm_hyp_reset(). As we're moving towards a hyp-stub
defined API, it becomes necessary to implement HVC_RESET_VECTORS.
This patch adds the HVC_RESET_VECTORS hypercall to the KVM init
code, which so far lacked any for
Now that we have an infrastructure to handle hypercalls in the KVM
init code, let's implement HVC_GET_VECTORS there.
Signed-off-by: Marc Zyngier
---
arch/arm/kvm/init.S | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
index 9b0c7
We are now able to use the hyp stub to reset HYP mode. Time to
kiss __kvm_hyp_reset goodbye, and use __hyp_reset_vectors.
Signed-off-by: Marc Zyngier
---
arch/arm64/include/asm/kvm_asm.h | 1 -
arch/arm64/include/asm/kvm_host.h | 3 +--
arch/arm64/kvm/hyp-init.S | 2 --
arch/arm64/kv
Let's define a new stub hypercall that resets the HYP configuration
to its default: hyp-stub vectors, and MMU disabled.
Of course, for the hyp-stub itself, this is a trivial no-op.
Hypervisors will have a bit more work to do.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/virt.h | 3 +++
The KVM code needs to be able to compute the address of
symbols in its idmap page (the equivalent of a virt_to_idmap()
call). Unfortunately, virt_to_idmap is slightly complicated,
depending on the use of arch_phys_to_idmap_offset or not, and
none of that is readily available at HYP.
Instead, expos
Another missing stub hypercall is HVC_SOFT_RESTART. It turns out
that it is pretty easy to implement in terms of HVC_RESET_VECTORS
(since it needs to turn the MMU off).
Signed-off-by: Marc Zyngier
---
arch/arm64/kvm/hyp-init.S | 31 +++
1 file changed, 23 insertions(+
The conversion of the HYP stub ABI to something similar to arm64
left the KVM code broken, as it doesn't know about the new
stub numbering. Let's move the various #defines to virt.h, and
let KVM use HVC_GET_VECTORS.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/virt.h | 8
arch/
From: Russell King
Improve the hyp-stub ABI to allow it to do more than just get/set the
vectors. We follow the example in ARM64, where r0 is used as an opcode
with the other registers as an argument.
Signed-off-by: Russell King
Signed-off-by: Marc Zyngier
---
arch/arm/kernel/hyp-stub.S | 27
As noticed by RMK in this thread[1], the hyp-stub API on 32bit ARM
could do with some TLC (it cannot perform a soft-restart at HYP, and
has holes in the hyp-stub support in a number of places). In general,
it would be desirable for the 32bit behaviour to align on 64bit, if
only to ease maintenance.
From: Russell King
When we soft-reboot (eg, kexec) from one kernel into the next, we need
to ensure that we enter the new kernel in the same processor mode as
when we were entered, so that (eg) the new kernel can install its own
hypervisor - the old kernel's hypervisor will have been overwritten.
cpu_v7_reset() now takes a second parameter indicating whether
we should reboot in HYP or not. Update the documentation to
reflect this.
Signed-off-by: Marc Zyngier
---
arch/arm/mm/proc-v7.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm
We now have a full hyp-stub implementation in the KVM init code,
but the main KVM code only supports HVC_GET_VECTORS, which is not
enough.
Instead of reinventing the wheel, let's reuse the init implementation
by branching to the idmap page when called with a hyp-stub hypercall.
Signed-off-by: Mar
In order to restore HYP mode to its original condition, KVM currently
implements __kvm_hyp_reset(). As we're moving towards a hyp-stub
defined API, it becomes necessary to implement HVC_RESET_VECTORS.
This patch adds the HVC_RESET_VECTORS hypercall to the KVM init
code, which so far lacked any for
Let's define a new stub hypercall that resets the HYP configuration
to its default: hyp-stub vectors, and MMU disabled.
Of course, for the hyp-stub itself, this is a trivial no-op.
Hypervisors will have a bit more work to do.
Signed-off-by: Marc Zyngier
---
arch/arm64/include/asm/virt.h | 9 ++
Now that we have an infrastructure to handle hypercalls in the KVM
init code, let's implement HVC_GET_VECTORS there.
Signed-off-by: Marc Zyngier
---
arch/arm64/kvm/hyp-init.S | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-
From: Christoffer Dall
We found a deadlock when changing the active state of an interrupt while
the interrupt is queued on the LR of the running VCPU.
Defend KVM against this bug in the future now when we've introduced a
fix.
Signed-off-by: Christoffer Dall
---
arm/gic.c | 43
Hello James,
On 3/6/2017 3:28 AM, James Morse wrote:
On 28/02/17 19:43, Baicar, Tyler wrote:
On 2/24/2017 3:42 AM, James Morse wrote:
On 21/02/17 21:22, Tyler Baicar wrote:
Currently external aborts are unsupported by the guest abort
handling. Add handling for SEAs so that the host kernel re
Hi Marc,
On 03/06/2017 02:34 AM, Marc Zyngier wrote:
Hi Shanker,
On Mon, Mar 06 2017 at 2:33:18 am GMT, Shanker Donthineni
wrote:
Now all the cpu_hwcaps features have their own static keys. We don't
need a separate function hyp_alternate_select() to patch the vhe/nvhe
code. We can achieve
From: Jintack Lim
Currently, if a vcpu thread tries to change the active state of an
interrupt which is already on the same vcpu's AP list, Since the VGIC
mmio handler is called after a vcpu has already synced back the LR state
to the struct vgic_irq, we can just let it proceed safely.
Signed-of
Save and restore the pending tables.
Pending table restore obviously requires the pendbaser to be
already set.
Signed-off-by: Eric Auger
---
v1 -> v2:
- do not care about the 1st KB which should be zeroed according to
the spec.
---
virt/kvm/arm/vgic/vgic-its.c | 71 +
This patch flushes the device table entries into guest RAM.
Both flat table and 2 stage tables are supported. DeviceId
indexing is used.
For each device listed in the device table, we also flush
the translation table using the vgic_its_flush/restore_itt
routines.
On restore, devices are re-alloc
Introduce routines to flush and restore device ITT and their
interrupt table entries (ITE).
The routines will be called on device table flush and
restore.
Signed-off-by: Eric Auger
---
v2 -> v3:
- add return 0 in vgic_its_restore_ite (was in subsequent patch)
v2: creation
---
virt/kvm/arm/vgi
As vgic_its_check_id() computes the device/collection entry's
GPA, let's return it so that new callers can retrieve it easily.
Signed-off-by: Eric Auger
---
v2: new
---
virt/kvm/arm/vgic/vgic-its.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/virt/kvm/arm/vgi
Natively sort the device and ITE lists in ascending
deviceId/eventid order. This paves the way to optimized
DTE and ITE scan in guest RAM table where entries are chained
together using a next ID offset.
Signed-off-by: Eric Auger
---
virt/kvm/arm/vgic/vgic-its.c | 36 +
Add a generic lookup_table() helper whose role consists in
scanning a contiguous table located in guest RAM and applying
a callback on each entry. Entries can be handled as linked lists
since the callback may return an offset to the next entry and
also tell that an entry is the last one.
Helper fu
The flush path copies the collection entries into guest RAM
at the GPA specified in the BASER register. This obviously
requires the BASER to be set. The last written element
is a dummy collection table entry.
We do not index by collection ID as the collection entry
can fit into 8 bytes while conta
Add two new helpers to allocate an its ite and an its device.
This will avoid duplication on restore path.
Signed-off-by: Eric Auger
---
v1 -> v2:
- report itt_size fix and remove ITE_SIZE
- s/itte/ite/g
---
virt/kvm/arm/vgic/vgic-its.c | 70 +---
1 file
An ITE size of 8 Bytes is reported to the guest. Combining this
information with the number of event IDs the guest wants to support,
this latter will be able to allocate each device's ITT with the
right size.
Signed-off-by: Eric Auger
---
v1 -> v2:
- correct ITT_ENTRY_SIZE field
- remove ITE_SI
Introduce a new group aiming at saving/restoring the ITS
tables to/from the guest memory.
We hold the its lock during the save and restore to prevent
any command from being executed. This also garantees the LPI
list is not going to change and no MSI injection can happen
during the operation.
At t
The actual abbreviation for the interrupt translation table entry
is ITE. Let's rename all itte instances by ite.
Signed-off-by: Eric Auger
---
virt/kvm/arm/vgic/vgic-its.c | 148 +--
1 file changed, 74 insertions(+), 74 deletions(-)
diff --git a/virt/kvm
GITS_CREADR needs to be restored so let's implement the associated
uaccess_write_its callback.
Signed-off-by: Eric Auger
---
---
virt/kvm/arm/vgic/vgic-its.c | 22 +-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vg
Add description for how to access vITS registers and how to flush/restore
vITS tables into/from memory
Signed-off-by: Eric Auger
---
v1 -> v2:
- DTE and ITE now are 8 bytes
- DTE and ITE now indexed by deviceid/eventid
- use ITE name instead of ITTE
- mentions ITT_addr matches bits [51:8] of th
On MAPD we currently check the device id can be stored in the device table.
Let's first check it can be encoded within the range defined by TYPER
DEVBITS.
Signed-off-by: Eric Auger
---
virt/kvm/arm/vgic/vgic-its.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/virt/k
Up to now the MAPD's ITT size field has been ignored. It encodes
the number of eventid bit minus 1. It should be used to check
the eventid when a MAPTI command is issued on a device. Let's
store the nb_eventid_bits in the its_device and do the check
on MAPTI. Also make sure the ITT size field does
This patch implements vgic_its_has_attr_regs and vgic_its_attr_regs_access
upon the MMIO framework. VGIC ITS KVM device KVM_DEV_ARM_VGIC_GRP_ITS_REGS
group becomes functional.
At least GITS_CREADR requires to differentiate a guest write action from a
user access. As such let's introduce a new uacc
Up to now the MAPD ITT_addr had been ignored. We will need it
for save/restore. Let's record it in the its_device struct.
Signed-off-by: Eric Auger
---
virt/kvm/arm/vgic/vgic-its.c | 4
1 file changed, 4 insertions(+)
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
This series specifies and implements an API aimed at saving and restoring
the state of the in-kernel emulated ITS device.
The ITS is programmed through registers and tables. Those latter
are allocated by the guest. Their base address is programmed in
registers or table entries before the ITS is en
The ITS KVM device exposes a new KVM_DEV_ARM_VGIC_GRP_ITS_REGS
group which allows the userspace to save/restore ITS registers.
At this stage the get/set/has operations are not yet implemented.
Signed-off-by: Eric Auger
---
arch/arm/include/uapi/asm/kvm.h | 1 +
arch/arm64/include/uapi/asm/kv
We plan to use vgic_find_mmio_region in vgic-its.c so let's
turn it into a public function.
Signed-off-by: Eric Auger
---
virt/kvm/arm/vgic/vgic-mmio.c | 3 +--
virt/kvm/arm/vgic/vgic-mmio.h | 5 +
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b
Hi Tyler,
On 28/02/17 19:43, Baicar, Tyler wrote:
> On 2/24/2017 3:42 AM, James Morse wrote:
>> On 21/02/17 21:22, Tyler Baicar wrote:
>>> Currently external aborts are unsupported by the guest abort
>>> handling. Add handling for SEAs so that the host kernel reports
>>> SEAs which occur in the gu
From: Jintack Lim
Currently, if a vcpu thread tries to change its own active state when
the irq is already in AP list, it'll loop forever. Since the VCPU thread
has already synced back LR state to the struct vgic_irq, let it modify
its own state safely.
Signed-off-by: Jintack Lim
---
virt/kvm/
Hi Shanker,
On Mon, Mar 06 2017 at 2:33:18 am GMT, Shanker Donthineni
wrote:
> Now all the cpu_hwcaps features have their own static keys. We don't
> need a separate function hyp_alternate_select() to patch the vhe/nvhe
> code. We can achieve the same functionality by using has_vhe(). It
> impr
77 matches
Mail list logo