Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3167708lqp; Tue, 26 Mar 2024 01:08:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOqvLyYz4gHVMvBNt0ulyqqdg20hjaG5x8ukf8aNnn8uiDtAVLJClxd/9u0dv8LJ7bwb1Bdmaerb3qY0DsVFBNJqIg0nNxCZUNqFYU6w== X-Google-Smtp-Source: AGHT+IFIZKVuoN+AVJBc/9f19wHXRRrXs6ntlV1vKmh0YbEWXMgmwnsHLQioTZL0TFUoithIo8nF X-Received: by 2002:a05:620a:578a:b0:78a:65c2:a71f with SMTP id wk10-20020a05620a578a00b0078a65c2a71fmr537041qkn.15.1711440494282; Tue, 26 Mar 2024 01:08:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711440494; cv=pass; d=google.com; s=arc-20160816; b=wnnRiUnQdA7gacguELb18zoTPEL22sBFSHxTFuWNzf/i8+kJljMyjTIFkfGd9JBTfX r9ZCBluWDjtRIpifPtj1saC4MlSCvylW33pmM0DE1+xqnV6Xr+eZ8ZODTlJ3i7VEH7CG I65hD8eBEbqhZZ5pwU2Ev2VbvlDxykjY2ehXaHT1FkBa0hTBr4sl3m12ZAW9jKaXT7uy +w0yzUUB+vVUTLS8W25XDP0fniV9JrULV8dPeyNrnvt4QMq7GryTzhnf7Dau0xw7drWT LWEyj9vJtJA+4+MYU2uxgyPJC3DR0jO0BPbO6pCHU+yLDXXCyrM/IR8Om9Z4QtxwQa/X jO+g== 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:message-id:date:subject:cc:to :from; bh=dQzLseVm9TFbSW01ciDjKA4Mkn/FTByWqbq6Gr8eDeM=; fh=BiF0hEshLlgkfLjpsxHbCrGkBkMCi7pW69Ltatg7IXs=; b=bRCky5sUB60xCbG4SONEjIeADc0lenlSLkStlLxoiHgYu4U5OOYsPECyzuOFd+z7Wn +xOSQ9Mg5skqaHdkI3hMM0Di+U4yPO7izbmcYoYKCvDxw3ojtjToxg+WHynews1etFOA OEHUWNyKCah/9GyUzuB1PQ/2ovmbblt8RtemS5KFZOA3Few3sccQffqXZ0gyHS6ZRAFQ BKLD2jzRDVZSYgH/74RpCgKC8NiqeoevXYa2rxLj+pgI4SuQb2qbKvcv50x7w+VqOOw3 kbcHg2/H2pGd3N3blyTmG20BwOt4Apdvfa42wn7dH9jwKJ9k3PF7OnQPXfcR7phzIJUO W+0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=loongson.cn); spf=pass (google.com: domain of linux-kernel+bounces-118512-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118512-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w9-20020a05620a0e8900b00789f61e3e39si6875524qkm.74.2024.03.26.01.08.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 01:08:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118512-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=loongson.cn); spf=pass (google.com: domain of linux-kernel+bounces-118512-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118512-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2F56A1C3319C for ; Tue, 26 Mar 2024 08:08:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEA431350F1; Tue, 26 Mar 2024 08:06:35 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 565EC134412; Tue, 26 Mar 2024 08:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711440395; cv=none; b=b8MktuAa58bIIrdhMWOFCoG5Wdqw0sHUUESh1nBFjklbMX3Oe++22Tro5ozBf4gVgOrfmd5dGAkxgTODllXpDS8bDiUrtlH+htbxGcN625/quWTa0VTjPnaldJZboHzMnxF7uSRkOFKF0pn0u8G4yE4rjBCaLcBuwgVmzewo9Xo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711440395; c=relaxed/simple; bh=f9hCfYedwpxEoNBuNNWZFPjqKzvQdVCG0xEb4sz+K0Y=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Gda3IwEnZYTXDYcYYmD8drPHgUS80AQJFqSsHSxP9DPshbYHAMWGScwc/mey3Yt5mVI3RCreeJX7jXKG0UPsQnxjbs5zDJNATdSg8BIevBqnO6mu3i4LztoI7saFMAp2e4VsFvx1yGfXMYgPBDO6+EJv3oCGN0l6ePKQjY05JtM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.2.5.213]) by gateway (Coremail) with SMTP id _____8BxHOsDggJmCUoeAA--.61102S3; Tue, 26 Mar 2024 16:06:27 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxbRMBggJmhaRoAA--.9600S2; Tue, 26 Mar 2024 16:06:25 +0800 (CST) From: Bibo Mao To: Tianrui Zhao , Huacai Chen Cc: Juergen Gross , kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, x86@kernel.org Subject: [PATCH 0/2] LoongArch: Add steal time support Date: Tue, 26 Mar 2024 16:06:23 +0800 Message-Id: <20240326080625.898051-1-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8CxbRMBggJmhaRoAA--.9600S2 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Para-virt feature steal time is added in both kvm and guest kernel side. It is silimar with other architectures, steal time structure comes from guest memory, also pseduo register is used to save/restore base address of steal time structure, so that vm migration is supported also. Bibo Mao (2): LoongArch: KVM: Add steal time support in kvm side LoongArch: Add steal time support in guest side arch/loongarch/include/asm/kvm_host.h | 7 ++ arch/loongarch/include/asm/kvm_para.h | 10 ++ arch/loongarch/include/asm/loongarch.h | 1 + arch/loongarch/include/asm/paravirt.h | 5 + arch/loongarch/include/uapi/asm/kvm.h | 4 + arch/loongarch/kernel/paravirt.c | 130 +++++++++++++++++++++++++ arch/loongarch/kernel/time.c | 2 + arch/loongarch/kvm/exit.c | 35 ++++++- arch/loongarch/kvm/vcpu.c | 120 +++++++++++++++++++++++ 9 files changed, 309 insertions(+), 5 deletions(-) base-commit: 2ac2b1665d3fbec6ca709dd6ef3ea05f4a51ee4c -- 2.39.3