Patchwork [10/10] S390: Enabling device and program selection

login
register
mail settings
Submitter Dominik Dingel
Date April 26, 2013, 12:12 p.m.
Message ID <1366978377-16823-11-git-send-email-dingel@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/239855/
State New
Headers show

Comments

Dominik Dingel - April 26, 2013, 12:12 p.m.
Pass the eboot device info and the loadparm in register 7 and 8.
Use this values in the BIOS to directly boot the respective
operating system.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Alexander Graf - April 26, 2013, 3:29 p.m.
On 26.04.2013, at 14:12, Dominik Dingel wrote:

> Pass the eboot device info and the loadparm in register 7 and 8.
> Use this values in the BIOS to directly boot the respective
> operating system.
> 
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 36daa67..960ba71 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
>     env->psw.addr = pswaddr;
>     env->psw.mask = IPL_PSW_MASK;
>     env->regs[7] = ccw_dev->sch->devno;
> +    env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
> +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
> +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
> +    env->regs[8] = ccw_dev->loadparm;

No, we want a list.

>     s390_add_running_cpu(cpu);
> }
> 
> diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img

Please do blob patches at the end of the series in a separate patch.

Alex

> index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
> GIT binary patch
> literal 17528
> zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
> zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+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si-qmcN
> 
> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> index 53a460d..9cd3edf 100644
> --- a/pc-bios/s390-ccw/bootmap.c
> +++ b/pc-bios/s390-ccw/bootmap.c
> @@ -173,7 +173,7 @@ fail:
>     return -1;
> }
> 
> -int zipl_load(void)
> +int zipl_load(uint64_t load_parm)
> {
>     struct mbr *mbr = (void*)sec;
>     uint8_t *ns, *ns_end;
> @@ -223,7 +223,7 @@ int zipl_load(void)
> 
>     /* Run the default entry */
> 
> -    prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
> +    prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
> 
>     return zipl_run(prog_table_entry);
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index fd40fa5..0c1c11c 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
>     while (1) { }
> }
> 
> -static void virtio_setup(void)
> +static void virtio_setup(uint16_t dev_no)
> {
>     struct schib schib;
>     int i;
> @@ -35,7 +35,7 @@ static void virtio_setup(void)
>         if (r == 3) {
>             break;
>         }
> -        if (schib.pmcw.dnv) {
> +        if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
>             if (virtio_is_blk(blk_schid)) {
>                 found = true;
>                 break;
> @@ -52,10 +52,24 @@ static void virtio_setup(void)
> 
> int main(void)
> {
> +    uint64_t boot_value;
> +    uint64_t load_parm;
> +    register uint64_t reg7 asm("7");
> +    register uint64_t reg8 asm("8");
> +    
> +    asm volatile(
> +            "   stg     %2, %0\n"
> +            "   stg     %3, %1\n"
> +            : "=m" (boot_value), "=m" (load_parm)
> +            : "d" (reg7), "d" (reg8)
> +            : "cc");
> +    
>     sclp_setup();
> -    virtio_setup();
> -    if (zipl_load() < 0)
> +    virtio_setup(boot_value >> 32);
> +
> +    if (zipl_load(load_parm) < 0) {
>         sclp_print("Failed to load OS from hard disk\n");
> +    }
>     disabled_wait();
>     while (1) { }
> }
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index 8241b0a..2851995 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
> int virtio_read(ulong sector, void *load_addr);
> 
> /* bootmap.c */
> -int zipl_load(void);
> +int zipl_load(uint64_t load_parm);
> 
> static inline void *memset(void *s, int c, size_t n)
> {
> -- 
> 1.7.9.5
>
Alexander Graf - April 26, 2013, 4:56 p.m.
On 26.04.2013, at 14:12, Dominik Dingel wrote:

> Pass the eboot device info and the loadparm in register 7 and 8.
> Use this values in the BIOS to directly boot the respective
> operating system.
> 
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 36daa67..960ba71 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
>     env->psw.addr = pswaddr;
>     env->psw.mask = IPL_PSW_MASK;
>     env->regs[7] = ccw_dev->sch->devno;
> +    env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
> +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
> +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
> +    env->regs[8] = ccw_dev->loadparm;
>     s390_add_running_cpu(cpu);
> }
> 
> diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
> index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
> GIT binary patch
> literal 17528
> zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA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_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
> 
> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> index 53a460d..9cd3edf 100644
> --- a/pc-bios/s390-ccw/bootmap.c
> +++ b/pc-bios/s390-ccw/bootmap.c
> @@ -173,7 +173,7 @@ fail:
>     return -1;
> }
> 
> -int zipl_load(void)
> +int zipl_load(uint64_t load_parm)
> {
>     struct mbr *mbr = (void*)sec;
>     uint8_t *ns, *ns_end;
> @@ -223,7 +223,7 @@ int zipl_load(void)
> 
>     /* Run the default entry */
> 
> -    prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
> +    prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
> 
>     return zipl_run(prog_table_entry);
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index fd40fa5..0c1c11c 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
>     while (1) { }
> }
> 
> -static void virtio_setup(void)
> +static void virtio_setup(uint16_t dev_no)
> {
>     struct schib schib;
>     int i;
> @@ -35,7 +35,7 @@ static void virtio_setup(void)
>         if (r == 3) {
>             break;
>         }
> -        if (schib.pmcw.dnv) {
> +        if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {

What if I have no dev_no passed in? We need to support the mode where the user doesn't specify any device he wants to boot from.

>             if (virtio_is_blk(blk_schid)) {
>                 found = true;
>                 break;
> @@ -52,10 +52,24 @@ static void virtio_setup(void)
> 
> int main(void)
> {
> +    uint64_t boot_value;
> +    uint64_t load_parm;
> +    register uint64_t reg7 asm("7");
> +    register uint64_t reg8 asm("8");
> +    
> +    asm volatile(
> +            "   stg     %2, %0\n"
> +            "   stg     %3, %1\n"
> +            : "=m" (boot_value), "=m" (load_parm)
> +            : "d" (reg7), "d" (reg8)
> +            : "cc");

What is this for? If you have a local register variable, won't that value get saved automatically?


Alex

> +    
>     sclp_setup();
> -    virtio_setup();
> -    if (zipl_load() < 0)
> +    virtio_setup(boot_value >> 32);
> +
> +    if (zipl_load(load_parm) < 0) {
>         sclp_print("Failed to load OS from hard disk\n");
> +    }
>     disabled_wait();
>     while (1) { }
> }
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index 8241b0a..2851995 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
> int virtio_read(ulong sector, void *load_addr);
> 
> /* bootmap.c */
> -int zipl_load(void);
> +int zipl_load(uint64_t load_parm);
> 
> static inline void *memset(void *s, int c, size_t n)
> {
> -- 
> 1.7.9.5
>
Dominik Dingel - April 26, 2013, 5:55 p.m.
On Fri, 26 Apr 2013 18:56:44 +0200
Alexander Graf <agraf@suse.de> wrote:

> 
> On 26.04.2013, at 14:12, Dominik Dingel wrote:
> 
> > Pass the eboot device info and the loadparm in register 7 and 8.
> > Use this values in the BIOS to directly boot the respective
> > operating system.
> > 
> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> > 
> > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> > index 36daa67..960ba71 100644
> > --- a/hw/s390x/ipl.c
> > +++ b/hw/s390x/ipl.c
> > @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
> >     env->psw.addr = pswaddr;
> >     env->psw.mask = IPL_PSW_MASK;
> >     env->regs[7] = ccw_dev->sch->devno;
> > +    env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
> > +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
> > +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
> > +    env->regs[8] = ccw_dev->loadparm;
> >     s390_add_running_cpu(cpu);
> > }
> > 
> > diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
> > index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
> > GIT binary patch
> > literal 17528
> > zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
> > zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo
> > z@%s6G-`l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P9D(TTIgsxyuxranB2(xrn<QQ#U&s
> > zd5nohQ7U4hOoTBf*b?>J;vqDrX6`7&?Rv!>8IJHu6=aNu(1Mz|qngp@P*mOL@PcZ-
> > z<7pZPh2a~qRIQ%7BjXXyhr|=Xc<Pn5Jl<VQC^Wa#H^KzXik~|&-si9uQtNB}BzqRG
> > zq6LZ;C|aOsfuaS97ARVvXn~>yiWVqZplE@j1wL{M%ug@0i|XuxY?Xg785GlPwlkWI
> > zIzytm-Ev0LHBw?_JR8GGkk^Cln2$9?#n|n_K4ptr=s94=CpU==piq^KovjhU`RTKk
> > z2!<AO^xGBvtWC7}Gnjb=2l5sATz4+LD1?H|%wqm)NEA^Rpt&(-Ip0s?Wkj3hT+CP^
> > z{7Aapw#3L?!f3;&pS%nj`yk27kt&9HE@oS1#s>7$ps_8zO`K`BZGro`%qvpLKPAeb
> > zI0u}$^sOS0J}Dl|TFw~}+-J>(@fX~<0c+LywMf;-$AxHxG$VLRvZX4W5;rlg10)Y?
> > zQbAN1FATX1k{EJrAi2_8dHyop@3&?}`kZ_L&jJyFm5abhi7@09>vpqzolLpjrCi<t
> > z%eJ#+V`SM-C}-O?ZQFjxUY#8z3zIB?872Ar24RZ|d`883{v;Wzn8z+az_V&Dgn65m
> > zeppNLG4|2j^jZFP-be6`%hP6_95Im3X8FR`k#8-qIu3Q5uym|NHLM}Ze}j9+^$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!7k%1wR#k0>?W^_cX+pvD)SG&JOyT%Uh*-jK28yd@HbN%}%mK!{l
> > zquBnjF^Y|h<_2R2M~=kyAIS`-*Jjcb%Z{e|bNv(>9NKpv+ka?q-%vXHX^&z9qlfrO
> > zsoIFKPqAIed&j;g2CUzN>OW?vD_$>xqY9pjR0;d{Sfx+ZOAL%9sQfI%MO~+O-l`N)
> > zp@q25@u+WC_4t1<{^hT((ecXvOz?F?zM>bcP@mM!k9W(e|4JYC>7*wZsZj5E!dC|M
> > z{bklVRDb;yeeZuKMBe{UFrH(<no>LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
> > zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
> > 
> > diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> > index 53a460d..9cd3edf 100644
> > --- a/pc-bios/s390-ccw/bootmap.c
> > +++ b/pc-bios/s390-ccw/bootmap.c
> > @@ -173,7 +173,7 @@ fail:
> >     return -1;
> > }
> > 
> > -int zipl_load(void)
> > +int zipl_load(uint64_t load_parm)
> > {
> >     struct mbr *mbr = (void*)sec;
> >     uint8_t *ns, *ns_end;
> > @@ -223,7 +223,7 @@ int zipl_load(void)
> > 
> >     /* Run the default entry */
> > 
> > -    prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
> > +    prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
> > 
> >     return zipl_run(prog_table_entry);
> > 
> > diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> > index fd40fa5..0c1c11c 100644
> > --- a/pc-bios/s390-ccw/main.c
> > +++ b/pc-bios/s390-ccw/main.c
> > @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
> >     while (1) { }
> > }
> > 
> > -static void virtio_setup(void)
> > +static void virtio_setup(uint16_t dev_no)
> > {
> >     struct schib schib;
> >     int i;
> > @@ -35,7 +35,7 @@ static void virtio_setup(void)
> >         if (r == 3) {
> >             break;
> >         }
> > -        if (schib.pmcw.dnv) {
> > +        if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
> 
> What if I have no dev_no passed in? We need to support the mode where the user doesn't specify any device he wants to boot from.

There is actually no code path where you would boot the BIOS and at the sametime have no device passed in.

> 
> >             if (virtio_is_blk(blk_schid)) {
> >                 found = true;
> >                 break;
> > @@ -52,10 +52,24 @@ static void virtio_setup(void)
> > 
> > int main(void)
> > {
> > +    uint64_t boot_value;
> > +    uint64_t load_parm;
> > +    register uint64_t reg7 asm("7");
> > +    register uint64_t reg8 asm("8");
> > +    
> > +    asm volatile(
> > +            "   stg     %2, %0\n"
> > +            "   stg     %3, %1\n"
> > +            : "=m" (boot_value), "=m" (load_parm)
> > +            : "d" (reg7), "d" (reg8)
> > +            : "cc");
> 
> What is this for? If you have a local register variable, won't that value get saved automatically?

It's a real verbose way to say here in this register we have the boot parameter stored in... And my confidence in understanding local register variables is not so that I would hope to get it perfectly right.

> 
> Alex
> 
> > +    
> >     sclp_setup();
> > -    virtio_setup();
> > -    if (zipl_load() < 0)
> > +    virtio_setup(boot_value >> 32);
> > +
> > +    if (zipl_load(load_parm) < 0) {
> >         sclp_print("Failed to load OS from hard disk\n");
> > +    }
> >     disabled_wait();
> >     while (1) { }
> > }
> > diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> > index 8241b0a..2851995 100644
> > --- a/pc-bios/s390-ccw/s390-ccw.h
> > +++ b/pc-bios/s390-ccw/s390-ccw.h
> > @@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
> > int virtio_read(ulong sector, void *load_addr);
> > 
> > /* bootmap.c */
> > -int zipl_load(void);
> > +int zipl_load(uint64_t load_parm);
> > 
> > static inline void *memset(void *s, int c, size_t n)
> > {
> > -- 
> > 1.7.9.5
> > 
>
Alexander Graf - April 26, 2013, 5:56 p.m.
On 26.04.2013, at 19:55, Dominik Dingel wrote:

> On Fri, 26 Apr 2013 18:56:44 +0200
> Alexander Graf <agraf@suse.de> wrote:
> 
>> 
>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>> 
>>> Pass the eboot device info and the loadparm in register 7 and 8.
>>> Use this values in the BIOS to directly boot the respective
>>> operating system.
>>> 
>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>> 
>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>>> index 36daa67..960ba71 100644
>>> --- a/hw/s390x/ipl.c
>>> +++ b/hw/s390x/ipl.c
>>> @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
>>>    env->psw.addr = pswaddr;
>>>    env->psw.mask = IPL_PSW_MASK;
>>>    env->regs[7] = ccw_dev->sch->devno;
>>> +    env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
>>> +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
>>> +    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
>>> +    env->regs[8] = ccw_dev->loadparm;
>>>    s390_add_running_cpu(cpu);
>>> }
>>> 
>>> diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
>>> index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
>>> GIT binary patch
>>> literal 17528
>>> zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
>>> zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo
>>> z@%s6G-`l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P9D(TTIgsxyuxranB2(xrn<QQ#U&s
>>> zd5nohQ7U4hOoTBf*b?>J;vqDrX6`7&?Rv!>8IJHu6=aNu(1Mz|qngp@P*mOL@PcZ-
>>> z<7pZP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LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
>>> zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
>>> 
>>> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
>>> index 53a460d..9cd3edf 100644
>>> --- a/pc-bios/s390-ccw/bootmap.c
>>> +++ b/pc-bios/s390-ccw/bootmap.c
>>> @@ -173,7 +173,7 @@ fail:
>>>    return -1;
>>> }
>>> 
>>> -int zipl_load(void)
>>> +int zipl_load(uint64_t load_parm)
>>> {
>>>    struct mbr *mbr = (void*)sec;
>>>    uint8_t *ns, *ns_end;
>>> @@ -223,7 +223,7 @@ int zipl_load(void)
>>> 
>>>    /* Run the default entry */
>>> 
>>> -    prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
>>> +    prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
>>> 
>>>    return zipl_run(prog_table_entry);
>>> 
>>> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
>>> index fd40fa5..0c1c11c 100644
>>> --- a/pc-bios/s390-ccw/main.c
>>> +++ b/pc-bios/s390-ccw/main.c
>>> @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
>>>    while (1) { }
>>> }
>>> 
>>> -static void virtio_setup(void)
>>> +static void virtio_setup(uint16_t dev_no)
>>> {
>>>    struct schib schib;
>>>    int i;
>>> @@ -35,7 +35,7 @@ static void virtio_setup(void)
>>>        if (r == 3) {
>>>            break;
>>>        }
>>> -        if (schib.pmcw.dnv) {
>>> +        if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
>> 
>> What if I have no dev_no passed in? We need to support the mode where the user doesn't specify any device he wants to boot from.
> 
> There is actually no code path where you would boot the BIOS and at the sametime have no device passed in.

If we drop patch 1 there is will be.

> 
>> 
>>>            if (virtio_is_blk(blk_schid)) {
>>>                found = true;
>>>                break;
>>> @@ -52,10 +52,24 @@ static void virtio_setup(void)
>>> 
>>> int main(void)
>>> {
>>> +    uint64_t boot_value;
>>> +    uint64_t load_parm;
>>> +    register uint64_t reg7 asm("7");
>>> +    register uint64_t reg8 asm("8");
>>> +    
>>> +    asm volatile(
>>> +            "   stg     %2, %0\n"
>>> +            "   stg     %3, %1\n"
>>> +            : "=m" (boot_value), "=m" (load_parm)
>>> +            : "d" (reg7), "d" (reg8)
>>> +            : "cc");
>> 
>> What is this for? If you have a local register variable, won't that value get saved automatically?
> 
> It's a real verbose way to say here in this register we have the boot parameter stored in... And my confidence in understanding local register variables is not so that I would hope to get it perfectly right.

Then grab yourself someone who knows :).


Alex

Patch

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 36daa67..960ba71 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -77,6 +77,10 @@  static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
     env->psw.addr = pswaddr;
     env->psw.mask = IPL_PSW_MASK;
     env->regs[7] = ccw_dev->sch->devno;
+    env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
+    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
+    env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
+    env->regs[8] = ccw_dev->loadparm;
     s390_add_running_cpu(cpu);
 }
 
diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
GIT binary patch
literal 17528
zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo
z@%s6G-`l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P9D(TTIgsxyuxranB2(xrn<QQ#U&s
zd5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;zE3iZD+|-Ns@XE5@lM8;>(A#2rD_6`ed~W5IUZe<9l;@P(lll|k#}_`<c%o^d
zxwoYd^u|~|$4$LR=b2*myZ%SMuf=Zg2HB6Fa8oY^nwdgAULy}l<qfX`Sg>4hGgFi;
zsJw=ExC8z;Q<N8bpRE3b1N&NtnR+qAzH#|kjs4!1ca`U`qp5Moz3GWjv6olqbugy&
zaZ@iYIOnmnXpNo68i88{10III+IP627aRV{6a{feZ0Bk2fd4L2lnd9`>1%nj27mVd
z0t@Ly{Y9oI4^-rVjanM>*zRR+=*4g|Q<SGaW4Cr+J&F2f9f3Lmbp+}Nd{G2A5%V1t
z+<w=6v^aD8yJt?^c=sLOzuexqvNJsYLg$t3x8J@=th(pEd$x(b%*c^rt3^+&JJuua
zKR7V3wr5}W+Wp!7k%1wR#k0>?W^_cX+pvD)SG&JOyT%Uh*-jK28yd@HbN%}%mK!{l
zquBnjF^Y|h<_2R2M~=kyAIS`-*Jjcb%Z{e|bNv(>9NKpv+ka?q-%vXHX^&z9qlfrO
zsoIFKPqAIed&j;g2CUzN>OW?vD_$>xqY9pjR0;d{Sfx+ZOAL%9sQfI%MO~+O-l`N)
zp@q25@u+WC_4t1<{^hT((ecXvOz?F?zM>bcP@mM!k9W(e|4JYC>7*wZsZj5E!dC|M
z{bklVRDb;yeeZuKMBe{UFrH(<no>LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN

diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 53a460d..9cd3edf 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -173,7 +173,7 @@  fail:
     return -1;
 }
 
-int zipl_load(void)
+int zipl_load(uint64_t load_parm)
 {
     struct mbr *mbr = (void*)sec;
     uint8_t *ns, *ns_end;
@@ -223,7 +223,7 @@  int zipl_load(void)
 
     /* Run the default entry */
 
-    prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
+    prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
 
     return zipl_run(prog_table_entry);
 
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index fd40fa5..0c1c11c 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -20,7 +20,7 @@  void virtio_panic(const char *string)
     while (1) { }
 }
 
-static void virtio_setup(void)
+static void virtio_setup(uint16_t dev_no)
 {
     struct schib schib;
     int i;
@@ -35,7 +35,7 @@  static void virtio_setup(void)
         if (r == 3) {
             break;
         }
-        if (schib.pmcw.dnv) {
+        if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
             if (virtio_is_blk(blk_schid)) {
                 found = true;
                 break;
@@ -52,10 +52,24 @@  static void virtio_setup(void)
 
 int main(void)
 {
+    uint64_t boot_value;
+    uint64_t load_parm;
+    register uint64_t reg7 asm("7");
+    register uint64_t reg8 asm("8");
+    
+    asm volatile(
+            "   stg     %2, %0\n"
+            "   stg     %3, %1\n"
+            : "=m" (boot_value), "=m" (load_parm)
+            : "d" (reg7), "d" (reg8)
+            : "cc");
+    
     sclp_setup();
-    virtio_setup();
-    if (zipl_load() < 0)
+    virtio_setup(boot_value >> 32);
+
+    if (zipl_load(load_parm) < 0) {
         sclp_print("Failed to load OS from hard disk\n");
+    }
     disabled_wait();
     while (1) { }
 }
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index 8241b0a..2851995 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -63,7 +63,7 @@  void virtio_setup_block(struct subchannel_id schid);
 int virtio_read(ulong sector, void *load_addr);
 
 /* bootmap.c */
-int zipl_load(void);
+int zipl_load(uint64_t load_parm);
 
 static inline void *memset(void *s, int c, size_t n)
 {