Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3798343ybx; Mon, 4 Nov 2019 03:06:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwALh9+eanjmfZDlPCaTah2zbZyscxeJViDD0aBI+3FtevBOg+nm7nGnWKSnG+BBsnaxKdS X-Received: by 2002:a17:906:1542:: with SMTP id c2mr22980090ejd.80.1572865580050; Mon, 04 Nov 2019 03:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572865580; cv=none; d=google.com; s=arc-20160816; b=ZLzudRHVCp5xLv/ekGhNDy9tYBwS0LQOJOU7/BdhBizFCMlFSr7xZKDXXZdJTfcE3y J9svkEFMEoCywBGr6Wp+DB/XPNlq2/wDAIPP6TfmoxZ2GI6/DMltKwj5xAMU2hDPoNUY +9Wm3N7Pc3zVEhYQQG8JrvLfR82uIrnG9sqWWCj5bO4X2IPL4gwlhp4Lf3BK/xmRW//W oK6rvD3HP8CvUQo/MZRa9kRRHM+PUK3aIZr27OA47EJaaI9Ezxsi0EA05yUZo3Oen1VG qxcn5GlMJH+1xh+2h1qUGmYSHUWUfLDKQRGY50fwk++SH7EI/aOX5vGMnrgkV4Wx8aVJ qQZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=2YGtffgu21sLBx6mcauveZ8fJL8aiPwtvI0beV+s1v8=; b=hQfL7/Cb2CQbjLUv+dbyef78MFLJkcu0C1YJACb6Y5Zl3epZJR1CYJW6SyPWFFeQeT CR3irWvg8evdOqCi/jzUA+25XBqea7LqIZ6am0xTD0VOEn2f8K2AE11VSjpcLkzG6Q82 SmNAoFxgOsFyN8QcqkuByDJ8liL78p/xZinqdRw1ukNH28sIeW/noqDwWFgxxEGB2trK Mn2+OapzrHdLyRiYkbXcOZSMVSNb4brWG9S+AowIt7x5Hih8fdQUcwioejXdbMBnfZJK jmWFQWQfIDgxS9lqtbO0EXNWg+5Px47HnXKPTwE/gWV5/8iTxVDtdwWGT/6qLRRJm2xx awCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si2693500ejr.410.2019.11.04.03.05.56; Mon, 04 Nov 2019 03:06:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728872AbfKDLEQ (ORCPT + 99 others); Mon, 4 Nov 2019 06:04:16 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:54707 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728522AbfKDLEP (ORCPT ); Mon, 4 Nov 2019 06:04:15 -0500 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1iRa95-0003Mx-DL; Mon, 04 Nov 2019 12:03:39 +0100 To: Sami Tolvanen Subject: Re: [PATCH v4 03/17] arm64: kvm: stop treating register x18 as caller save X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 04 Nov 2019 12:13:00 +0109 From: Marc Zyngier Cc: Will Deacon , Catalin Marinas , Steven Rostedt , Masami Hiramatsu , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Mark Rutland , Nick Desaulniers , Jann Horn , Miguel Ojeda , Masahiro Yamada , , , , In-Reply-To: <20191101221150.116536-4-samitolvanen@google.com> References: <20191018161033.261971-1-samitolvanen@google.com> <20191101221150.116536-1-samitolvanen@google.com> <20191101221150.116536-4-samitolvanen@google.com> Message-ID: <79e8f958cbde52a3d90aec24dd4638d9@www.loen.fr> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: samitolvanen@google.com, will@kernel.org, catalin.marinas@arm.com, rostedt@goodmis.org, mhiramat@kernel.org, ard.biesheuvel@linaro.org, dave.martin@arm.com, keescook@chromium.org, labbott@redhat.com, mark.rutland@arm.com, ndesaulniers@google.com, jannh@google.com, miguel.ojeda.sandonis@gmail.com, yamada.masahiro@socionext.com, clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sami, On 2019-11-01 23:20, Sami Tolvanen wrote: > From: Ard Biesheuvel > > In preparation of reserving x18, stop treating it as caller save in > the KVM guest entry/exit code. Currently, the code assumes there is > no need to preserve it for the host, given that it would have been > assumed clobbered anyway by the function call to __guest_enter(). > Instead, preserve its value and restore it upon return. > > Link: https://patchwork.kernel.org/patch/9836891/ > Signed-off-by: Ard Biesheuvel > [Sami: updated commit message, switched from x18 to x29 for the guest > context] > Signed-off-by: Sami Tolvanen > Reviewed-by: Kees Cook If you intend for this to be merged via the arm64 tree, please add my Reviewed-by: Marc Zyngier Thanks, M. -- Jazz is not dead. It just smells funny...