From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16C624C8FEF for ; Tue, 5 May 2026 19:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778010810; cv=none; b=cCBlEs4tfLzRBawJqWkPsv2RiMNoht3f7iSKQnmXv09N2z5sRxNIETQJB5FSodZ7zqTp0RpcO1DQlbC72w/bbgBN8rolo0elH/o5+hbV97Lx5kxlWo6H6P9HJKJL+Ya0quW9EEHegskaohZB9hcFDpfBX2PGdr4OtzK8YdC0B/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778010810; c=relaxed/simple; bh=2pXIK+CdgvXVanR6B3Y07NvJzjvZnQ0FvEOa8rzUPic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I0aoIHlG20ON5gYQF+k2VfvZPAt0I26gf8pZ1WGXaTibpFAseHOMvlse5YwHW/MZV7XFha8Hs3b32/CwAtPwc4ZRWGXXc3B9SBqsHUJqaD3jiNMS51QDmAeOnxUhngQF2Ghf+kYsPJKN5iSEhzGNyG/qDCjnulstRWUNiTKvH9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aLTet4+C; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=XF7RvkxL; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aLTet4+C"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="XF7RvkxL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778010808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCtnCZH8ZoKxZPeVUzWtK/UQekMVfj0snT68dwdPoMQ=; b=aLTet4+C4mwjx1qFlaZ1oKwzBXDUCEkOIE8fXpLXMR5Hy/eOlNJ/HuSMl7rEpL1YG1rLjM PBIAeS+RoWzQ4lMya2wTv5KU+dxma+wS2OdfGlSbECq5Cq+IUzZ1zi4gY9AWPRnuvjTMPA BocGQgXfYX7kRTTeCP0YO3yX9W8XbtE= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-YG4sgCb_OZOPVJc4RFiBYw-1; Tue, 05 May 2026 15:53:27 -0400 X-MC-Unique: YG4sgCb_OZOPVJc4RFiBYw-1 X-Mimecast-MFC-AGG-ID: YG4sgCb_OZOPVJc4RFiBYw_1778010805 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-486fa07f2bbso45226965e9.2 for ; Tue, 05 May 2026 12:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778010804; x=1778615604; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BCtnCZH8ZoKxZPeVUzWtK/UQekMVfj0snT68dwdPoMQ=; b=XF7RvkxLqpgwpitQW7+I6LC0SZcgdmSlGlwtyv7fsBf76nYHQg2PAQA1Sv8Vm/TbO5 d1TUTMw+p0hMqXl3Krcytr9d051Pq3qKGK7pZVLdhZWqgH/u+db2xh3Ie8NEU0r+Rcce H52e1zehCf3kjKGzsTDina8jEhWZqTD7VbTPN2lU0rkzsRlbklaQkIqtYo0ZQ/vSScn8 9vY0x4R1wte31Ddw4LZWNNV/zIG1eLUfs7BbcpEmhnlX7YHVubCf5PQJDLJiRF9zuobr gn/SOHn3DDgMEpp2OtdWOj2s6u9ELpLOmHMnTph2SXZ2UQXexPi9f2J3xzWbuAAx+Lnl DiAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778010804; x=1778615604; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BCtnCZH8ZoKxZPeVUzWtK/UQekMVfj0snT68dwdPoMQ=; b=MQaEMp6wFMJfbGPfxsd9AXCk1WpdjVxrJAqRHM7/g4x8hqH7pBtfO4+US3Zcpfus3U p+pEXpjpThU3uBFyNoNsV32IBKRsFe7krFYEm55jFAU8sUY/B6thQhP8keluTwbYOOUD TGfjb2mFYTP8Ax9ie+DfHY9CmLaFpI4YZh13/ffOocCvHCQFq6sPh/ENJp7rvo5R1w/o cHLkio3zgZ6LCxnE9/ipOw6B/UQhSxBg9XFU1NHu6HoQj1X4HT28ID2TnfLS3yeQeD+I N6vde+gEewDjlvhngIEEqO7yqUP73fPljp6/f58m7cIKkhMdixQZk+rObvMmIbZNI9Ny 4QBA== X-Gm-Message-State: AOJu0YywbqPBTYOjtAvgcvUqCDYuBxE3dIgihchNL9hYH0AHP2XNOIa8 bj4Zwf20HE8lrA/kDuuqHFwa7tnNn7cqrIHOSSFN5raPNSUQK49GsWjBbUlgerNVZEpHIGIGfSA VBiwTBdVqt+whCZ9lJBNiAYr3N7pVdcXVDw3S00BdCdJ8MAYew4tHib1icN5T0DDinRtd0oMKWz seqtCR7FlOAUslnY9KEx2qIZxgcywxz7d3tRRSi8PLC4BCcx17sQ== X-Gm-Gg: AeBDievAmyfic6ajkFfKiQCve1twj74mNEmGjn6X0fr1gXAZLkWmkN7REYPmaom20/n V5dwtUBIrxGf17yZKC7FUOQ3c0/3i2CvAs5SCYlo+3dYps+5LuBlsyOnsmEI7K9Xi/91b4APWHH A6f6nc5Oa8KSOBo70kzQrJBm1jUMC3F1odunxGE2vKAEYgxOoM19iUDjQ+/yIfq/EDaUUs8Bx3x sUMRbmkXN3mPNxUmp7cAs+YTdZ+2Xr3Htrvkg7qHS+elQtKn6kE4MlmQq0GQp375zRtfe0907wy ZhwhWmxZOyzoa+R+ijmD6gPIM0QvWhqj4eVgV5NilWrDIdHHLfW5xZZLcEOMGcNU/I5wLFoSc4Q 3mCEterffeDXzFgrTU7onNJNsWeLwa0MBUiWymUWls6Fsgdit/eQ3/vi4VHr8acwiI6TiQFX0/Z H0veJ/yzXggmnKYwKc4Wr0dxd6Kj9adlTr6i5nd8E= X-Received: by 2002:a05:600c:8589:b0:48d:5c1:bc3b with SMTP id 5b1f17b1804b1-48e51f410a4mr8256935e9.24.1778010803995; Tue, 05 May 2026 12:53:23 -0700 (PDT) X-Received: by 2002:a05:600c:8589:b0:48d:5c1:bc3b with SMTP id 5b1f17b1804b1-48e51f410a4mr8256585e9.24.1778010803501; Tue, 05 May 2026 12:53:23 -0700 (PDT) Received: from [192.168.10.48] ([176.206.106.181]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed6bafsm760324365e9.2.2026.05.05.12.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 12:53:22 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: d.riley@proxmox.com, jon@nutanix.com, "Borislav Petkov (AMD)" Subject: [PATCH 23/28] KVM: SVM: add GMET bit definitions Date: Tue, 5 May 2026 21:52:21 +0200 Message-ID: <20260505195226.563317-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260505195226.563317-1-pbonzini@redhat.com> References: <20260505195226.563317-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit GMET (Guest Mode Execute Trap) is an AMD virtualization feature, essentially the nested paging version of SMEP. Hyper-V uses it; add it in preparation for making it available to hypervisors running under KVM. Acked-by: Borislav Petkov (AMD) Tested-by: David Riley Signed-off-by: Paolo Bonzini --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/svm.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index de7bd88e539d..d58dbce83f45 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -379,6 +379,7 @@ #define X86_FEATURE_AVIC (15*32+13) /* "avic" Virtual Interrupt Controller */ #define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* "v_vmsave_vmload" Virtual VMSAVE VMLOAD */ #define X86_FEATURE_VGIF (15*32+16) /* "vgif" Virtual GIF */ +#define X86_FEATURE_GMET (15*32+17) /* Guest Mode Execution Trap */ #define X86_FEATURE_X2AVIC (15*32+18) /* "x2avic" Virtual x2apic */ #define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* "v_spec_ctrl" Virtual SPEC_CTRL */ #define X86_FEATURE_VNMI (15*32+25) /* "vnmi" Virtual NMI */ diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index bcfeb5e7c0ed..aa63431ba92c 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -243,6 +243,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area { #define SVM_MISC_ENABLE_NP BIT(0) #define SVM_MISC_ENABLE_SEV BIT(1) #define SVM_MISC_ENABLE_SEV_ES BIT(2) +#define SVM_MISC_ENABLE_GMET BIT(3) #define SVM_MISC2_ENABLE_V_LBR BIT_ULL(0) #define SVM_MISC2_ENABLE_V_VMLOAD_VMSAVE BIT_ULL(1) -- 2.54.0