From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by sourceware.org (Postfix) with ESMTPS id 57B1B3840C3C for ; Mon, 8 Jun 2020 20:27:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 57B1B3840C3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=palmer@dabbelt.com Received: by mail-pl1-x641.google.com with SMTP id q16so7112726plr.2 for ; Mon, 08 Jun 2020 13:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=eQAH9M+pych4MQe+gAmsNaWNkEu0LiiMbsVFtSs2XvY=; b=eE5XJQHS/Eiq+Otv+Et4PG5I8zPkRkn8Xs2xjkkLnJWcrt0CQwcVxVR3tqaGCdkdSl bN28q/ntjl+zf8NCc8Cbn5ezYGY6WQLBbwyFSER8IEvkk9npS/7mlktAxBqbjxRpm06v IWuqyrZ4z73C/owTpVttxn8EgD5jl809DVEY/+MliWSaUe85jLhN1A5Q7nrmM5f/nIJD nxQ+cwrkBsmNRRTRmnEBuhQM1ZR/iwjRajW9HMrge093GEh6lel3v+RV/w2Dy8wYpXTr MRCnL4L9S4hFk43oCseFYa3j8P1QHYiyE12O/erDtSM2SUuFJXL9Mc1OPqEgHef9av7w WBkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=eQAH9M+pych4MQe+gAmsNaWNkEu0LiiMbsVFtSs2XvY=; b=rE9c37PEewUa3wbnWbkvYPI8zysfuTnmTsW8SDuO4Cu0gE96u5sfpAjuhbTJX8Wb6V 4b4ed4aG5U5uDVKnAPeieCoLJIfKqmKSUUn6onrtxzHtSo5vbFdNzTx4UijNPPxVCKWM pH+8N4BrywQYRJJhe67BL4xA1EFaogngoSqK1Ps0JryCAqa0cPgg/94eAOElbZJR/Jfi tea/gNuW1HQivtC25ZUjDCHCa7bCG6FxKSq2heDTZViZ0KXs00aUjM7wyx4eFeu4ybaK JRispgNlKgDnr5tUMxb44av8X7/c2CY2RRAMGJka7j5+q3Lp5eImk9qnV6i6/z1GU5qN TJig== X-Gm-Message-State: AOAM531CtsXxs+0+gBVEhmIx+jiOGuCRCUKH1dfNp03bVdint8R0iYzY 380IJNAC80jaxJVYDJepxxcCw5aB2L5q7A== X-Google-Smtp-Source: ABdhPJyakcMEKR5EZWma0LzVBg6pb2ClEbZu2TWvW+oUdARSZzPxpZCR4rUQktY8ggeaHBwt/l1+XA== X-Received: by 2002:a17:90a:6407:: with SMTP id g7mr1013035pjj.9.1591648072866; Mon, 08 Jun 2020 13:27:52 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id q13sm8232225pfk.8.2020.06.08.13.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 13:27:51 -0700 (PDT) Date: Mon, 08 Jun 2020 13:27:51 -0700 (PDT) X-Google-Original-Date: Mon, 08 Jun 2020 13:27:39 PDT (-0700) Subject: Re: [PATCH 0/2] RISC-V: Fix the conflicting priv spec problems In-Reply-To: CC: binutils@sourceware.org, Jim Wilson From: Palmer Dabbelt To: nelson.chu@sifive.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 20:27:57 -0000 On Thu, 04 Jun 2020 22:41:19 PDT (-0700), nelson.chu@sifive.com wrote: > On Fri, Jun 5, 2020 at 6:23 AM Palmer Dabbelt wrote: >> These fix the obvious problem, so consider them approved, > > Thank you very much :) > >> Specifically, I don't think it's reasonable to expect >> the linker to be able to determine whether or not objects that are built for >> different version of the privelege spec are compatible with each other. At any rate >> minimum we'd need a way to force linking, but I think we should start by just >> annotating > > Kito had discussed with me that we might need a linker option to > choose the link compatibility levels. And supporting three levels > might be enough, > > -Wl,--link-attrs-mode=[strict? median? loose?] > * Strict: the linked objects must have the same privilege version. > * Median: Allow compatibility, but consider all conflicts when we > link objects with different versions of specs. > * Loose: Force to link all objects without checking attrs. Users must > be responsible when they use this option. > (The naming is just temporary.) I'm not sure the middle version actually has any value for the privilege spec. For the user spec it could make sense, as old programs run on newer specs, but that's not the case for the privileged spec. I'd start with just "strict" and "permissive", if we need a third we can add one. It's also probably best to split out the privileged and user specs for this sort of argument, as they really have different constraints. >> Presumably the other priv instructions should also be triggering the attribute? > > Thanks for the reminder. This looks good. I will add it in the future patches. > > Nelson