Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbdGXUHr (ORCPT ); Mon, 24 Jul 2017 16:07:47 -0400 Received: from mail-sn1nam02on0051.outbound.protection.outlook.com ([104.47.36.51]:47345 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752020AbdGXUFN (ORCPT ); Mon, 24 Jul 2017 16:05:13 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Borislav Petkov , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?=5C=22Radim=20Kr=C4=8Dm=C3=A1=C5=99=5C=22?= , Tom Lendacky , Brijesh Singh Subject: [RFC Part2 PATCH v3 11/26] KVM: X86: Extend struct kvm_arch to include SEV information Date: Mon, 24 Jul 2017 15:02:48 -0500 Message-Id: <20170724200303.12197-12-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724200303.12197-1-brijesh.singh@amd.com> References: <20170724200303.12197-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0049.namprd12.prod.outlook.com (10.161.151.17) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d7fe150-9ede-4270-a733-08d4d2cf10f8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: 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/jj5wD7BsfiQUqAfmiGxsSrH5PbbXbb13mOP2Qcvb5MCfMQwn1OLzF19Q3RSBcw6PhCAcxDSQ0LagblB/aZ5UxZ2r1atb4X5sJDpQAVam+AS8QLpAFZCbMXVu3NIFM6Q1fIBAhlhh3vpcPs93kx9cNS0GhCHC3+re1y4uMWGlfgFw9JYBNsvcbN2AA9sHqNSpNpSbMPYR9J0XuvAOfd678BAeuGY2pI0G2vfnOj514Ya0bdNdNhsEpMSki+/PsiqF7Iz8bwaI2WAo99ekYzLf0Hln6SlBwj+2OOlyIJdNfFegLRpOqBi6ZExF7Q8H7504idAsc50ByPOWVduZBNgl2baVaAePN87RBjJNjhaSv76MNkarciVK8auvsYS9JFEcqb8= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:OSx2IBdUA5aoor7Sxxmw8mMLt/FQ/G+7WI2uecdqOHrl5uRam5pORM5MxyV/EU+b3EhVRFl0EUHjLgx+rPls0Q0RV4ZBF0stIYyoRtziWWqANVqGvrtU8sMCWc76+7QQCOjKglhN2Kite5eVVN2tuLNyTPLeGpsV4OtsFsnaEiRVjLzxcodLuZLnqV4xWjAB0a7ostDGYi6dX1630nfbM00eKSvaJswGYi/gdih9LXwUVpBeOvuKg99j2bLeLB7eo7K/jI0bR1Aq0p8MYekUryeNxg4jb7FS5yBlBtJFoZdkzpjoGZDAaisQm4Un5SmGnBd8C41qT+396iuUjlBb6nJcUErZ+xGJXHy0NPH6tRtGqeN0AA8wnJmG+oSCU4GBPWWybyblS82LjHjNRAqT6YChmXd4PgBce3+/1I8qnb7Ay6E6tGWwOs3WfTh9Gh5j2hcuVVsO4fI4vMmuvKgfRfj2LsPma/ghwlOOIo/ZqKNaS+V5wELpoJpDr8dBwvqh X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR12MB0145;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;4:ZBDCZicSvPwXWK01fjCpCEE7l5443uocDfR6pO4Uoj?= =?us-ascii?Q?d55vVDEOOjGEUdyr2lFwHWEMjvAVD44dLZPdh2MITOajB7PQM72xxFza85Tg?= =?us-ascii?Q?RD6dXiT/Abj4btqzxwXRvjCqHdaQNTojdtwDhGUekCxwgY8sTOV8hHl/yfRd?= =?us-ascii?Q?gnJbNVEpMrmV5NtBgji4SGcEfXSG6Eydq1Wp6xBl6m/eczN3uc3A/NrGI3ku?= =?us-ascii?Q?tg0bv22dVcaFbHtKhshEq7GZU6a1YrgdJhV8Dci7IOhjFT0YkecR6aFwrJ+N?= =?us-ascii?Q?xr9SUNuuZF7R5LKAvL4w5f9pFDJQv0C7IFfOrhIKX3g0zEvAK4PYxTSp5WDU?= =?us-ascii?Q?/2NX4hsDFuoe5iKt9Lt97T4ZpKMaOHdA1Z/g67zmhEhzBGt4LutT70g4RuUh?= =?us-ascii?Q?BwkDF8IaGSXlnY0bR0lpIlSUEHf+e+tdUCHpTuXU3HX7BFdl6yUDqZjOhGca?= =?us-ascii?Q?LjStmDgJbiHrCRvSy8SmMs1f3cwNZtrBPbA5fkB3mZeqS+PAj/OFjF/9r4H6?= =?us-ascii?Q?ff81O4mVEox5hSsVOaxfuYITKbf4hhFjulfLJSVgZn1OVKEqc89bJsnT843I?= =?us-ascii?Q?mQ2SOIydLXotDWLtD2vsYr5f/n939HQaLrlCfOZHAXYQ8Z3cH2Jdc1Lh9sHH?= =?us-ascii?Q?y+9Wvn/ScgafFqLKegalES8J0edBgz2bhMXn4TqBooUqzOnBmnb/OSdxe3HJ?= =?us-ascii?Q?AQdHmUAhU8WMKLg0IHlTbXXWk+P2f26crE4XyyTOatZixwzAqbVMFIogbkCG?= =?us-ascii?Q?JtTRhMGe2W/JQ2h7jmYbcrx1Va1gyLUJkmY4/lUi3m7XOJ4pdtEep3ZNXcP5?= =?us-ascii?Q?vzFI6fBfuXTP44usYH/TUM2uHUHl7oSOCtgebGYQTLqvq2EkphhD6WY0oHUR?= =?us-ascii?Q?WuHmrkIsaDpX8asC+ygLnIj4J81H9YLEEM6qy8e+L5dhgC+14t9zUL5MHzsP?= =?us-ascii?Q?RJmCYgUQMN8yvANr8OXul6UwpDW3587Pb40Hq9q1vTI2JXtJYvr9C2897kbr?= =?us-ascii?Q?en3sRHf4Mu8uS2xY9OHXtRBT/eO7K4/ZZ4P6EoVDUJPjKofZ/ENuFKr1sOsq?= =?us-ascii?Q?B0KW04FtiYtuq8V6hzGQgInbm9PzDC7rRkreTGLYc6ISIECKs/4eSor+TXTq?= =?us-ascii?Q?9e0/NPCMVzHAvarPI+HCCPm+8pc2076SYCRCtXf9I3C//b738k9H9yf/XZGc?= =?us-ascii?Q?V+GpLU//u7+x3Mf9TQBrh3W5jLDoax3y6x?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(189002)(199003)(7350300001)(68736007)(53416004)(105586002)(54906002)(97736004)(50466002)(6486002)(48376002)(2906002)(106356001)(33646002)(6116002)(1076002)(53936002)(3846002)(189998001)(101416001)(6666003)(2950100002)(478600001)(50986999)(76176999)(81156014)(50226002)(38730400002)(47776003)(5003940100001)(86362001)(25786009)(4326008)(36756003)(42186005)(8676002)(81166006)(110136004)(5660300001)(66066001)(7736002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR12MB0145;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;23:VJxb0OObj0vK6qDMhCLlxBCdK/Z+k8HEgHTAoZXAj?= =?us-ascii?Q?rxjmYKrBfiaRbKzz00J7pLBQSIUWMY9zsz6jajDqT+iDMA7fQR3117A/XcTp?= =?us-ascii?Q?uAsO18r8t9r8pn6a1mcoj5G307JQ5UPajzkT+yElFAydWoiTX88p2z4R0Zgt?= =?us-ascii?Q?lzGaq5f77vQcIMtXWHBFShJBedhCb8C+0Pmr6nwhRrDvSrG5vyLcRdM1E6B2?= =?us-ascii?Q?E+jRC94DfmrVQbhesA/adsSrdcXz5G7IycIIJBz80Ha1ZdrFYKUhvCJ3i0eC?= =?us-ascii?Q?JLdwXK/WU6b6FSq4n/kZNhedgCkynnM0h6RMEei7p++QowTJOb6lc2DS6wbe?= =?us-ascii?Q?/1eq167mtcPEl6isUmgGm+ljAC0OISdcpUyaPWLVrUNo2Eeb9K/Yy+oPowQJ?= =?us-ascii?Q?BpaRvACI6RRSAN+ISU23sfpoLmAye4TTlrTFxneK9dYmco52R7psl6LXFfdB?= =?us-ascii?Q?2ts/yjihsspO6nP60RQLL3oOgPXIe3M+2EBoGVlxrpGZ3SUIZLcy8z95WDWf?= =?us-ascii?Q?J1OSAUAFWbJZ78MDlMg2JugMSq/SCQ6grA+YgPgQXGDafBJ74lCvwTMrVJ+O?= =?us-ascii?Q?bjX+L6YK0dgWbCrjG1kdSS3FrBkAmh3qHB69UnkOPuZa3ywtEF7TX3UrpZHY?= =?us-ascii?Q?kR484wvk0J8+gn70HUrqQrG0XqokAvV5yWZSQHIGKLmvBPAo7gQSjNwXWxZJ?= =?us-ascii?Q?KrEiBzZTerAs6buBPmyfrT61bV/VNmNIdkI751TPRWiwXVW1/rkGMegze4VE?= =?us-ascii?Q?2PrzYBO4PfQ5Zh20C/9fVnpcH/UZliimpi2Jt4NWRrsTr5F6NHKbEBGcMT6i?= =?us-ascii?Q?AmhGG2hfaPEJLHIwqcVNwg018V8Od+C3dcdAMVo76PnaOcHCoGgAdmt+Mu8O?= =?us-ascii?Q?q7mx0B5BJdlOi/OvneFgmHpQxNLwtjkZWG0V52EOKcbvKfay4c3Ou4a2bYA6?= =?us-ascii?Q?RoM/+rTRCbFSBLl586sq4A2dy5RTZbxCxRvfG1/nQHtBLGjuSjV+Lyk1fewO?= =?us-ascii?Q?LWzmY1r+qyaHG4+w/B046RMFSFchESIKrTyUbd4dnQV1dbhsxT7342NSrDR3?= =?us-ascii?Q?bWUuCOsSDheuRcwxfoxKUlMedScwJY2cROToO+HxS0yDxtSPv33HvYYRadnM?= =?us-ascii?Q?+44oEUyfZVcdGxD+oGgdnFoDel/DL8Hln/Gm8G48CEiLgvT83ovhrxvfnIxd?= =?us-ascii?Q?2qj5+P5x6Cj7JWdxRtfp3S2sQGDrRtBT1+Z7SLKkkPFbcdlbrdVlohDmleB7?= =?us-ascii?Q?aFU0QEPinwev1YIXExa3T7mGFCcQulPktunxDcq?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;6:XfEoHnScS7eJGqkyhXWfhpTkKFSpR7nzAue3JQ4uKw?= =?us-ascii?Q?MOq8RaAuQ4SG7RuvnngNAc8dJ/5oyoiVP5O5FwQt29ektIEdBVDTD4nFCdcX?= =?us-ascii?Q?xKX1JM9U6s70ao+bSSAQNYuKs86l/qyFDRlmyR0fKwe6Kp26ZpfjnbwwkmRi?= =?us-ascii?Q?Su0Zxy7ge2KC97YkehSeGU6EEy/LZgTh92/S/LDV29OnhAtf7z/9B6tBfU8O?= =?us-ascii?Q?LAdwfI7BTuMXmThhKVPzlRp+S25oon2e6YREhXg/TBXhTCVbE3Hnpbzg8pXe?= =?us-ascii?Q?oP/UXlY246gw2bzI2bJoE6l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p1O2sGvNeDKzry6mAn1hWKPkPhZ/Ftx5AJVYl9oJ8HDQJFcAGAGI79hVzb2TEsgE/rbe+NXXwx6YMFKSeqG/UJq+regff2Y0NtJqkL//0rmjycYlm+l5WAipRR69o+Qlea2T1sxUKfKUO9EOljZv4ioLW2u7dchSDk6uFYQ7se/ZJmOWESodXQFg5dYKRDWcrbnPGwDvSdZKAIBngpc+c5TuNPyVo1F8NSMUFWRxLRvcK4jk6P7sH8gqvvIg+SiCA3Br0skbC50HER40= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:2MSpEZJq1ZVOksX5HxH7Qw7h3m5D6UjyZPx7w4RrZAscGG8Hs+RdjXsTWS2YR/3ugSf6mYfVYoumF9bF7lV0zoTreo5Wxpn9uJs91lZtTUJicmbBaS1/BEuNLn6Rg9HUSXpgE9SkQeAweX8H6Lqi4jCWHOP4XPr4Wlde/7OluV2ySCPx9SmvV2My7cUTOWm6B1bqd+7VZszGl6LvsEBSTjL4F1owfL9vMUGgVMvgsywgBXBOUaPIVLgBF5SRkXrz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 20:03:34.1189 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2308 Lines: 94 The patch adds a new member (sev_info) in 'struct kvm_arch', and setter/getter functions for the sev_info field. Signed-off-by: Brijesh Singh --- arch/x86/include/asm/kvm_host.h | 9 +++++++++ arch/x86/kvm/svm.c | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 4295f82..150177e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -742,6 +742,13 @@ enum kvm_irqchip_mode { KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */ }; +struct kvm_sev_info { + bool active; /* SEV enabled guest */ + unsigned int handle; /* firmware handle */ + unsigned int asid; /* asid for this guest */ + int sev_fd; /* SEV device fd */ +}; + struct kvm_arch { unsigned int n_used_mmu_pages; unsigned int n_requested_mmu_pages; @@ -829,6 +836,8 @@ struct kvm_arch { bool x2apic_format; bool x2apic_broadcast_quirk_disabled; + + struct kvm_sev_info sev_info; }; struct kvm_vm_stat { diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 256c9df..2a5a03a 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -322,6 +322,51 @@ enum { /* Secure Encrypted Virtualization */ static unsigned int max_sev_asid; +static inline struct kvm_sev_info *to_sev_info(struct kvm *kvm) +{ + return &kvm->arch.sev_info; +} + +static inline void sev_set_active(struct kvm *kvm) +{ + to_sev_info(kvm)->active = true; +} + +static inline unsigned int sev_get_handle(struct kvm *kvm) +{ + return to_sev_info(kvm)->handle; +} + +static inline bool sev_guest(struct kvm *kvm) +{ + return to_sev_info(kvm)->active; +} + +static inline int sev_get_asid(struct kvm *kvm) +{ + return to_sev_info(kvm)->asid; +} + +static inline int sev_get_fd(struct kvm *kvm) +{ + return to_sev_info(kvm)->sev_fd; +} + +static inline void sev_set_asid(struct kvm *kvm, int asid) +{ + to_sev_info(kvm)->asid = asid; +} + +static inline void sev_set_handle(struct kvm *kvm, unsigned int handle) +{ + to_sev_info(kvm)->handle = handle; +} + +static inline void sev_set_fd(struct kvm *kvm, int fd) +{ + to_sev_info(kvm)->sev_fd = fd; +} + static inline void mark_all_dirty(struct vmcb *vmcb) { vmcb->control.clean = 0; -- 2.9.4