Received: by 10.192.165.156 with SMTP id m28csp3013626imm; Sun, 15 Apr 2018 15:01:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx498139IVFD+sdqz2mijsKQlJ/dA1Z7lNVxKFZc1ZP7G0QCQMRxM3zOCW1RIZWIAfkQ9qmdL X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr13183761plg.195.1523829691103; Sun, 15 Apr 2018 15:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523829691; cv=none; d=google.com; s=arc-20160816; b=cqHjNbxu3B6BkEFc4fUJWApNjjOyAtWDsqgpud85H9KTG65+qAyKDHsL2rdqfC8265 WkOMCinoUyuWUEPs9REnAZvXUpP06Zrk4V173eyWb6Yyf0/Skk9SIzNsj9HKkjxdQ8LO BmbU+XU8YQqnZyprTobzofmt6ErhTMWJUeb74vN7TSXkRWUvVLZAZTyE4tgjLXmpqn/+ 6obMoGOMKUYso7jalXuLW7OV9LZDVUe3P3YsNsJEMEePPUjdm3KJbRob6z1EQexi0TrN J0Esm/HAtLPllQ1y9J1uu0EhGJ7Apj0xnS2A841AI3BdYbU52ZkjN9cPdz9uzLXzBNiD 2agg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=y9z9C/LlBtxTMjbqGNRoRhZG/GqYs9N6aOY++SwsdYQ=; b=RELTGqm3WFzKRGVrao0T0oKps2IZ5u+qZUjP2CpUHle4YW6aJXnaQGAIKGrNlSeUoj JqbAA9Q8SFmyM8gcqiLq4YWuVxDoXIK6GPDrs+JI+jy6nfQZEwinXt70MNCXV+ufo6H9 FuSUNKylGKFgXixM/rxe04hUJIqvWzB0Nyp339EgIAVepTDkQDQ6t+WpJUIRgNiLhC+5 vQ1I7p0ZdXZnez1l+R6x3R4P1/6Pq18Apu2mnj0prHmhU504fszpc2XJkH+EVzA+g6oS IXaN0l0I3mtZaPvasaJ9T/LXpsRO5PRisRMuxOleYBLUMZnclDuXUOE+CoMH8MeS9cSp afVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=n9Ia48R4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si9590475pfi.355.2018.04.15.15.01.17; Sun, 15 Apr 2018 15:01:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=n9Ia48R4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537AbeDOVyy (ORCPT + 99 others); Sun, 15 Apr 2018 17:54:54 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:21598 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeDOVyw (ORCPT ); Sun, 15 Apr 2018 17:54:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1523829292; x=1555365292; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=y9z9C/LlBtxTMjbqGNRoRhZG/GqYs9N6aOY++SwsdYQ=; b=n9Ia48R4uhA9c7wCcT121a/BEO8QE02O3bPv5PAufzmlqvR03DDVNSJp cY9QIxI6zTXyCzEwDRWT/QMzFW7iuR4Xiq+2Tr0ii7oxQ60zQd4CrKOH3 sgabypEHhL3zWL/+C5tGPOPeY2YRAEwEhPBhBLVqFlre3WIFcvGg2PUyL 0=; X-IronPort-AV: E=Sophos;i="5.48,456,1517875200"; d="scan'208";a="735371352" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2c-87a10be6.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Apr 2018 21:54:50 +0000 Received: from u54e1ad5160425a4b64ea.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2c-87a10be6.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w3FLskkC003305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Apr 2018 21:54:47 GMT Received: from u54e1ad5160425a4b64ea.ant.amazon.com (localhost [127.0.0.1]) by u54e1ad5160425a4b64ea.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id w3FLsj3B013400; Sun, 15 Apr 2018 23:54:45 +0200 Received: (from karahmed@localhost) by u54e1ad5160425a4b64ea.ant.amazon.com (8.15.2/8.15.2/Submit) id w3FLsj2F013395; Sun, 15 Apr 2018 23:54:45 +0200 From: KarimAllah Ahmed To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com Cc: KarimAllah Ahmed Subject: [PATCH v2 00/12] KVM/X86: Introduce a new guest mapping interface Date: Sun, 15 Apr 2018 23:53:06 +0200 Message-Id: <1523829198-13236-1-git-send-email-karahmed@amazon.de> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Guest memory can either be directly managed by the kernel (i.e. have a "struct page") or they can simply live outside kernel control (i.e. do not have a "struct page"). KVM mostly support these two modes, except in a few places where the code seems to assume that guest memory must have a "struct page". This patchset introduces a new mapping interface to map guest memory into host kernel memory which also supports PFN-based memory (i.e. memory without 'struct page'). It also converts all offending code to this interface or simply read/write directly from guest memory. As far as I can see all offending code is now fixed except the APIC-access page which I will handle in a seperate patch. Filippo Sironi (1): X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs KarimAllah Ahmed (11): X86/nVMX: handle_vmon: Read 4 bytes from guest memory X86/nVMX: handle_vmptrld: Copy the VMCS12 directly from guest memory X86/nVMX: Update the PML table without mapping and unmapping the page KVM: Introduce a new guest mapping API KVM/nVMX: Use kvm_vcpu_map when mapping the L1 MSR bitmap KVM/nVMX: Use kvm_vcpu_map when mapping the virtual APIC page KVM/nVMX: Use kvm_vcpu_map when mapping the posted interrupt descriptor table KVM/X86: Use kvm_vcpu_map in emulator_cmpxchg_emulated KVM/X86: hyperv: Use kvm_vcpu_map in synic_clear_sint_msg_pending KVM/X86: hyperv: Use kvm_vcpu_map in synic_deliver_msg KVM/nSVM: Use the new mapping API for mapping guest memory arch/x86/kvm/hyperv.c | 28 ++++----- arch/x86/kvm/paging_tmpl.h | 38 +++++++++--- arch/x86/kvm/svm.c | 97 +++++++++++++++--------------- arch/x86/kvm/vmx.c | 145 +++++++++++++++------------------------------ arch/x86/kvm/x86.c | 13 ++-- include/linux/kvm_host.h | 9 +++ virt/kvm/kvm_main.c | 50 ++++++++++++++++ 7 files changed, 203 insertions(+), 177 deletions(-) Cc: Paolo Bonzini Cc: Radim Krčmář Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org -- 2.7.4