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=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 23049C4360C for ; Fri, 4 Oct 2019 07:27:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D310B2084D for ; Fri, 4 Oct 2019 07:27:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IsIt9NAQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D310B2084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7FA636B0003; Fri, 4 Oct 2019 03:27:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7AB9F8E0003; Fri, 4 Oct 2019 03:27:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C2D46B0007; Fri, 4 Oct 2019 03:27:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 4BBF86B0003 for ; Fri, 4 Oct 2019 03:27:15 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id D56FD82437D2 for ; Fri, 4 Oct 2019 07:27:14 +0000 (UTC) X-FDA: 76005271188.04.metal33_503e72422434 X-HE-Tag: metal33_503e72422434 X-Filterd-Recvd-Size: 4581 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Oct 2019 07:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570174033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:openpgp; bh=XUCVhLyFU0egbeCCPyi0gdOMvXkRkhtQ2UQBx6VdaxY=; b=IsIt9NAQW1emN3o31/e9G7Q0L6ElHcLkNQNEF43Buh4YusBLfeIinADVCsYky2Ck6vWrNR ZTcG2DeNLY5dMiFZpeTJ5p0hdOG/2mi9e8Yj3dG+zNlMFhWvJawz02D2ZXnd0y5BlgcD++ oCHWc6SQ5shLa4NDXwhJlyoqnE69YgU= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-xRckPaZAOleMrOlEQP4D4w-1; Fri, 04 Oct 2019 03:27:11 -0400 Received: by mail-wm1-f72.google.com with SMTP id f63so1250620wma.7 for ; Fri, 04 Oct 2019 00:27:11 -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=aEdY8z5AWfJTa7GTLm63bwyTFqdMFQ7x24M2Gp/SY3g=; b=gh11EsrwagRPFv+ukzYhA0dE+4bsBaWcAks7dwpOxkIU0eip9NGKaUrwLviAvhyd84 7J4vVFj3wa+q7yKSudqhwsWqI65RrJsmowPzgBc1eFpd6hmz8HFlWCPB15yX3dPXB6oj uYIFQ+AQxwBLLcSMCp7QAJbiUgsGowvjUo6xBM4FNrIfebKaJ4J3fBJ8KwKpmL0k2OJW aa4nv71iWjl+CTRyYCZdwUY/N/z72SD6hl6Q+oRNUFrp44szLEE+G+oF17EGxspjMMxC QNroBbRVhZhXbyr1Yk66qij2ndo4FuzAf7dK5OOgcy/p8DUj0GXKJi5hwvwjPAMw+q+T +mXw== X-Gm-Message-State: APjAAAURSXOZo2H2Vq4N9tykAZ0Pb9D9LhkuH3wFpAU2+3XAnw5zkGow RbxVp9ev5K/+ND0tVt2w4wRO9LmVJRtMyJ+3ChvYOYb/xFJ9C25q1+sxyfvypLImW/XrdDYUiSK kZienPTn53QA= X-Received: by 2002:adf:ef4a:: with SMTP id c10mr1474588wrp.10.1570174030810; Fri, 04 Oct 2019 00:27:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVRPZN9h/0C4acuqjoYLiCq8cberKuvezxJ5ZluiUcxk7RleMGP3eYODMaMTDsSPJdw/GkUg== X-Received: by 2002:adf:ef4a:: with SMTP id c10mr1474556wrp.10.1570174030564; Fri, 04 Oct 2019 00:27:10 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:e56d:fbdf:8b79:c79c? ([2001:b07:6468:f312:e56d:fbdf:8b79:c79c]) by smtp.gmail.com with ESMTPSA id m16sm3817660wml.11.2019.10.04.00.27.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Oct 2019 00:27:09 -0700 (PDT) Subject: Re: [RFC PATCH 03/13] kvm: Add XO memslot type To: Rick Edgecombe , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org, luto@kernel.org, peterz@infradead.org, dave.hansen@intel.com, sean.j.christopherson@intel.com, keescook@chromium.org Cc: kristen@linux.intel.com, deneen.t.dock@intel.com, Yu Zhang References: <20191003212400.31130-1-rick.p.edgecombe@intel.com> <20191003212400.31130-4-rick.p.edgecombe@intel.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <5201724e-bded-1af1-7f46-0f3e1763c797@redhat.com> Date: Fri, 4 Oct 2019 09:27:09 +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: <20191003212400.31130-4-rick.p.edgecombe@intel.com> Content-Language: en-US X-MC-Unique: xRckPaZAOleMrOlEQP4D4w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 03/10/19 23:23, Rick Edgecombe wrote: > Add XO memslot type to create execute-only guest physical memory based on > the RO memslot. Like the RO memslot, disallow changing the memslot type > to/from XO. >=20 > In the EPT case ACC_USER_MASK represents the readable bit, so add the > ability for set_spte() to unset this. >=20 > This is based in part on a patch by Yu Zhang. >=20 > Signed-off-by: Yu Zhang > Signed-off-by: Rick Edgecombe Instead of this, why not check the exit qualification gpa and, if it has the XO bit set, mask away both the XO bit and the R bit? It can be done unconditionally for all memslots. This should require no change to userspace. Paolo