Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1733580lqa; Mon, 29 Apr 2024 18:45:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCt15PBGU7EMJWFwBVpbaL9uhPUvDSUqnve55xzRq7JEkySZ9xOeWhagg07m7j78l2EGRMgbE14V6FmEaYqrcC5PPyycaAodBEhwrQJg== X-Google-Smtp-Source: AGHT+IFaovltfRfYUoXs3d1tvUmGdaVW1V8/w2zAbx/krJcMg2zZwB0q1JLeDp2wbT5QijJOS7B7 X-Received: by 2002:a17:906:230e:b0:a58:eaf7:1887 with SMTP id l14-20020a170906230e00b00a58eaf71887mr5371182eja.72.1714441528608; Mon, 29 Apr 2024 18:45:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714441528; cv=pass; d=google.com; s=arc-20160816; b=YSVUulftAisjXqBAEhyP7h+Rih6IJUat+Od/67Gx6OQ7vrH/9zzDF4kGvhvPaCI44x G12VEUcgdMiRFrG4w+mLi7CWSKblvzc8auf9h0tY+m+CJHr4VGlrzWpkljMJS0mUJZq+ ebwtFdmGIyQjWRGJ1KFvVghDmqENFTDqpHTESjUXt7NwbOS+3aiYHy8o5KY8UHCVUUPW Jz2lmL71+gaTEHPLTGxpy0YEnH4IeXM4P/QjWP1mbVybmsPoiu/V9JZyVu8XIig+ZUtL f1eSu2baiLGlQC0Eym8gRpu11A9doXJEHJ6OTyGJ9o9XQJC/3xHXtEKf0VLMb1b84d6Q w4cw== 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=RBkp6Khjn/hcCd/hXkknIb796Pl8KJeqmkZpe1qSplw=; fh=qdV62HKG2O0E2jvRwrIfwpeQ+X1zBkVKEmCAXswaWZQ=; b=lTV1Yp3M/zw7qspeOkSUK88lcuwRnEf/x9cQPWBmwl/tNIPXxcasYbHa+BYuW0bk1p L/UHUvSDkUKipshKNMc6DJcSPWbuTz2Pf/TjDFDJ81WogkDGpeMGgZUTQEu1TCR/k/nF 1023N6AN6l8BytgzjLRzTW0UsYiJHa0Dbkpg4QdER9eAxVqM02pqVv/bwRa4+Md89yuP YyddFgnoYMhRsETsD1b4kaMK9+kr7JBAtf1QS5603hKT5Gbu7dnLNDzquA6kt05wP55s j+o7ZPwHPSeWTJdhZXyhffzJkvRLFMnT/IgANfa3RHYS6hfWEQbwoOjEYOWk46uy9X5C ig6A==; 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-163247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163247-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id sh37-20020a1709076ea500b00a55a10eb06bsi12105479ejc.580.2024.04.29.18.45.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 18:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=loongson.cn); spf=pass (google.com: domain of linux-kernel+bounces-163247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163247-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 51B3C1F22D02 for ; Tue, 30 Apr 2024 01:45:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 655878F7A; Tue, 30 Apr 2024 01:45:16 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 746B88F6F; Tue, 30 Apr 2024 01:45:11 +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=1714441515; cv=none; b=i595w4SGIuA7v1bQJ1gP99eRBbZuYokngDL0SZdxzEVWyLfiTaCd+/nme5vb/02e3peQibEqTZVqit6Sn90eDJvh64YBDjjx8B0RKGqiiOpzJGtuub9dUJ0/3Y342iHaIXxal5RHG1a8W4AnRPESxr09DM6ebQlSXZbzRYLaGHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714441515; c=relaxed/simple; bh=FCCUCcSRQzl70WCsycckCWI1PlotsQL9ggX/zV1th3M=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=suOvGwtiO1QJVkSggpX/wBgEIu9yRchcHeQwXRt3KPqwwp2ZGnNplm65ZsYlv0VwHUWakoVIJYxZB/IS0IcK/QkyHt7Pr8ksC+7P86HYWNb3b5B8uqauguOQJrAPIlKnOw8SQroWVV2O+UqSHN0CzZ4Gah8pvWbPovJnJ4q/OOg= 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 _____8BxN+klTTBmsjoFAA--.5166S3; Tue, 30 Apr 2024 09:45:09 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxyt0hTTBmfrwKAA--.25728S2; Tue, 30 Apr 2024 09:45:05 +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, x86@kernel.org, virtualization@lists.linux.dev Subject: [PATCH v2 0/2] LoongArch: Add steal time support Date: Tue, 30 Apr 2024 09:45:03 +0800 Message-Id: <20240430014505.2102631-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:AQAAf8Cxyt0hTTBmfrwKAA--.25728S2 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. --- v2: 1. Add PARAVIRT_TIME_ACCOUNTING kconfig option in file arch/loongarch/Kconfig 2. Function name change such as replace pv_register_steal_time with pv_enable_steal_time etc --- Bibo Mao (2): LoongArch: KVM: Add steal time support in kvm side LoongArch: Add steal time support in guest side arch/loongarch/Kconfig | 11 +++ 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 | 131 +++++++++++++++++++++++++ arch/loongarch/kernel/time.c | 2 + arch/loongarch/kvm/exit.c | 29 +++++- arch/loongarch/kvm/vcpu.c | 120 ++++++++++++++++++++++ 10 files changed, 318 insertions(+), 2 deletions(-) base-commit: 2c8159388952f530bd260e097293ccc0209240be -- 2.39.3