From nobody Fri May 3 08:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1611917178; cv=none; d=zohomail.com; s=zohoarc; b=Tpusx78m75VdwuIEsB8A7/3mX0oPNT7hX0Kw3vSLT8vqeN1HoVIA6jocH4Q0gYpIA3TMwr6Ihk2TXC813MEuUM+wo7jSuovwI/fn4PsrwL0gxuW4a4xmLPSjAYRS1CyqDSHGv1muynWYP8zMUe4pbAWNdcs2oUUcUgnTTCsKcxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611917178; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kYW0NQbd3V4SunwfLCCAxG2tT/qQ/q2Y/8k8cqow+t4=; b=KLsvLTnH70ZyJvQIpMeFc7VcbkFZvCismg/eq/33T7/d+tnwljR5ZaPqZN5aVv/SNpJhlV2KuSqef3yq28uBBoJDiBcmZqowTNB1E0END1pfsk51FLYlNaomPPS5fihUW2p+WlbtFMfSTBnHnuIEgSam6sFy00uBV7SlMNRXBj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1611917178088785.790431310163; Fri, 29 Jan 2021 02:46:18 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.77956.141574 (Exim 4.92) (envelope-from ) id 1l5RHt-0000IX-8J; Fri, 29 Jan 2021 10:46:01 +0000 Received: by outflank-mailman (output) from mailman id 77956.141574; Fri, 29 Jan 2021 10:46:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l5RHt-0000IQ-5I; Fri, 29 Jan 2021 10:46:01 +0000 Received: by outflank-mailman (input) for mailman id 77956; Fri, 29 Jan 2021 10:46:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l5RHs-0000II-61 for xen-devel@lists.xenproject.org; Fri, 29 Jan 2021 10:46:00 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3b96bfaa-ea30-43aa-90ae-e97994574f26; Fri, 29 Jan 2021 10:45:58 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3b96bfaa-ea30-43aa-90ae-e97994574f26 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1611917158; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Tv4cBwEAsvdZj0In03grL69EwnWIPYvdtYFViraxlCw=; b=heEQui6/Hcfj0UIueMzpsIIFbSwgt0e9pkTGgs5g2REpiN2iueTvlQGg 6yU0PW+qupV9SszUu1xIqcpsDv0EYDB1R4Y2uONJzrVisisPOAqE2x1X0 /FZ+A9WHGriyXCcN4VWGVTQTEXjoln8pk/OoIZVyk3BL+Hq4xyYZ8e8pc 0=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: SpVlrpEWSl+OnuyIfttemGZHhAdmBXE1B+7P38b1dZKAIwUHZvGBw22W5LaN7rN4AujlHEIiV8 zqnPznKbd4FpO3Z5lRJltfOu4WiRCEXJ5T2X1EPodAGQoSoE2eEjwHybffJ4d26DLbwNd1hhKf Jp86OoGqClOGEWFSR0/a9hk5SwDQpg1Rfpw0/ZSUSuUTFMNGTEoEUJQbAeewwes1SiBwkSqKcm f8x0JRowtothAAFRIlVqkaJ5z2lPR8cYfSjCJhfB1HFMrKxQ8mAmCysS+O99BIDttj/8QVz1Kj 4OE= X-SBRS: 5.1 X-MesageID: 36517224 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,385,1602561600"; d="scan'208";a="36517224" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 2.5/3] x86/svm: Reimplement VMRUN/STGI/CLGI with new asm-defns.h infrastructure Date: Fri, 29 Jan 2021 10:45:40 +0000 Message-ID: <20210129104540.32137-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210115231046.31785-1-andrew.cooper3@citrix.com> References: <20210115231046.31785-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) ... in order to reuse stgi elsewhere. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/hvm/svm/entry.S | 10 +++------- xen/include/asm-x86/asm-defns.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S index 1d2df08e89..e208a4b32a 100644 --- a/xen/arch/x86/hvm/svm/entry.S +++ b/xen/arch/x86/hvm/svm/entry.S @@ -22,10 +22,6 @@ #include #include =20 -#define VMRUN .byte 0x0F,0x01,0xD8 -#define STGI .byte 0x0F,0x01,0xDC -#define CLGI .byte 0x0F,0x01,0xDD - ENTRY(svm_asm_do_resume) GET_CURRENT(bx) .Lsvm_do_resume: @@ -82,9 +78,9 @@ __UNLIKELY_END(nsvm_hap) pop %rsi pop %rdi =20 - CLGI + clgi sti - VMRUN + vmrun =20 SAVE_ALL =20 @@ -93,7 +89,7 @@ __UNLIKELY_END(nsvm_hap) SPEC_CTRL_ENTRY_FROM_HVM /* Req: b=3Dcurr %rsp=3Dregs/cpuinfo, = Clob: acd */ /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */ =20 - STGI + stgi GLOBAL(svm_stgi_label) mov %rsp,%rdi call svm_vmexit_handler diff --git a/xen/include/asm-x86/asm-defns.h b/xen/include/asm-x86/asm-defn= s.h index 43f4868d40..2e3ec0ac01 100644 --- a/xen/include/asm-x86/asm-defns.h +++ b/xen/include/asm-x86/asm-defns.h @@ -8,6 +8,18 @@ .endm #endif =20 +.macro vmrun + .byte 0x0f, 0x01, 0xd8 +.endm + +.macro stgi + .byte 0x0f, 0x01, 0xdc +.endm + +.macro clgi + .byte 0x0f, 0x01, 0xdd +.endm + .macro INDIRECT_BRANCH insn:req arg:req /* * Create an indirect branch. insn is one of call/jmp, arg is a single --=20 2.11.0