qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Victor Kaplansky <victork@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] tests/pxe: Check virtio-net-ccw on s390x
Date: Tue, 8 Aug 2017 09:26:27 +0200	[thread overview]
Message-ID: <20170808092627.4450aa05@gondolin> (raw)
In-Reply-To: <016df631-ccf8-69bd-0211-becbecac4450@redhat.com>

On Tue, 8 Aug 2017 07:19:54 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 07.08.2017 22:35, Michael S. Tsirkin wrote:
> > On Thu, Aug 03, 2017 at 03:30:19PM +0200, Thomas Huth wrote:  
> >> Now that we've got a firmware that can do TFTP booting on s390x (i.e.
> >> the pc-bios/s390-netboot.img), we can enable the PXE tester for this
> >> architecture, too.
> >>
> >> Signed-off-by: Thomas Huth <thuth@redhat.com>

> >> @@ -81,10 +83,27 @@ int boot_sector_init(char *fname)
> >>      }
> >>  
> >>      /* For Open Firmware based system, we can use a Forth script instead */
> >> -    if (strcmp(qtest_get_arch(), "ppc64") == 0) {
> >> +    if (g_str_equal(arch, "ppc64")) {
> >>          len = sprintf((char *)boot_sector, "\\ Bootscript\n%x %x c! %x %x c!\n",
> >> -                LOW(SIGNATURE), BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET,
> >> -                HIGH(SIGNATURE), BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1);
> >> +                LOW(SIGNATURE), SIGNATURE_ADDR,
> >> +                HIGH(SIGNATURE), SIGNATURE_ADDR + 1);
> >> +    } else if (g_str_equal(arch, "s390x")) {
> >> +        /* For s390x, fake a kernel signature */
> >> +        const uint8_t psw[] = {
> >> +            0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00
> >> +        };
> >> +        const uint8_t code[] = {
> >> +            0xa7, 0xf4, 0x00, 0x0a,     /* j 0x10010 */
> >> +            0x00, 0x00, 0x00, 0x00,
> >> +            'S', '3', '9', '0',
> >> +            'E', 'P', 0x00, 0x01,
> >> +            0xa7, 0x38, HIGH(SIGNATURE_ADDR), LOW(SIGNATURE_ADDR), /* lhi r3 */
> >> +            0xa7, 0x48, LOW(SIGNATURE), HIGH(SIGNATURE),    /* lhi r4,0xadde */
> >> +            0x40, 0x40, 0x30, 0x00,     /* sth r4,0(r3) */
> >> +            0xa7, 0xf4, 0xff, 0xfa      /* j 0x10010 */
> >> +        };
> >> +        memcpy(boot_sector, psw, 8);
> >> +        memcpy(&boot_sector[0x10000], code, sizeof(code));  
> > 
> > 
> > Could we avoid overwriting boot sector?
> > We really should have
> > x86_boot_sector
> > ppc64_boot_sector
> > s390_boot_sector
> > 
> > And write out the correct thing.  

That sounds good.

> 
> Ok, I don't mind either way ... I can try to come up with a patch.
> 
> > Also:
> >  * Q35 machine requires a minimum 0x7e000 bytes disk.
> >  * (bug or feature?)
> > 
> > probably does not apply to s390x, does it?  
> 
> We can also just load 0x10000 + sizeof(code) bytes here. I'll fix it.
> 
> Cornelia, please unqueue the patch, I'll send a v2...

OK, I had not yet pushed out anyway.

      reply	other threads:[~2017-08-08  7:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 13:30 [Qemu-devel] [PATCH] tests/pxe: Check virtio-net-ccw on s390x Thomas Huth
2017-08-03 15:20 ` Cornelia Huck
2017-08-07 16:09 ` Cornelia Huck
2017-08-07 20:35 ` Michael S. Tsirkin
2017-08-08  5:19   ` Thomas Huth
2017-08-08  7:26     ` Cornelia Huck [this message]

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=20170808092627.4450aa05@gondolin \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=victork@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;
as well as URLs for NNTP newsgroup(s).