Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp260785lqp; Mon, 10 Jun 2024 03:23:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXswVneWaFMVTO0KvRj9HqPW/JOig+9roMnEzyI5JCseR2ZJzSCxj5XvvuqeMVSTUzEVSuDyT7DMbod0FF+1oAsNi1j8i4CnvRVVS02ng== X-Google-Smtp-Source: AGHT+IH/798hbgmNPu9ABh6D9P1ZmsuxSzM27wP4G5mr5zecs3Z+ku/NQv93cOGIly7U4jQi65vk X-Received: by 2002:a05:6a00:ac1:b0:704:3271:7c0e with SMTP id d2e1a72fcca58-70432717f24mr6728381b3a.6.1718014980641; Mon, 10 Jun 2024 03:23:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718014980; cv=pass; d=google.com; s=arc-20160816; b=AM3+LH61jOElsbF8zSnDk3+NcqRFUl66dzZI0brZjf9ZUICMWAGUDgU2DK7/RjVdjl HpZZf66NbxBQG3feJhaPhe7BIicZPSSUpxe7qz/P7rq86XOwX0z5C4UuFPwAKjPrf1uG HGG7OK3rJ09dg6ex/S0mNRk9Z3nSHNWHA6U1e7/yQ2EPmcQSAY7cL2Fz7Soo9OjJzJYE 5DQvNjgWkSXvyVtglY86Nkc1YMSzuLq8Oc1JT4FZnHq5rEPWJuaQh0+VuaC2RZ3g/a9e 9PhsoznWUe28uR8B6c03GIpfbV4U5AqsC7kM30FPudOnVslK2VIRxKSrgAXu3YugyrDv oqOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PXpLAMRWKrEJAxhlnztpKOQCT6b3mNAcjXJNnKoGzl0=; fh=7WYkuF3gCA44Zi6Qmz2s17R1Cv4Mt6FGcFpZ0nrAg/g=; b=AkMxYik6dc6tJx7DwwVE8uVOb7NttPvRVcl8IjmGssk6gCiYKDRh4dWBfeBNjkEdSJ Z6xKHkbyWZejrAws3gV6JcF4l3jcaFA9IUaGrEkMLauaAaBJQO6N1gY/R6obyZYrcLfM yBzh2c93Xs+I6emE77mk3hEehqNTivlpsG0I8b41EKkmV1yI3C3cYn+dtoIan4oxsBwX liivedvKvByP/WOTpbJfJP7cSKe8fgZOrWGALv2yPZI7J2KBN4zO6ueMeAVoZU4T2bNE FmUkCFsGa3c3j2gLBKH0AN82qg3tWEPkZ4Bn+PUoOrCs5Z0qTaPVcRd0Ai6sGyppqS3c rQmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="dyhZM/Rm"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208006-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-7043586dec4si2457779b3a.247.2024.06.10.03.23.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 03:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208006-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="dyhZM/Rm"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208006-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7EBBE284C6F for ; Mon, 10 Jun 2024 10:22:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8415B80035; Mon, 10 Jun 2024 10:21:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dyhZM/Rm" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 211C17D3F0; Mon, 10 Jun 2024 10:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718014892; cv=none; b=FLT35B0lqF1ny7/QASlOMvw6PUa4R8eTho5loMZgBLV8JioML52dzOz5eM3Pg6ABFhidSsuoqYUcYjvho5kP4jgP4aTDcdsCLikmy4ZaJTfNxDkkXHWO4odzde1Bbslp/mHoeMpQgPDYMgFKEC/dnoxWT7q+TcT80ZyvdFCkif8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718014892; c=relaxed/simple; bh=JZT+a3gMm7LX5fmthY+7RJk9xN/fuL/DRlnnw7HuKpA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QD6BEG5G2bh0qmZXvxBSSLaLY4tA+uqFveIjyNPUpVeJ/BwqB2FRhgC8chLzgpryKYxtwO6OW+fVVpqBoAIukIiTv4cpJPMwtr/X8ZCds9BuqcR2Wh+3jpVZj9TiBpJBKC2CFHzLsF5XuPFASXaQ5ywT011S0cDwmRQWSZAELLo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dyhZM/Rm; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-52c82101407so2422847e87.3; Mon, 10 Jun 2024 03:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718014889; x=1718619689; 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=PXpLAMRWKrEJAxhlnztpKOQCT6b3mNAcjXJNnKoGzl0=; b=dyhZM/RmKHcs+Ry9fehP1SAPhD6tJFf3dZVbWCThC/rnGWi6amBR5qKljfNnF6GE8z wPmNonM+6rC0psGN5hdOvRX/jSAQatFXNCI2MfufaIG4HZhDBcCNe2XOQRC4V2uROs3a 9QzY0ZZ4S66Nh9hwfkZWWv02QqRpi9+mlgSheK9hhrGpZyWFmDjQJW8cvYxW1oTf55M9 Iu8qahED6O1UJvV67CvgD89KqM6SMSo7CKUCPOp/g1WZvnhHrRGpsdQyEKYuqc0hBW37 TGr2xVYyGOU4/GJ3Cc6jHgVUKj28ueDrBFYy7RcI3fAKJJJNFFIvuV0ITpdqNHAUktSs HLIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718014889; x=1718619689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PXpLAMRWKrEJAxhlnztpKOQCT6b3mNAcjXJNnKoGzl0=; b=odfcrzya15c0EXc90xY0+5Z/cEaorhw5iDUgHHzu4F9oaSs4bBXdaBgPE1C7CkXsaF G6rHamZJbcdESb9aQDEWhr02P53U1K+uWWoP+rWqfq6zU30FVD4o9luNmy7ezLYiTJGz u7NsXI7kOi7UUVygt92olBFVZVdjmS8NJwD3dz/6b/VDeT6ZPUeSGDKeytrnZus/SYOr XrVwccG1DAM6/VhXyyqGXTVMPCUiIZPLYALjAqGmUv26A8PaL+TTcT8AWy5gs6xQOXuq VROgAeMYyFJmB7E1rZ4ipNRCb423eV7xkgQ3XGhq+PeU+6iuI+12QFtAVzIlSXwtGc3z HQUQ== X-Forwarded-Encrypted: i=1; AJvYcCUEUpfvhqiAyGlhGbFwgLgfP8FA5JDiw3uVwcXvpSTaYISUdFf1b1JXt3Xtzn5OfJADdXKzLQCuwYejU7YAGhVCWYIOqqTp8p+w/dDkCRxyepRGnGrN5NPWYQNqfmeXqMODckPdtO4/TV4zLFrjMsh3LUhCKjirvb7S X-Gm-Message-State: AOJu0YyAvgSgIdO9TmryZxGBFiaNNKrERRJhPPA1iEqL7BS3v0jgWGw8 3q/eRWOr9GOBtHcpMlhn2/izO5Fi0phruUFVNWyuZjsxx0pafpc/ X-Received: by 2002:ac2:4c82:0:b0:52c:8289:e891 with SMTP id 2adb3069b0e04-52c8289e9a0mr3434713e87.6.1718014889127; Mon, 10 Jun 2024 03:21:29 -0700 (PDT) Received: from vasant-suse.fritz.box ([2001:9e8:ab68:af00:6f43:17ee:43bd:e0a9]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f0d7b35d5sm290887766b.192.2024.06.10.03.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 03:21:28 -0700 (PDT) From: vsntk18@gmail.com To: vsntk18@gmail.com Cc: x86@kernel.org, Borislav.Petkov@amd.com, Dhaval.Giani@amd.com, ashish.kalra@amd.com, cfir@google.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, ebiederm@xmission.com, erdemaktas@google.com, hpa@zytor.com, jgross@suse.com, jroedel@suse.de, jslaby@suse.cz, keescook@chromium.org, kexec@lists.infradead.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, luto@kernel.org, martin.b.radev@gmail.com, mhiramat@kernel.org, michael.roth@amd.com, mstunes@vmware.com, nivedita@alum.mit.edu, peterz@infradead.org, rientjes@google.com, seanjc@google.com, stable@vger.kernel.org, thomas.lendacky@amd.com, virtualization@lists.linux-foundation.org, vkarasulli@suse.de Subject: [PATCH v6 03/10] x86/sev: Set GHCB data structure version Date: Mon, 10 Jun 2024 12:21:06 +0200 Message-Id: <20240610102113.20969-4-vsntk18@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610102113.20969-1-vsntk18@gmail.com> References: <20240610102113.20969-1-vsntk18@gmail.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 From: Joerg Roedel It turned out that the GHCB->protocol field does not declare the version of the guest-hypervisor communication protocol, but rather the version of the GHCB data structure. Reflect that in the define used to set the protocol field. Signed-off-by: Joerg Roedel Signed-off-by: Vasant Karasulli --- arch/x86/include/asm/sev.h | 3 +++ arch/x86/kernel/sev-shared.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/sev.h b/arch/x86/include/asm/sev.h index ca20cc4e5826..963d51dcf0e6 100644 --- a/arch/x86/include/asm/sev.h +++ b/arch/x86/include/asm/sev.h @@ -19,6 +19,9 @@ #define GHCB_PROTOCOL_MAX 2ULL #define GHCB_DEFAULT_USAGE 0ULL +/* Version of the GHCB data structure */ +#define GHCB_VERSION 1 + #define VMGEXIT() { asm volatile("rep; vmmcall\n\r"); } struct boot_params; diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c index f5717eddf75b..f63262a9c2a5 100644 --- a/arch/x86/kernel/sev-shared.c +++ b/arch/x86/kernel/sev-shared.c @@ -264,7 +264,7 @@ static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, u64 exit_info_2) { /* Fill in protocol and format specifiers */ - ghcb->protocol_version = ghcb_version; + ghcb->protocol_version = GHCB_VERSION; ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; ghcb_set_sw_exit_code(ghcb, exit_code); -- 2.34.1