This is merely an update to the patch Marc posted in 2014:
https://lists.cs.columbia.edu/pipermail/kvmarm/2014-June/010055.html
This updated patch is against today's current kvmarm git tree tag,
kvm-for-arm-v4.7-rc6.
The GIC CPU interface is always 4k aligned. If the host is using
64k pages,
As we move towards a selectable HYP VA range, it is obvious that
we don't want to test a variable to find out if we need to use
the bottom VA range, the top VA range, or use the address as is
(for VHE).
Instead, we can expand our current helper to generate the right
mask or nop with code
HYP_PAGE_OFFSET is not massively useful. And the way we use it
in KERN_HYP_VA is inconsistent with the equivalent operation in
EL2, where we use a mask instead.
Let's replace the uses of HYP_PAGE_OFFSET with HYP_PAGE_OFFSET_MASK,
and get rid of the pointless macro.
Signed-off-by: Marc Zyngier
Until now, we've been setting up KVM using two sets of page tables:
one for the "boot" where we perform the basic MMU setup, and one for
the runtime.
Switching between the two was though to be safe, but we've recently
realized that it is not: it is not enough to ensure that the VA->PA
mapping is
Just like for arm64, we can now make the HYP setup a lot simpler,
and we can now initialise it in one go (instead of the two
phases we currently have).
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_host.h | 15 +
arch/arm/kvm/init.S | 49
Declare the __hyp_text_start/end symbols in asm/virt.h so that
they can be reused without having to declare them locally.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/virt.h | 4
arch/arm/kvm/mmu.c| 2 --
arch/arm64/include/asm/virt.h | 4
3
This is more of a safety measure than anything else: If we end-up
with an idmap page that intersect with the range picked for the
the HYP VA space, abort the KVM setup, as it is unsafe to go
further.
I cannot imagine it happening on 64bit (we have a mechanism to
work around it), but could
We have both KERN_TO_HYP and kern_hyp_va, which do the exact same
thing. Let's standardize on the latter.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_hyp.h | 2 --
arch/arm/include/asm/kvm_mmu.h | 2 +-
arch/arm/kvm/mmu.c | 18
hyp_kern_va is now completely unused, so let's remove it entirely.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_hyp.h | 1 -
arch/arm64/include/asm/kvm_hyp.h | 12
2 files changed, 13 deletions(-)
diff --git a/arch/arm/include/asm/kvm_hyp.h
__hyp_panic_string is passed via the HYP panic code to the panic
function, and is being "upgraded" to a kernel address, as it is
referenced by the HYP code (in a PC-relative way).
This is a bit silly, and we'd be better off obtaining the kernel
address and not mess with it at all. This patch
Add the code that enables the switch to the lower HYP VA range.
Signed-off-by: Marc Zyngier
---
arch/arm64/kernel/cpufeature.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index
Define the two possible HYP VA regions in terms of VA_BITS,
and keep HYP_PAGE_OFFSET_MASK as a temporary compatibility
definition.
Signed-off-by: Marc Zyngier
---
arch/arm64/include/asm/kvm_mmu.h | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
We're in a position where we can now always have "merged" page
tables, where both the runtime mapping and the idmap coexist.
This results in some code being removed, but there is more to come.
Signed-off-by: Marc Zyngier
---
arch/arm/kvm/mmu.c | 74
Since we now only have one set of page tables, the concept of
boot_pgd is useless and can be removed. We still keep it as
an element of the "extended idmap" thing.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_host.h | 8 +++-
There is no way to free the boot PGD, because it doesn't exist
anymore as a standalone entity.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_mmu.h | 1 -
arch/arm/kvm/arm.c | 4
arch/arm/kvm/mmu.c | 30
Since dealing with VA ranges tends to hurt my brain badly, let's
start with a bit of documentation that will hopefully help
understanding what comes next...
Signed-off-by: Marc Zyngier
---
arch/arm64/include/asm/kvm_mmu.h | 40 +---
1
Now that we only have the "merged page tables" case to deal with,
there is a bunch of things we can simplify in the HYP code (both
at init and teardown time).
Signed-off-by: Marc Zyngier
---
arch/arm64/include/asm/kvm_host.h | 12 ++--
arch/arm64/kvm/hyp-init.S
We can now remove a number of dead #defines, thanks to the trampoline
code being gone.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_mmu.h | 9 -
arch/arm64/include/asm/kvm_mmu.h | 10 --
2 files changed, 19 deletions(-)
diff --git
So far, KVM was getting in the way of kexec on 32bit (and the arm64
kexec hackers couldn't be bothered to fix it on 32bit...).
With simpler page tables, tearing KVM down becomes very easy, so
let's just do it.
Signed-off-by: Marc Zyngier
---
arch/arm/include/asm/kvm_asm.h
Hi,
On 29/06/16 16:59, Auger Eric wrote:
>
>
> On 28/06/2016 14:32, Andre Przywara wrote:
>> kvm_register_device_ops() can return an error, so lets check its return
> returned
>> value and propagate this up the call chain.
>>
>> Signed-off-by: Andre Przywara
>> ---
>>
Hi Eric,
thanks for going through the mes^Wpatches!
On 29/06/16 16:58, Auger Eric wrote:
> Hi Andre,
>
> On 28/06/2016 14:32, Andre Przywara wrote:
>> In the moment our struct vgic_irq's are statically allocated at guest
>> creation time. So getting a pointer to an IRQ structure is trivial and
Hi Paolo and Radim,
Please pull two small fixes for KVM/ARM for rc6 or as soon as it can make it:
They fix a build issue without CONFIG_ARM_PMU and plugs pid leak on arm/arm64.
Thanks,
-Christoffer
The following changes since commit a0052191624e9bf8a8f9dc41b92ab5f252566c3c:
kvm: vmx: check
From: James Morse
kvm provides kvm_vcpu_uninit(), which amongst other things, releases the
last reference to the struct pid of the task that was last running the vcpu.
On arm64 built with CONFIG_DEBUG_KMEMLEAK, starting a guest with kvmtool,
then killing it with SIGKILL
From: Sudeep Holla
When CONFIG_ARM_PMU is disabled, we get the following build error:
arch/arm64/kvm/sys_regs.c: In function 'pmu_counter_idx_valid':
arch/arm64/kvm/sys_regs.c:564:27: error: 'ARMV8_PMU_CYCLE_IDX' undeclared
(first use in this function)
if (idx >= val &&
On Thu, Jun 30, 2016 at 01:10:33PM +0100, Marc Zyngier wrote:
> On 28/06/16 22:31, Christoffer Dall wrote:
> > On Tue, Jun 07, 2016 at 11:58:29AM +0100, Marc Zyngier wrote:
> >> Now that we only have the "merged page tables" case to deal with,
> >> there is a bunch of things we can simplify in the
On Thu, Jun 30, 2016 at 01:27:05PM +0100, Marc Zyngier wrote:
> On 28/06/16 22:43, Christoffer Dall wrote:
> > On Tue, Jun 07, 2016 at 11:58:28AM +0100, Marc Zyngier wrote:
> >> We're in a position where we can now always have "merged" page
> >> tables, where both the runtime mapping and the idmap
On Thu, Jun 30, 2016 at 01:51:00PM +0100, Marc Zyngier wrote:
> On 28/06/16 23:01, Christoffer Dall wrote:
> > On Tue, Jun 07, 2016 at 11:58:35AM +0100, Marc Zyngier wrote:
> >> This is more of a safety measure than anything else: If we end-up
> >> with an idmap page that intersect with the range
On 28/06/16 23:01, Christoffer Dall wrote:
> On Tue, Jun 07, 2016 at 11:58:35AM +0100, Marc Zyngier wrote:
>> This is more of a safety measure than anything else: If we end-up
>> with an idmap page that intersect with the range picked for the
>> the HYP VA space, abort the KVM setup, as it is
On 28/06/16 22:50, Christoffer Dall wrote:
> On Tue, Jun 07, 2016 at 11:58:32AM +0100, Marc Zyngier wrote:
>> Just like for arm64, we can now make the HYP setup a lot simpler,
>> and we can now initialise it in one go (instead of the two
>> phases we currently have).
>>
>> Signed-off-by: Marc
On 28/06/16 22:43, Christoffer Dall wrote:
> On Tue, Jun 07, 2016 at 11:58:28AM +0100, Marc Zyngier wrote:
>> We're in a position where we can now always have "merged" page
>> tables, where both the runtime mapping and the idmap coexist.
>>
>> This results in some code being removed, but there is
On 28/06/16 22:31, Christoffer Dall wrote:
> On Tue, Jun 07, 2016 at 11:58:29AM +0100, Marc Zyngier wrote:
>> Now that we only have the "merged page tables" case to deal with,
>> there is a bunch of things we can simplify in the HYP code (both
>> at init and teardown time).
>>
>> Signed-off-by:
Hi,
On 30/06/2016 13:40, Andrew Jones wrote:
> On Thu, Jun 30, 2016 at 11:09:30AM +0100, Andre Przywara wrote:
>> Hi,
>>
>> On 29/06/16 05:43, Bharat Bhushan wrote:
>>>
>>>
-Original Message-
From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm-
On 30/06/16 12:10, Ard Biesheuvel wrote:
> On 30 June 2016 at 13:02, Marc Zyngier wrote:
>> On 30/06/16 11:42, Ard Biesheuvel wrote:
>>> On 30 June 2016 at 12:16, Marc Zyngier wrote:
On 30/06/16 10:22, Marc Zyngier wrote:
> On 28/06/16 13:42,
On Thu, Jun 30, 2016 at 11:09:30AM +0100, Andre Przywara wrote:
> Hi,
>
> On 29/06/16 05:43, Bharat Bhushan wrote:
> >
> >
> >> -Original Message-
> >> From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm-
> >> boun...@lists.cs.columbia.edu] On Behalf Of Andre Przywara
> >> Sent:
Hi Andre,
On 06/28/2016 03:32 PM, Andre Przywara wrote:
> The connection between a device, an event ID, the LPI number and the
> allocated CPU is stored in in-memory tables in a GICv3, but their
> format is not specified by the spec. Instead software uses a command
> queue in a ring buffer to let
On 30 June 2016 at 13:02, Marc Zyngier wrote:
> On 30/06/16 11:42, Ard Biesheuvel wrote:
>> On 30 June 2016 at 12:16, Marc Zyngier wrote:
>>> On 30/06/16 10:22, Marc Zyngier wrote:
On 28/06/16 13:42, Christoffer Dall wrote:
> On Tue, Jun 07,
On 30/06/16 11:42, Ard Biesheuvel wrote:
> On 30 June 2016 at 12:16, Marc Zyngier wrote:
>> On 30/06/16 10:22, Marc Zyngier wrote:
>>> On 28/06/16 13:42, Christoffer Dall wrote:
On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote:
> As we move towards a
On 30 June 2016 at 12:16, Marc Zyngier wrote:
> On 30/06/16 10:22, Marc Zyngier wrote:
>> On 28/06/16 13:42, Christoffer Dall wrote:
>>> On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote:
As we move towards a selectable HYP VA range, it is obvious that
On Thu, Jun 30, 2016 at 11:16:44AM +0100, Marc Zyngier wrote:
> On 30/06/16 10:22, Marc Zyngier wrote:
> > On 28/06/16 13:42, Christoffer Dall wrote:
> >> On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote:
> >>> As we move towards a selectable HYP VA range, it is obvious that
> >>> we
On 30/06/16 10:22, Marc Zyngier wrote:
> On 28/06/16 13:42, Christoffer Dall wrote:
>> On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote:
>>> As we move towards a selectable HYP VA range, it is obvious that
>>> we don't want to test a variable to find out if we need to use
>>> the
Hi,
On 29/06/16 05:43, Bharat Bhushan wrote:
>
>
>> -Original Message-
>> From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm-
>> boun...@lists.cs.columbia.edu] On Behalf Of Andre Przywara
>> Sent: Tuesday, June 28, 2016 6:02 PM
>> To: Marc Zyngier ;
On 28/06/16 13:42, Christoffer Dall wrote:
> On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote:
>> As we move towards a selectable HYP VA range, it is obvious that
>> we don't want to test a variable to find out if we need to use
>> the bottom VA range, the top VA range, or use the
42 matches
Mail list logo