Message ID | 20240223204233.3337324-8-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-79134-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp835977dyb; Fri, 23 Feb 2024 12:47:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW08QyTPQoqR65BeyrXVzgPPO/mpU90mVT/xJfY2R16bK6X9yzrtsoRY/XQ0fljsHDJFvx+qDyVBFDUeRsC4SF+jWJZ3w== X-Google-Smtp-Source: AGHT+IGlXx1k2rDO77/A/Glnz7MaUbGZb4oh8a10GRjDozaENAOyM3Fa0oORTw+J87oPXxExRWir X-Received: by 2002:a17:906:168d:b0:a3d:bb68:be30 with SMTP id s13-20020a170906168d00b00a3dbb68be30mr701314ejd.6.1708721231302; Fri, 23 Feb 2024 12:47:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708721231; cv=pass; d=google.com; s=arc-20160816; b=H/gfHajN47y5aTkFv8pIWeXy2eh+/oamoAIYlL2SXb3lRa0dJbSzHZOWAhN6zd9AXb sUjGBdLpMBu0oRrIRnOJVBwTHs04adzuLYKqKa0YUFmtbLsI9YISpnCfU2Wc2dcpPqwH NSioPhWXBylKnTQqM7ainFKK2vIbrc5biZIEjkNX/hb3emiCRB0FElX59J0G31b1WSOS a6e0FYbJyiRp5k0ULycIGHpPm8AQofigRxXVaSzKHagdfUU/TJe17xF19U8eM2bPwG09 9GEVcwD7j88PbYldMp+Zpo8YCxNRaWjsl//pOOLT4cQlYg1mlBgHZpYNpwNSnRWy28Rt dDlw== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79134-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ho12-20020a1709070e8c00b00a3f5732bdc1si2392994ejc.376.2024.02.23.12.47.11 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:47:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79134-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79134-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id E6F5A1F227E7 for <ouuuleilei@gmail.com>; Fri, 23 Feb 2024 20:47:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33B9314C5AA; Fri, 23 Feb 2024 20:42:55 +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 <linux-kernel@vger.kernel.org>; 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 <linux-kernel@vger.kernel.org>; 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 <seanjc@google.com> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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 <seanjc@google.com> To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Lendacky <thomas.lendacky@amd.com>, Michael Roth <michael.roth@amd.com>, Alexey Kardashevskiy <aik@amd.com> Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791724073468291819 X-GMAIL-MSGID: 1791724073468291819 |
Series |
KVM: SVM: Clean up VMRUN=>#VMEXIT assembly
|
|
Commit Message
Sean Christopherson
Feb. 23, 2024, 8:42 p.m. UTC
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 <seanjc@google.com>
---
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 <asm/asm.h> #include <asm/asm-offsets.h> #include <asm/bitsperlong.h> +#include <asm/frame.h> #include <asm/kvm_vcpu_regs.h> #include <asm/nospec-branch.h> #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