Re: [PATCH v2 0/8] Workaround for Cortex-A76 erratum 1165522

2018-12-04 Thread Marc Zyngier
Hi Will, On Mon, 03 Dec 2018 19:22:43 +, Will Deacon wrote: > > Hi Marc, > > On Fri, Nov 23, 2018 at 06:40:59PM +, Marc Zyngier wrote: > > Early Cortex-A76 suffer from an erratum that can result in invalid > > TLBs when the CPU speculatively executes an AT instruction in the > > middle

[PATCH kvmtool 05/13] virtio: Add exit_vq() callback

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker Virtio allows to reset individual virtqueues. For legacy devices, it's done by writing an address of 0 into the PFN register. Modern devices have an "enable" register. Add an exit_vq() callback to all devices. A lot more work is required by each device to clean up

[PATCH kvmtool 04/13] virtio: Add get_vq() callback

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker To ease future changes to the core, replace get_pfn_vq() with get_vq(). This way adding new generic operation on virtqueues won't require modifying every virtio device. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- include/kvm/virtio.h | 2

[PATCH kvmtool 12/13] virtio/p9: Implement reset

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker The p9 reset cancels all running jobs and closes any open fid. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- virtio/9p.c | 16 1 file changed, 16 insertions(+) diff --git a/virtio/9p.c b/virtio/9p.c index d9f45cf..6bae403

[PATCH kvmtool 09/13] virtio/net: Implement device and virtqueue reset

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker On exit_vq(), clean all resources allocated for the queue. When the device is reset, clean the backend. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- virtio/net.c | 63 1 file

[PATCH kvmtool 10/13] virtio/blk: Reset virtqueue

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker Move pthread creation to init_vq, and kill the thread in exit_vq. Initialize the virtqueue states at runtime. All in-flight I/O is canceled with the virtqueue pthreads, except for AIO threads, but after reading the code I'm not sure if AIO has ever worked anyway.

[PATCH kvmtool 06/13] virtio: Add reset() callback

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker When the guest writes a status of 0, the device should be reset. Add a reset() callback for the transport layer to reset all queues and their ioeventfd. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- include/kvm/virtio-mmio.h | 1 +

[PATCH kvmtool 07/13] net/uip: Add exit function

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker When resetting the virtio-net queues, the UIP state needs to be reset as well. Stop all threads (one per TCP stream and UDP connection) and free memory. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- include/kvm/uip.h | 6 ++

[PATCH kvmtool 08/13] virtio/net: Clean virtqueue state

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker Currently the virtqueue state is mixed with the netdev state. Move it to a separate structure. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- virtio/net.c | 110 +++ 1 file changed, 57

[PATCH kvmtool 03/13] virtio: Add get_vq_count() callback

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker Modern virtio requires devices to report how many queues they support. Add an operation to query all devices about their capacities. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- include/kvm/virtio.h | 1 + virtio/9p.c | 6 ++

[PATCH kvmtool 11/13] threadpool: Add cancel() function

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker When resetting a virtqueue, it is often necessary to make sure that the associated threadpool job isn't running anymore. Add a function to cancel a job. A threadpool job has three states: idle, queued and running. A job is queued when it is in the job list. It is

[PATCH kvmtool 13/13] virtio/console: Implement reset

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker The virtio-console reset cancels all running jobs. Unfortunately we don't have a good way to prevent the term polling thread from getting in the way, read invalid data during reset and cause a segfault. To prevent this, move all handling of the Rx queue in the

[PATCH kvmtool 00/13] Implement reset of virtio devices

2018-12-04 Thread Julien Thierry
Hi, This series was developped by Jean-Philippe and is needed for a series I'll be posting shortly after to load firmwares on arm kvmtool. Currently, when a guest tries to reset a device, a lot of ressources aren't reset (threads keep running, virtio queue keep their state, etc). When the guest

[PATCH kvmtool 02/13] virtio: Implement notify_status

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker Modern virtio require proper status handling and reset. A "notify_status" callback is already present in the virtio ops, but isn't implemented by any device. Instead they currently use "set_guest_feature" to reset the device and deal with endianess. This isn't

[PATCH kvmtool 01/13] ioeventfd: Fix removal of ioeventfd

2018-12-04 Thread Julien Thierry
From: Jean-Philippe Brucker Fix three bugs that prevent removal of ioeventfds in KVM. Store the flags in the right structure, check the datamatch parameter, and pass the fd to KVM. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Julien Thierry --- ioeventfd.c | 6 -- 1 file changed,

Re: [PATCH v7 02/25] ACPI / APEI: Remove silent flag from ghes_read_estatus()

2018-12-04 Thread Borislav Petkov
On Mon, Dec 03, 2018 at 06:05:50PM +, James Morse wrote: > Subsequent patches will split up ghes_read_estatus(), at which > point passing around the 'silent' flag gets annoying. This is to > suppress prink() messages, which prior to commit 42a0bb3f7138 > ("printk/nmi: generic solution for safe

[PATCH kvmtool 5/6] kvm: Add arch specific reset

2018-12-04 Thread Julien Thierry
Add a callback that allows to set arch specific default values when creating fresh VM. Signed-off-by: Julien Thierry --- arm/kvm.c | 4 include/kvm/kvm.h | 1 + kvm.c | 2 ++ mips/kvm.c| 4 powerpc/kvm.c | 4 x86/kvm.c | 4 6 files

[PATCH kvmtool 1/6] rtc: Initialize the Register D for MC146818 RTC

2018-12-04 Thread Julien Thierry
From: Sami Mujawar Some software drivers check the VRT bit (BIT7) of Register D before using the MC146818 RTC. Initialized the VRT bit in rtc__init() to indicate that the RAM and time contents are valid. Signed-off-by: Sami Mujawar Signed-off-by: Julien Thierry --- hw/rtc.c | 8 1

[PATCH kvmtool 0/6] arm: Add support for firmware booting

2018-12-04 Thread Julien Thierry
Hi, This series is based on the virtio reset series posted earlier: https://marc.info/?l=kvm=154392174625966=2 We would like to be able to load firmwares like UEFI in kvmtool. The series contains: A way to load the firmware into RAM and an option to be able to create non-volatile memory zones

[PATCH kvmtool 6/6] arm: Support non-volatile memory

2018-12-04 Thread Julien Thierry
Add an option to let user load files as non-volatile memory. An additional range of addresses is reserved for nv memory. Loaded files must be a multiple of the system page size. Users can chose whether the data written by the guest modifies the original file. Signed-off-by: Julien Thierry ---

[PATCH kvmtool 3/6] builtin-run: Do not look for default kernel when firmware is provided

2018-12-04 Thread Julien Thierry
When a firmware file is provided, kvmtool is not responsible for loading a kernel image. There is no reason for looking for a default kernel image when loading a firmware. Signed-off-by: Julien Thierry --- builtin-run.c | 24 1 file changed, 16 insertions(+), 8

[PATCH kvmtool 4/6] arm: Support firmware loading

2018-12-04 Thread Julien Thierry
Implement firmware image loading for arm and set the boot start address to the firmware address. Add an option for the user to specify where to map the firmware. Signed-off-by: Julien Thierry --- arm/fdt.c| 14 +++- arm/include/arm-common/kvm-config-arch.h |

[PATCH kvmtool 2/6] arm: Move firmware function

2018-12-04 Thread Julien Thierry
Firmware loading/setup function are in fdt file while it is not very related to this. Move them to the file that does the main init/setup for memory. Signed-off-by: Julien Thierry --- arm/fdt.c | 10 -- arm/kvm.c | 10 ++ 2 files changed, 10 insertions(+), 10 deletions(-) diff

Re: [PATCH v7 03/25] ACPI / APEI: Switch estatus pool to use vmalloc memory

2018-12-04 Thread Borislav Petkov
On Mon, Dec 03, 2018 at 06:05:51PM +, James Morse wrote: > The ghes code is careful to parse and round firmware's advertised > memory requirements for CPER records, up to a maximum of 64K. > However when ghes_estatus_pool_expand() does its work, it splits > the requested size into PAGE_SIZE

[PATCH v4 1/4] arm64: arm_pmu: remove unnecessary isb instruction

2018-12-04 Thread Andrew Murray
The armv8pmu_enable_event_counter function issues an isb instruction after enabling a pair of counters - this doesn't provide any value and is inconsistent with the armv8pmu_disable_event_counter. In any case armv8pmu_enable_event_counter is always called with the PMU stopped. Starting the PMU

[PATCH v4 2/4] arm64: KVM: add accessors to track guest/host only counters

2018-12-04 Thread Andrew Murray
In order to effeciently enable/disable guest/host only perf counters at guest entry/exit we add bitfields to kvm_cpu_context for guest and host events as well as accessors for updating them. Signed-off-by: Andrew Murray --- arch/arm64/include/asm/kvm_host.h | 24 1 file

[PATCH v4 4/4] arm64: KVM: Enable support for :G/:H perf event modifiers

2018-12-04 Thread Andrew Murray
Enable/disable event counters as appropriate when entering and exiting the guest to enable support for guest or host only event counting. For both VHE and non-VHE we switch the counters between host/guest at EL2. EL2 is filtered out by the PMU when we are using the :G modifier. The PMU may be on

[PATCH v4 0/4] arm64: Support perf event modifiers :G and :H

2018-12-04 Thread Andrew Murray
This patchset provides support for perf event modifiers :G and :H which allows for filtering of PMU events between host and guests when used with KVM. As the underlying hardware cannot distinguish between guest and host context, the performance counters must be stopped and started upon entry/exit

[PATCH v4 3/4] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2018-12-04 Thread Andrew Murray
Add support for the :G and :H attributes in perf by handling the exclude_host/exclude_guest event attributes. We notify KVM of counters that we wish to be enabled or disabled on guest entry/exit and thus defer from starting or stopping :G events as per the events exclude_host attribute. With

Re: [RFC PATCH v2 00/23] KVM: arm64: Initial support for SVE guests

2018-12-04 Thread Dave Martin
On Thu, Nov 22, 2018 at 03:34:16PM +, Alex Bennée wrote: > > Dave Martin writes: > > > This series implements basic support for allowing KVM guests to use the > > Arm Scalable Vector Extension (SVE). > > > > The patches are based on v4.19-rc5. > > > > The patches are also available on a

Re: [PATCH v4 4/4] arm64: KVM: Enable support for :G/:H perf event modifiers

2018-12-04 Thread Julien Thierry
Hi Andrew, On 04/12/18 14:58, Andrew Murray wrote: > Enable/disable event counters as appropriate when entering and exiting > the guest to enable support for guest or host only event counting. > > For both VHE and non-VHE we switch the counters between host/guest at > EL2. EL2 is filtered out by

[tip:core/rcu] KVM: arm/arm64: vgic: Replace spin_is_locked() with lockdep

2018-12-04 Thread tip-bot for Lance Roy
Commit-ID: d4d592a6eeda1e381f38f398e7a0474a599c11ed Gitweb: https://git.kernel.org/tip/d4d592a6eeda1e381f38f398e7a0474a599c11ed Author: Lance Roy AuthorDate: Thu, 4 Oct 2018 23:45:50 -0700 Committer: Paul E. McKenney CommitDate: Mon, 12 Nov 2018 09:06:22 -0800 KVM: arm/arm64: vgic:

[PATCH] kvm/arm: return 0 when the number of objects is not less than min

2018-12-04 Thread Peng Hao
Return 0 when there is enough kvm_mmu_memory_cache object. Signed-off-by: Peng Hao --- virt/kvm/arm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index ed162a6..fcda0ce 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c

Re: [PATCH v7 22/25] ACPI / APEI: Kick the memory_failure() queue for synchronous errors

2018-12-04 Thread Xie XiuQi
Hi James & Boris, On 2018/12/4 2:06, James Morse wrote: > memory_failure() offlines or repairs pages of memory that have been > discovered to be corrupt. These may be detected by an external > component, (e.g. the memory controller), and notified via an IRQ. > In this case the work is queued as