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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF050C433F5 for ; Tue, 24 May 2022 20:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241313AbiEXU57 (ORCPT ); Tue, 24 May 2022 16:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241766AbiEXU4A (ORCPT ); Tue, 24 May 2022 16:56:00 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C45987A2C for ; Tue, 24 May 2022 13:55:59 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id 202so10475442pfu.0 for ; Tue, 24 May 2022 13:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MjBnehvEwPZLzs4+i+dSICYOgzejGL+XMwwqgLCtq0s=; b=SnIB/h6p4zajI9jK5p01v04JiMknxosV5tXu1PwEktHSgnIWXEpfHyR2S3Be+3UG28 yFauwPfd3tTs/f4FbQIlgs5Jc9knP3OFyCbTFABsuQZS9m7EYwJxdjWpxt934TFKM2s+ bZ3aF3I/mWXhcVIStndN+jv7z6i33Y6690bwZoyixkHIHZncsG6ii3+2uyDk6dY5N3Lz BvQ1dgVKgqBVM0SatIkNhVrtyAljHCdpDGp27xJ5S+qUlIw8PPxUEz6TmV9UTVo6XycR xvt7S/XVXLWY+ETb8VsgspdHFvOf/5ZRPJIvUIbRrnQPf8pDaLDlvG35MiAwUZ3vT2v4 78gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MjBnehvEwPZLzs4+i+dSICYOgzejGL+XMwwqgLCtq0s=; b=MTuKreCkt6NAFIBSE3hYI3ky6mpCgDadC7YC3JzqhpFkZdtFi8UWt0hR/faPskc5wQ G3VhHxyQEZIdy7mQVfjQ1Df7iwt4A41kRBJ/6YjyEBtnjwpSriYrKVCEVEzXltlPWDhl VMxdcOXpXRn+rYDdB3PH64PMlgaGWyG86TppS7CGiaM/AUXC+ORUo80e++JSrDU5pAKg Mqa1VXVwQW351m2hAwR+xKmEo8gwkPZFjzltKh2Mb2urwBxLS/ahXfE3cdPZzLEbKtU9 u/JoI5rrLvqIUBqv4zqM+uCDoGLv9reT7hMCSVn2HeF4CrdmsAb4YCf3ysp8zYFgA3gZ QqUw== X-Gm-Message-State: AOAM533Pju+k1guayW9BMD9C5QQMzHnAEr6b9Ms/xCWuPim/12Kqovox wK9T/3sN7cF8hOXMmDef4wEWpQ== X-Google-Smtp-Source: ABdhPJyItd5TkRoDL/PBRi8x67lR4NgEpz+M4QMVvCsc5IPE1+rTorq3tadhk7sNyXDFG+M53CQ1ig== X-Received: by 2002:a05:6a00:2391:b0:50a:3ea9:e84d with SMTP id f17-20020a056a00239100b0050a3ea9e84dmr29943750pfc.21.1653425758967; Tue, 24 May 2022 13:55:58 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id z6-20020a170902708600b0015e8d4eb285sm561336plk.207.2022.05.24.13.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 13:55:58 -0700 (PDT) Date: Tue, 24 May 2022 20:55:55 +0000 From: Sean Christopherson To: Lei Wang Cc: pbonzini@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, chenyi.qiang@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 1/8] KVM: VMX: Introduce PKS VMCS fields Message-ID: References: <20220424101557.134102-1-lei4.wang@intel.com> <20220424101557.134102-2-lei4.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220424101557.134102-2-lei4.wang@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 24, 2022, Lei Wang wrote: > From: Chenyi Qiang > > PKS(Protection Keys for Supervisor Pages) is a feature that extends the > Protection Key architecture to support thread-specific permission > restrictions on supervisor pages. > > A new PKS MSR(PKRS) is defined in kernel to support PKS, which holds a > set of permissions associated with each protection domain. > > Two VMCS fields {HOST,GUEST}_IA32_PKRS are introduced in > {host,guest}-state area to store the respective values of PKRS. > > Every VM exit saves PKRS into guest-state area. Uber nit, PKRS isn't saved if VMX doesn't support the entry control. Every VM exit saves PKRS into guest-state area if VM_ENTRY_LOAD_IA32_PKRS is supported by the CPU. With that tweak, Reviewed-by: Sean Christopherson