Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4298390pxb; Tue, 2 Nov 2021 07:28:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpVPRBSSBiujcVPahm+5h6q6Ofs+tf2jOYsnt4P5zHLTJadelpuWSTi3lAuoBWcU7oES5y X-Received: by 2002:a5d:9751:: with SMTP id c17mr26199772ioo.61.1635863322636; Tue, 02 Nov 2021 07:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635863322; cv=none; d=google.com; s=arc-20160816; b=z4XU4gd/ewx1LwvYq6dOs+zyfzmVTDcFARx8yxC4kwzGK+5jf+DsDOb5gE7Kmr0YXF Em+c4kzZidmbtf5Qq8B5x/GD537uLm1tHuHFYDhWGiIBZc3bQx3BQuDcpBD/9VjqBZXz LudI9/xMvE1KmUplYkYavB2iJi8YJ2tVMV1cJFv1CtmBgUUN0ITyEYVCy6yrShvs1eb4 6L8iWO+CLPJZtFggMq23im8eJKC2xw+eSlLSmxE1JgPdJwm2LPXd8MMk/KItPmUNxZZ8 6ehwPWjfAxnOePB4WE73vN3c0HuqSvqBG0DDbhY2e/ccYoSkZIOASw5uBBduXIRH0F2U WckA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MgzXun1sGyXAbI3k6Dnpky/GrLb5A5Lop9Rxzlg7jwI=; b=G86QfrsJAu5EP3ppUir2hqVhxP8tOUngzMb4AUmQMUcCEZy4TFNET5hJpRoFOpqsbw FR+saT7tqsDnQqSO8HwXKRPZLPN5NrRHC9pyC/kogzv9ckgbmwzg8zsNzdFqOYj484FF W+zSM2NY8K5dJQDXoa6LI8zH3FwyGEeGtDMErSUqzvnQe3diSzkLrFFEKo/cLO2fFm99 u9pns8Y6o9TAeLAUmooypX/BIp4jeXXSca9hBDFemnkwRD09Ags76hKRNteooSj+u4DB 5YXIOotMBqLD7iQATz6UQZtRp5sj7YbBy+frpYxSqsR6EG462PHBcBQwWOAC3b0Xc0p/ HlCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ASq4jAIH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si3318435jad.116.2021.11.02.07.28.25; Tue, 02 Nov 2021 07:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ASq4jAIH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230333AbhKBOaE (ORCPT + 99 others); Tue, 2 Nov 2021 10:30:04 -0400 Received: from mail.skyhub.de ([5.9.137.197]:56132 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbhKBOaD (ORCPT ); Tue, 2 Nov 2021 10:30:03 -0400 Received: from zn.tnic (p200300ec2f0f6200d878d07ae9750fe9.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:6200:d878:d07a:e975:fe9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BA7D51EC051F; Tue, 2 Nov 2021 15:27:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1635863247; 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:in-reply-to:in-reply-to: references:references; bh=MgzXun1sGyXAbI3k6Dnpky/GrLb5A5Lop9Rxzlg7jwI=; b=ASq4jAIHpy8E52FTr9weFP+TD8+l23LFSQga5+c0Ujj0WHMNuHy63r+r6XIpWsN2BjO1X0 difW7wdNKyKN4Pj4p5VCD9cD6QYFn9S9ppe/ssR/HFWhzMEAIQ3NCKNfXqa/O6mG6GI7A9 60zcPcQEi0MF14FxGjMVXSPvt121WE4= Date: Tue, 2 Nov 2021 15:27:23 +0100 From: Borislav Petkov To: "H. Peter Anvin" Cc: Lai Jiangshan , Lai Jiangshan , linux-kernel@vger.kernel.org, x86@kernel.org, Jan Beulich , Thomas Gleixner , Juergen Gross , xen-devel@lists.xenproject.org, Andy Lutomirski , Ingo Molnar , Dave Hansen , Boris Ostrovsky , Stefano Stabellini Subject: Re: [PATCH V4 04/50] x86/xen: Add xenpv_restore_regs_and_return_to_usermode() Message-ID: References: <20211026141420.17138-1-jiangshanlai@gmail.com> <20211026141420.17138-5-jiangshanlai@gmail.com> <6F6D3FEC-9AF1-40E1-A7C2-394D21C40114@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6F6D3FEC-9AF1-40E1-A7C2-394D21C40114@zytor.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 02, 2021 at 12:22:50PM +0100, H. Peter Anvin wrote: > It would be interesting to have an "override function with jmp" > alternatives macro. It doesn't require any changes to the alternatives > mechanism proper (but possibly to objtool): it would just insert an > alternatives entry without adding any code including nops to the main > path. It would of course only be applicable to a jmp, so a syntax like > OVERRIDE_JMP feature, target rather than open-coding the instruction > would probably be a good idea. I think you wanna say ALTERNATIVE_JMP here seeing how we have ALTERNATIVE_CALL already :) As to marking it properly, we can finally add that struct alt_instr.flags thing we have been trying to add for years now. /me adds it to his evergrowing todo. If anyone beats /me to it, /me will gladly have a look at it. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette