Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6501171imu; Sun, 2 Dec 2018 20:04:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WHi5vDRyPrdc2JM4+5+9Ug8a9HxNuxIiedMIUBMHZVMJTbPNrtDS6kRdLIP8qEykElKHK/ X-Received: by 2002:a63:d005:: with SMTP id z5mr12047822pgf.64.1543809869088; Sun, 02 Dec 2018 20:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543809869; cv=none; d=google.com; s=arc-20160816; b=Nk0NkBzUAnb4tEEPwHVAfmhXO6N2r/2ns+I9UH2aq+bJ4YXSN5FSIeXtuuxJ8AoClC vls3ccJ9ApO1NIZ65yRNVuAmHgJtD6/LNjWoO6zxXjudnHNBwGL785kOQ0sBQdR82bt6 Hh7pAxHXyNEovdgAczyWD5jfjSwO6MuKPLwyIREbwCq/krLz/NGnDKWxYUBhZi2X7etW oc7mXauRuXJgDaLRISWmmV8azkxALDO+OrXu4oqQ8c+1+nWbeoOzliGXKPYJeBxJBFWU C5HH2xeSeR+RdkmbWyPDu0hOaTD3zbpWMCxeUBz1znZX8zVjHiggvPCjlVbYCirHYq8k 7A7Q== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id; bh=ojYAsQDz305gxtqNRAKFsBcO8GK/grI7G8KfQwl8xLQ=; b=bPTkEgzevwChb9OkV577y6HsD5R9JWp0WqVBmTWDSK4xkY5f8wJAaCmfFnvKZ6w7JV i9leakpwjV0AGsh408bzbqgDWNeiUy7NkqPcEx89kS8ah2KfXEuqoN5wn6BqVV1UiwtY 6jAmNb5mrKezLI+MKmbv73GBcEUSFn4QLn3hbgw3ARUnWkWCxiQJ92ql2u8j/OG6RBkf xCC7H7tjupXnIA2pQEfgf0McHXWOjfS2e4/zvOW1ylrFIH0U5xLdinMGkyZa+uRGUqy9 BaQSI7opfGzxBkdCZDabFNikrPMNWA3XNJxtIvES6/msJsxssocjdOGebfw4c1kKXmKB YIFQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si13692779ple.281.2018.12.02.20.04.14; Sun, 02 Dec 2018 20:04:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725846AbeLCEDo (ORCPT + 99 others); Sun, 2 Dec 2018 23:03:44 -0500 Received: from mx01.bbu.dsd.mx.bitdefender.com ([91.199.104.161]:37176 "EHLO mx01.bbu.dsd.mx.bitdefender.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbeLCEDo (ORCPT ); Sun, 2 Dec 2018 23:03:44 -0500 X-Greylist: delayed 445 seconds by postgrey-1.27 at vger.kernel.org; Sun, 02 Dec 2018 23:03:43 EST Received: from smtp.bitdefender.com (smtp01.buh.bitdefender.com [10.17.80.75]) by mx01.bbu.dsd.mx.bitdefender.com (Postfix) with ESMTPS id B90FF307503A; Mon, 3 Dec 2018 05:56:13 +0200 (EET) Received: from [192.168.1.131] (unknown [188.27.64.30]) by smtp.bitdefender.com (Postfix) with ESMTPSA id 962EC300F70D; Mon, 3 Dec 2018 05:56:13 +0200 (EET) Message-ID: <1543809373.23880.17.camel@bitdefender.com> Subject: Re: [RFC PATCH V2 00/11] Intel EPT-Based Sub-page Protection Support From: Mihai =?UTF-8?Q?Don=C8=9Bu?= To: Paolo Bonzini Cc: rkrcmar@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Nicusor CITU , Zhang Yi , Adalbert =?UTF-8?Q?Laz=C4=83r?= Date: Mon, 03 Dec 2018 05:56:13 +0200 In-Reply-To: <1c7e9821-df4b-9b1c-76aa-d1c4c654c952@redhat.com> References: <1c7e9821-df4b-9b1c-76aa-d1c4c654c952@redhat.com> Organization: Bitdefender Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paolo, On Fri, 2018-11-30 at 11:07 +0100, Paolo Bonzini wrote: > On 30/11/18 08:52, Zhang Yi wrote: > > Here is a patch-series which adding EPT-Based Sub-page Write Protection Support. > > > > Introduction: > > > > EPT-Based Sub-page Write Protection referred to as SPP, it is a capability which > > allow Virtual Machine Monitors(VMM) to specify write-permission for guest > > physical memory at a sub-page(128 byte) granularity. When this capability is > > utilized, the CPU enforces write-access permissions for sub-page regions of 4K > > pages as specified by the VMM. EPT-based sub-page permissions is intended to > > enable fine-grained memory write enforcement by a VMM for security(guest OS > > monitoring) and usages such as device virtualization and memory check-point. > > > > SPPT is active when the "sub-page write protection" VM-execution control is 1. > > SPPT looks up the guest physical addresses to derive a 64 bit "sub-page > > permission" value containing sub-page write permissions. The lookup from > > guest-physical addresses to the sub-page region permissions is determined by a > > set of SPPT paging structures. > > > > When the "sub-page write protection" VM-execution control is 1, the SPPT is used > > to lookup write permission bits for the 128 byte sub-page regions containing in > > the 4KB guest physical page. EPT specifies the 4KB page level privileges that > > software is allowed when accessing the guest physical address, whereas SPPT > > defines the write permissions for software at the 128 byte granularity regions > > within a 4KB page. Write accesses prevented due to sub-page permissions looked > > up via SPPT are reported as EPT violation VM exits. Similar to EPT, a logical > > processor uses SPPT to lookup sub-page region write permissions for > > guest-physical addresses only when those addresses are used to access memory. > > Hi, > > I think the right thing to do here would be to first get VM > introspection in KVM, as SPP is mostly an introspection feature and it > should be controller by the introspector rather than the KVM userspace. > > Mihai, if you resubmit, I promise that I will look at it promptly. I'm currently traveling until Wednesday, but when I'll get into the office I will see about preparing a new patch set and send it to the list before Christmas. Regards, -- Mihai Donțu