All of lore.kernel.org
 help / color / mirror / Atom feed
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 v2 1/4] xen/io: provide helpers for multi size MMIO accesses
Date: Thu, 17 Apr 2025 16:16:42 +0200	[thread overview]
Message-ID: <aAENSnhKDQHQERgl@macbook.lan> (raw)
In-Reply-To: <1c4f6304-a272-4fb2-8892-43118d080641@suse.com>

On Thu, Apr 17, 2025 at 09:43:09AM +0200, Jan Beulich wrote:
> On 15.04.2025 17:32, Roger Pau Monne wrote:
> > @@ -5115,7 +5115,6 @@ static void subpage_mmio_write_emulate(
> >  
> >      if ( test_bit(offset / MMIO_RO_SUBPAGE_GRAN, entry->ro_elems) )
> >      {
> > - write_ignored:
> >          gprintk(XENLOG_WARNING,
> >                  "ignoring write to R/O MMIO 0x%"PRI_mfn"%03x len %u\n",
> >                  mfn_x(mfn), offset, len);
> > @@ -5131,26 +5130,7 @@ static void subpage_mmio_write_emulate(
> >          return;
> >      }
> >  
> > -    addr += offset;
> > -    switch ( len )
> > -    {
> > -    case 1:
> > -        writeb(*(const uint8_t*)data, addr);
> > -        break;
> > -    case 2:
> > -        writew(*(const uint16_t*)data, addr);
> > -        break;
> > -    case 4:
> > -        writel(*(const uint32_t*)data, addr);
> > -        break;
> > -    case 8:
> > -        writeq(*(const uint64_t*)data, addr);
> > -        break;
> > -    default:
> > -        /* mmio_ro_emulated_write() already validated the size */
> > -        ASSERT_UNREACHABLE();
> > -        goto write_ignored;
> > -    }
> > +    write_mmio(addr + offset, data, len);
> >  }
> 
> Should probably have noticed this on v1 already: The log message is now lost
> for the write-ignored case. It looks easy enough to have the function return
> a boolean indicating "done", to retain original behavior here.

Hm, I didn't seem to me the message wants conserving, as it's
unreachable code.  I can try to add again, but we don't print such
message in other cases.

Thanks, Roger.


  reply	other threads:[~2025-04-17 14:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 15:32 [PATCH v2 0/4] xen/x86: fix implementation of subpage r/o MMIO Roger Pau Monne
2025-04-15 15:32 ` [PATCH v2 1/4] xen/io: provide helpers for multi size MMIO accesses Roger Pau Monne
2025-04-16  6:28   ` dmkhn
2025-04-16  8:29   ` Andrew Cooper
2025-04-16  8:40     ` Jan Beulich
2025-04-17  7:43   ` Jan Beulich
2025-04-17 14:16     ` Roger Pau Monné [this message]
2025-04-17 14:22       ` Jan Beulich
2025-04-15 15:32 ` [PATCH v2 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages Roger Pau Monne
2025-04-17  7:57   ` Jan Beulich
2025-04-17 12:19     ` Marek Marczykowski-Górecki
2025-04-17 13:59     ` Roger Pau Monné
2025-04-15 15:32 ` [PATCH v2 3/4] x86/hvm: only register the r/o subpage ops when needed Roger Pau Monne
2025-04-15 15:32 ` [PATCH v2 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=aAENSnhKDQHQERgl@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.