From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 1/4] xen/io: provide helpers for multi size MMIO accesses
Date: Tue, 29 Apr 2025 12:46:10 +0200 [thread overview]
Message-ID: <aBCt8lb-2X75-wqF@macbook.lan> (raw)
In-Reply-To: <08d550d4-2283-4177-b812-fd87c0fa511d@suse.com>
On Tue, Apr 29, 2025 at 12:23:05PM +0200, Jan Beulich wrote:
> On 29.04.2025 12:12, Roger Pau Monne wrote:
> > Several handlers have the same necessity of reading or writing from or to
> > an MMIO region using 1, 2, 4 or 8 bytes accesses. So far this has been
> > open-coded in the function itself. Instead provide a new set of handlers
> > that encapsulate the accesses.
> >
> > Since the added helpers are not architecture specific, introduce a new
> > generic io.h header.
> >
> > No functional change intended.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> preferably with ...
>
> > @@ -5185,6 +5167,7 @@ int cf_check mmio_ro_emulated_write(
> > struct x86_emulate_ctxt *ctxt)
> > {
> > struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
> > + unsigned long data = 0;
>
>
> ... this moved ...
>
> > @@ -5195,9 +5178,12 @@ int cf_check mmio_ro_emulated_write(
> > return X86EMUL_UNHANDLEABLE;
> > }
> >
> > - if ( bytes <= 8 )
> > + if ( bytes <= sizeof(data) )
> > + {
> > + memcpy(&data, p_data, bytes);
> > subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
> > - p_data, bytes);
> > + data, bytes);
> > + }
>
> ... into this more narrow scope.
Hm, but if I move it I can no longer use sizeof(data) in the condition
check, that's why data is defined in the outside.
Let me know if you are OK with this.
Thanks, Roger.
next prev parent reply other threads:[~2025-04-29 10:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 10:12 [PATCH v4 0/4] xen/x86: fix implementation of subpage r/o MMIO Roger Pau Monne
2025-04-29 10:12 ` [PATCH v4 1/4] xen/io: provide helpers for multi size MMIO accesses Roger Pau Monne
2025-04-29 10:23 ` Jan Beulich
2025-04-29 10:46 ` Roger Pau Monné [this message]
2025-04-29 11:47 ` Jan Beulich
2025-04-29 10:12 ` [PATCH v4 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages Roger Pau Monne
2025-04-29 10:29 ` Jan Beulich
2025-04-29 10:47 ` Roger Pau Monné
2025-04-29 10:12 ` [PATCH v4 3/4] x86/hvm: only register the r/o subpage ops when needed Roger Pau Monne
2025-04-29 10:12 ` [PATCH v4 4/4] x86/mm: move mmio_ro_emulated_write() to PV only file Roger Pau Monne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBCt8lb-2X75-wqF@macbook.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.