Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1861011lqz; Mon, 1 Apr 2024 22:34:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULgdEubCEb2D3CjdsphDMlxWm9bXprBm6riUhEWvl6ur5ItFin3POS3xzYBbbZiEZke2qa/5yi6pxqZP67vARIcp+jsqQLlUrHX2AXPA== X-Google-Smtp-Source: AGHT+IFeAGLL3g2qnIRLPQy6vYX3Iof0+xBbWYf2EYSTCeWzBu+BIkc6cSqfSfQ/ObI47w6EPqhc X-Received: by 2002:a9d:73c5:0:b0:6e6:7293:fc1d with SMTP id m5-20020a9d73c5000000b006e67293fc1dmr12674309otk.4.1712036098288; Mon, 01 Apr 2024 22:34:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712036098; cv=pass; d=google.com; s=arc-20160816; b=0s1RBpEH8ldbar9muVs5CH+bPCT25y88Vf8Q7b2c6cyoTvPTuF3A7NTiXBfzv3EdV7 va9XF/gvh/L0MoCNWmbm/XvG9/+LMOFsBWVfOaZXmR+Tg4k+B3BOQwl8Mv2N8MrwIeaB cVS8NWq0bWdJniufbc3PpLRT4A2lxQrswBAJzha1+6R2DqY+SdxxQMpX/nA77QukZlqQ 8srtZ78sgseCwxSb+LVJyEyxfgVbpf69IX3TlhIo9panO/kdJvlYHEIUW4kgqanQhncq qIbhJ58cyCSu5WdumRGsF/Szfi18uWFosEo+qjTc//IwpUT/PlMATAhomxv+JC9RXHW5 PxBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=55k1TgXDVDHYQDCMA3WV23Z+s2H4L4wYg62tSiICz4Y=; fh=S2E7/6r6AYDazVAR7hcOSIu9hV7qcCZRMviHUXgGzuA=; b=w6RZp1YnXx2qEXbXP5hlixuuzXd71bM88H4jd63aYDw2AvgIzYLR/wN51mx+jh7QNb NRS0WFKYzaTHyLckKX4AB3/JpTw6FdoYvuEE3ERmvAPV7bhw8OiLnn/T770AQLWcBvfH VGx5eMtX7bfUi2nIR8aZXKxS6GM2CsNz2zKRG6LOHodIko3auczLeem1oAxxO4sTRUEy KajNYy0pTDpQU2hnO2JRn0lBT6O0njAQX3Q+ey2CF+Cn0fjLCZScQnuvWph8M6UHc70G yFdc1TFqYh7FlR4Rwgu17/m1I/bxLNNShvm02mX4CXsDJltmy68OWqaaFalwj2z12M6s A4Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=nVYEvcSV; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-127406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m22-20020a6562d6000000b005e3cdc24c26si10667353pgv.467.2024.04.01.22.34.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 22:34:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=nVYEvcSV; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-127406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0EC59B23731 for ; Tue, 2 Apr 2024 05:34:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82C841863B; Tue, 2 Apr 2024 05:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="nVYEvcSV" Received: from xry111.site (xry111.site [89.208.246.23]) (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 5CF0018035; Tue, 2 Apr 2024 05:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.208.246.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712036068; cv=none; b=VQqTkPFE8YjJCYiJ+wY0Vy+aIcEjaET17D8GnlnPjgQa/TwmtG7+9twRL2zvhFbc3CQpdW+3h4G2qC7XF8Zo4QI/cTG5SZtUx6JGWkOY8AdG/yGe/009KRHVgYvzPiFPfemu4f0lZKlGFOr88Kl42xV191SA8w+SwcIjvSiQlL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712036068; c=relaxed/simple; bh=gVS7XG9AAxqbh2ZdTm88rieui4opdSW40IfBuDEG+FQ=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=mpuzaPwLL3+RWbxuNNZOJ3EOxe0TNtiZ0h83ow2NbbR5GXev5BRmlI0NGLNxOYNhnqUom8dJ9LB39faTEoGb58G203XpL1KGHjWPToREZXAXM6u31EvSrjQH6FX04yeu7ZNxBa+3gVclWaGbNTMx672yx6Zz9lZHoS9aW5L5MXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site; spf=pass smtp.mailfrom=xry111.site; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b=nVYEvcSV; arc=none smtp.client-ip=89.208.246.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1712036064; bh=gVS7XG9AAxqbh2ZdTm88rieui4opdSW40IfBuDEG+FQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=nVYEvcSVJOg2nZToOUc4chytdO/YIf+XZe79gobgGORICktkVt2KbRi+/gewz+mq3 VTVW/TY/9y/zYZg/DJI+tKTouppcqflTOxiUbaauQ+TKzLjYRMck4235L3rG5zAhTF t/20FjbWKvgp1Apqv2+ccz8N9rBNMaz94ZJXuUjM= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 19C4966F79; Tue, 2 Apr 2024 01:34:22 -0400 (EDT) Message-ID: <71ab04b76d23497ff63e36dcc05f6580223d22a2.camel@xry111.site> Subject: Re: [PATCH v7 3/7] LoongArch: KVM: Add cpucfg area for kvm hypervisor From: Xi Ruoyao To: maobibo , WANG Xuerui , Huacai Chen , Tianrui Zhao , Juergen Gross , Paolo Bonzini , Jonathan Corbet Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org Date: Tue, 02 Apr 2024 13:34:21 +0800 In-Reply-To: References: <20240315080710.2812974-1-maobibo@loongson.cn> <20240315080710.2812974-4-maobibo@loongson.cn> <4668e606-a7b5-49b7-a68d-1c2af86f7d76@xen0n.name> <57e66ff5-1cb6-06bd-ee6f-a3c3dadd6aef@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2024-04-02 at 11:34 +0800, maobibo wrote: > Are you sure that it's impossible to read some data used by the kernel > internally? Yes. > There is another issue, since kernel restore T0-T7 registers and user > space save T0-T7. Why T0-T7 is scratch registers rather than preserve > registers like other architecture? What is the advantage if it is > scratch registers? I'd say "MIPS legacy." Note that MIPS also does not preserve temp registers, and MIPS does not have the "info leak" issue as well (or it should have been assigned a CVE, in all these years). I do agree maybe it's the time to move away from MIPS legacy and be more similar to RISC-V etc now... In Glibc we can condition __SYSCALL_CLOBBERS with #if __LINUX_KERNEL_VERSION > xxxxxxx to take the advantage. Huacai, Xuerui, how do you think? --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University