From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2A5B3624C3 for ; Wed, 13 May 2026 17:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778694596; cv=none; b=c7QHjKg+XtBbZEySHAVROgVwmbR6t4Zed8AitdPv6iH2EQrfQ2HAM0cHmPXkz6SVOFEl9Ioc7QB7Lv0wKJMjOlfBEZDWvUOTfPI3RKW4U9chMT3P3GhHT4TGDx0bsPQnVWj3X2o9B40GGp1eCEUYb5ULeBgEmoywKvT3AnW9whA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778694596; c=relaxed/simple; bh=krC0ZzkKqMwVwUkveX9UPZZT/gve5nTOPOgFRBwgnZg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=V0b466rcx2OxuV+Nb10uPRK+rQmMfjknOE2JlpJ6dJ1hIqRFDQz6oVBjvTRrcdmHjCTOfPFKEfwiRPbU115wX9TeEvPutX+W82nm9Xr+cIXhoFb3dkSFzZlQ8eSTYBMtyCaC7ul/x3xEiiJXoFSrNsWfb/YsbXhJo/1W7dYn2iQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bQ9DS/sG; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bQ9DS/sG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778694594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyL0IEiA9w4BmMO1XJO+YTzds/kk5taNwUgG4i+zSP0=; b=bQ9DS/sGfwCwH4ev4QesC9Ih/dBbSY6s2eii3D5Z+t/2ElOkMVqXKAsFHESyrcOB4boLd/ YwRIV0FZZArhPc6DurkQe1Km724369KbJAE65pPbRcbvHv8rtzGUvOYTUB1qyWRZRcXCcT s8gX/MZ6ZkLGYlSvhjaLUBcJLWsBDBs= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-685-9U2qZPgTPL6ShR-5cz_6BA-1; Wed, 13 May 2026 13:49:50 -0400 X-MC-Unique: 9U2qZPgTPL6ShR-5cz_6BA-1 X-Mimecast-MFC-AGG-ID: 9U2qZPgTPL6ShR-5cz_6BA_1778694589 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8F17D19560B4; Wed, 13 May 2026 17:49:49 +0000 (UTC) Received: from virtlab1023.lab.eng.rdu2.redhat.lab.eng.rdu2.redhat.com (virtlab1023.lab.eng.rdu2.redhat.com [10.8.1.187]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 133CB180034E; Wed, 13 May 2026 17:49:48 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: chang.seok.bae@intel.com Subject: [PATCH 0/3] KVM: Macrofy GPR swapping in assembly code Date: Wed, 13 May 2026 13:49:45 -0400 Message-ID: <20260513174948.726812-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 A small change to Chang's patches from the APX series. The only change is keeping __VCPU_REGS_* constants to avoid relying on the ordering of constants in kvm_host.h. While the kvm_vcpu_regs.h changes make the line count boom a bit, the actual assembly code loses almost a hundred lines and APX makes that even more extreme. Paolo Chang S. Bae (3): KVM: VMX: Macrofy GPR swapping in __vmx_vcpu_run() KVM: SVM: Macrofy GPR swapping in __svm_vcpu_run() KVM: SEV: Macrofy GPR swapping in __svm_sev_es_vcpu_run() arch/x86/include/asm/kvm_host.h | 16 ++-- arch/x86/include/asm/kvm_vcpu_regs.h | 127 +++++++++++++++++++++++++-- arch/x86/kvm/svm/vmenter.S | 107 +++++----------------- arch/x86/kvm/vmenter.h | 43 +++++++++ arch/x86/kvm/vmx/vmenter.S | 89 +++++-------------- 5 files changed, 211 insertions(+), 171 deletions(-) -- 2.52.0