Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1449867ybt; Thu, 2 Jul 2020 05:56:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQZjxrFx7TOq+Dqv8h03JR5M0M1xmLHzTaP4mqwelWcB8F9G+q0U2JHH5SWxkPOULh2mWQ X-Received: by 2002:a05:6402:1153:: with SMTP id g19mr33964585edw.127.1593694569153; Thu, 02 Jul 2020 05:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593694569; cv=none; d=google.com; s=arc-20160816; b=xq+2qupFTEvlj0puQeMm2xJEaKWnFCt+RPJ4mygxDAZwKDEbT0/4h+Bg89MT1MEBn/ UT5qdn9DQ7AdgbuO5INSY2NCiMORowrduvm3SwNtI0t91g1+YLBjOgaNyRqnu7MC7Qxv i1uxhb7WGGwHI+ULyxMN+zZ1ZxHsfS14IFkDCj6nKsvsXFGGTzZZPveiMEW3UKrJ8Iam K2m2fg585RpcZGjhuCLw3XRZYMzRo6mZYRva51xQF6qXkK1fAA2TBEDDAk87/ff5BixD yAyYprUckZ26vVdMNEnyLrORZIJqjqJsJ5uiZL1XlKs3un13NSVObvFqk9q3+QSdOlEf UZ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=hNvxqRrDBbz/jOt3So+sU7T7gZSGCFNrBBBNp3CZ8ak=; b=YWtg3f4L/vou0hO7CNC58BL6KkrXblUXxPAVNyprzxpTXvH/RsdsF5DPlemPW/gPL9 CDJmMHcFAx8bHAQXnTJRkuWNM27BOaVSlgZPudsDm/OByHtW0FsZ/ZKsB/moxjCc5qEd an7iixn2NxQib6Ainn0UuPyXyQwgN4LwpgD71nZWTy1kCcRXg2di3xG5FYvUAvgxqro5 Wlua6loUjOvA0H0KnynKMxhWFE+j7lRSjwk0OFZydVoDGMv9lcaKEaqJbRap+Mw88j4Y Xz3Py6VIRG+tnPbeYqmESLmgOeJZV2NTyFHRF++2F2QPcZgNxrIYFPy6ye+mq7LuOOmU i0Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uFjYLcy3; dkim=neutral (no key) header.i=@vger.kernel.org header.b=J83+q3jn; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do10si7843848ejc.671.2020.07.02.05.55.46; Thu, 02 Jul 2020 05:56:09 -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=@linutronix.de header.s=2020 header.b=uFjYLcy3; dkim=neutral (no key) header.i=@vger.kernel.org header.b=J83+q3jn; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729103AbgGBMzA (ORCPT + 99 others); Thu, 2 Jul 2020 08:55:00 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:49426 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728917AbgGBMzA (ORCPT ); Thu, 2 Jul 2020 08:55:00 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1593694497; 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: in-reply-to:in-reply-to:references:references; bh=hNvxqRrDBbz/jOt3So+sU7T7gZSGCFNrBBBNp3CZ8ak=; b=uFjYLcy3ORbpRJ1mNlx3oLoa/xhPpbmog/Rzoeck+yzRlpR+1qwqbSbNRNkICxTp+NeiZ4 1/5ZodefKs3pCG7Dr1zT1PtRHOmyPIarZKu5JrBCFec29TFCTKV4lBvvX1zyGqDxQVdNtl 7wZqz88O8OsL8c2ovz5KpEjSb9EmltKRcWqqYLCOA8Jx3IFGtHz5Xm9YkjG4K/yAPIpbFL nOuvXvfvXPZc2nVgqCg03DT4kNoEgAUypGBlx0yupqVkaseT4QedEj3mFGCU+u6uFTNjwQ QVhMC61GkmeCe60cHGtCwBAgYeCWmooqDxCAB9PFpGNbfZm6wHtyKqtva+msPQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1593694497; 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: in-reply-to:in-reply-to:references:references; bh=hNvxqRrDBbz/jOt3So+sU7T7gZSGCFNrBBBNp3CZ8ak=; b=J83+q3jnPFCHhvohg6pU47S27J9wegJwqnwUYOrKe1OOWO7wE7bVIoC8hRvQ+vI0ktFeHt GchKFMnOfP9AxrCw== To: Andy Lutomirski , Brian Gerst Cc: Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , Andrew Cooper , Juergen Gross , Boris Ostrovsky , Stefano Stabellini , xen-devel Subject: Re: [PATCH 3/6] x86/entry/64/compat: Fix Xen PV SYSENTER frame setup In-Reply-To: References: <947880c41ade688ff4836f665d0c9fcaa9bd1201.1593191971.git.luto@kernel.org> Date: Thu, 02 Jul 2020 14:54:57 +0200 Message-ID: <87k0zm9ivy.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: > On Wed, Jul 1, 2020 at 8:42 AM Brian Gerst wrote: > > On Fri, Jun 26, 2020 at 1:30 PM Andy Lutomirski wrote: >> > >> > The SYSENTER frame setup was nonsense. It worked by accident >> > because the normal code into which the Xen asm jumped >> > (entry_SYSENTER_32/compat) threw away SP without touching the stack. >> > entry_SYSENTER_compat was recently modified such that it relied on >> > having a valid stack pointer, so now the Xen asm needs to invoke it >> > with a valid stack. >> > >> > Fix it up like SYSCALL: use the Xen-provided frame and skip the bare >> > metal prologue. >> > >> > Cc: Boris Ostrovsky >> > Cc: Juergen Gross >> > Cc: Stefano Stabellini >> > Cc: xen-devel@lists.xenproject.org >> > Fixes: 1c3e5d3f60e2 ("x86/entry: Make entry_64_compat.S objtool clean") >> > Signed-off-by: Andy Lutomirski >> > --- >> > arch/x86/entry/entry_64_compat.S | 1 + >> > arch/x86/xen/xen-asm_64.S | 20 ++++++++++++++++---- >> > 2 files changed, 17 insertions(+), 4 deletions(-) >> > >> > diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S >> > index 7b9d8150f652..381a6de7de9c 100644 >> > --- a/arch/x86/entry/entry_64_compat.S >> > +++ b/arch/x86/entry/entry_64_compat.S >> > @@ -79,6 +79,7 @@ SYM_CODE_START(entry_SYSENTER_compat) >> > pushfq /* pt_regs->flags (except IF = 0) */ >> > pushq $__USER32_CS /* pt_regs->cs */ >> > pushq $0 /* pt_regs->ip = 0 (placeholder) */ >> > +SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL) >> >> This skips over the section that truncates the syscall number to >> 32-bits. The comments present some doubt that it is actually >> necessary, but the Xen path shouldn't differ from native. That code >> should be moved after this new label. > > Whoops. I thought I caught that myself, but apparently not. I'll fix it. Darn. I already applied that lot. Can you please send a delta fix? Thanks, tglx