Re: [PATCH 03/62] x86/cpufeatures: Add SEV-ES CPU feature

2020-02-12 Thread Borislav Petkov
On Tue, Feb 11, 2020 at 02:51:57PM +0100, Joerg Roedel wrote: > From: Tom Lendacky > > Add CPU feature detection for Secure Encrypted Virtualization with > Encrypted State. This feature enhances SEV by also encrypting the > guest register state, making it in-accessible to the hypervisor. > >

Re: [PATCH V2 3/5] vDPA: introduce vDPA bus

2020-02-12 Thread Jason Wang
On 2020/2/12 下午8:51, Jason Gunthorpe wrote: On Wed, Feb 12, 2020 at 03:55:31PM +0800, Jason Wang wrote: The ida_simple_remove should probably be part of the class release function to make everything work right It looks to me bus instead of class is the correct abstraction here since the

Re: [PATCH] virtio: Work around frames incorrectly marked as gso

2020-02-12 Thread Jason Wang
On 2020/2/13 上午1:38, Anton Ivanov wrote: On 11/02/2020 10:37, Michael S. Tsirkin wrote: On Tue, Feb 11, 2020 at 07:42:37AM +, Anton Ivanov wrote: On 11/02/2020 02:51, Jason Wang wrote: On 2020/2/11 上午12:55, Anton Ivanov wrote: On 09/12/2019 10:48, anton.iva...@cambridgegreys.com

Re: [PATCH v3 13/22] compat_ioctl: scsi: move ioctl handling into drivers

2020-02-12 Thread Arnd Bergmann
On Wed, Feb 12, 2020 at 10:15 PM Johannes Hirte wrote: > > On 2020 Jan 02, Arnd Bergmann wrote: > > Error in getting drive hardware properties > Error in getting drive reading properties > Error in getting drive writing properties > __ > > Disc mode is listed as:

Re: [PATCH 38/62] x86/sev-es: Handle instruction fetches from user-space

2020-02-12 Thread Andy Lutomirski
On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > From: Joerg Roedel > > When a #VC exception is triggered by user-space the instruction > decoder needs to read the instruction bytes from user addresses. > Enhance es_fetch_insn_byte() to safely fetch kernel and user > instruction bytes. I

[PATCH 4/5] x86/vmware: Enable steal time accounting

2020-02-12 Thread Alexey Makhalov via Virtualization
Set paravirt_steal_rq_enabled if steal clock present. paravirt_steal_rq_enabled is used in sched/core.c to adjust task progress by offsetting stolen time. Use 'no-steal-acc' off switch (share same name with KVM) to disable steal time accounting. Signed-off-by: Alexey Makhalov Reviewed-by: Thomas

[PATCH 2/5] x86/vmware: Remove vmware_sched_clock_setup()

2020-02-12 Thread Alexey Makhalov via Virtualization
Move cyc2ns setup logic to separate function. This separation will allow to use cyc2ns mult/shift pair not only for the sched_clock but also for other clocks such as steal_clock. Signed-off-by: Alexey Makhalov Reviewed-by: Thomas Hellstrom --- arch/x86/kernel/cpu/vmware.c | 15 ++-

[PATCH 1/5] x86/vmware: Make vmware_select_hypercall() __init

2020-02-12 Thread Alexey Makhalov via Virtualization
vmware_select_hypercall() is used only by the __init functions, and should be annotated with __init as well. Signed-off-by: Alexey Makhalov Reviewed-by: Thomas Hellstrom --- arch/x86/kernel/cpu/vmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 5/5] x86/vmware: Use bool type for vmw_sched_clock

2020-02-12 Thread Alexey Makhalov via Virtualization
To be aligned with other bool variables. Signed-off-by: Alexey Makhalov --- arch/x86/kernel/cpu/vmware.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 0c65d661d88b..54e57931051d 100644 ---

[PATCH 3/5] x86/vmware: Steal time clock for VMware guest

2020-02-12 Thread Alexey Makhalov via Virtualization
Steal time is the amount of CPU time needed by a guest virtual machine that is not provided by the host. Steal time occurs when the host allocates this CPU time elsewhere: for example, to another guest. Steal time can be enabled by adding VM configuration option stealclock.enable = "TRUE". It is

[PATCH 0/5] x86/vmware: Steal time accounting support

2020-02-12 Thread Alexey Makhalov via Virtualization
Hello, This patchset introduces steal time accounting support for the VMware guest. The idea and implementation of guest steal time support is similar to KVM ones and it is based on steal clock. The steal clock is a per CPU structure in a shared memory between hypervisor and guest, initialized by

[PATCH] drm/qxl: replace zero-length array with flexible-array member

2020-02-12 Thread Gustavo A. R. Silva
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By

Re: [PATCH v2] drm/virtio: rework batching

2020-02-12 Thread Chia-I Wu
On Wed, Feb 12, 2020 at 3:13 AM Gerd Hoffmann wrote: > > Drop the virtio_gpu_{disable,enable}_notify(). Add a new > virtio_gpu_notify() call instead, which must be called whenever > the driver wants make sure the host is notified needed. > > Drop notification from command submission. Add

Re: [PATCH] virtio: Work around frames incorrectly marked as gso

2020-02-12 Thread Anton Ivanov
On 11/02/2020 10:37, Michael S. Tsirkin wrote: On Tue, Feb 11, 2020 at 07:42:37AM +, Anton Ivanov wrote: On 11/02/2020 02:51, Jason Wang wrote: On 2020/2/11 上午12:55, Anton Ivanov wrote: On 09/12/2019 10:48, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov Some of the

Re: [PATCH 23/62] x86/idt: Move IDT to data segment

2020-02-12 Thread Jürgen Groß
On 12.02.20 17:23, Andy Lutomirski wrote: On Feb 12, 2020, at 3:55 AM, Joerg Roedel wrote: On Tue, Feb 11, 2020 at 02:41:25PM -0800, Andy Lutomirski wrote: On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: From: Joerg Roedel With SEV-ES, exception handling is needed very early, even

Re: [PATCH 23/62] x86/idt: Move IDT to data segment

2020-02-12 Thread Andy Lutomirski
> On Feb 12, 2020, at 3:55 AM, Joerg Roedel wrote: > > On Tue, Feb 11, 2020 at 02:41:25PM -0800, Andy Lutomirski wrote: >>> On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: >>> >>> From: Joerg Roedel >>> >>> With SEV-ES, exception handling is needed very early, even before the >>>

Re: [PATCH 14/62] x86/boot/compressed/64: Add stage1 #VC handler

2020-02-12 Thread Andy Lutomirski
> On Feb 12, 2020, at 3:38 AM, Joerg Roedel wrote: > > On Tue, Feb 11, 2020 at 02:23:22PM -0800, Andy Lutomirski wrote: >>> On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: >>> +void __init no_ghcb_vc_handler(struct pt_regs *regs) >> >> Isn't there a second parameter: unsigned long

Re: [PATCH 46/62] x86/sev-es: Handle INVD Events

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 04:12:19PM -0800, Andy Lutomirski wrote: > > > > On Feb 11, 2020, at 5:53 AM, Joerg Roedel wrote: > > > > From: Tom Lendacky > > > > Implement a handler for #VC exceptions caused by INVD instructions. > > Uh, what? Surely the #VC code can have a catch-all OOPS path

Re: [PATCH 35/62] x86/sev-es: Setup per-cpu GHCBs for the runtime handler

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:46:11PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > +/* Runtime GHCBs */ > > +static DEFINE_PER_CPU_DECRYPTED(struct ghcb, ghcb_page) > > __aligned(PAGE_SIZE); > > Hmm. This is a largeish amount of memory on large

Re: [RFC PATCH 00/62] Linux as SEV-ES Guest Support

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 07:48:12PM -0800, Andy Lutomirski wrote: > > > > On Feb 11, 2020, at 5:53 AM, Joerg Roedel wrote: > > > > > > >* Putting some NMI-load on the guest will make it crash usually > > within a minute > > Suppose you do CPUID or some MMIO and get #VC. You fill in

Re: [PATCH 62/62] x86/sev-es: Add NMI state tracking

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:50:29PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > This patch is overcomplicated IMO. Just do the magic incantation in C > from do_nmi or from here: > > /* > * For ease of testing, unmask NMIs right away.

Re: [RFC PATCH 00/62] Linux as SEV-ES Guest Support

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:12:04PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 7:43 AM Joerg Roedel wrote: > > > > On Tue, Feb 11, 2020 at 03:50:08PM +0100, Peter Zijlstra wrote: > > > > > Oh gawd; so instead of improving the whole NMI situation, AMD went and > > > made it worse still

Re: [PATCH 50/62] x86/sev-es: Handle VMMCALL Events

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 04:14:53PM -0800, Andy Lutomirski wrote: > > How about we just don’t do VMMCALL if we’re a SEV-ES guest? Otherwise > we add thousands of cycles of extra latency for no good reason. True, but I left that as a future optimization for now, given the size the patch-set

Re: [PATCH 39/62] x86/sev-es: Harden runtime #VC handler for exceptions from user-space

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:47:05PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > > > From: Joerg Roedel > > > > Send SIGBUS to the user-space process that caused the #VC exception > > instead of killing the machine. Also ratelimit the error messages so >

Re: [PATCH V2 3/5] vDPA: introduce vDPA bus

2020-02-12 Thread Jason Gunthorpe
On Wed, Feb 12, 2020 at 03:55:31PM +0800, Jason Wang wrote: > > The ida_simple_remove should probably be part of the class release > > function to make everything work right > > It looks to me bus instead of class is the correct abstraction here since > the devices share a set of programming

Re: [PATCH 30/62] x86/head/64: Move early exception dispatch to C code

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:44:45PM -0800, Andy Lutomirski wrote: > How about int (or bool) handled; Or just if (!early_make_pgtable) > return; This would also be nicer if you inverted the return value so > that true means "I handled it". Okay, makes sense. Changed the return value of

Re: [PATCH 25/62] x86/head/64: Install boot GDT

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:29:24PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > + /* GDT loaded - switch to __KERNEL_CS so IRET works reliably */ > > + pushq $__KERNEL_CS > > + leaq.Lon_kernel_cs(%rip), %rax > > + pushq

Re: [PATCH 23/62] x86/idt: Move IDT to data segment

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:41:25PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > > > From: Joerg Roedel > > > > With SEV-ES, exception handling is needed very early, even before the > > kernel has cleared the bss segment. In order to prevent clearing the

Re: [PATCH 19/62] x86/sev-es: Add support for handling IOIO exceptions

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:28:06PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > It would be nice if this could reuse the existing in-kernel > instruction decoder. Is there some reason it can't? It does, see patch 5, which makes the inat-tables generator

Re: [PATCH 18/62] x86/boot/compressed/64: Setup GHCB Based VC Exception handler

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:25:49PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > > > From: Joerg Roedel > > > > Install an exception handler for #VC exception that uses a GHCB. Also > > add the infrastructure for handling different exit-codes by decoding

Re: [PATCH 14/62] x86/boot/compressed/64: Add stage1 #VC handler

2020-02-12 Thread Joerg Roedel
On Tue, Feb 11, 2020 at 02:23:22PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > +void __init no_ghcb_vc_handler(struct pt_regs *regs) > > Isn't there a second parameter: unsigned long error_code? No, the function gets the error-code from regs->orig_ax.

Re: [PATCH 08/62] x86/boot/compressed/64: Add IDT Infrastructure

2020-02-12 Thread Joerg Roedel
Hi Andy, thanks a lot for your valuable reviews! On Tue, Feb 11, 2020 at 02:18:52PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > + entry.offset_low= (u16)(address & 0x); > > + entry.segment = __KERNEL_CS; > > +

Re: [PATCH] virtio: Work around frames incorrectly marked as gso

2020-02-12 Thread Anton Ivanov
On 12/02/2020 10:19, Michael S. Tsirkin wrote: On Wed, Feb 12, 2020 at 10:03:31AM +, Anton Ivanov wrote: On 11/02/2020 10:37, Michael S. Tsirkin wrote: On Tue, Feb 11, 2020 at 07:42:37AM +, Anton Ivanov wrote: On 11/02/2020 02:51, Jason Wang wrote: On 2020/2/11 上午12:55, Anton

[PATCH v2] drm/virtio: rework batching

2020-02-12 Thread Gerd Hoffmann
Drop the virtio_gpu_{disable,enable}_notify(). Add a new virtio_gpu_notify() call instead, which must be called whenever the driver wants make sure the host is notified needed. Drop notification from command submission. Add virtio_gpu_notify() calls everywhere instead. This results in more

Re: [PATCH] virtio: Work around frames incorrectly marked as gso

2020-02-12 Thread Michael S. Tsirkin
On Wed, Feb 12, 2020 at 10:03:31AM +, Anton Ivanov wrote: > > > On 11/02/2020 10:37, Michael S. Tsirkin wrote: > > On Tue, Feb 11, 2020 at 07:42:37AM +, Anton Ivanov wrote: > > > On 11/02/2020 02:51, Jason Wang wrote: > > > > > > > > On 2020/2/11 上午12:55, Anton Ivanov wrote: > > > > >

Re: [PATCH] virtio: Work around frames incorrectly marked as gso

2020-02-12 Thread Anton Ivanov
On 11/02/2020 10:37, Michael S. Tsirkin wrote: On Tue, Feb 11, 2020 at 07:42:37AM +, Anton Ivanov wrote: On 11/02/2020 02:51, Jason Wang wrote: On 2020/2/11 上午12:55, Anton Ivanov wrote: On 09/12/2019 10:48, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov Some of the

Re: [PATCH v4] drm/virtio: add drm_driver.release callback.

2020-02-12 Thread Gerd Hoffmann
On Tue, Feb 11, 2020 at 03:27:11PM +0100, Daniel Vetter wrote: > On Tue, Feb 11, 2020 at 02:58:04PM +0100, Gerd Hoffmann wrote: > > Split virtio_gpu_deinit(), move the drm shutdown and release to > > virtio_gpu_release(). Drop vqs_ready variable, instead use > > drm_dev_{enter,exit,unplug} to

Re: [PATCH v4] drm/bochs: add drm_driver.release callback.

2020-02-12 Thread Gerd Hoffmann
On Tue, Feb 11, 2020 at 03:19:56PM +0100, Daniel Vetter wrote: > On Tue, Feb 11, 2020 at 02:52:18PM +0100, Gerd Hoffmann wrote: > > Call bochs_unload via drm_driver.release to make sure we release stuff > > when it is safe to do so. Use drm_dev_{enter,exit,unplug} to avoid > > touching hardware

Re: [PATCH V2 5/5] vdpasim: vDPA device simulator

2020-02-12 Thread Jason Wang
On 2020/2/11 下午9:52, Jason Gunthorpe wrote: On Mon, Feb 10, 2020 at 11:56:08AM +0800, Jason Wang wrote: + +static struct vdpasim *vdpasim_create(void) +{ + struct vdpasim *vdpasim; + struct virtio_net_config *config; + struct vdpa_device *vdpa; + struct device *dev; +