Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp88522rbb; Fri, 23 Feb 2024 12:46:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCjF3lhk1aS22xBbJ50s56ossGJia6d29gNJgNG3Pe+WxMbrnw14HmRTWY8FC03soxJ/RranDBnauVFbe8kF/hn3reP5/cjeLf+/AuYw== X-Google-Smtp-Source: AGHT+IFtOLQmIHiXGUnHOhQHRkYALg++Zkno163Sxo1mm+aeIQvT2LEYB8corZ+0VnOmkuA9xDJQ X-Received: by 2002:a05:620a:11a6:b0:787:7d02:805e with SMTP id c6-20020a05620a11a600b007877d02805emr1718079qkk.16.1708721214510; Fri, 23 Feb 2024 12:46:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708721214; cv=pass; d=google.com; s=arc-20160816; b=fQXjvxdExJs246gpzKY0fi2UQFB9+62gUxcH9UchQrdAP+1ta7BD/UbCmZhopCE4A1 GpIKVSFKheoZ3f9ilEAike3Nlm8t9A8GAnLJUG0x11bszPxanNjM4a6WojypG39Tm+7C gKoTL+vw597nqNeRpsze8AH6PkcRJHR4krx7xhbap59M6aumWKPt1+/XOuP0n/wupRqj Ok4Ti+u1vWStkjM30cD/u3Lz32NJwh2Cm/pT75gHYxEEZ4bTayWQs9eSj8hmzNmIylKB W0uoiuuH+2XDjyRKCe02JoWE/ZfhA0TE+uyvZ3Y6ro0VsNAERru/Ap7KrSWYrsyNyym+ r5ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :reply-to:dkim-signature; bh=FfzNCmRZ0S/1zY2q7LR3gyLGd166iHY+ytisyKJMCXE=; fh=RzqJtP8H/dXjhC3yV4/7BFS6Ab9jCksIMQ8xPM+aPPw=; b=Se4wLKp4VHZIpa3JTgWnPjN9+ToSz31avyqdeN6d+u5u65wrptBC38rwsZ1oA5mZmA KZ6ez+dscPV4+zsSJ5o8jpviMs5FnQSvIJw2RrRPz6v/dbsNxJVhOCA44czwbLN9XZWV L/d8Wy1d9pQsuWMxpbX5zyhCt9cHoRdDnLMJAfGLcT4wpfds/z7AaR48pxl4GXNj9Jau 6gbmaXjMNUF/GtHwCVWzGjo8StZTYOIt7isDbGZ5H+041jZYngNcpzBvStUI5pkjWI6q 8qyl1N4EIyiTkA3t29iNK0YpP7To1/rZy0hJj7RV295S/uTwY54m45Te83bL6cqNpwa7 dTdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bpT+2oIB; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-79134-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79134-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l21-20020a05620a28d500b00787b434d4cesi2034240qkp.639.2024.02.23.12.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:46:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79134-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bpT+2oIB; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-79134-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79134-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 44E9B1C248CD for ; Fri, 23 Feb 2024 20:46:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BF9E15958E; Fri, 23 Feb 2024 20:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bpT+2oIB" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 E348A158D8D for ; Fri, 23 Feb 2024 20:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708720972; cv=none; b=Yl1L/nD8KRQbEyPrittucUd+Tw60rqrBvbGPibet3bpwlv6/roolQfrLoawZSnE/awgaski6O7qneA9G4LfzcXySa9t5wnV4pGihow0VwCKe3/qyt2F3gSdV3bdM4urqVfytKl/kUdCr+GCxh/jKZfLtNHyJJNogeovdkaF3BO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708720972; c=relaxed/simple; bh=x8JOCHKvKb4ozY0sAwrZiWMcGVvJkG+syIMQG5Dq5oA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XE1kGwoOYdI3fLvJrtpGAdlTwL7e8nnfk67gZNzEv5KaaqzO2Pa1Lj9OSE1Uby5n1575JG1J2ylEknR027OReNHRvSk9uejvbxhWySrYA+pgEocik3o0oWmIFCC/FCWKp3rqu/4UDOffGGw+lgc0QSZ1xbCPJ0ePUZRjb0JZo9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bpT+2oIB; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-608ad239f8fso22867787b3.0 for ; Fri, 23 Feb 2024 12:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708720970; x=1709325770; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=FfzNCmRZ0S/1zY2q7LR3gyLGd166iHY+ytisyKJMCXE=; b=bpT+2oIBtxQEZ5sHzyTYn58ZEVbChWKoqeyVU7YgevVPbxsTMBbkFVxnBJ2vrYKRED QVN4vsNproJH7drfX9lXIMKf5c1rouM4YcdATbY/b4sWyk/Q1ZzxlWMvoS80slMAGfra 37omCqmeSOl548rP/Zdrj6j3fNT3aguQ97cFoprNR1E4U3MB1Q65cG7ycfMx8R7UcXLL NEXu2JUzFVQ6K32SstHAn4i5RWT9etYIDGIrn6YmotxX9sd8boKnROT2pkzCad9T+Te1 JavvoSrkDBcpSRHGVAGbc5a3rngICnIHoGwNbGY6qNJ64a+CW4XuLMDVLqMzIa4W9nyL D5CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708720970; x=1709325770; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FfzNCmRZ0S/1zY2q7LR3gyLGd166iHY+ytisyKJMCXE=; b=atq7cv6O6MZJHpLkhDXnegsgiGByQt0OH5KRO70HfkWMiovyDvrZ3vQRhu68CjBgKj IIAGqJ1Qhx55EjA3JusQRFwQU5w6Gp5Kbh1HFkzAEJi7pKYuEBqPAO6EOF9l7/FaToHm S/2SI4OGwvbZkwKSBLtCs9Oh/KETcNpfphdo4Faqi0L4AfEuSfJ153Kh1/qWagg0/yXX zehmMkFgsPtGRhs2MNE/W1z/EUrJWKa6Ow6r1TSOAZZazhBETxSYtmQ+W6DWNPGHinDI MHmC3PyRwzM2RNEvvPrGWGQGnVS632yiBLcXWnG05KYS589/bJVP3eUfhNSJ9qffYRIE 0n8g== X-Forwarded-Encrypted: i=1; AJvYcCWT7Z+aPcEPtvCEvzUNI2ePkCqxXhLm56b4IcqtYzeAhjVvV6rb6XYy/U2GhJZ0O8pWT11gWrA++eXocovFgytSOawVPvj2BPs+kOdl X-Gm-Message-State: AOJu0YyKNCNCBEywvL0JinIKQp6kjxXukN0Tejv1MHVYpbSjSZtx2vdq JsGAYHfc3RTFPOdCpB3TIMGtXZ9FhxqHTwAQQQmhgRM6Be68FsujRvr0YIyfP5nQOZu7qrsTWst SQQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:2602:b0:dc6:519b:5425 with SMTP id dw2-20020a056902260200b00dc6519b5425mr242656ybb.11.1708720969888; Fri, 23 Feb 2024 12:42:49 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 23 Feb 2024 12:42:32 -0800 In-Reply-To: <20240223204233.3337324-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240223204233.3337324-1-seanjc@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240223204233.3337324-8-seanjc@google.com> Subject: [PATCH 7/8] KVM: SVM: Create a stack frame in __svm_sev_es_vcpu_run() From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Lendacky , Michael Roth , Alexey Kardashevskiy Content-Type: text/plain; charset="UTF-8" Now that KVM uses the host save area to context switch RBP, i.e. preserves RBP for the entirety of __svm_sev_es_vcpu_run(), create a stack frame using the standared FRAME_{BEGIN,END} macros. Note, __svm_sev_es_vcpu_run() is subtly not a leaf function as it can call into ibpb_feature() via UNTRAIN_RET_VM. Signed-off-by: Sean Christopherson --- arch/x86/kvm/svm/vmenter.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kvm/svm/vmenter.S b/arch/x86/kvm/svm/vmenter.S index 48cdba47622c..5461c23ee762 100644 --- a/arch/x86/kvm/svm/vmenter.S +++ b/arch/x86/kvm/svm/vmenter.S @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include "kvm-asm-offsets.h" @@ -312,6 +313,8 @@ SYM_FUNC_END(__svm_vcpu_run) * @spec_ctrl_intercepted: bool */ SYM_FUNC_START(__svm_sev_es_vcpu_run) + FRAME_BEGIN + /* * Save non-volatile (callee-saved) registers to the host save area. * Except for RAX and RSP, all GPRs are restored on #VMEXIT, but not @@ -362,6 +365,7 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run) */ UNTRAIN_RET_VM + FRAME_END RET RESTORE_GUEST_SPEC_CTRL_BODY -- 2.44.0.rc0.258.g7320e95886-goog