public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nico Boehr" <nrb@linux.ibm.com>
To: "Claudio Imbrenda" <imbrenda@linux.ibm.com>
Cc: <kvm@vger.kernel.org>, <frankja@linux.ibm.com>,
	<borntraeger@de.ibm.com>, <thuth@redhat.com>, <david@redhat.com>,
	<schlameuss@linux.ibm.com>, <linux-s390@vger.kernel.org>
Subject: Re: [kvm-unit-tests PATCH v3 3/3] s390x: pv: Add test for large host pages backing
Date: Thu, 09 Jan 2025 10:51:05 +0100	[thread overview]
Message-ID: <D6XG6ZSJ22ZU.1UDCOZQS6KUBP@linux.ibm.com> (raw)
In-Reply-To: <20241220165224.3307fbf4@p-imbrenda>

On Fri Dec 20, 2024 at 4:52 PM CET, Claudio Imbrenda wrote:
[...]
> > > diff --git a/s390x/snippets/c/pv-memhog.c b/s390x/snippets/c/pv-memhog.c
> > > new file mode 100644
> > > index 00000000..43f0c2b1
> > > --- /dev/null
> > > +++ b/s390x/snippets/c/pv-memhog.c
> > > @@ -0,0 +1,59 @@  
> > [...]
> > > +int main(void)
> > > +{
> > > +	uint64_t param, addr, i, n;
> > > +
> > > +	READ_ONCE(*MIDPAGE_PTR(SZ_1M + 42 * PAGE_SIZE));
> > > +	param = get_value(42);  
> > 
> > (see below)
> > 
> > > +	n = (param >> 32) & 0x1fffffff;
> > > +	n = n ? n : N_PAGES;
> > > +	param &= 0x7fffffff;
> > > +
> > > +	while (true) {
> > > +		for (i = 0; i < n; i++) {
> > > +			addr = ((param ? i * param : i * i * i) * PAGE_SIZE) & MASK_2G;
> > > +			WRITE_ONCE(*MIDPAGE_PTR(addr), addr);
> > > +		}
> > > +
> > > +		i = get_value(23);
> > > +		if (i != 42)  
> > 
> > I would like some defines for 23 and 42 and possibly share them with the host.
>
> not sure what's the easiest way to share with the host, but I can just
> copy the defines

The sie-dat.c test does this, there's a header file

s390x/snippets/c/sie-dat.h

which is included in the host:

#include "snippets/c/sie-dat.h"

Not the most beautiful way, but works.

  reply	other threads:[~2025-01-09  9:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 13:51 [kvm-unit-tests PATCH v3 0/3] s390x: pv: Add test for large host pages backing Claudio Imbrenda
2024-12-18 13:51 ` [kvm-unit-tests PATCH v3 1/3] lib: s390: add ptlb wrapper Claudio Imbrenda
2024-12-18 13:51 ` [kvm-unit-tests PATCH v3 2/3] lib: s390x: add function to test available UV features Claudio Imbrenda
2024-12-18 13:51 ` [kvm-unit-tests PATCH v3 3/3] s390x: pv: Add test for large host pages backing Claudio Imbrenda
2024-12-20 15:22   ` Nico Boehr
2024-12-20 15:52     ` Claudio Imbrenda
2025-01-09  9:51       ` Nico Boehr [this message]
2024-12-20 15:40   ` Christoph Schlameuss

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=D6XG6ZSJ22ZU.1UDCOZQS6KUBP@linux.ibm.com \
    --to=nrb@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=schlameuss@linux.ibm.com \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox