On 24/03/18 00:42, Peng Hao wrote:
> Add lpi debug info to vgic-stat.
> The printed info like this:
> SPI 287 0 0100 0 160 -1
> LPI 8192 2 00010000 0 160 -1
>
> Signed-off-by: Peng Hao
> ---
> virt/kvm/arm/vgic/vgic-debug.c | 5
This patch updates KASAN documentation to reflect the addition of KHWASAN.
Signed-off-by: Andrey Konovalov
---
Documentation/dev-tools/kasan.rst | 212 +-
1 file changed, 122 insertions(+), 90 deletions(-)
diff --git a/Documentation/dev-tools/kasan.rst
b/Documentati
KHWASAN inline instrumentation mode (which embeds checks of shadow memory
into the generated code, instead of inserting a callback) generates a brk
instruction when a tag mismatch is detected.
This commit add a KHWASAN brk handler, that decodes the immediate value
passed to the brk instructions (t
This commit adds KHWASAN hooks implementation.
1. When a new slab cache is created, KHWASAN rounds up the size of the
objects in this cache to KASAN_SHADOW_SCALE_SIZE (== 16).
2. On each kmalloc KHWASAN generates a random tag, sets the shadow memory,
that corresponds to this object to this
The krealloc function checks where the same buffer was reused or a new one
allocated by comparing kernel pointers. KHWASAN changes memory tag on the
krealloc'ed chunk of memory and therefore also changes the pointer tag of
the returned pointer. Therefore we need to perform comparison on untagged
(w
This commit adds rountines, that print KHWASAN error reports. Those are
quite similar to KASAN, the difference is:
1. The way KHWASAN finds the first bad shadow cell (with a mismatching
tag). KHWASAN compares memory tags from the shadow memory to the pointer
tag.
2. KHWASAN reports all bugs
KHWASAN uses the Top Byte Ignore feature of arm64 CPUs to store a pointer
tag in the top byte of each pointer. This commit enables the TCR_TBI1 bit,
which enables Top Byte Ignore for the kernel, when KHWASAN is used.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/pgtable-hwdef.h | 1
kern_hyp_va that converts kernel VA into a HYP VA relies on the top byte
of kernel pointers being 0xff. Untag pointers passed to it with KHWASAN
enabled.
Also fix create_hyp_mappings() and create_hyp_io_mappings(), to use the
untagged kernel pointers for address computations.
Signed-off-by: Andre
This commit adds a few helper functions, that are meant to be used to
work with tags embedded in the top byte of kernel pointers: to set, to
get or to reset (set to 0xff) the top byte.
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/kasan_init.c | 2 ++
include/linux/kasan.h | 23 +++
A KHWASAN shadow memory cell contains a memory tag, that corresponds to
the tag in the top byte of the pointer, that points to that memory. The
native top byte value of kernel pointers is 0xff, so with KHWASAN we
need to initialize shadow memory to 0xff. This commit does that.
Signed-off-by: Andre
__kimg_to_phys (which is used by virt_to_phys) assumes that the top byte
of the address is 0xff, which isn't always the case with KHWASAN enabled.
The solution is to reset the tag in __kimg_to_phys.
__lm_to_phys doesn't require any fixups, as it zeroes out the top byte
with the current implementat
show_pte in arm64 fault handling relies on the fact that the top byte of
a kernel pointer is 0xff, which isn't always the case with KHWASAN enabled.
Reset the top byte.
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/fault.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/mm/
This commit splits the current CONFIG_KASAN config option into two:
1. CONFIG_KASAN_CLASSIC, that enables the classic KASAN version (the one
that exists now);
2. CONFIG_KASAN_TAGS, that enables KHWASAN.
With CONFIG_KASAN_TAGS enabled, compiler options are changed to instrument
kernel files wiht
KWHASAN uses 1 shadow byte for 16 bytes of kernel memory, so it requires
1/16th of the kernel virtual address space for the shadow memory.
This commit sets KASAN_SHADOW_SCALE_SHIFT to 4 when KHWASAN is enabled.
Signed-off-by: Andrey Konovalov
---
arch/arm64/Makefile | 2 +-
arch/ar
Hi! This is the 2nd RFC version of the patchset.
This patchset adds a new mode to KASAN [1], which is called KHWASAN
(Kernel HardWare assisted Address SANitizer). There's still some work to
do and there are a few TODOs in the code, so I'm publishing this as an RFC
to collect some initial feedback.
KHWASAN will change the value of the top byte of pointers returned from the
kernel allocation functions (such as kmalloc). This patch updates KASAN
hooks signatures and their usage in SLAB and SLUB code to reflect that.
Signed-off-by: Andrey Konovalov
---
include/linux/kasan.h | 34 +
KHWASAN will reuse a significant part of KASAN code, so move the common
parts to common.c without any functional changes.
Signed-off-by: Andrey Konovalov
---
mm/kasan/Makefile | 5 +-
mm/kasan/common.c | 318 ++
mm/kasan/kasan.c | 288 +-
Add lpi debug info to vgic-stat.
The printed info like this:
SPI 287 0 0100 0 160 -1
LPI 8192 2 00010000 0 160 -1
Signed-off-by: Peng Hao
---
virt/kvm/arm/vgic/vgic-debug.c | 59 ++
virt/
Hi,
On 23/03/18 15:21, Marc Zyngier wrote:
> vgic_copy_lpi_list() parses the LPI list and picks LPIs targetting
targeting
> a given vcpu. We allocate the array containing the intids before taking
> the lpi_list_lock, which means we can ha
On 23/03/18 23:01, Peng Hao wrote:
> Add lpi debug info to vgic-stat.
> the printed info like this:
> SPI 287 0 0100 0 160 -1
> LPI 8192 2 00010000 0 160 -1
>
> Signed-off-by: Peng Hao
> ---
> virt/kvm/arm/vgic/vgic-debug.c | 5
vgic_copy_lpi_list() parses the LPI list and picks LPIs targetting
a given vcpu. We allocate the array containing the intids before taking
the lpi_list_lock, which means we can have an array size that is not
equal to the number of LPIs.
This is particularily obvious when looking at the path coming
On 14/02/18 14:53, Jean-Philippe Brucker wrote:
When the device offers the probe feature, send a probe request for each
device managed by the IOMMU. Extract RESV_MEM information. When we
encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region.
This will tell other subsystems that th
On 14/02/18 14:53, Jean-Philippe Brucker wrote:
The virtio IOMMU is a para-virtualized device, allowing to send IOMMU
requests such as map/unmap over virtio-mmio transport without emulating
page tables. This implementation handles ATTACH, DETACH, MAP and UNMAP
requests.
The bulk of the code tran
[fixing Christoffer's email address]
On 23/03/18 13:33, peng.h...@zte.com.cn wrote:
>> On 23/03/18 10:36, Peng Hao wrote:
>>> Add lpi debug info to vgic-stat.
>>> the printed info like this:
>>> SPI 287 0 0100 0 160 -1
>>> LPI 8192 2 0001000
Add lpi debug info to vgic-stat.
the printed info like this:
SPI 287 0 0100 0 160 -1
LPI 8192 2 00010000 0 160 -1
Signed-off-by: Peng Hao
---
virt/kvm/arm/vgic/vgic-debug.c | 56 ++
1 fil
>On 23/03/18 10:36, Peng Hao wrote:
>> Add lpi debug info to vgic-stat.
>> the printed info like this:
>> SPI 287 0 0100 0 160 -1
>> LPI 8192 2 00010000 0 160 -1
>>
>> Signed-off-by: Peng Hao
>> ---
>> virt/kvm/arm/vgic/vgic-
On 19 March 2018 at 09:20, Eric Auger wrote:
> We introduce a new KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attribute in
> KVM_DEV_ARM_VGIC_GRP_ADDR group. It allows userspace to provide the
> base address and size of a redistributor region
>
> Compared to KVM_VGIC_V3_ADDR_TYPE_REDIST, this new attribut
On 23/03/18 10:36, Peng Hao wrote:
> Add lpi debug info to vgic-stat.
> the printed info like this:
> SPI 287 0 0100 0 160 -1
> LPI 8192 2 00010000 0 160 -1
>
> Signed-off-by: Peng Hao
> ---
> virt/kvm/arm/vgic/vgic-debug.c |
> From: Tian, Kevin
> Sent: Thursday, March 22, 2018 6:06 PM
>
> > From: Robin Murphy [mailto:robin.mur...@arm.com]
> > Sent: Wednesday, March 21, 2018 10:24 PM
> >
> > On 21/03/18 13:14, Jean-Philippe Brucker wrote:
> > > On 21/03/18 06:43, Tian, Kevin wrote:
> > > [...]
> > >>> +
> > >>> +#inclu
Add lpi debug info to vgic-stat.
the printed info like this:
SPI 287 0 0100 0 160 -1
LPI 8192 2 00010000 0 160 -1
Signed-off-by: Peng Hao
---
virt/kvm/arm/vgic/vgic-debug.c | 61 ++
1 f
30 matches
Mail list logo