kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	david@redhat.com, thuth@redhat.com, seiden@linux.ibm.com,
	mhartmay@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH 7/8] s390x: snippets: Add PV support
Date: Thu, 13 Jan 2022 14:10:01 +0100	[thread overview]
Message-ID: <62524574-a3c9-9024-7655-2a59725e557f@linux.ibm.com> (raw)
In-Reply-To: <e0708a4f-8747-d1c5-229e-d06c8d67dcda@linux.ibm.com>

On 12/3/21 10:29, Janosch Frank wrote:
> On 11/26/21 14:28, Janosch Frank wrote:
>> On 11/23/21 12:22, Claudio Imbrenda wrote:
>>> On Tue, 23 Nov 2021 10:39:55 +0000
>>> Janosch Frank <frankja@linux.ibm.com> wrote:
>>>
[...]
>>> are they supposed to have different addresses?
>>> the C files start at 0x4000, while the asm ones at 0
>>
>> That's a mistake I'll need to fix.
> 
> On second thought this is correct since it's the starting address of the
> component and not the PSW entry. The psw entry is the next argument.
> The C snippets currently have data in the first 4 pages so we can
> encrypt from offset 0.
> 
> The question that remains is: do we need the data at 0x0 - 0x4000?
> The reset and restart PSWs are not really necessary since we don't start
> the snippets as a lpar or in simulation where we use these PSWs.
> The stackptr is just that, a ptr AFAIK so there shouldn't be data on
> 0x3000 (but I'll look that up anyway).

Colleagues have used the C PV snippets over the last few weeks and 
haven't reported any issues. It's time that we bring this into master 
since a lot of upcoming tests are currently based on this series.

@Claudio: Any further comments?

>>
>>>
>>>> +
>>>> +.SECONDARY:
>>>> +%.gobj: %.gbin
>>>> +	$(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $< $@
>>>> +
>>>> +.SECONDARY:
>>>> +%.hdr.obj: %.hdr
>>>> +	$(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $< $@
>>>>     
>>>> -$(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_asmlib) $(FLATLIBS)
>>>> -	$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/snippets/c/flat.lds $(patsubst %.gbin,%.o,$@) $(snippet_asmlib) $(FLATLIBS)
>>>> -	$(OBJCOPY) -O binary $@ $@
>>>> -	$(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@
>>>>     
>>>>     .SECONDEXPANSION:
>>>> -%.elf: $$(snippets) %.o $(FLATLIBS) $(SRCDIR)/s390x/flat.lds $(asmlib)
>>>> +%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o
>>>>     	$(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$@\"
>>>> -	$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds $(filter %.o, $^) $(FLATLIBS) $(snippets) $(@:.elf=.aux.o)
>>>> +	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
>>>> +		$(filter %.o, $^) $(FLATLIBS) $(snippets-obj) $(snippet-hdr-obj) $(@:.elf=.aux.o) || \
>>>> +		{ echo "Failure probably caused by missing definition of gen-se-header executable"; exit 1; }
>>>>     	$(RM) $(@:.elf=.aux.o)
>>>>     	@chmod a-x $@
>>>>     
>>>> @@ -114,8 +155,12 @@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_asmlib) $(FLATLIBS)
>>>>     %.pv.bin: %.bin $(HOST_KEY_DOCUMENT)
>>>>     	$(GENPROTIMG) --host-key-document $(HOST_KEY_DOCUMENT) --no-verify --image $< -o $@
>>>>     
>>>> +$(snippet_asmlib): $$(patsubst %.o,%.S,$$@) $(asm-offsets)
>>>> +	$(CC) $(CFLAGS) -c -nostdlib -o $@ $<
>>>> +
>>>> +
>>>>     arch_clean: asm_offsets_clean
>>>> -	$(RM) $(TEST_DIR)/*.{o,elf,bin} $(TEST_DIR)/.*.d $(SNIPPET_DIR)/c/*.{o,gbin} $(SNIPPET_DIR)/c/.*.d lib/s390x/.*.d
>>>> +	$(RM) $(TEST_DIR)/*.{o,elf,bin} $(SNIPPET_DIR)/*/*.{o,elf,*bin,*obj,hdr} $(SNIPPET_DIR)/asm/.*.d $(TEST_DIR)/.*.d lib/s390x/.*.d
>>>>     
>>>>     generated-files = $(asm-offsets)
>>>>     $(tests:.elf=.o) $(asmlib) $(cflatobjs): $(generated-files)
>>>
>>
> 


  reply	other threads:[~2022-01-13 13:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 10:39 [kvm-unit-tests PATCH 0/8] s390x: sie: Add PV snippet support Janosch Frank
2021-11-23 10:39 ` [kvm-unit-tests PATCH 1/8] lib: s390x: sie: Add sca allocation and freeing Janosch Frank
2021-11-23 10:51   ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 2/8] s390x: sie: Add PV fields to SIE control block Janosch Frank
2021-11-23 10:52   ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 3/8] s390x: sie: Add UV information into VM struct Janosch Frank
2021-11-23 10:54   ` Claudio Imbrenda
2021-11-23 12:49     ` Janosch Frank
2021-11-23 10:39 ` [kvm-unit-tests PATCH 4/8] s390x: uv: Add more UV call functions Janosch Frank
2021-11-23 10:56   ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 5/8] s390x: lib: Extend UV library with PV guest management Janosch Frank
2021-11-23 11:13   ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 6/8] lib: s390: sie: Add PV guest register handling Janosch Frank
2021-11-23 11:14   ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 7/8] s390x: snippets: Add PV support Janosch Frank
2021-11-23 11:22   ` Claudio Imbrenda
2021-11-26 13:28     ` Janosch Frank
2021-12-03  9:29       ` Janosch Frank
2022-01-13 13:10         ` Janosch Frank [this message]
2022-01-13 13:17           ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 8/8] s390x: sie: Add PV diag test Janosch Frank
2021-11-23 11:41   ` Claudio Imbrenda

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=62524574-a3c9-9024-7655-2a59725e557f@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mhartmay@linux.ibm.com \
    --cc=seiden@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;
as well as URLs for NNTP newsgroup(s).