Message ID | 20240226143630.33643-66-jiangshanlai@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-81713-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2162839dyb; Mon, 26 Feb 2024 07:50:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXwwp8fBHbL45EZ0O8mUGQvz9kM6ZisN2qxBWIrxFs/veXhGlOBm0TGSw3WLUGc4mr7UxLa4qAB87AKLJqtyXMsDeVMtw== X-Google-Smtp-Source: AGHT+IEwZ5w9z2cSfkeLY818WXECbx+FhtkL2sA8j4bm8aFQ8kKWitpEHmJjbHcxc+qQ+FLYovdt X-Received: by 2002:a05:6870:514f:b0:21f:a649:dc65 with SMTP id z15-20020a056870514f00b0021fa649dc65mr7525618oak.6.1708962609893; Mon, 26 Feb 2024 07:50:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708962609; cv=pass; d=google.com; s=arc-20160816; b=p3lVclJbCyzyJn2xRyS+9XUZN5idAmwIu4GtNDlA3gY5Y2oe6AKcnDBxGBqAcwzQ4Q XoKAR9sESAhq+hmn6rt+0ycDmILUmTQiZBOht7YfEAJ9PWvqC9tqZU1UNOI8kMXc/50N gaEADy+Q4bf+Wfv8jwfYB4mgGU5DVROfFaCuyf6c0x21Ti2bAva86Sya6KEGQ/c+Zhnb 1M1iMl193NiRR1dOCp3RJdfZb2vcnynpee3GU+lcSz49AqRC1SxloC6O3t87ptlB7vMH 5eutq19zjCFl+xJKB4eM4UiVyqpsDH5Ir+xiyjPt7dZ5SFVBuP2p74yDAstP+QgduwHq J23g== 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=WkFyhfs2k+/ZiDzHPyMbRms0OafqFweJ9xnGHR0iLV8=; fh=VXU29+gBdvXrhbGJhM1O3AzVes3BG7sqjheT0rqxxwU=; b=02q4J0aAEWUoQC4vpd20oyu5HuUKa+UsZAHaq9blXSAZl9JZ/3ybaplmCpceakb6h+ 3l2SMd5j3H4TRJy8wf9pxU6CC1MOkQaHIyIn2Kavssk2TFvziuqWbGUheEnxSkemZgL+ BhwNL3qLXCJ64r3jfeGUprCK08nJOu98ahT2SrcU7l/inHDQgs7GBQc91rhGSAsTJCtl dkI/DqyM/Cd7oK5eN4hJYYR7MH9sS+A9Wbn6NMyoq3rI+R6f97idY3+iYrEhRwTVI+KS jFBRtbbPVPa8vUKaDIw9okfyas8y7T3MF5c/7PDa09zvVTWMYShB7UBqWTR4PY9/73cq m5AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=km8qtcDh; 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-81713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81713-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 24-20020a631158000000b005d6c2958481si3938022pgr.639.2024.02.26.07.50.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:50:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=km8qtcDh; 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-81713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81713-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2C823B33415 for <ouuuleilei@gmail.com>; Mon, 26 Feb 2024 15:01:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BE0314DFF6; Mon, 26 Feb 2024 14:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="km8qtcDh" Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 32A9914AD3B; Mon, 26 Feb 2024 14:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708958361; cv=none; b=GTPbMTB6x6/pZ4bbBK3uWVBVz0zsO6F5N+sqZBndB2+qoe+On4Q4d03p1BD8nmq4J3SFmQg/JtGSR/9Q5WmoL2LgC3e014H37G+OKVAE48Xe1rFRN/upPTjA3SLH+krElgAAToFu8ruiF6rJPX/T8AzDFJPelSpW2vbGo8AhGJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708958361; c=relaxed/simple; bh=XhSoym3qQlKNWcZaO1fmucbwOJAhaGU0ZDzfY5zhuSk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AvrL2yEVwObNlWd5YgQQkzkilx2JzkYaRwfI8GYlGyuNTNeMvJT6U309O0xcB8Pz+TKPBPhLYXYavPJwuR6qjc4YvTGAAZ9pJDurSqUj7PuCdBxFMFO9y35RyGMkwfA8sS3Iga6lHlXpmak6XZ3qzIi+P6HdwsAk8VFpy6jMRMk= 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=km8qtcDh; arc=none smtp.client-ip=209.85.214.181 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-pl1-f181.google.com with SMTP id d9443c01a7336-1dcafff3c50so3680195ad.0; Mon, 26 Feb 2024 06:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708958359; x=1709563159; 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=WkFyhfs2k+/ZiDzHPyMbRms0OafqFweJ9xnGHR0iLV8=; b=km8qtcDhONpx3iGTYwvzSZTeaCQUZLPRlKLAAnm+nDZXnmuiCpSvU3aDjI2f2+wcyj 9R9zPCS5dcnEGWyht4zpdJcf3y86FDNnQZsg6/7c+vakIEkp+lNCffDEyYMK1c9XIhmO XGCLdXyJFjUo6xNmrfM5lczAEuU1mbqDY+3lry/Zwdtl0dFleT//VJfl4wQ2AvjWQN1n i190qpCZ5ejZPEum/3rxE9+jhtGAIJXD4FJf71v2VtYyNsduJrK98TPHEOqxj+NyjvqP b220mHUMYfWQe8p03aJ+oZXPxUF8IlhqH8r0WHljj2xuwkYXzGu38KnP8uaQV4iBIJoA daWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708958359; x=1709563159; 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=WkFyhfs2k+/ZiDzHPyMbRms0OafqFweJ9xnGHR0iLV8=; b=QLfjRmAE3+g0JOShuRWDVMLAGoGxb4dnlynOCMWzZHz6BbVx9tuZwQ/atYeYKpZn4g NLeL+l0dVAWs991UO3SNY0Ri37W3r+QZxhg2iKIQiFULgs3DsdoKu/F7p8GyjPQVyndB 2kHZBFPUJXr8Wzcf9KSCJ+77aFiASjBEIB9HmheCcBuEyYRB2N1vZlnLK4wP71UC5qVj WBf1OM2zcAEUjSigZu3aPCQ/uf8VBFsZbHb+MnRvM1MJNUVtIqfoVpp9YAhf9gMFIuXU OBXcRGEHdoSdW+t7udCwlSi3ABzWSxTMNyDwQ+WDZp6uEO3fU6Cgz7sS82rof94sE/Rk 3XnQ== X-Forwarded-Encrypted: i=1; AJvYcCW/92nAyb+4OnrYd5XiInYZguhoAtZTAIWrNNZqahzpMobFxK0m2eZHoYTP//9v7STJmmgqJyrkytt5mjzeepGolKVB X-Gm-Message-State: AOJu0YyfAh+9xksGH7f2UUxqF4usGqpPEBnBBTajRjcdRLAwt/rqKmun gZQNQn+YcsFSxKksRGKvMKgaxO3FbUaUWdHBj5SWVLCZsdH79fMRbYvyqkfm X-Received: by 2002:a17:902:d488:b0:1dc:8042:3b76 with SMTP id c8-20020a170902d48800b001dc80423b76mr10400301plg.2.1708958359247; Mon, 26 Feb 2024 06:39:19 -0800 (PST) Received: from localhost ([198.11.176.14]) by smtp.gmail.com with ESMTPSA id b4-20020a170903228400b001db5ea6664asm3997276plh.21.2024.02.26.06.39.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2024 06:39:18 -0800 (PST) From: Lai Jiangshan <jiangshanlai@gmail.com> To: linux-kernel@vger.kernel.org Cc: Lai Jiangshan <jiangshan.ljs@antgroup.com>, Hou Wenlong <houwenlong.hwl@antgroup.com>, Linus Torvalds <torvalds@linux-foundation.org>, Peter Zijlstra <peterz@infradead.org>, Sean Christopherson <seanjc@google.com>, Thomas Gleixner <tglx@linutronix.de>, Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>, kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>, x86@kernel.org, Kees Cook <keescook@chromium.org>, Juergen Gross <jgross@suse.com>, Wanpeng Li <wanpengli@tencent.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com> Subject: [RFC PATCH 65/73] x86/kvm: Patch KVM hypercall as PVM hypercall Date: Mon, 26 Feb 2024 22:36:22 +0800 Message-Id: <20240226143630.33643-66-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240226143630.33643-1-jiangshanlai@gmail.com> References: <20240226143630.33643-1-jiangshanlai@gmail.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 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791977177471385250 X-GMAIL-MSGID: 1791977177471385250 |
Series |
[RFC,01/73] KVM: Documentation: Add the specification for PVM
|
|
Commit Message
Lai Jiangshan
Feb. 26, 2024, 2:36 p.m. UTC
From: Lai Jiangshan <jiangshan.ljs@antgroup.com> Modify the KVM_HYPERCALL macro to enable patching the KVM hypercall as a PVM hypercall. Note that this modification will increase the size by two bytes for each KVM hypercall instruction. Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com> --- arch/x86/include/asm/kvm_para.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 57bc74e112f2..1a322b684146 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h @@ -2,6 +2,7 @@ #ifndef _ASM_X86_KVM_PARA_H #define _ASM_X86_KVM_PARA_H +#include <asm/pvm_para.h> #include <asm/processor.h> #include <asm/alternative.h> #include <linux/interrupt.h> @@ -18,8 +19,14 @@ static inline bool kvm_check_and_clear_guest_paused(void) } #endif /* CONFIG_KVM_GUEST */ +#ifdef CONFIG_PVM_GUEST +#define KVM_HYPERCALL \ + ALTERNATIVE_2("vmcall", "vmmcall", X86_FEATURE_VMMCALL, \ + "call pvm_hypercall", X86_FEATURE_KVM_PVM_GUEST) +#else #define KVM_HYPERCALL \ ALTERNATIVE("vmcall", "vmmcall", X86_FEATURE_VMMCALL) +#endif /* CONFIG_PVM_GUEST */ /* For KVM hypercalls, a three-byte sequence of either the vmcall or the vmmcall * instruction. The hypervisor may replace it with something else but only the