Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3403381ybt; Tue, 30 Jun 2020 01:42:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1UkY7RdnMd9UOcgjbkYjuHig5NVNnWrIWFNVSqwUjWNIKtJV9g7nvpmdR69H7tjIqZmrn X-Received: by 2002:a17:906:1403:: with SMTP id p3mr9389309ejc.106.1593506551002; Tue, 30 Jun 2020 01:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593506550; cv=none; d=google.com; s=arc-20160816; b=Bwn6FKoHrpgKKXOI91fjU9frX5JjxwhWQMZQh6fYMiHkyNs779haa/RvZL0iXENc9a TKCThk4+MddA/Y8GyLAoo0Q4XOKg0aYv8JQ4hLhinUVtXbsiLqNYLub3i/4PPGhVbOuF zrP0pDYpYzP/tjGSGLOlACoYq8hjSSGVXtkoNzhgZZ1Ho+cORCnsampfK84UNhymLVsi cvlckyMZ9d7sLYYK+3xix0cCTNB7KHOBymqVwDAg8Hr4YmlCBA2/4BcGmBUsSHbEUusC BTl8nZbJ3wrBOfAUGOHup4iolW04QHFCLXVZIQ9VkpBmFHT6PkcnjCMyJUPbU0NSW6tx sR2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ue2iecCNcCz8MqiJJqArPW8phjfA3/MN25DhE18wPNM=; b=smNblW4kpe1vCAlFYc2cKHBVFTx026xJf7PmEGBP5nvQqhDuSK0zPiMyz4IeC5Rfxu DtqLzqip5Nc3FHYlBXRes9xdFKdmvJ2IVm0wfnwlXWPd7vSM1tUocpNeJzm7yLcsITiS eEOKb4A19it1hbyBF9ME0cnShuD91KiPFqDtnT6iAjTzS/hzTap2iT7ywh+lbV/T25bB WtR/eFz/Tf1GGufhXRhuQfAKVHOEAzy1snsri28Cjix+sLdf90JpEfxwR5qWY5s2kwff DiLQpjWGiEJqwOEwleZVF8FMWXn2IvPkHWE7hHY3KsxaGTnuUU6n+8lj+eL5Qbk82HV3 9qLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=VO8gB20o; 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 dr4si1796215ejc.239.2020.06.30.01.42.08; Tue, 30 Jun 2020 01:42:30 -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=VO8gB20o; 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 S1731581AbgF3Ilh (ORCPT + 99 others); Tue, 30 Jun 2020 04:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728132AbgF3Ilg (ORCPT ); Tue, 30 Jun 2020 04:41:36 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1396CC061755; Tue, 30 Jun 2020 01:41:36 -0700 (PDT) Received: from zn.tnic (p200300ec2f0eff00c5d3fc2efff9f4b6.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:ff00:c5d3:fc2e:fff9:f4b6]) (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 6A5531EC022C; Tue, 30 Jun 2020 10:41:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1593506494; 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=ue2iecCNcCz8MqiJJqArPW8phjfA3/MN25DhE18wPNM=; b=VO8gB20oMAHm26xXaegwffMDcAMXlnx8ejK7HFksmCaogo82YZgyWJ74ELZ5bFMy7jK4Th abFvh+rcCg8dG/0WAEHrAAapSphDK6yFXy6HWsFnHeFgAxNp0uLNwusiMYcdMykPGXSwlB 2IXm1KO57nmFygYwySEO0teHcIiw288= Date: Tue, 30 Jun 2020 10:41:28 +0200 From: Borislav Petkov To: Sean Christopherson Cc: Jarkko Sakkinen , x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Jethro Beekman , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, cedric.xing@intel.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, josh@joshtriplett.org, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, luto@kernel.org, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v33 15/21] x86/vdso: Add support for exception fixup in vDSO functions Message-ID: <20200630084128.GA1093@zn.tnic> References: <20200617220844.57423-1-jarkko.sakkinen@linux.intel.com> <20200617220844.57423-16-jarkko.sakkinen@linux.intel.com> <20200629171022.GC32176@zn.tnic> <20200630060055.GS12312@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200630060055.GS12312@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 11:00:55PM -0700, Sean Christopherson wrote: > E.g. the vDSO function should get the fixup even if userspace screws > up mmap() and invokes __vdso_sgx_enter_enclave() without being tagged > an SGX task. I sincerely hope you don't mean this seriously. Please add a member to task_struct which denotes that a task is an sgx task, test that member where needed and forget real quickly about running *any* *fixup* for unrelated tasks. > No hard dependency, it's normal kernel code. My reasoning for dropping it > in .../vdso was largely to co-locate it with vdso/extable.h due to the > dependency on the format of 'struct vdso_exception_table_entry'. A struct which you defined instead of simply using struct exception_table_entry even if it has a handler member which would remain unused? Let's not put code in vdso/ if it doesn't really belong there pls. > Ya, shouldn't be a problem to stub it out for SGX=n. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette