From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755271AbdKAVBd (ORCPT ); Wed, 1 Nov 2017 17:01:33 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51129 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922AbdKAVBb (ORCPT ); Wed, 1 Nov 2017 17:01:31 -0400 Date: Wed, 1 Nov 2017 22:01:28 +0100 (CET) From: Thomas Gleixner To: Dave Hansen cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, luto@kernel.org, torvalds@linux-foundation.org, keescook@google.com, hughd@google.com, x86@kernel.org Subject: Re: [PATCH 01/23] x86, kaiser: prepare assembly for entry/exit CR3 switching In-Reply-To: <20171031223148.5334003A@viggo.jf.intel.com> Message-ID: References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223148.5334003A@viggo.jf.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Oct 2017, Dave Hansen wrote: > > + pushq %rdi > + SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi > + popq %rdi Can you please have a macro variant which does: SWITCH_TO_KERNEL_CR3_PUSH reg=%rdi So the pushq/popq is inside the macro. This has two reasons: 1) If KAISER=n the pointless pushq/popq go away 2) We need a boottime switch for that stuff, so we better have all related code in the various macros in order to patch it in/out. Also, please wrap these macros in #ifdef KAISER right away and provide the stubs as well. It does not make sense to have them in patch 7 when patch 1 introduces them. Aside of Boris comments this looks about right. Thanks, tglx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 83CE26B0033 for ; Wed, 1 Nov 2017 17:01:33 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id n8so1910558wmg.4 for ; Wed, 01 Nov 2017 14:01:33 -0700 (PDT) Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id u18si1415351wrc.235.2017.11.01.14.01.32 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 01 Nov 2017 14:01:32 -0700 (PDT) Date: Wed, 1 Nov 2017 22:01:28 +0100 (CET) From: Thomas Gleixner Subject: Re: [PATCH 01/23] x86, kaiser: prepare assembly for entry/exit CR3 switching In-Reply-To: <20171031223148.5334003A@viggo.jf.intel.com> Message-ID: References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223148.5334003A@viggo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, luto@kernel.org, torvalds@linux-foundation.org, keescook@google.com, hughd@google.com, x86@kernel.org On Tue, 31 Oct 2017, Dave Hansen wrote: > > + pushq %rdi > + SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi > + popq %rdi Can you please have a macro variant which does: SWITCH_TO_KERNEL_CR3_PUSH reg=%rdi So the pushq/popq is inside the macro. This has two reasons: 1) If KAISER=n the pointless pushq/popq go away 2) We need a boottime switch for that stuff, so we better have all related code in the various macros in order to patch it in/out. Also, please wrap these macros in #ifdef KAISER right away and provide the stubs as well. It does not make sense to have them in patch 7 when patch 1 introduces them. Aside of Boris comments this looks about right. Thanks, tglx -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org