From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29FCCC433FF for ; Tue, 13 Aug 2019 14:45:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A20F20651 for ; Tue, 13 Aug 2019 14:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729703AbfHMOpP (ORCPT ); Tue, 13 Aug 2019 10:45:15 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38196 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728793AbfHMOpP (ORCPT ); Tue, 13 Aug 2019 10:45:15 -0400 Received: by mail-wr1-f67.google.com with SMTP id g17so108000925wrr.5 for ; Tue, 13 Aug 2019 07:45:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jWtEd3owCPSOaSqnFheJ8jWjvLGAgQi5lkfcBCpyD7o=; b=UevYMYv+8ldS6wgGNAFTk08WzQQqvUnr8Vkgx6vqHybt+7u12XLGrDUQNYfYKUoTSL zcHhrThB999kKNx8VdV1GqKl+3V45cL5fU8w1yGbcMQ5XFIQQNNmUzkYz2KC4O0OJcI7 6/x2sr8pTuGXDM9hwkJb72QFPcGtzrTrX/Y+hW25C0SsDm4+ZcNxL1o4VNJIckkYgUdU zLxkiWzIhqaRZRZd5nRM1sIusXZJWGYZXz3ndC4kB1ttymVeyP+jV/nKooZgqaHEWE5N 5Ez8XRrD+TDZ9yqdFez0EEUusRPU8mhU1cl3YOKmybe2spPYKUR/Aek4yqQZgSGCFAf3 sU2A== X-Gm-Message-State: APjAAAVeZM6EnAOGmaHnee2imPd736kEcTHZak77eANUGVK/HO5BDxdQ IGBia2uqLyuzhpqoT2uhHl1U9w== X-Google-Smtp-Source: APXvYqwcGE4nFuUbUV12L+CuV8ssqEc28LeuFzgoubUsbyKYX9+fTashqIpI1VrJDY8+MqB+OZnDSA== X-Received: by 2002:adf:fc51:: with SMTP id e17mr43958026wrs.348.1565707513708; Tue, 13 Aug 2019 07:45:13 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:5193:b12b:f4df:deb6? ([2001:b07:6468:f312:5193:b12b:f4df:deb6]) by smtp.gmail.com with ESMTPSA id x20sm237275027wrg.10.2019.08.13.07.45.12 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 07:45:13 -0700 (PDT) Subject: Re: [RFC PATCH v6 14/92] kvm: introspection: handle introspection commands before returning to guest To: =?UTF-8?Q?Adalbert_Laz=c4=83r?= , kvm@vger.kernel.org Cc: linux-mm@kvack.org, virtualization@lists.linux-foundation.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Konrad Rzeszutek Wilk , Tamas K Lengyel , Mathieu Tarral , =?UTF-8?Q?Samuel_Laur=c3=a9n?= , Patrick Colp , Jan Kiszka , Stefan Hajnoczi , Weijiang Yang , Yu C Zhang , =?UTF-8?Q?Mihai_Don=c8=9bu?= , =?UTF-8?Q?Mircea_C=c3=aerjaliu?= References: <20190809160047.8319-1-alazar@bitdefender.com> <20190809160047.8319-15-alazar@bitdefender.com> <645d86f5-67f6-f5d3-3fbb-5ee9898a7ef8@redhat.com> <5d52c10e.1c69fb81.26904.fd34SMTPIN_ADDED_BROKEN@mx.google.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <97cdf9cb-286c-2387-6cb5-003b30f74c7e@redhat.com> Date: Tue, 13 Aug 2019 16:45:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <5d52c10e.1c69fb81.26904.fd34SMTPIN_ADDED_BROKEN@mx.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 13/08/19 15:54, Adalbert Lazăr wrote: > Leaving kvm_vcpu_block() in order to handle a request such as 'pause', > would cause the vCPU to enter the guest when resumed. Most of the > time this does not appear to be an issue, but during early boot it > can happen for a non-boot vCPU to start executing code from areas that > first needed to be set up by vCPU #0. > > In a particular case, vCPU #1 executed code which resided in an area > not covered by a memslot, which caused an EPT violation that got > turned in mmu_set_spte() into a MMIO request that required emulation. > Unfortunatelly, the emulator tripped, exited to userspace and the VM > was aborted. Okay, this makes sense. Maybe you want to handle KVM_REQ_INTROSPECTION in vcpu_run rather than vcpu_enter_guest? Paolo