Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1073658imu; Wed, 23 Jan 2019 10:17:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN6eHhSsxGPE7PQcOrSsjZs91eKfFdAyYBbhor6Vv7aafp56ddDq2USDpzEHg0sx1hhlBe+Y X-Received: by 2002:a62:4b4d:: with SMTP id y74mr2986452pfa.186.1548267451131; Wed, 23 Jan 2019 10:17:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548267451; cv=none; d=google.com; s=arc-20160816; b=cCkFL3NiqawZWceO3kO1au7q7GyGfywXJoHsD+WvsxDW2EVPftgaN2sWwhOFAIfWjj KIeGdkzeqdSaSc6qKj/MNvogzGAu4FaDabKxUrLcRtgN39R4lt0N0iQ8p0h6diJ9ySqB ItJZXR31rjK0kbW//Ph7jb7Iv6vEP43ztLjaQz/ozsW+yst1qX7CxbmUc6ZiOJg7CyHW qOLVqslpkJ9kzc0nnVw8mqIbNCZzdfcKFINK0VWBqTrMLdWUeQRMJCCmXRy0wxSIteJc E/w0WGOz1Em5n7PYq5WwrGW1TDljnekPju+0Ex4GyQ/OuqnskcCAiIAwyv8WNLUMxQJc j0fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AJINrUIxo76Q5Ha8suEMASURD6Z2ULXcWJLcTlMdh9g=; b=HAhaoTmqTr8sAZVxtgroY5dPXTpSjxL8LM24nCYhkiKK6/ghhsjtHKQoqxYTKKhKZi u2XsjQ6JGIZD5I7NvdEnW51XZJbs/2vLoxfHIhxUjOTXsjAj2xhTvGQvqmnz3ZUtTKQo yXsmRD8q7D/9gVjWql3hWlkKoAAEh4b7T4i6sv6Q8fd2eWUPQqTmfvX7GuEInb4t2V48 a9LPFCOo/OeopHiScBp73VIldNKJVE74q1+Hh2qg7XzlOKHJDI45Pi1z0Dm6TVmgoyL2 Bqokhh2ybQPb8wKCcN++8t503TBtSXdM++26KiL41zRDuHoB3/ePBN5YJH9z13XD/ra4 Cj0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=g6Qi8ztG; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si16329693pgc.85.2019.01.23.10.17.15; Wed, 23 Jan 2019 10:17:30 -0800 (PST) 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=@oracle.com header.s=corp-2018-07-02 header.b=g6Qi8ztG; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726322AbfAWSRH (ORCPT + 99 others); Wed, 23 Jan 2019 13:17:07 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:43604 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfAWSRH (ORCPT ); Wed, 23 Jan 2019 13:17:07 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0NI4Jap067637; Wed, 23 Jan 2019 18:17:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=AJINrUIxo76Q5Ha8suEMASURD6Z2ULXcWJLcTlMdh9g=; b=g6Qi8ztGIUAFKQ8FasezS9/gomhncdKMTn8+0kxxKM8lPjxjlea+T637FAc+ofMSTMZI MXFflQvJ7IZO8qANx03bLpMYGUJK4p0bO+qoHZSSLdkUlc4ddicf21RugfzNRpxjAkfR aXVGMSQw8MJeYNa3/KkrmQMabJSjF+uJB3hREr04kOTUqu7e7jKnwupJiroe+HUiY1Va BknZssubyzVybK2DABd+HpSdOaii9EgcaK8h6b/jDcl6plxpTXNKLNe40N1td5u6P2Uh BErw05xv8Cf/l23MI/6hYGzHk5LrLssBkbmzSzrIM1EqgIf9U3RHHusVtXmHPOEtf/6O Uw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2q3sdekr4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 18:17:01 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0NIGtBN025480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 18:16:55 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0NIGtKI008364; Wed, 23 Jan 2019 18:16:55 GMT Received: from Konrads-MacBook-Pro.local (/75.104.64.133) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Jan 2019 10:16:55 -0800 Date: Wed, 23 Jan 2019 13:16:39 -0500 From: Konrad Rzeszutek Wilk To: KarimAllah Ahmed Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com Subject: Re: [PATCH v5 00/13] KVM/X86: Introduce a new guest mapping interface Message-ID: <20190123181636.GR19289@Konrads-MacBook-Pro.local> References: <1547026933-31226-1-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547026933-31226-1-git-send-email-karahmed@amazon.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9145 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901230134 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2019 at 10:42:00AM +0100, KarimAllah Ahmed wrote: > 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. Patch 2 is additionally fixing an > incorrect page release and marking the page as dirty (i.e. as a side-effect of > using the helper function to write). > > As far as I can see all offending code is now fixed except the APIC-access page > which I will handle in a seperate series along with dropping > kvm_vcpu_gfn_to_page and kvm_vcpu_gpa_to_page from the internal KVM API. > > The current implementation of the new API uses memremap to map memory that does > not have a "struct page". This proves to be very slow for high frequency > mappings. Since this does not affect the normal use-case where a "struct page" > is available, the performance of this API will be handled by a seperate patch > series. Where could one find this patchset? Also is there an simple test-case (or a writeup) you have for testing this code? Specifically I am thinking about the use-case of "memory without the 'struct page'" And thank you for posting this patchset. It was a pleasure reviewing the code!