From nobody Mon Feb 9 16:34:21 2026 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=1708952123; cv=none; d=zohomail.com; s=zohoarc; b=OzLpwt3TQuxhJidQdhZIoHOTFRzTFH1QA5b4mAyGDnpGrF+WQ5t5b2t2B6YwvSA65dfH/fe0s+XqS2wsZl8FE06hCTOap/Qt8dLsaMicZ0VgWtvlHp53c4AUQFHtNUJxc47u69S6zhaHSn9Asf3IxcHjkKLRMRIq7vTA6bzEZG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708952123; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cUPkBSwvovweP2Vn5x5Slws9PAyzIz15Jh15k5P3vWY=; b=AS1wsNeLFZ8ttyZpocw0LN1hto0mFhvXmYqNCZSU5g30cN33egOEJi0Y9UTxm4zLktOVBPStRJMiCjc/WHaiInwDahYSDU8iWq2bmD9OyLV1wNMLPQDF46xVp16aZjuOhFWz9dxwwz24HDBrgFy/PGGT9Pm6hDBLQxKdgdJr7/s= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708952123226173.61581714749764; Mon, 26 Feb 2024 04:55:23 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.685526.1066388 (Exim 4.92) (envelope-from ) id 1reaVf-0005Sv-Kk; Mon, 26 Feb 2024 12:55:07 +0000 Received: by outflank-mailman (output) from mailman id 685526.1066388; Mon, 26 Feb 2024 12:55:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1reaVf-0005Ro-GJ; Mon, 26 Feb 2024 12:55:07 +0000 Received: by outflank-mailman (input) for mailman id 685526; Mon, 26 Feb 2024 12:55:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1reaVe-0004hn-2h for xen-devel@lists.xenproject.org; Mon, 26 Feb 2024 12:55:06 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 429d66e0-d4a6-11ee-98f5-efadbce2ee36; Mon, 26 Feb 2024 13:55:04 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a3e75e30d36so585120466b.1 for ; Mon, 26 Feb 2024 04:55:04 -0800 (PST) Received: from andrewcoop.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id ll9-20020a170907190900b00a42e4b5ab00sm2379645ejc.41.2024.02.26.04.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:55:03 -0800 (PST) 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: 429d66e0-d4a6-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1708952104; x=1709556904; darn=lists.xenproject.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=cUPkBSwvovweP2Vn5x5Slws9PAyzIz15Jh15k5P3vWY=; b=DfOoHuQR819ayTj+9RmgidFAecxkIKZqWBoD+g0No+0ZClGRsD/OkC7RDjf0bg4Imo cqx2WlKan6Op6JYOmuaUhp8nryRlGkdpqcPOl5COUX39U1FHCbJ3ZdJacfkxgDkwNvC8 qMvphZGBcYp89r3ebuPjqz2CyyLzPvmvgS3fU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708952104; x=1709556904; 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=cUPkBSwvovweP2Vn5x5Slws9PAyzIz15Jh15k5P3vWY=; b=iWuee0cxc7Sy0CluBeqV2wOCIFscROkh/oOkDHEkkmZaUQ/6SdlOE4Mh10UysvghJK NRHDYnXFHLoHY8XQOiMuWrirVQbE3E3hrRmf+pHNcLQKhn3b2GkX/2rFcwj4BF/VLqOd JOOTAaJKGAa+6l27zi/rS4xKpB3CakGxm2K6TsrMbySwQPYLSIjrp7s2tgaz7lhmZ43e ICKbNijrUz5Bc/Qu23A7fpgrtELkBa+/rcgicKuQy6EDRmBWWmauFXQOHweE2n3tTpMR VyoaIKGJ7uwOzZxxu6OG4J+4CYxoRRDhG5fBukzIj9sPWbwDcHYMCP8EWycMt/Ec0OsA N5Mw== X-Gm-Message-State: AOJu0YzThXl2Tzk4UCuKUBBSMDo4LtOfusLrBn4BW50rbbnKGXq/cjs8 /he2/JrW5H25DGMqOtT9gCtY/IFL9uo6ZVXZP5TvN7m5il8ZOlDbRT4MaGNxVTNMvk9ibuiZChD r X-Google-Smtp-Source: AGHT+IEKNzT7MZ4rDTxGGiXsJK7wd2sxKAEBDCZBcMxCYN7prH6PCeoNPa15iBXbH092aJEeovGm2g== X-Received: by 2002:a17:906:1159:b0:a3f:3d0d:30cc with SMTP id i25-20020a170906115900b00a3f3d0d30ccmr5855933eja.1.1708952103876; Mon, 26 Feb 2024 04:55:03 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 2/3] x86/entry: Simplify expressions in compat_restore_all_guest() Date: Mon, 26 Feb 2024 12:55:00 +0000 Message-Id: <20240226125501.1233599-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240226125501.1233599-1-andrew.cooper3@citrix.com> References: <20240226125501.1233599-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) X-ZM-MESSAGEID: 1708952124375100005 compat_restore_all_guest() already has SPEC_CTRL_EXIT_TO_PV with a document= ed requirement for %rsp to be both regs and cpuinfo. Use the now-normal annotations and simplify the expressions which happen to= be a subtraction of 0. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/x86_64/compat/entry.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compa= t/entry.S index 93fbbeb4ae18..727ab65290de 100644 --- a/xen/arch/x86/x86_64/compat/entry.S +++ b/xen/arch/x86/x86_64/compat/entry.S @@ -117,19 +117,19 @@ compat_process_trap: jmp compat_test_all_events END(compat_test_all_events) =20 -/* %rbx: struct vcpu, interrupts disabled */ +/* %rbx: struct vcpu, interrupts disabled, %rsp=3Dregs/cpuinfo */ FUNC(compat_restore_all_guest) ASSERT_INTERRUPTS_DISABLED mov $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d and UREGS_eflags(%rsp),%r11d =20 -.macro alt_cr4_pv32 +.macro alt_cr4_pv32 /* %rsp=3Dregs/cpuinfo */ testb $3,UREGS_cs(%rsp) jpe 2f - mov CPUINFO_cr4-CPUINFO_guest_cpu_user_regs(%rsp), %rax + mov CPUINFO_cr4(%rsp), %rax and $~XEN_CR4_PV32_BITS, %rax 1: - mov %rax, CPUINFO_cr4-CPUINFO_guest_cpu_user_regs(%rsp) + mov %rax, CPUINFO_cr4(%rsp) mov %rax, %cr4 /* * An NMI or MCE may have occurred between the previous two @@ -141,7 +141,7 @@ FUNC(compat_restore_all_guest) * loop to cause a live lock: If NMIs/MCEs occurred at that * high a rate, we'd be live locked anyway. */ - cmp %rax, CPUINFO_cr4-CPUINFO_guest_cpu_user_regs(%rsp) + cmp %rax, CPUINFO_cr4(%rsp) jne 1b 2: .endm --=20 2.30.2