Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4925508ybv; Tue, 11 Feb 2020 06:02:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzdk6f78x+y48nxVizRLwAOSLh2a7SaYEUSxN5DSyDoJ4nLaODOEOVDJh9xXMn93/Xpy8Tq X-Received: by 2002:a05:6808:7dd:: with SMTP id f29mr3034081oij.67.1581429775002; Tue, 11 Feb 2020 06:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581429774; cv=none; d=google.com; s=arc-20160816; b=E3Cu4vHDNTs75mCkd92JwLR+M4ZKbAuVgp922j2grLVOGcGAyKEkC/yBFO9ZNtd+na GbOPuP7sbbOmhvbU67xL3m9V9dtRVx2VU7LZ5TUSJIhmR+lgg3IvZHsqiFiqjp40sqSr GqUz7FRbAL41+HOE32FhQ8ZGagje+XNzJ7wmbNtlExgTc39un19Aq7/ghNS8g5/cWX5o Qncr3+s/iYuJWxQBehjfpt7BJAzrfhuXC7kgYbLMwYTBSi/548BTeKtpvRMRDK6/9w8Q R+M1utXfM9P52ue8vow59s6TgtEvxF8R5X6HE1yWMldTu0C3njxkXtN2kmVLXrdQvJ29 +kKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=/K+K5byJ2DTwBYNxE8wNo0CyYc1cCp/c1ofecUG6kXc=; b=ufRWauGdmAsh0TRowtv8RQH7s5A4PL7CowODKn8RdeQKK8MCKURsOzzLEKdUVbQLFC d6/LyVFE0V5XKusuhPJKCdBvt/Apq4k+0AEvwrrToTyQJluy7CNkPTIZaR/YZqsO7Xky nrkOtXon9zgf3UcYu+O46/TzyWNv7bxzXajzsLVsOowWdBlgglOeueQz9MMOpQJ3AySR 6wIx+DqrHhYMPih9NV+bP70gC4EXRrErXwQJUeVPOtHjWlYTGoTSwGeBTAckIXnfVRvl n8xlNYfS5pLKIyCJeSgBOiv0YnNqjdBNNyX4FHb+SfmfNq1wQgHYByrbMj6nYLc88R9I e8aQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si2015103otn.117.2020.02.11.06.02.28; Tue, 11 Feb 2020 06:02:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729853AbgBKNz0 (ORCPT + 99 others); Tue, 11 Feb 2020 08:55:26 -0500 Received: from 8bytes.org ([81.169.241.247]:52390 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729577AbgBKNx1 (ORCPT ); Tue, 11 Feb 2020 08:53:27 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 75519E91; Tue, 11 Feb 2020 14:53:15 +0100 (CET) From: Joerg Roedel To: x86@kernel.org Cc: hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel , Joerg Roedel Subject: [PATCH 46/62] x86/sev-es: Handle INVD Events Date: Tue, 11 Feb 2020 14:52:40 +0100 Message-Id: <20200211135256.24617-47-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200211135256.24617-1-joro@8bytes.org> References: <20200211135256.24617-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Lendacky Implement a handler for #VC exceptions caused by INVD instructions. Signed-off-by: Tom Lendacky [ jroedel@suse.de: Adapt to #VC handling infrastructure ] Co-developed-by: Joerg Roedel Signed-off-by: Joerg Roedel --- arch/x86/kernel/sev-es.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c index e96332516c2a..485f5a14c3b4 100644 --- a/arch/x86/kernel/sev-es.c +++ b/arch/x86/kernel/sev-es.c @@ -308,6 +308,11 @@ static enum es_result handle_rdpmc(struct ghcb *ghcb, struct es_em_ctxt *ctxt) return ES_OK; } +static enum es_result handle_invd(struct ghcb *ghcb, struct es_em_ctxt *ctxt) +{ + return ghcb_hv_call(ghcb, ctxt, SVM_EXIT_INVD, 0, 0); +} + static enum es_result handle_vc_exception(struct es_em_ctxt *ctxt, struct ghcb *ghcb, unsigned long exit_code, @@ -328,6 +333,9 @@ static enum es_result handle_vc_exception(struct es_em_ctxt *ctxt, case SVM_EXIT_RDPMC: result = handle_rdpmc(ghcb, ctxt); break; + case SVM_EXIT_INVD: + result = handle_invd(ghcb, ctxt); + break; case SVM_EXIT_CPUID: result = handle_cpuid(ghcb, ctxt); break; -- 2.17.1