From nobody Fri Dec 19 07:15:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621508973; cv=none; d=zohomail.com; s=zohoarc; b=d7cNretqJg6LL3xY/Q6P5uiEzSF2T6385Nkzyx05metvqo7osURXYnMWpmx+m2WeQ2Vu5goiDtoTuOQImodgM9de0cKUZNHTS77sZ5tEIdzf4P75BXI8U2VgPu+OfHW3nn3vbchdoa5Qph4WIkQJMfxivsTQ47GP9VQ32s13KU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621508973; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=z3/KZxEceqNBHXRRxZ4yuG2qkGWWINMUXp6C+3kJ9h4=; b=eTVAFtZtS4RAyYU0XkFmEwl/sdz08F/2ZVQgPhduIBs8DvB4Ig/iXNdwnOxs8R+lbWjABrh+APiPNscAO1uNKNjKoT1d/Id0cnjTNdsz13BGnfAC2zoqJAolApVMIxx5LDfVU4RubgYyw+qYnTs+du8/7vTMxxfxOPqf/5S8fbY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621508973859505.9872342059516; Thu, 20 May 2021 04:09:33 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-xjbV_970PB6dwqYavzkjsA-1; Thu, 20 May 2021 07:09:31 -0400 Received: by mail-wm1-f72.google.com with SMTP id g17-20020a05600c0011b029014399f816a3so1310745wmc.7 for ; Thu, 20 May 2021 04:09:31 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id y137sm3081451wmc.11.2021.05.20.04.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 04:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621508972; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z3/KZxEceqNBHXRRxZ4yuG2qkGWWINMUXp6C+3kJ9h4=; b=RpjFhsB/+8s2XK64X1eDqQPj4nT9HPRAp/2hu/CTg4Pnh/Vgn4PajRkrWMOfmgZ2lxH6ip swERpbVcxGDuAmsWn1bMuvxQSK3qQoW2LFn3CPxn0RAEvXF7FcUuDw0SubjWcxj0t2kBj6 qcCzIyxWtnzc5bLIgt4W06G/2S4hwW8= X-MC-Unique: xjbV_970PB6dwqYavzkjsA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z3/KZxEceqNBHXRRxZ4yuG2qkGWWINMUXp6C+3kJ9h4=; b=rOik5RABuYdUxXizjWe7AQ3Njv2hKVVUygk3s7Lhqt0q3wPtH/mocrOH+1JMYdNS16 zi49wclhRzqBX+AglFuohpz540JOcs6vbgXra8fWQzez4jitWsoBGrqg9ort0s0bIxAf 9peyla0jegY1/0/Ahn/I/riKdMZjOggwfjASv6CC9EYjhDP76RkWCbrIImLSfDwBo6C1 SEGDQL54d/V1KRh3snNTrAZ8uANeYKU08OiStzlYgwLsMTYL5q9lQ5eViRgO7ITOclDY jJ362Hp9F3J51+PXzDfG2y2gFKKgv/JszC/1CFXGAbhruvw//xif78WNnrMUKbBmLskX ejJw== X-Gm-Message-State: AOAM532DbUpy1dPfdhmY/MKo/U3v7wYxFOjax4yKZ/dGopFBql08ogaZ Hd/k8eA4rThcAFkNSF50JIZW+d8GTCq4zvLzBlmPNZjCMF1wwdglzDF7OvXORSUVPqTTYuU4lWZ plyM0rQAPWA8cPA== X-Received: by 2002:a5d:5008:: with SMTP id e8mr3641401wrt.386.1621508970190; Thu, 20 May 2021 04:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOqk6hVjufnuap/b7mFO0PpMjE1Kc0WB3eAcoLpFr39pSsAkfOvHC1dpN9xEobxcRXxiycOg== X-Received: by 2002:a5d:5008:: with SMTP id e8mr3641385wrt.386.1621508970060; Thu, 20 May 2021 04:09:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Peter Maydell , Peter Xu , Paolo Bonzini , Richard Henderson , Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 02/12] exec/memattrs: Add attribute/error for address alignment Date: Thu, 20 May 2021 13:09:09 +0200 Message-Id: <20210520110919.2483190-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210520110919.2483190-1-philmd@redhat.com> References: <20210520110919.2483190-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) A bus master might specify the 'aligned' attribute to enforce a transaction using aligned address. If the address is not aligned, the accessor will return MEMTX_UNALIGNED_ERROR. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/memattrs.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 95f2d20d55b..6fe59194e35 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -39,6 +39,8 @@ typedef struct MemTxAttrs { unsigned int requester_id:16; /* Invert endianness for this page */ unsigned int byte_swap:1; + /* Memory access must be aligned */ + unsigned int aligned:1; /* * The following are target-specific page-table bits. These are not * related to actual memory transactions at all. However, this struct= ure @@ -66,6 +68,7 @@ typedef struct MemTxAttrs { #define MEMTX_OK 0 #define MEMTX_ERROR (1U << 0) /* device returned an error */ #define MEMTX_DECODE_ERROR (1U << 1) /* nothing at that address */ +#define MEMTX_UNALIGNED_ERROR (1U << 2) /* address is not aligned */ typedef uint32_t MemTxResult; =20 #endif --=20 2.26.3