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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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 8543CC11F67 for ; Thu, 1 Jul 2021 21:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C12961411 for ; Thu, 1 Jul 2021 21:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234391AbhGAVfP (ORCPT ); Thu, 1 Jul 2021 17:35:15 -0400 Received: from forward3-smtp.messagingengine.com ([66.111.4.237]:36051 "EHLO forward3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234269AbhGAVfP (ORCPT ); Thu, 1 Jul 2021 17:35:15 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailforward.nyi.internal (Postfix) with ESMTP id 603AD1940612; Thu, 1 Jul 2021 17:32:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 01 Jul 2021 17:32:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mWlQta zONJf20m+7LmPaIQjTDpN9ZKSOivB8Gnz9aQU=; b=CBxRH3+MKhjaLiPYU1WCya 0jrXt76EjE4MIUWl0n7iSc+OO3Z+86CVPw/wTM5Iqt/9yHQrrlfHgszJ1F2ctZsq gHmSxRL1t+Yl4Oq8e+/qciVZ1PJbK8XmIpEbXCCy/my97hZwphdnsJ43hl+En7SJ 8o5XvFuw0CINgeK658OPwx2uJ1t7nnqLB+LgvX3PzoYpW4aBWiS7RNtbDL2RBrSW zYYAKL+05LPLKcGVXh4fd7UFiOn0mixlRJKoWhSMkeoUjRthVR1dsKPbW/3i2LfA IrYD+EFbVkwnDWqhnn6Q7U4gHZq8b/UWzjM/YNZgi2PiZK+YZXcO6LQEe1l49kaw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeiiedgudehlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefvufgjfhfhfffkgggtsehttdertddttddtnecuhfhrohhmpeffrghvihgu ucfgughmohhnughsohhnuceoughmvgesughmvgdrohhrgheqnecuggftrfgrthhtvghrnh ephfekgeeutddvgeffffetheejvdejieetgfefgfffudegffffgeduheegteegleeknecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmvgesug hmvgdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jul 2021 17:32:42 -0400 (EDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id c0eccd27; Thu, 1 Jul 2021 21:32:39 +0000 (UTC) To: Babu Moger , "qemu-devel@nongnu.org" Cc: "kvm@vger.kernel.org" , Eduardo Habkost , Paolo Bonzini , Marcelo Tosatti , Richard Henderson Subject: Re: [RFC PATCH 0/7] Support protection keys in an AMD EPYC-Milan VM In-Reply-To: <31dce00c-71bf-6d30-a1d2-f0b6ce743db2@amd.com> References: <20210520145647.3483809-1-david.edmondson@oracle.com> <31dce00c-71bf-6d30-a1d2-f0b6ce743db2@amd.com> X-HGTTG: heart-of-gold From: David Edmondson Date: Thu, 01 Jul 2021 22:32:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thursday, 2021-07-01 at 16:24:51 -05, Babu Moger wrote: > David, Are you still working on v2 of these series? I was going to test > and review. Thanks Yes. I have something that works, but it's messy in places. I hope to get it out in a couple of days. >> -----Original Message----- >> From: David Edmondson >> Sent: Tuesday, June 8, 2021 3:25 AM >> To: qemu-devel@nongnu.org >> Cc: kvm@vger.kernel.org; Eduardo Habkost ; Paolo >> Bonzini ; Marcelo Tosatti ; >> Richard Henderson ; Moger, Babu >> >> Subject: Re: [RFC PATCH 0/7] Support protection keys in an AMD EPYC-Milan >> VM >> >> On Thursday, 2021-05-20 at 15:56:40 +01, David Edmondson wrote: >> >> > AMD EPYC-Milan CPUs introduced support for protection keys, previously >> > available only with Intel CPUs. >> > >> > AMD chose to place the XSAVE state component for the protection keys >> > at a different offset in the XSAVE state area than that chosen by >> > Intel. >> > >> > To accommodate this, modify QEMU to behave appropriately on AMD >> > systems, allowing a VM to properly take advantage of the new feature. >> > >> > Further, avoid manipulating XSAVE state components that are not >> > present on AMD systems. >> > >> > The code in patch 6 that changes the CPUID 0x0d leaf is mostly dumped >> > somewhere that seemed to work - I'm not sure where it really belongs. >> >> Ping - any thoughts about this approach? >> >> > David Edmondson (7): >> > target/i386: Declare constants for XSAVE offsets >> > target/i386: Use constants for XSAVE offsets >> > target/i386: Clarify the padding requirements of X86XSaveArea >> > target/i386: Prepare for per-vendor X86XSaveArea layout >> > target/i386: Introduce AMD X86XSaveArea sub-union >> > target/i386: Adjust AMD XSAVE PKRU area offset in CPUID leaf 0xd >> > target/i386: Manipulate only AMD XSAVE state on AMD >> > >> > target/i386/cpu.c | 19 +++++---- >> > target/i386/cpu.h | 80 ++++++++++++++++++++++++++++-------- >> > target/i386/kvm/kvm.c | 57 +++++++++---------------- >> > target/i386/tcg/fpu_helper.c | 20 ++++++--- >> > target/i386/xsave_helper.c | 70 +++++++++++++++++++------------ >> > 5 files changed, 152 insertions(+), 94 deletions(-) >> > >> > -- >> > 2.30.2 >> >> dme. >> -- >> You know your green from your red. dme. -- When you were the brightest star, who were the shadows?