Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp739201imn; Thu, 28 Jul 2022 14:21:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sACW74s031ZTf9styD+qgioKB0Ozp9hhii4tVA1emaVpdo2KO4I0NiQlatETwUIhpCmO79 X-Received: by 2002:a17:906:9c82:b0:6e1:2c94:1616 with SMTP id fj2-20020a1709069c8200b006e12c941616mr598001ejc.64.1659043296935; Thu, 28 Jul 2022 14:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659043296; cv=none; d=google.com; s=arc-20160816; b=W2ZyKlqLj1+f8Q7I0vveIJoc6H8MoLVvI68SmEUS3aUA3zULQo73KOkdxTnpmwEC2o uuuDLTwE/cC4JjRR0N8CcppNX7AtG4UkAN/ZB0RTE6buJ83KG5oDE0eOs1f0fnQa/a30 cDNuGAKWsLzg2XW+Tl2Tge5hUtjb/h95dfVuJQUugWqUuRD4q+c7aTkB8stgBIviEItv diaKFe6FHuUW1ElHz5PsNdgo5ToHexkUjkltap1fCjJMc+smIb57b+PfKjpVADS/wC3B mTY6LF0F5j0+INYHNWPbiUf5he07j6W9qWvBZ5F4WL8x3LvsHJ9r32LG6alPUxCO/N2W LCDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=20zO2FT2JEdVmGgde/EIUF8PTTirUHSwEDYNPZ44Pgg=; b=nUlH3Fz0evc9IeU/yCBt+Mq4BlZgwdsIocLhoD3kovnVX8YosFXLyeTtCDN+RGuYIN 2dYPArNd1+akbSmCiiC/ugt5D4BAHhwuajM2eOVR+nQ1imSKdktIklyitoWWLxJFopri ZgE9m2yUEACo5FBGePs9Y2VaQepqxqVOBh8h1izrM6A+S1ApFn+2wxa51ItIIWbGI6C5 TV6KSUWUtZW8GzLSob+tlpz/LoebiNdg6otCiHy3ZUA6GiHAsg24HYS7/mp1V8KwBDGl 9JGJU4oEYVXFNzQlcrCgprOkS8jS8XxbvxNYbPrk08cwyZaVci7mTbEUGyRZqgvbnh94 eEIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=p5F2+1ue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b0072f0a99e2c4si1313972ejc.266.2022.07.28.14.21.12; Thu, 28 Jul 2022 14:21:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=p5F2+1ue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232260AbiG1VHp (ORCPT + 99 others); Thu, 28 Jul 2022 17:07:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232292AbiG1VHl (ORCPT ); Thu, 28 Jul 2022 17:07:41 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A952774DF4 for ; Thu, 28 Jul 2022 14:07:40 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 70so2969340pfx.1 for ; Thu, 28 Jul 2022 14:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc; bh=20zO2FT2JEdVmGgde/EIUF8PTTirUHSwEDYNPZ44Pgg=; b=p5F2+1uekipyQTSPfAX9HTNnh+s8rs4JzMcbfmP2rciMhLOLs/BJ1lT1wlNCW75IaJ TeGKO8/VEM62witITuWamrO7mM80bTZFgorffYUiNIT63txY3XDLKmKOGb4ODk8UxcIB SAoyzVUd3k8qRJNDBkq+fqiZkEtHAYtOyeRY0uGQAQZLyiu1nv4K1m89/k9M2o/jo2xQ UZcoLSRsTl082ii08jfcUVbn8LlcgSLA12uEkLPClKzvZP9R+grPWetSS3FndjOUut3s Cbz+RZAsKPZJuTL2dB1V3AOsaKBUOyVqUSlcJXeYHikSzjXltwt9b9gwoiczKJ/zjfwC RkzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc; bh=20zO2FT2JEdVmGgde/EIUF8PTTirUHSwEDYNPZ44Pgg=; b=fXC5Q59nBMYmnwtSI8DSXHvvo5DMpXfL3uqjbcI0S0tX7l1jxc0i9yPWH46ygcWG9/ 1RPg65pNBy89H9yeFHJu5TSJ+M/HcFQCwOLzNLfP2YBBrwJwRhXWqIFc8S5LPSZDEF8/ 1x4yZ1oyhelIJAwymJ2RbvdgCshIYWbn/uVUAmcbz+QlsuxtCAWsffaij6HE5PjZG50/ pd3pLmbaG9l0rHwAsdzSjyR4ld9qkEBZ5uuVhAMz2FjcX7Ot6Wtj3eQRH6FgQvJ2bVZ5 85dMU/mQ6drooXGeczyUQvIYY6V7NyXTVHcBJydp7YBAWtfQ3HzNbwORFvDpSNpZ5/Wb jetQ== X-Gm-Message-State: AJIora95S+6W+ii8KkdKJFSReuNF6J2S1dOefHSLjimC7D0d1tHpBQ1K 19ZyTrb6vmUnYLIkwUjM2w4y2w== X-Received: by 2002:a65:5a05:0:b0:41a:ea25:a631 with SMTP id y5-20020a655a05000000b0041aea25a631mr495385pgs.46.1659042460013; Thu, 28 Jul 2022 14:07:40 -0700 (PDT) Received: from localhost ([50.221.140.186]) by smtp.gmail.com with ESMTPSA id n3-20020a1709026a8300b0016b81679c31sm1704066plk.213.2022.07.28.14.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 14:07:38 -0700 (PDT) Subject: [PATCH] doc: RISC-V: Document that misaligned accesses are supported Date: Thu, 28 Jul 2022 14:07:15 -0700 Message-Id: <20220728210715.17214-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, bagasdotme@gmail.com, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: corbet@lwn.net X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Palmer Dabbelt The RISC-V ISA manual used to mandate that misaligned accesses were supported in user mode, but that requirement was removed in 2018 via riscv-isa-manual commit 61cadb9 ("Provide new description of misaligned load/store behavior compatible with privileged architecture."). Since the Linux uABI was already frozen at that point it's just been demoted to part of the uABI, but that was never written down. Signed-off-by: Palmer Dabbelt --- We currently rely on either hardware or M-mode to support misaligned accesses. It's probably worth supporting the PR_SET_UNALIGN so userspace can opt out of the emulation routines, but we can't break the uABI so we're stuck with defaulting to them on for now. Doing so would also require some way of informing M-mode that unsupported accesses shouldn't be emulated. --- Documentation/riscv/index.rst | 1 + Documentation/riscv/uabi.rst | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 Documentation/riscv/uabi.rst diff --git a/Documentation/riscv/index.rst b/Documentation/riscv/index.rst index e23b876ad6eb..2e5b18fbb145 100644 --- a/Documentation/riscv/index.rst +++ b/Documentation/riscv/index.rst @@ -8,6 +8,7 @@ RISC-V architecture boot-image-header vm-layout patch-acceptance + uabi features diff --git a/Documentation/riscv/uabi.rst b/Documentation/riscv/uabi.rst new file mode 100644 index 000000000000..21a82cfb6c4d --- /dev/null +++ b/Documentation/riscv/uabi.rst @@ -0,0 +1,6 @@ +.. SPDX-License-Identifier: GPL-2.0 + +RISC-V Linux User ABI +===================== + +Misaligned accesses are supported in userspace, but they may perform poorly. -- 2.34.1