From: "Collin L. Walling" <walling@linux.vnet.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
borntraeger@de.ibm.com, frankja@linux.vnet.ibm.com,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v1 4/5] s390-ccw: interactive boot menu for eckd dasd
Date: Tue, 28 Nov 2017 11:31:23 -0500 [thread overview]
Message-ID: <ff314c86-be4e-db08-aae8-40ef3e3e68d3@linux.vnet.ibm.com> (raw)
In-Reply-To: <d007f7af-f15e-105c-7859-13b7141cf260@redhat.com>
On 11/28/2017 07:36 AM, Thomas Huth wrote:
> On 27.11.2017 21:55, Collin L. Walling wrote:
> [...]
>> +static void read_stage2(block_number_t s1b_block_nr, void **stage2_data)
>> +{
>> + block_number_t s2_block_nr;
>> + BootEckdStage1b *s1b = (void *)sec;
>> + int i;
>> +
>> + /* Get Stage1b data */
>> + memset(sec, FREE_SPACE_FILLER, sizeof(sec));
>> + read_block(s1b_block_nr, s1b, "Cannot read stage1b boot loader.");
>> +
>> + /* Get Stage2 data */
>> + *stage2_data = (void *)s2_area;
> I think you could also simply "return s2_area" at the end of the
> function instead of using a pointer-to-a-pointer as parameter of the
> function.
Ideally I'd like to figure out some way to get rid of the s2_area and
just read stage2 block-by-block (that way we're only using sec).
I'll play around with things here after I've taken care of the other
suggestions.
[...]
>
>> +#define KEYCODE_BACKSP '\177'
>> +#define KEYCODE_ENTER '\r'
>> +
>> long write(int fd, const void *str, size_t len);
>>
>> static char _sccb[PAGE_SIZE] __attribute__((__aligned__(4096)));
>> @@ -101,3 +106,130 @@ void sclp_get_loadparm_ascii(char *loadparm)
>> ebcdic_to_ascii((char *) sccb->loadparm, loadparm, 8);
>> }
>> }
>> +
>> +static void read(char **str)
> Please avoid using names from the standard C-library, unless the
> function is supposed to do the same (as the write() function here).
Thinking about it, I'm not sure if it would make sense for us to have a
C-like read() function... perhaps it'd be best to rename it for now.
[...]
>> + );
>> +}
>> +
>> +static inline bool check_clock_int(void)
>> +{
>> + uint16_t code;
>> +
>> + consume_sclp_int();
>> +
>> + asm volatile(
>> + "lh 1, 0x86(0,0)\n"
>> + "sth 1, %0"
>> + : "=r" (code)
>> + );
> That way, you need r1 in the clobber list. But why don't you simply use
> only "lh %0,0x86(0,0)\n" instead? Or simply do it without assembly:
>
> code = *(volatile uint16_t *)0x86;
This is new to me... thanks for showing me this :)
>
> ?
[...]
> Thomas
>
Thanks for the review, Thomas.I've noted all other suggestions.
--
- Collin L Walling
next prev parent reply other threads:[~2017-11-28 16:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 20:55 [Qemu-devel] [PATCH v1 0/5] (FIXED) Interactive Boot Menu for DASD and SCSI Guests on s390x Collin L. Walling
2017-11-27 20:55 ` [Qemu-devel] [PATCH v1 1/5] s390-ccw: update libc.h Collin L. Walling
2017-11-28 10:45 ` Cornelia Huck
2017-11-28 15:36 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2017-11-28 11:32 ` Thomas Huth
2017-11-27 20:55 ` [Qemu-devel] [PATCH v1 2/5] s390-ccw: ipl structs for eckd cdl/ldl Collin L. Walling
2017-11-28 10:48 ` Cornelia Huck
2017-11-28 15:42 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2017-11-28 16:41 ` Cornelia Huck
2017-11-27 20:55 ` [Qemu-devel] [PATCH v1 3/5] s390-ccw: parse and set boot menu options Collin L. Walling
2017-11-28 11:04 ` Cornelia Huck
2017-11-28 16:00 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2017-11-28 11:45 ` Thomas Huth
2017-11-28 16:02 ` Collin L. Walling
2017-11-29 22:28 ` David Hildenbrand
2017-11-29 22:33 ` Collin L. Walling
2017-11-30 15:52 ` David Hildenbrand
2017-11-30 16:05 ` Cornelia Huck
2017-11-27 20:55 ` [Qemu-devel] [PATCH v1 4/5] s390-ccw: interactive boot menu for eckd dasd Collin L. Walling
2017-11-28 12:36 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2017-11-28 12:45 ` Cornelia Huck
2017-11-28 16:31 ` Collin L. Walling [this message]
2017-11-27 20:55 ` [Qemu-devel] [PATCH v1 5/5] s390-ccw: interactive boot menu for scsi Collin L. Walling
2017-11-28 10:35 ` [Qemu-devel] [PATCH v1 0/5] (FIXED) Interactive Boot Menu for DASD and SCSI Guests on s390x Cornelia Huck
2017-11-28 16:35 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2017-11-28 16:42 ` Cornelia Huck
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=ff314c86-be4e-db08-aae8-40ef3e3e68d3@linux.vnet.ibm.com \
--to=walling@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=frankja@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--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;
as well as URLs for NNTP newsgroup(s).